[libvirt] [PATCH 00/16] Misc fixes and refactoring of LXC driver
by Daniel P. Berrange
The first 7 patches in this series are a set of misc fixes
I identified while working on the LXC driver code.
The remaining 9 patches heavily re-arrange, re-factor and
re-name the LXC driver code. The intent is to make the code
layout closer in style to the QEMU driver, to facilitate
its future growth in size & complexity
12 years, 5 months
[libvirt] [PATCH libvirt-glib] gobject: add GVir.DomainXMLFlags binding
by Marc-André Lureau
---
libvirt-gobject/libvirt-gobject-domain.c | 2 +-
libvirt-gobject/libvirt-gobject-domain.h | 14 ++++++++++++++
libvirt-gobject/libvirt-gobject.sym | 5 +++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index e14190c..ba8e12b 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -709,7 +709,7 @@ gboolean gvir_domain_save_to_file_finish(GVirDomain *dom,
/**
* gvir_domain_get_config:
* @dom: the domain
- * @flags: the flags
+ * @flags: the %GVirDomainXMLFlags flags
*
* Returns: (transfer full): the config. The returned object should be
* unreffed with g_object_unref() when no longer needed.
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 8f17799..70e7e37 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -102,6 +102,20 @@ typedef enum {
GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA = VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA,
} GVirDomainDeleteFlags;
+/**
+ * GVirDomainXMLFlags:
+ * @GVIR_DOMAIN_XML_NONE: No flags
+ * @GVIR_DOMAIN_XML_SECURE: Dump security sensitive information too
+ * @GVIR_DOMAIN_XML_INACTIVE: Dump inactive domain information
+ * @GVIR_DOMAIN_XML_UPDATE_CPU: Update guest CPU requirements according to host CPU
+ */
+typedef enum {
+ GVIR_DOMAIN_XML_NONE = 0,
+ GVIR_DOMAIN_XML_SECURE = VIR_DOMAIN_XML_SECURE,
+ GVIR_DOMAIN_XML_INACTIVE = VIR_DOMAIN_XML_INACTIVE,
+ GVIR_DOMAIN_XML_UPDATE_CPU = VIR_DOMAIN_XML_UPDATE_CPU,
+} GVirDomainXMLFlags;
+
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 60478d1..cc602d3 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -175,4 +175,9 @@ LIBVIRT_GOBJECT_0.0.9 {
gvir_domain_start_finish;
} LIBVIRT_GOBJECT_0.0.8;
+LIBVIRT_GOBJECT_0.1.1 {
+ global:
+ gvir_domain_xml_flags_get_type;
+} LIBVIRT_GOBJECT_0.0.9;
+
# .... define new API here using predicted next version number ....
--
1.7.10.4
12 years, 5 months
[libvirt] Libvirt on power pc
by B Veera-B37207
Hi,
Using command line I am able to bring up VM
Here is the command:
"qemu-system-ppc -enable-kvm -m 512M -mem-path /var/lib/hugetlbfs/pagesize-4MB -nographic -M ppce500v2 -kernel /boot/uImage-p2020rdb.bin -initrd
./guest.rootfs.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4444,server,telnet -dtb /usr/share/qemu/ppce500v2.dtb -net
nic,model=virtio -net tap,script=/home/root/qemu-ifup"
Can anybody let me know the libvirt xml format for above command.
Regards,
Veera.
12 years, 5 months
[libvirt] [PATCH] rpc: remove trailing carriage return character in error string
by Guannan Ren
If the error message string ends with '\r\n', it is not enough
to remove '\n' only which leads to messed string.
Example, after three time incorrect password input, virsh command
virsh -c qemu://remoteserver/system will report error like:
: Connection reset by peerey,gssapi-keyex,gssapi-with-mic,password).
it should be:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
: Connection reset by peer
The terminal interprets '\r' as "move the cursor back to the start
of the current line", so we have to remove the character if it exists.
---
src/rpc/virnetsocket.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 08dfbb0..8385d88 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -985,8 +985,14 @@ reread:
virFileReadLimFD(sock->errfd, 1024, &errout) >= 0 &&
errout != NULL) {
size_t elen = strlen(errout);
- if (elen && errout[elen-1] == '\n')
+ if (elen && errout[elen-1] == '\n') {
errout[elen-1] = '\0';
+
+ /* remove trailing '\r' if it exists */
+ if (elen-1 && errout[elen-2] == '\r') {
+ errout[elen-2] = '\0';
+ }
+ }
}
if (ret < 0) {
--
1.7.7.5
12 years, 5 months
[libvirt] [PATCH] po: avoid spurious double spaces in messages
by Eric Blake
Noticed during the recent error cleanups.
* src/network/bridge_driver.c (networkStartRadvd): Fix spacing.
* src/openvz/openvz_conf.c (openvzReadMemConf): Likewise.
* src/qemu/qemu_command.c (qemuNetworkIfaceConnect): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainDetachNetDevice): Likewise.
* src/qemu/qemu_process.c (qemuProcessStop): Likewise.
* src/security/virt-aa-helper.c (vah_add_file): Likewise.
---
Pushing under the trivial rule.
src/network/bridge_driver.c | 2 +-
src/openvz/openvz_conf.c | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/security/virt-aa-helper.c | 8 ++++----
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 9b1964b..5bf1412 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -850,7 +850,7 @@ networkStartRadvd(virNetworkObjPtr network)
prefix = virNetworkIpDefPrefix(ipdef);
if (prefix < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
- _("bridge '%s' has an invalid prefix"),
+ _("bridge '%s' has an invalid prefix"),
network->def->bridge);
goto cleanup;
}
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index bc54012..57479d4 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -511,7 +511,7 @@ openvzReadMemConf(virDomainDefPtr def, int veid)
ret = openvzParseBarrierLimit(temp, &barrier, NULL);
if (ret < 0) {
openvzError(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse barrier of '%s' "
+ _("Could not parse barrier of '%s' "
"from config for container %d"), param, veid);
goto error;
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 09215af..4013740 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -265,7 +265,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
if (driver->macFilter) {
if ((err = networkAllowMacOnPort(driver, net->ifname, &net->mac))) {
virReportSystemError(err,
- _("failed to add ebtables rule to allow MAC address on '%s'"),
+ _("failed to add ebtables rule to allow MAC address on '%s'"),
net->ifname);
}
}
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 09c8c97..5a9a6f7 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2293,7 +2293,7 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
detach->ifname,
&detach->mac))) {
virReportSystemError(errno,
- _("failed to remove ebtables rule on '%s'"),
+ _("failed to remove ebtables rule on '%s'"),
detach->ifname);
}
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d8169e8..b260a20 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4029,7 +4029,7 @@ void qemuProcessStop(struct qemud_driver *driver,
if ((errno = networkDisallowMacOnPort(driver, net->ifname,
&net->mac))) {
virReportSystemError(errno,
- _("failed to remove ebtables rule to allow MAC address on '%s'"),
+ _("failed to remove ebtables rule to allow MAC address on '%s'"),
net->ifname);
}
}
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 7b41d38..056362c 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -2,7 +2,7 @@
/*
* virt-aa-helper: wrapper program used by AppArmor security driver.
*
- * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2010-2012 Red Hat, Inc.
* Copyright (C) 2009-2011 Canonical Ltd.
*
* See COPYING.LIB for the License of this software
@@ -762,14 +762,14 @@ vah_add_file(virBufferPtr buf, const char *path, const char *perms)
*/
if (STRNEQLEN(path, "/", 1)) {
vah_warning(path);
- vah_warning(_(" skipped non-absolute path"));
+ vah_warning(_("skipped non-absolute path"));
return 0;
}
if (virFileExists(path)) {
if ((tmp = realpath(path, NULL)) == NULL) {
vah_error(NULL, 0, path);
- vah_error(NULL, 0, _(" could not find realpath for disk"));
+ vah_error(NULL, 0, _("could not find realpath for disk"));
return rc;
}
} else
@@ -783,7 +783,7 @@ vah_add_file(virBufferPtr buf, const char *path, const char *perms)
if (rc != 0) {
if (rc > 0) {
vah_error(NULL, 0, path);
- vah_error(NULL, 0, _(" skipped restricted file"));
+ vah_error(NULL, 0, _("skipped restricted file"));
}
goto clean;
}
--
1.7.10.4
12 years, 5 months
[libvirt] [PATCH] esx: Fix esxVI_String_Deserialize
by Matthias Bolte
It was broken since forever as it expected a libxml2
XML_ELEMENT_NODE containing a XML_TEXT_NODE instead of
just a XML_TEXT_NODE.
This problem was not discovered for so long because
esxVI_String_Deserialize was not used until now.
Reported by Ata Bohra
---
src/esx/esx_vi_types.c | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index bcc310f..844fb65 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -1227,11 +1227,26 @@ esxVI_String_SerializeValue(const char *value, const char *element,
return 0;
}
-/* esxVI_String_Deserialize */
-ESX_VI__TEMPLATE__DESERIALIZE(String,
+int
+esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string)
{
- ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_VALUE(String, value)
-})
+ if (string == NULL || *string != NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ return -1;
+ }
+
+ if (esxVI_String_Alloc(string) < 0 ||
+ esxVI_String_DeserializeValue(node, &(*string)->value) < 0) {
+ goto failure;
+ }
+
+ return 0;
+
+ failure:
+ esxVI_String_Free(string);
+
+ return -1;
+}
/* esxVI_String_DeserializeList */
ESX_VI__TEMPLATE__LIST__DESERIALIZE(String)
--
1.7.4.1
12 years, 5 months
[libvirt] [PATCH] nodeinfo: deal with offline cpus in a node
by Eric Blake
Commit 80533ca forgot to think about offline cpus. When a node
cpu is offline, then its topology/ subdirectory is not present,
leading to spurious error messages leaked to the user such as:
libvir: error : cannot open /home/dummy/libvirt/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu7/topology/physical_package_id: No such file or directory
Fix that, as well as test it; the test data is gathered from a
machine with one NUMA node, hyperthreading, and with 2 of the
8 cpus offline.
* src/nodeinfo.c (virNodeParseNode): Don't parse topology of
offline cpus.
* tests/nodeinfotest.c (mymain): Run new test.
* tests/nodeinfodata/linux-nodeinfo-sysfs-test-6*: New data.
---
Offline cpus are an annoying corner case :)
src/nodeinfo.c | 6 +
.../linux-nodeinfo-sysfs-test-6-cpu-x86-output.txt | 1 +
.../linux-nodeinfo-sysfs-test-6-x86.cpuinfo | 150 ++++++++++++++++++++
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu2/online | 1 +
.../cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../cpu/cpu2/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu3/online | 1 +
.../cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../cpu/cpu3/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu4/online | 1 +
.../cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../cpu/cpu4/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu5/online | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu6/online | 1 +
.../cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../cpu/cpu6/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-6/cpu/cpu7/online | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu0 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu1 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu2 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu3 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu4 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu5 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu6 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/cpu7 | 1 +
.../linux-nodeinfo-sysfs-test-6/node/node0/meminfo | 29 ++++
.../linux-nodeinfo-sysfs-test-6/node/online | Bin 0 -> 3 bytes
.../linux-nodeinfo-sysfs-test-6/node/possible | Bin 0 -> 3 bytes
tests/nodeinfotest.c | 1 +
40 files changed, 220 insertions(+)
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-cpu-x86-output.txt
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu7/online
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu1
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu2
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu3
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu4
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu5
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu6
create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu7
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/possible
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index a892e7a..052b006 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -225,6 +225,12 @@ virNodeParseNode(const char *node, int *sockets, int *cores, int *threads)
if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
continue;
+ if ((online = virNodeGetCpuValue(node, cpu, "online", true)) < 0)
+ goto cleanup;
+
+ if (!online)
+ continue;
+
/* Parse socket */
sock = virNodeParseSocket(node, cpu);
CPU_SET(sock, &sock_map);
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-cpu-x86-output.txt
new file mode 100644
index 0000000..7ffcb8e
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-cpu-x86-output.txt
@@ -0,0 +1 @@
+CPUs: 6/8, MHz: 1596, Nodes: 1, Sockets: 1, Cores: 4, Threads: 2
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-x86.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-x86.cpuinfo
new file mode 100644
index 0000000..61838dd
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6-x86.cpuinfo
@@ -0,0 +1,150 @@
+processor : 0
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 0
+cpu cores : 4
+apicid : 0
+initial apicid : 0
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
+processor : 1
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 1
+cpu cores : 4
+apicid : 2
+initial apicid : 2
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
+processor : 2
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 9
+cpu cores : 4
+apicid : 18
+initial apicid : 18
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
+processor : 3
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 10
+cpu cores : 4
+apicid : 20
+initial apicid : 20
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
+processor : 4
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 0
+cpu cores : 4
+apicid : 1
+initial apicid : 1
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
+processor : 6
+vendor_id : GenuineIntel
+cpu family : 6
+model : 44
+model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
+stepping : 2
+cpu MHz : 1596.000
+cache size : 12288 KB
+physical id : 0
+siblings : 6
+core id : 9
+cpu cores : 4
+apicid : 19
+initial apicid : 19
+fpu : yes
+fpu_exception : yes
+cpuid level : 11
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
+bogomips : 5333.90
+clflush size : 64
+cache_alignment : 64
+address sizes : 40 bits physical, 48 bits virtual
+power management:
+
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/core_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/core_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/thread_siblings
new file mode 100644
index 0000000..b4de394
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu0/topology/thread_siblings
@@ -0,0 +1 @@
+11
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/online
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/online
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/core_id
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/core_id
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/thread_siblings
new file mode 100644
index 0000000..9e22bcb
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu1/topology/thread_siblings
@@ -0,0 +1 @@
+02
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/online
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/online
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/core_id
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/core_id
@@ -0,0 +1 @@
+9
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/thread_siblings
new file mode 100644
index 0000000..c739b42
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu2/topology/thread_siblings
@@ -0,0 +1 @@
+44
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/online
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/online
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/core_id
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/core_id
@@ -0,0 +1 @@
+10
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/thread_siblings
new file mode 100644
index 0000000..adb9de8
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu3/topology/thread_siblings
@@ -0,0 +1 @@
+08
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/online
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/online
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/core_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/core_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/thread_siblings
new file mode 100644
index 0000000..b4de394
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu4/topology/thread_siblings
@@ -0,0 +1 @@
+11
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu5/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu5/online
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu5/online
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/online
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/online
@@ -0,0 +1 @@
+1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/core_id
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/core_id
@@ -0,0 +1 @@
+9
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/physical_package_id
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/physical_package_id
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/thread_siblings
new file mode 100644
index 0000000..c739b42
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu6/topology/thread_siblings
@@ -0,0 +1 @@
+44
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu7/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu7/online
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/cpu/cpu7/online
@@ -0,0 +1 @@
+0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu0 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu0
new file mode 120000
index 0000000..c841bea
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu0
@@ -0,0 +1 @@
+../../cpu/cpu0
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu1 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu1
new file mode 120000
index 0000000..5f45362
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu1
@@ -0,0 +1 @@
+../../cpu/cpu1
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu2 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu2
new file mode 120000
index 0000000..2dcca33
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu2
@@ -0,0 +1 @@
+../../cpu/cpu2
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu3 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu3
new file mode 120000
index 0000000..c7690e5
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu3
@@ -0,0 +1 @@
+../../cpu/cpu3
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu4 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu4
new file mode 120000
index 0000000..9e77a64
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu4
@@ -0,0 +1 @@
+../../cpu/cpu4
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu5 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu5
new file mode 120000
index 0000000..cc07c3b
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu5
@@ -0,0 +1 @@
+../../cpu/cpu5
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu6 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu6
new file mode 120000
index 0000000..2e75763
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu6
@@ -0,0 +1 @@
+../../cpu/cpu6
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu7 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu7
new file mode 120000
index 0000000..09e3f79
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/cpu7
@@ -0,0 +1 @@
+../../cpu/cpu7
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/meminfo
new file mode 100644
index 0000000..8122d41
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/node0/meminfo
@@ -0,0 +1,29 @@
+
+Node 0 MemTotal: 8379620 kB
+Node 0 MemFree: 2971308 kB
+Node 0 MemUsed: 5408312 kB
+Node 0 Active: 3795016 kB
+Node 0 Inactive: 869528 kB
+Node 0 Active(anon): 3081132 kB
+Node 0 Inactive(anon): 13352 kB
+Node 0 Active(file): 713884 kB
+Node 0 Inactive(file): 856176 kB
+Node 0 Unevictable: 48324 kB
+Node 0 Mlocked: 13580 kB
+Node 0 Dirty: 84 kB
+Node 0 Writeback: 0 kB
+Node 0 FilePages: 1585776 kB
+Node 0 Mapped: 134048 kB
+Node 0 AnonPages: 866116 kB
+Node 0 Shmem: 13512 kB
+Node 0 KernelStack: 3904 kB
+Node 0 PageTables: 40664 kB
+Node 0 NFS_Unstable: 0 kB
+Node 0 Bounce: 0 kB
+Node 0 WritebackTmp: 0 kB
+Node 0 Slab: 244404 kB
+Node 0 SReclaimable: 161784 kB
+Node 0 SUnreclaim: 82620 kB
+Node 0 HugePages_Total: 0
+Node 0 HugePages_Free: 0
+Node 0 HugePages_Surp: 0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/online
new file mode 100644
index 0000000000000000000000000000000000000000..c1da2e294b3f3646e368cc0056986632de06e2cc
GIT binary patch
literal 3
KcmXruVgLXDrvN(u
literal 0
HcmV?d00001
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/possible b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-6/node/possible
new file mode 100644
index 0000000000000000000000000000000000000000..c1da2e294b3f3646e368cc0056986632de06e2cc
GIT binary patch
literal 3
KcmXruVgLXDrvN(u
literal 0
HcmV?d00001
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
index 346af58..851acd0 100644
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -130,6 +130,7 @@ mymain(void)
"nodeinfo-sysfs-test-3",
"nodeinfo-sysfs-test-4",
"nodeinfo-sysfs-test-5",
+ "nodeinfo-sysfs-test-6",
# endif
};
--
1.7.10.4
12 years, 5 months
[libvirt] [PATCH] build: fix compilation without struct ifreq
by Eric Blake
Detected on Cygwin. Broken in commit 387117ad.
* src/util/virnetdev.c (virNetDevValidateConfig): Fix prototype.
---
Pushing under the build-breaker rule.
src/util/virnetdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index cd44bf4..4fd9b00 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -927,7 +927,7 @@ int virNetDevValidateConfig(const char *ifname,
}
#else /* ! HAVE_STRUCT_IFREQ */
int virNetDevValidateConfig(const char *ifname ATTRIBUTE_UNUSED,
- const unsigned char *macaddr ATTRIBUTE_UNUSED,
+ const virMacAddrPtr macaddr ATTRIBUTE_UNUSED,
int ifindex ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
--
1.7.10.4
12 years, 5 months
[libvirt] Linker error in gnulib test-binary-io.c
by Matthias Bolte
I get the following error on Ubuntu 11.04 with current libvirt git HEAD:
$ make check
[...]
CC test-binary-io.o
test-binary-io.c: In function 'main':
test-binary-io.c:54:7: warning: implicit declaration of function
'set_binary_mode'
CCLD test-binary-io
test-binary-io.o: In function `main':
[...]/test-binary-io.c:54: undefined reference to `set_binary_mode'
collect2: ld returned 1 exit status
--
Matthias Bolte
http://photron.blogspot.com
12 years, 5 months
[libvirt] [PATCH v3] esx: Extend esxVI_CURL_Download for partial downloads
by Matthias Bolte
Also ensure that the virBuffer used to store the downloaded data
does not overflow.
---
v3:
- Fix virBuffer limit checks.
v2:
- Ensure that the used virBuffer dos not overflow.
src/esx/esx_driver.c | 2 +-
src/esx/esx_vi.c | 62 +++++++++++++++++++++++++++++++++++++++++++------
src/esx/esx_vi.h | 3 +-
3 files changed, 57 insertions(+), 10 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index db2144c..95b9286 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2802,7 +2802,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
url = virBufferContentAndReset(&buffer);
- if (esxVI_CURL_Download(priv->primary->curl, url, &vmx) < 0) {
+ if (esxVI_CURL_Download(priv->primary->curl, url, &vmx, 0, NULL) < 0) {
goto cleanup;
}
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 48718b6..0df973c 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -116,9 +116,9 @@ ESX_VI__TEMPLATE__FREE(CURL,
})
static size_t
-esxVI_CURL_ReadString(char *data, size_t size, size_t nmemb, void *ptrptr)
+esxVI_CURL_ReadString(char *data, size_t size, size_t nmemb, void *userdata)
{
- const char *content = *(const char **)ptrptr;
+ const char *content = *(const char **)userdata;
size_t available = 0;
size_t requested = size * nmemb;
@@ -138,16 +138,28 @@ esxVI_CURL_ReadString(char *data, size_t size, size_t nmemb, void *ptrptr)
memcpy(data, content, requested);
- *(const char **)ptrptr = content + requested;
+ *(const char **)userdata = content + requested;
return requested;
}
static size_t
-esxVI_CURL_WriteBuffer(char *data, size_t size, size_t nmemb, void *buffer)
+esxVI_CURL_WriteBuffer(char *data, size_t size, size_t nmemb, void *userdata)
{
+ virBufferPtr buffer = userdata;
+
if (buffer != NULL) {
- virBufferAdd((virBufferPtr) buffer, data, size * nmemb);
+ /*
+ * Using a virBuffer to store the download data limits the downloadable
+ * size. This is no problem as esxVI_CURL_Download and esxVI_CURL_Perform
+ * are meant to download small things such as VMX files, VMDK metadata
+ * files and SOAP responses.
+ */
+ if (size * nmemb > INT32_MAX / 2 - virBufferUse(buffer)) {
+ return 0;
+ }
+
+ virBufferAdd(buffer, data, size * nmemb);
return size * nmemb;
}
@@ -160,7 +172,7 @@ esxVI_CURL_WriteBuffer(char *data, size_t size, size_t nmemb, void *buffer)
#if ESX_VI__CURL__ENABLE_DEBUG_OUTPUT
static int
esxVI_CURL_Debug(CURL *curl ATTRIBUTE_UNUSED, curl_infotype type,
- char *info, size_t size, void *data ATTRIBUTE_UNUSED)
+ char *info, size_t size, void *userdata ATTRIBUTE_UNUSED)
{
char *buffer = NULL;
@@ -355,8 +367,10 @@ esxVI_CURL_Connect(esxVI_CURL *curl, esxUtil_ParsedUri *parsedUri)
}
int
-esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content)
+esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content,
+ unsigned long long offset, unsigned long long *length)
{
+ char *range = NULL;
virBuffer buffer = VIR_BUFFER_INITIALIZER;
int responseCode = 0;
@@ -365,9 +379,33 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content)
return -1;
}
+ if (length != NULL && *length > 0) {
+ /*
+ * Using a virBuffer to store the download data limits the downloadable
+ * size. This is no problem as esxVI_CURL_Download is meant to download
+ * small things such as VMX of VMDK metadata files.
+ */
+ if (*length > INT32_MAX / 2) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Download length it too large"));
+ return -1;
+ }
+
+ if (virAsprintf(&range, "%llu-%llu", offset, offset + *length - 1) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ } else if (offset > 0) {
+ if (virAsprintf(&range, "%llu-", offset) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ }
+
virMutexLock(&curl->lock);
curl_easy_setopt(curl->handle, CURLOPT_URL, url);
+ curl_easy_setopt(curl->handle, CURLOPT_RANGE, range);
curl_easy_setopt(curl->handle, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(curl->handle, CURLOPT_UPLOAD, 0);
curl_easy_setopt(curl->handle, CURLOPT_HTTPGET, 1);
@@ -378,7 +416,7 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content)
if (responseCode < 0) {
goto cleanup;
- } else if (responseCode != 200) {
+ } else if (responseCode != 200 && responseCode != 206) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
_("HTTP response code %d for download from '%s'"),
responseCode, url);
@@ -390,9 +428,15 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content)
goto cleanup;
}
+ if (length != NULL) {
+ *length = virBufferUse(&buffer);
+ }
+
*content = virBufferContentAndReset(&buffer);
cleanup:
+ VIR_FREE(range);
+
if (*content == NULL) {
virBufferFreeAndReset(&buffer);
return -1;
@@ -414,6 +458,7 @@ esxVI_CURL_Upload(esxVI_CURL *curl, const char *url, const char *content)
virMutexLock(&curl->lock);
curl_easy_setopt(curl->handle, CURLOPT_URL, url);
+ curl_easy_setopt(curl->handle, CURLOPT_RANGE, NULL);
curl_easy_setopt(curl->handle, CURLOPT_READDATA, &content);
curl_easy_setopt(curl->handle, CURLOPT_UPLOAD, 1);
curl_easy_setopt(curl->handle, CURLOPT_INFILESIZE, strlen(content));
@@ -1231,6 +1276,7 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
virMutexLock(&ctx->curl->lock);
curl_easy_setopt(ctx->curl->handle, CURLOPT_URL, ctx->url);
+ curl_easy_setopt(ctx->curl->handle, CURLOPT_RANGE, NULL);
curl_easy_setopt(ctx->curl->handle, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(ctx->curl->handle, CURLOPT_UPLOAD, 0);
curl_easy_setopt(ctx->curl->handle, CURLOPT_POSTFIELDS, request);
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index 9560bd2..49b7ca2 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -167,7 +167,8 @@ struct _esxVI_CURL {
int esxVI_CURL_Alloc(esxVI_CURL **curl);
void esxVI_CURL_Free(esxVI_CURL **curl);
int esxVI_CURL_Connect(esxVI_CURL *curl, esxUtil_ParsedUri *parsedUri);
-int esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content);
+int esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content,
+ unsigned long long offset, unsigned long long *length);
int esxVI_CURL_Upload(esxVI_CURL *curl, const char *url, const char *content);
--
1.7.4.1
12 years, 5 months