diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-15 10:42:18 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-15 10:42:53 +0200 |
commit | b6c00d70308d31517175e50e2115b8c212738ae2 (patch) | |
tree | 97e47ecc76e40e711e0f8e979d6aa7936535110d | |
parent | 003673bf5821cbf910ccf637bd319ce2e6aa86fd (diff) | |
download | alpine_aports-b6c00d70308d31517175e50e2115b8c212738ae2.tar.bz2 alpine_aports-b6c00d70308d31517175e50e2115b8c212738ae2.tar.xz alpine_aports-b6c00d70308d31517175e50e2115b8c212738ae2.zip |
main/libvirt: update physmem patch for musl
-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 @@ | |||
2 | pkgname=libvirt | 2 | pkgname=libvirt |
3 | pkgver=1.2.3 | 3 | pkgver=1.2.3 |
4 | _ver="${pkgver/_rc/-rc}" | 4 | _ver="${pkgver/_rc/-rc}" |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="A virtualization API for several hypervisor and container systems" | 6 | pkgdesc="A virtualization API for several hypervisor and container systems" |
7 | url="http://libvirt.org/" | 7 | url="http://libvirt.org/" |
8 | arch="all" | 8 | arch="all" |
@@ -25,7 +25,7 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-client $pkgname-daemon | |||
25 | source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz | 25 | source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz |
26 | libvirt.confd | 26 | libvirt.confd |
27 | libvirt.initd | 27 | libvirt.initd |
28 | uclibc-physmem.patch | 28 | physmem.patch |
29 | musl-fix-includes.patch | 29 | musl-fix-includes.patch |
30 | nodeinfo-musl.patch | 30 | nodeinfo-musl.patch |
31 | " | 31 | " |
@@ -171,18 +171,18 @@ _common_drivers() { | |||
171 | md5sums="ad1602a2fcc3609c83b885a28f3eecbd libvirt-1.2.3.tar.gz | 171 | md5sums="ad1602a2fcc3609c83b885a28f3eecbd libvirt-1.2.3.tar.gz |
172 | 1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd | 172 | 1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd |
173 | d897df38c7e7fa1a297aa551108633c9 libvirt.initd | 173 | d897df38c7e7fa1a297aa551108633c9 libvirt.initd |
174 | df9cbfaf8a6e520a4822914a300add4d uclibc-physmem.patch | 174 | 2d44db1a1e849decd709ccf07098c475 physmem.patch |
175 | 9da7723b114b2d87558e92828366fbcb musl-fix-includes.patch | 175 | 9da7723b114b2d87558e92828366fbcb musl-fix-includes.patch |
176 | aea5a4bd25176fcc1333986c5932ecc2 nodeinfo-musl.patch" | 176 | aea5a4bd25176fcc1333986c5932ecc2 nodeinfo-musl.patch" |
177 | sha256sums="b489d1a29c6166643d34b72795a89b03c6ac775cdaeadb6aa86fc1a982c02e31 libvirt-1.2.3.tar.gz | 177 | sha256sums="b489d1a29c6166643d34b72795a89b03c6ac775cdaeadb6aa86fc1a982c02e31 libvirt-1.2.3.tar.gz |
178 | 851ab3f9678f0fa9c3ee03f7fc7bd00c4ee86d5f0777eecf9eb1ffe3243adfd1 libvirt.confd | 178 | 851ab3f9678f0fa9c3ee03f7fc7bd00c4ee86d5f0777eecf9eb1ffe3243adfd1 libvirt.confd |
179 | e9fad203434ffaa6afe524e42a9fb6594edad61cb02b1ca60a68d1a7fe0c31ab libvirt.initd | 179 | e9fad203434ffaa6afe524e42a9fb6594edad61cb02b1ca60a68d1a7fe0c31ab libvirt.initd |
180 | 807005a8669b7396c9af43ddb2534bb0f073f1e97a5c8b1d9eefc1949f3c2df8 uclibc-physmem.patch | 180 | 316a9783c162757d2b8530a65eccdc0d25975037699844679ffc3c7aee5206a6 physmem.patch |
181 | 8dfa9dbe71ee21dc53e44bd7cc0127adde1bf3371d6b393657b386bb83f8139b musl-fix-includes.patch | 181 | 8dfa9dbe71ee21dc53e44bd7cc0127adde1bf3371d6b393657b386bb83f8139b musl-fix-includes.patch |
182 | 7203f304eaf15f915c8a0551c9a5ea5f6646c9c6d937e399eda530d7be803768 nodeinfo-musl.patch" | 182 | 7203f304eaf15f915c8a0551c9a5ea5f6646c9c6d937e399eda530d7be803768 nodeinfo-musl.patch" |
183 | sha512sums="5ff85a98a0c62229d0ab8125d20fce982f8497d20cb89758bc37f475d7a5d59caa6d962e6c2313e1c494ca1648a836fcad253ceaccc34cc0060135470be3db5b libvirt-1.2.3.tar.gz | 183 | sha512sums="5ff85a98a0c62229d0ab8125d20fce982f8497d20cb89758bc37f475d7a5d59caa6d962e6c2313e1c494ca1648a836fcad253ceaccc34cc0060135470be3db5b libvirt-1.2.3.tar.gz |
184 | 9aba6ab73219a635c64a340ee8887356e644445c9128734cbce73f5d54778378da2f10a190365ad88a7db8bc95b1fb17f0c6ca41fc41bb786c09e1afe84d65dc libvirt.confd | 184 | 9aba6ab73219a635c64a340ee8887356e644445c9128734cbce73f5d54778378da2f10a190365ad88a7db8bc95b1fb17f0c6ca41fc41bb786c09e1afe84d65dc libvirt.confd |
185 | f48c97f93ef4509a86eda6200b3aae5b2c0c6263403bde933b770fd62240dca27bc439bd29b440ea6a47c8337f8b4511230ed915cb5ff54d9a1cf311863f6fa1 libvirt.initd | 185 | f48c97f93ef4509a86eda6200b3aae5b2c0c6263403bde933b770fd62240dca27bc439bd29b440ea6a47c8337f8b4511230ed915cb5ff54d9a1cf311863f6fa1 libvirt.initd |
186 | 4c885e72dcb11f8523a267917315d4874812eee289fb00075334c1728d0da9bd0e5db6c52d6e3c39bd3fe66d5ccadf9e26ec9dcaa855397e211b9bd1173ac72d uclibc-physmem.patch | 186 | 4c876a89dee4cc793ce64a0bf43db4f493d1d47409a9fab727b8b0f182e4b25017aa4371afd96ce081dab4aa3e93c6c5ad46e0e6fc2c2076a9da50632ef7f06e physmem.patch |
187 | b6142256bf2700b9e5335c60fe5628e4095a24689c31d54afcab46f46a06b9c0ae676f87f77a487377eafbec11fb7afa9b994aef48a10a39e82f47c45df008ba musl-fix-includes.patch | 187 | b6142256bf2700b9e5335c60fe5628e4095a24689c31d54afcab46f46a06b9c0ae676f87f77a487377eafbec11fb7afa9b994aef48a10a39e82f47c45df008ba musl-fix-includes.patch |
188 | 62267f24bc6c2baa8f09d0a56abc1cb39997b54ce665878f7e187bb87e2f25cc358849a63f2b10f43ce0f56d62261507ab5c0a6ad1874722b33f4e1329c4df34 nodeinfo-musl.patch" | 188 | 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 @@ | |||
1 | diff --git a/src/nodeinfo.c b/src/nodeinfo.c | ||
2 | index c88f86c..1fa3e05 100644 | ||
3 | --- a/src/nodeinfo.c | ||
4 | +++ b/src/nodeinfo.c | ||
5 | @@ -38,6 +38,8 @@ | ||
6 | # include <sys/types.h> | ||
7 | # include <sys/sysctl.h> | ||
8 | # include <sys/resource.h> | ||
9 | +#elif defined(__linux__) | ||
10 | +# include <sys/sysinfo.h> | ||
11 | #endif | ||
12 | |||
13 | #include "c-ctype.h" | ||
14 | @@ -1042,6 +1044,7 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo) | ||
15 | { | ||
16 | int ret = -1; | ||
17 | FILE *cpuinfo = fopen(CPUINFO_PATH, "r"); | ||
18 | + struct sysinfo si; | ||
19 | if (!cpuinfo) { | ||
20 | virReportSystemError(errno, | ||
21 | _("cannot open %s"), CPUINFO_PATH); | ||
22 | @@ -1053,7 +1056,11 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo) | ||
23 | goto cleanup; | ||
24 | |||
25 | /* Convert to KB. */ | ||
26 | - nodeinfo->memory = physmem_total() / 1024; | ||
27 | + if (sysinfo(&si) == 0) { | ||
28 | + nodeinfo->memory = si.totalram / 1024; | ||
29 | + } else { | ||
30 | + nodeinfo->memory = physmem_total() / 1024; | ||
31 | + } | ||
32 | |||
33 | cleanup: | ||
34 | 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 @@ | |||
1 | --- ./gnulib/lib/physmem.c.orig | ||
2 | +++ ./gnulib/lib/physmem.c | ||
3 | @@ -23,6 +23,7 @@ | ||
4 | #include "physmem.h" | ||
5 | |||
6 | #include <unistd.h> | ||
7 | +#include <stdio.h> | ||
8 | |||
9 | #if HAVE_SYS_PSTAT_H | ||
10 | # include <sys/pstat.h> | ||
11 | @@ -81,6 +82,22 @@ | ||
12 | double | ||
13 | physmem_total (void) | ||
14 | { | ||
15 | +#if defined(__UCLIBC__) | ||
16 | + char line[128]; | ||
17 | + FILE *f = fopen("/proc/meminfo", "r"); | ||
18 | + long double result = -1; | ||
19 | + if (f == NULL) | ||
20 | + return 0; | ||
21 | + while (!feof(f) && fgets(line, sizeof(line)-1, f)) { | ||
22 | + if (sscanf(line, "MemTotal: %Lf kB", &result) == 1) { | ||
23 | + result *= 1024; | ||
24 | + break; | ||
25 | + } | ||
26 | + } | ||
27 | + fclose(f); | ||
28 | + return result; | ||
29 | +#endif | ||
30 | + | ||
31 | #if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE | ||
32 | { /* This works on linux-gnu, solaris2 and cygwin. */ | ||
33 | double pages = sysconf (_SC_PHYS_PAGES); | ||