diff options
Diffstat (limited to 'main/libvirt')
-rw-r--r-- | main/libvirt/APKBUILD | 10 | ||||
-rw-r--r-- | main/libvirt/physmem.patch | 34 | ||||
-rw-r--r-- | main/libvirt/uclibc-physmem.patch | 33 |
3 files changed, 39 insertions, 38 deletions
diff --git a/main/libvirt/APKBUILD b/main/libvirt/APKBUILD index 0c17241d38..6c69cfaa40 100644 --- a/main/libvirt/APKBUILD +++ b/main/libvirt/APKBUILD @@ -2,7 +2,7 @@ pkgname=libvirt pkgver=1.2.3 _ver="${pkgver/_rc/-rc}" -pkgrel=1 +pkgrel=2 pkgdesc="A virtualization API for several hypervisor and container systems" url="http://libvirt.org/" arch="all" @@ -25,7 +25,7 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-client $pkgname-daemon source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz libvirt.confd libvirt.initd - uclibc-physmem.patch + physmem.patch musl-fix-includes.patch nodeinfo-musl.patch " @@ -171,18 +171,18 @@ _common_drivers() { md5sums="ad1602a2fcc3609c83b885a28f3eecbd libvirt-1.2.3.tar.gz 1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd d897df38c7e7fa1a297aa551108633c9 libvirt.initd -df9cbfaf8a6e520a4822914a300add4d uclibc-physmem.patch +2d44db1a1e849decd709ccf07098c475 physmem.patch 9da7723b114b2d87558e92828366fbcb musl-fix-includes.patch aea5a4bd25176fcc1333986c5932ecc2 nodeinfo-musl.patch" sha256sums="b489d1a29c6166643d34b72795a89b03c6ac775cdaeadb6aa86fc1a982c02e31 libvirt-1.2.3.tar.gz 851ab3f9678f0fa9c3ee03f7fc7bd00c4ee86d5f0777eecf9eb1ffe3243adfd1 libvirt.confd e9fad203434ffaa6afe524e42a9fb6594edad61cb02b1ca60a68d1a7fe0c31ab libvirt.initd -807005a8669b7396c9af43ddb2534bb0f073f1e97a5c8b1d9eefc1949f3c2df8 uclibc-physmem.patch +316a9783c162757d2b8530a65eccdc0d25975037699844679ffc3c7aee5206a6 physmem.patch 8dfa9dbe71ee21dc53e44bd7cc0127adde1bf3371d6b393657b386bb83f8139b musl-fix-includes.patch 7203f304eaf15f915c8a0551c9a5ea5f6646c9c6d937e399eda530d7be803768 nodeinfo-musl.patch" sha512sums="5ff85a98a0c62229d0ab8125d20fce982f8497d20cb89758bc37f475d7a5d59caa6d962e6c2313e1c494ca1648a836fcad253ceaccc34cc0060135470be3db5b libvirt-1.2.3.tar.gz 9aba6ab73219a635c64a340ee8887356e644445c9128734cbce73f5d54778378da2f10a190365ad88a7db8bc95b1fb17f0c6ca41fc41bb786c09e1afe84d65dc libvirt.confd f48c97f93ef4509a86eda6200b3aae5b2c0c6263403bde933b770fd62240dca27bc439bd29b440ea6a47c8337f8b4511230ed915cb5ff54d9a1cf311863f6fa1 libvirt.initd -4c885e72dcb11f8523a267917315d4874812eee289fb00075334c1728d0da9bd0e5db6c52d6e3c39bd3fe66d5ccadf9e26ec9dcaa855397e211b9bd1173ac72d uclibc-physmem.patch +4c876a89dee4cc793ce64a0bf43db4f493d1d47409a9fab727b8b0f182e4b25017aa4371afd96ce081dab4aa3e93c6c5ad46e0e6fc2c2076a9da50632ef7f06e physmem.patch b6142256bf2700b9e5335c60fe5628e4095a24689c31d54afcab46f46a06b9c0ae676f87f77a487377eafbec11fb7afa9b994aef48a10a39e82f47c45df008ba musl-fix-includes.patch 62267f24bc6c2baa8f09d0a56abc1cb39997b54ce665878f7e187bb87e2f25cc358849a63f2b10f43ce0f56d62261507ab5c0a6ad1874722b33f4e1329c4df34 nodeinfo-musl.patch" diff --git a/main/libvirt/physmem.patch b/main/libvirt/physmem.patch new file mode 100644 index 0000000000..b4901ad581 --- /dev/null +++ b/main/libvirt/physmem.patch @@ -0,0 +1,34 @@ +diff --git a/src/nodeinfo.c b/src/nodeinfo.c +index c88f86c..1fa3e05 100644 +--- a/src/nodeinfo.c ++++ b/src/nodeinfo.c +@@ -38,6 +38,8 @@ + # include <sys/types.h> + # include <sys/sysctl.h> + # include <sys/resource.h> ++#elif defined(__linux__) ++# include <sys/sysinfo.h> + #endif + + #include "c-ctype.h" +@@ -1042,6 +1044,7 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo) + { + int ret = -1; + FILE *cpuinfo = fopen(CPUINFO_PATH, "r"); ++ struct sysinfo si; + if (!cpuinfo) { + virReportSystemError(errno, + _("cannot open %s"), CPUINFO_PATH); +@@ -1053,7 +1056,11 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo) + goto cleanup; + + /* Convert to KB. */ +- nodeinfo->memory = physmem_total() / 1024; ++ if (sysinfo(&si) == 0) { ++ nodeinfo->memory = si.totalram / 1024; ++ } else { ++ nodeinfo->memory = physmem_total() / 1024; ++ } + + cleanup: + VIR_FORCE_FCLOSE(cpuinfo); diff --git a/main/libvirt/uclibc-physmem.patch b/main/libvirt/uclibc-physmem.patch deleted file mode 100644 index 73de5ac4ec..0000000000 --- a/main/libvirt/uclibc-physmem.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ./gnulib/lib/physmem.c.orig -+++ ./gnulib/lib/physmem.c -@@ -23,6 +23,7 @@ - #include "physmem.h" - - #include <unistd.h> -+#include <stdio.h> - - #if HAVE_SYS_PSTAT_H - # include <sys/pstat.h> -@@ -81,6 +82,22 @@ - double - physmem_total (void) - { -+#if defined(__UCLIBC__) -+ char line[128]; -+ FILE *f = fopen("/proc/meminfo", "r"); -+ long double result = -1; -+ if (f == NULL) -+ return 0; -+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) { -+ if (sscanf(line, "MemTotal: %Lf kB", &result) == 1) { -+ result *= 1024; -+ break; -+ } -+ } -+ fclose(f); -+ return result; -+#endif -+ - #if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE - { /* This works on linux-gnu, solaris2 and cygwin. */ - double pages = sysconf (_SC_PHYS_PAGES); |