[libvirt] [PATCH] client: Check if other thread claims it has the buck before claiming it.
by Peter Krempa
Originaly, the code checked if another client is the queue and infered
ownership of the buck from that. Commit fa9595003d043df9f2efe95521c008
added a separate variable to track the buck. That caused, that a new
call might enter claiming it has the buck, while another thread was
signalled to take the buck. This ends in two threads claiming they hold
the buck and entering poll(). This happens due to a race on waking up
threads on the client lock mutex.
This caused multi-threaded clients to hang, most prominently visible and
reproducible on python based clients, like virt-manager.
This patch causes threads, that have been signalled to take the buck to
re-check if buck is held by another thread.
---
src/rpc/virnetclient.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 5165c8d..07d8a60 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -1545,6 +1545,7 @@ static int virNetClientIO(virNetClientPtr client,
virNetClientCallQueue(&client->waitDispatch, thiscall);
/* Check to see if another thread is dispatching */
+recheck:
if (client->haveTheBuck) {
char ignore = 1;
@@ -1592,7 +1593,13 @@ static int virNetClientIO(virNetClientPtr client,
goto cleanup;
}
- /* Grr, someone passed the buck onto us ... */
+ /* Grr, someone might have passed the buck onto us ... */
+
+ /* We need to re-check if the buck has been passed to this thread
+ * as this thread might have been signalled to wake up, but the another
+ * call might acquire the lock before this thread manages to wake up.
+ * This could cause that two threads claim they have the buck */
+ goto recheck;
}
VIR_DEBUG("We have the buck %p %p", client->waitDispatch, thiscall);
--
1.7.3.4
13 years
[libvirt] [RFC v3 PATCH 0/5] PowerPC : Extend libvirt for the PowerPC-KVM platform
by Prerna Saxena
Recent development in KVM for 64-bit Power ISA Book3S machines, allows
users to run multiple KVM guest instances on POWER7 and PPC970
processor based systems. Also qemu-system-ppc64 has been enhanced to
support a new machine type "pseries" suitable for Power Book3S machines.
This addition effectively brings the KVM+qemu combination to run
multiple guest instances on a Power Book3S machine.
Libvirt continues to be the key interface to configure and manage the
KVM guest instances on x86. This patch set is an effort to enable
libvirt to support KVM guest configuration and management on Power Book3S
machines.
Based on community discussion around the earlier version, this patch
series augments the present 'kvm' driver to support PowerPC-KVM based
guests.Since some of the supported devices vary between architectures,
libvirt must be capable of choosing supported device backends and
defaults for each architecture in qemu.
To check if qemu supports a certain feature, libvirt at present parses
the -help string which is generated by running the qemu binary with the
'-h' argument. This approach is gated by QEMU's inherent limitation.
When generating the list of allowed options with the '-h' flags, qemu
today blindly lists all options defined for any architecture/platform
instead of doing any arch-specific checking. This tricks libvirt into
assuming a much bigger set of host capabilities than is actually
available.
Ideally, it would be good to have qemu specify a list of devices for a
given architecture and platform which libvirt can parse to understand
supported capabilities for that guest.
As a part of this patchset, there is an attempt to cleanly bifurcate
libvirt code and to remove x86-specific assumptions from generic qemu
commandline code.
Series Description:
-------------------
This patch series consists of 5 patches :
Patch 1/5 : Use sysfs to gather host topology in place of /proc/cpuinfo.
Patch 2/5 : Add PowerPC CPU Driver
Patch 3/5 : Add support for qemu-system-ppc64
Patch 4/5 : Clean up x86-specific assumptions from generic qemu code.
Patch 5/5 : Add address family "spapr-vio"
Changelog:
---------
** v1->v2 :
* Patches 1,2,3 unchanged ; The hacks in Patch 4 of v1 replaced by a
new patch to neatly select arch-specific features.
** v2->v3 :
* Patches 1,2,3 have minor cleanups ; Patch 4 no longer has an
arch-specific handler routine. It is now replaced by a much simpler
patch that merely removes x86/pc-specific assumptions from libvirt.
** v3->v4 :
* Patches 1,2,3,4 unchanged ; patch 5 is a new addition from Michael Ellerman
that adds a new device-tree based addressing mechanism for the 'pseries'
guest.
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
13 years
[libvirt] [RFC v4 PATCH 0/5] PowerPC : Extend libvirt to use PowerPC-KVM platform
by Prerna Saxena
Libvirt continues to be the key interface to configure and manage the
KVM guest instances on x86. This patch set is an effort to enable
libvirt to support KVM guest configuration and management on Power Book3S
machines.
Based on community discussion around the earlier version, this patch
series augments the present 'kvm' driver to support PowerPC-KVM based
guests. With the CPU driver for PowerPC already merged, this patch series
adds on clean-ups, and some test cases as suggested.
This series mostly focuses on cleanup and addition of testcases for base-
powerpc patches. The patches for enabling spapr-vio based addressing would
be sent out shortly, with the right domain schema additions.
Series description:
-------------------
Patch 1/5 : Use sysfs to decipher cpu topology information.
Patch 2/5 : Modify the tests/nodeinfotest.c to use sysfs in addition to
proc/cpuinfo.
Patch 3/5 : Add support for ppc64 qemu
Patch 4/5 : Clean up qemuBuildCommandLine to remove x86-specific assumptions.
Patch 5/5 : Add ppc64 specific definitions to domain.rng
Changelog:
----------
** v1->v2 :
* Patches 1,2,3 unchanged ; The hacks in Patch 4 of v1 replaced by a
new patch to neatly select arch-specific features.
** v2->v3 :
* Patches 1,2,3 have minor cleanups ; Patch 4 no longer has an
arch-specific handler routine. It is now replaced by a much simpler
patch that merely removes x86/pc-specific assumptions from libvirt.
Patch 5 is a new addition from Michael Ellerman that adds a new
device-tree based addressing mechanism for the 'pseries' guest.
** v3->v4 :
* Patch 1 has minor cleanups,
Patch 2 is a new addition that introduces test cases for patch 1.
Patch 3,4 also have minor cleanups
Patch 5 is a new addition, it contains ppc64 specific definitions
to domain.rng
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
13 years
[libvirt] [PATCH] nwfilter: Update of filters to handle multiple IP addresses
by Stefan Berger
With fragments borrowed from David Steven's previous submission and some
further modifications:
A set of modifications to existing filters to handle multiple IP addresses
(and MAC addresses) per interface.
Also:
- enable DHCP traffic from VM to any DHCP server
- will require an update to a libvirt-tck data file
Signed-off-by: David L Stevens <dlstevens(a)us.ibm.com>
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
examples/xml/nwfilter/Makefile.am | 2 +
examples/xml/nwfilter/clean-traffic.xml | 12 +++++++-
examples/xml/nwfilter/no-arp-ip-spoofing.xml | 9 ++++++
examples/xml/nwfilter/no-arp-mac-spoofing.xml | 7 ++++
examples/xml/nwfilter/no-arp-spoofing.xml | 38
++------------------------
examples/xml/nwfilter/no-ip-spoofing.xml | 17 ++++++++---
examples/xml/nwfilter/no-mac-spoofing.xml | 11 +++++--
7 files changed, 52 insertions(+), 44 deletions(-)
Index: libvirt-acl/examples/xml/nwfilter/Makefile.am
===================================================================
--- libvirt-acl.orig/examples/xml/nwfilter/Makefile.am
+++ libvirt-acl/examples/xml/nwfilter/Makefile.am
@@ -9,6 +9,8 @@ FILTERS = \
allow-ipv4.xml \
clean-traffic.xml \
no-arp-spoofing.xml \
+ no-arp-ip-spoofing.xml \
+ no-arp-mac-spoofing.xml \
no-ip-multicast.xml \
no-ip-spoofing.xml \
no-mac-broadcast.xml \
Index: libvirt-acl/examples/xml/nwfilter/no-arp-ip-spoofing.xml
===================================================================
--- /dev/null
+++ libvirt-acl/examples/xml/nwfilter/no-arp-ip-spoofing.xml
@@ -0,0 +1,9 @@
+<filter name='no-arp-ip-spoofing' chain='arp-ip' priority='-510'>
+ <!-- no arp spoofing -->
+ <!-- drop if ipaddr does not belong to guest -->
+ <rule action='return' direction='out' priority='400' >
+ <arp match='yes' arpsrcipaddr='$IP' />
+ </rule>
+ <!-- drop everything else -->
+ <rule action='drop' direction='out' priority='1000' />
+</filter>
Index: libvirt-acl/examples/xml/nwfilter/no-arp-mac-spoofing.xml
===================================================================
--- /dev/null
+++ libvirt-acl/examples/xml/nwfilter/no-arp-mac-spoofing.xml
@@ -0,0 +1,7 @@
+<filter name='no-arp-mac-spoofing' chain='arp-mac' priority='-520'>
+ <rule action='return' direction='out' priority='350' >
+ <arp match='yes' arpsrcmacaddr='$MAC'/>
+ </rule>
+ <!-- drop everything else -->
+ <rule action='drop' direction='out' priority='1000' />
+</filter>
Index: libvirt-acl/examples/xml/nwfilter/clean-traffic.xml
===================================================================
--- libvirt-acl.orig/examples/xml/nwfilter/clean-traffic.xml
+++ libvirt-acl/examples/xml/nwfilter/clean-traffic.xml
@@ -1,4 +1,4 @@
-<filter name='clean-traffic'>
+<filter name='clean-traffic' chain='root'>
<!-- An example of a traffic filter enforcing clean traffic
from a VM by
- preventing MAC spoofing -->
@@ -6,11 +6,21 @@
<!-- preventing IP spoofing on outgoing, allow all IPv4 in incoming -->
<filterref filter='no-ip-spoofing'/>
+
+ <rule direction='out' action='accept' priority='-650'>
+ <mac protocolid='ipv4'/>
+ </rule>
+
<filterref filter='allow-incoming-ipv4'/>
<!-- preventing ARP spoofing/poisoning -->
<filterref filter='no-arp-spoofing'/>
+ <!-- accept all other incoming and outgoing ARP traffic -->
+ <rule action='accept' direction='inout' priority='-500'>
+ <mac protocolid='arp'/>
+ </rule>
+
<!-- preventing any other traffic than IPv4 and ARP -->
<filterref filter='no-other-l2-traffic'/>
Index: libvirt-acl/examples/xml/nwfilter/no-mac-spoofing.xml
===================================================================
--- libvirt-acl.orig/examples/xml/nwfilter/no-mac-spoofing.xml
+++ libvirt-acl/examples/xml/nwfilter/no-mac-spoofing.xml
@@ -1,5 +1,10 @@
-<filter name='no-mac-spoofing' chain='ipv4'>
- <rule action='drop' direction='out' priority='10'>
- <mac match='no' srcmacaddr='$MAC' />
+<filter name='no-mac-spoofing' chain='mac' priority='-800'>
+ <!-- return packets with VM's MAC address as source address -->
+ <rule direction='out' action='return'>
+ <mac srcmacaddr='$MAC'/>
+ </rule>
+ <!-- drop everything else -->
+ <rule direction='out' action='drop'>
+ <mac/>
</rule>
</filter>
Index: libvirt-acl/examples/xml/nwfilter/no-arp-spoofing.xml
===================================================================
--- libvirt-acl.orig/examples/xml/nwfilter/no-arp-spoofing.xml
+++ libvirt-acl/examples/xml/nwfilter/no-arp-spoofing.xml
@@ -1,36 +1,4 @@
-<filter name='no-arp-spoofing' chain='arp'>
- <uuid>f88f1932-debf-4aa1-9fbe-f10d3aa4bc95</uuid>
- <rule action='drop' direction='out' priority='300' >
- <mac match='no' srcmacaddr='$MAC'/>
- </rule>
-
- <!-- no arp spoofing -->
- <!-- drop if ipaddr or macaddr does not belong to guest -->
- <rule action='drop' direction='out' priority='350' >
- <arp match='no' arpsrcmacaddr='$MAC'/>
- </rule>
- <rule action='drop' direction='out' priority='400' >
- <arp match='no' arpsrcipaddr='$IP' />
- </rule>
- <!-- allow gratuitous arp -->
- <rule action='accept' direction='in' priority='425'>
- <arp gratuitous='true'/>
- </rule>
- <!-- drop if ipaddr or macaddr does not belong to guest -->
- <rule action='drop' direction='in' priority='450' >
- <arp match='no' arpdstmacaddr='$MAC'/>
- <arp opcode='reply'/>
- </rule>
- <rule action='drop' direction='in' priority='500' >
- <arp match='no' arpdstipaddr='$IP' />
- </rule>
- <!-- accept only request or reply packets -->
- <rule action='accept' direction='inout' priority='600' >
- <arp opcode='request'/>
- </rule>
- <rule action='accept' direction='inout' priority='650' >
- <arp opcode='reply'/>
- </rule>
- <!-- drop everything else -->
- <rule action='drop' direction='inout' priority='1000' />
+<filter name='no-arp-spoofing' chain='root'>
+ <filterref filter='no-arp-mac-spoofing'/>
+ <filterref filter='no-arp-ip-spoofing'/>
</filter>
Index: libvirt-acl/examples/xml/nwfilter/no-ip-spoofing.xml
===================================================================
--- libvirt-acl.orig/examples/xml/nwfilter/no-ip-spoofing.xml
+++ libvirt-acl/examples/xml/nwfilter/no-ip-spoofing.xml
@@ -1,7 +1,14 @@
-<filter name='no-ip-spoofing' chain='ipv4'>
+<filter name='no-ip-spoofing' chain='ipv4-ip' priority='-710'>
+ <!-- allow DHCP requests -->
+ <rule action='accept' direction='out' priority='100'>
+ <ip srcipaddr='0.0.0.0' protocol='udp' srcportstart='68' srcportend='68'/>
+ </rule>
- <!-- drop if srcipaddr is not the IP address of the guest -->
- <rule action='drop' direction='out'>
- <ip match='no' srcipaddr='$IP' />
- </rule>
+ <!-- allow all known IP addresses -->
+ <rule direction='out' action='return' priority='500'>
+ <ip srcipaddr='$IP'/>
+ </rule>
+
+ <!-- drop everything else -->
+ <rule direction='out' action='drop' priority='1000'/>
</filter>
13 years
[libvirt] [PATCH] virsh: translate net-info help
by Eric Blake
Reported by kato.tomoyuki(a)jp.fujitsu.com at
https://bugzilla.redhat.com/show_bug.cgi?id=749564
* tools/virsh.c (info_network_info): Mark string for translation.
---
Pushing under the trivial rule.
tools/virsh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index ff9cc42..be4df58 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -6650,7 +6650,7 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_network_info[] = {
{"help", N_("network information")},
- {"desc", "Returns basic information about the network"},
+ {"desc", N_("Returns basic information about the network")},
{NULL, NULL}
};
--
1.7.7.3
13 years
[libvirt] [PATCH] maint: typo fixes
by Eric Blake
Many of these were mentioned by Yuri Chornoivan in:
https://bugzilla.redhat.com/show_bug.cgi?id=669506
* src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
* src/conf/netdev_vport_profile_conf.c
(virNetDevVPortProfileParse): Likewise.
* src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
Likewise.
* src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
* src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
* src/storage/storage_backend_fs.c
(virStorageBackendFileSystemBuild): Likewise.
* daemon/libvirtd.conf: Likewise.
* src/util/logging.c (virLogMessage): Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
* src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
---
Pushing under the trivial rule.
daemon/libvirtd.conf | 4 ++--
src/conf/netdev_vport_profile_conf.c | 2 +-
src/esx/esx_util.c | 4 ++--
src/esx/esx_vi.c | 2 +-
src/storage/storage_backend_fs.c | 2 +-
src/uml/uml_conf.c | 4 ++--
src/util/logging.c | 2 +-
src/vmx/vmx.c | 2 +-
src/xen/xend_internal.c | 2 +-
src/xen/xm_internal.c | 2 +-
10 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf
index f218454..3eab2be 100644
--- a/daemon/libvirtd.conf
+++ b/daemon/libvirtd.conf
@@ -284,7 +284,7 @@
# Logging controls
#
-# Logging level: 4 errors, 3 warnings, 2 informations, 1 debug
+# Logging level: 4 errors, 3 warnings, 2 information, 1 debug
# basically 1 will log everything possible
#log_level = 3
@@ -309,7 +309,7 @@
# the event layer.
# Logging outputs:
-# An output is one of the places to save logging informations
+# An output is one of the places to save logging information
# The format for an output can be:
# x:stderr
# output goes to stderr
diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c
index 861ad34..b48b2cb 100644
--- a/src/conf/netdev_vport_profile_conf.c
+++ b/src/conf/netdev_vport_profile_conf.c
@@ -167,7 +167,7 @@ virNetDevVPortProfileParse(xmlNodePtr node)
}
} else {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
- _("profileid parameter is missing for 802.1Qbh descripion"));
+ _("profileid parameter is missing for 802.1Qbh description"));
goto error;
}
break;
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
index 1925802..2c5ac1a 100644
--- a/src/esx/esx_util.c
+++ b/src/esx/esx_util.c
@@ -2,7 +2,7 @@
/*
* esx_util.c: utility functions for the VMware ESX driver
*
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2009-2011 Matthias Bolte <matthias.bolte(a)googlemail.com>
* Copyright (C) 2009 Maximilian Wilhelm <max(a)rfc2324.org>
*
@@ -384,7 +384,7 @@ esxUtil_ResolveHostname(const char *hostname,
if (errcode != 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Formating IP address for host '%s' failed: %s"), hostname,
+ _("Formatting IP address for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
freeaddrinfo(result);
return -1;
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 21892a0..80f337b 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -3955,7 +3955,7 @@ esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
if (taskInfo->cancelable == esxVI_Boolean_True) {
if (esxVI_CancelTask(ctx, task) < 0 && blocked) {
VIR_ERROR(_("Cancelable task is blocked by an "
- "unanswered question but cancelation "
+ "unanswered question but cancellation "
"failed"));
}
} else if (blocked) {
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 3473435..b5acd20 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -706,7 +706,7 @@ error:
/**
* @conn connection to report errors against
* @pool storage pool to build
- * @flags controls the pool formating behaviour
+ * @flags controls the pool formatting behaviour
*
* Build a directory or FS based storage pool.
*
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index a576047..b878622 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -188,12 +188,12 @@ umlBuildCommandLineNet(virConnectPtr conn,
}
if (def->data.ethernet.ipaddr) {
umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("IP address not supported for ethernet inteface"));
+ _("IP address not supported for ethernet interface"));
goto error;
}
if (def->data.ethernet.script) {
umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("script execution not supported for ethernet inteface"));
+ _("script execution not supported for ethernet interface"));
goto error;
}
break;
diff --git a/src/util/logging.c b/src/util/logging.c
index f550503..8d60280 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -677,7 +677,7 @@ virLogVersionString(char **msg)
* @fmt: the string format
* @...: the arguments
*
- * Call the libvirt logger with some informations. Based on the configuration
+ * Call the libvirt logger with some information. Based on the configuration
* the message may be stored, sent to output or just discarded
*/
void virLogMessage(const char *category, int priority, const char *funcname,
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 9ba06e5..c250aee 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -3513,7 +3513,7 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
STRCASENEQ(def->model, "vmxnet3") &&
STRCASENEQ(def->model, "e1000")) {
VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML entry 'devices/interfase/model' "
+ _("Expecting domain XML entry 'devices/interface/model' "
"to be 'vlance' or 'vmxnet' or 'vmxnet2' or 'vmxnet3' "
"or 'e1000' but found '%s'"), def->model);
return -1;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 2318565..16165fe 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2217,7 +2217,7 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
flags |= VIR_DOMAIN_VCPU_MAXIMUM;
if ((max = xenDaemonDomainGetVcpusFlags(domain, flags)) < 0) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("could not determin max vcpus for the domain"));
+ _("could not determine max vcpus for the domain"));
return -1;
}
if (vcpus > max) {
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index a250b6f..9c376fb 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -728,7 +728,7 @@ xenXMDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
/* Hypervisor maximum. */
if ((max = xenUnifiedGetMaxVcpus(domain->conn, NULL)) < 0) {
xenXMError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not determin max vcpus for the domain"));
+ _("could not determine max vcpus for the domain"));
goto cleanup;
}
/* Can't specify a current larger than stored maximum; but
--
1.7.7.3
13 years
[libvirt] [PATCH] conf: Improve incorrect root element error messages
by Michal Privoznik
When user pass wrong root element, it is not 'internal error' and
we can give him hint what we are expecting.
---
src/conf/domain_conf.c | 12 ++++++++----
src/conf/interface_conf.c | 6 ++++--
src/conf/network_conf.c | 6 ++++--
src/conf/node_device_conf.c | 6 ++++--
src/conf/secret_conf.c | 6 ++++--
src/security/virt-aa-helper.c | 2 +-
6 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f04e477..bb504f9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7932,8 +7932,10 @@ virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
virDomainDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "domain")) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virDomainReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <domain>"),
+ root->name);
goto cleanup;
}
@@ -7963,8 +7965,10 @@ virDomainObjParseNode(virCapsPtr caps,
virDomainObjPtr obj = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "domstatus")) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virDomainReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <domstatus>"),
+ root->name);
goto cleanup;
}
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index fd8d1ae..59f74a1 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -838,8 +838,10 @@ virInterfaceDefPtr virInterfaceDefParseNode(xmlDocPtr xml,
virInterfaceDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "interface")) {
- virInterfaceReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virInterfaceReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <interface>"),
+ root->name);
return NULL;
}
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 10afcde..1058b07 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1107,8 +1107,10 @@ virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml,
virNetworkDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "network")) {
- virNetworkReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virNetworkReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <network>"),
+ root->name);
return NULL;
}
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index fc284e0..084121f 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1204,8 +1204,10 @@ virNodeDeviceDefParseNode(xmlDocPtr xml,
virNodeDeviceDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "device")) {
- virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virNodeDeviceReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s> "
+ "expecting <device>"),
+ root->name);
return NULL;
}
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index a51fc69..6e80733 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -126,8 +126,10 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
char *uuidstr = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "secret")) {
- virSecretReportError(VIR_ERR_XML_ERROR, "%s",
- _("incorrect root element"));
+ virSecretReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <secret>"),
+ root->name);
goto cleanup;
}
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index ad06974..14399cc 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -644,7 +644,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
}
if (!xmlStrEqual(ctxt->node->name, BAD_CAST "domain")) {
- vah_error(NULL, 0, _("incorrect root element"));
+ vah_error(NULL, 0, _("unexpected root element, expecting <domain>"));
goto cleanup;
}
--
1.7.3.4
13 years
[libvirt] [PATCH 0/2] gnulib update
by Eric Blake
The latest gnulib update accidentally reintroduced -Wformat-nonliteral
(by virtue of adding -Wformat=2, understood only by newer gcc), I
almost got sucked into the rathole of fixing all our problems before
I realized the real issue, but by then, I had already written patch 1.
I'd like to get this in before the freeze, and then (hopefully) not
touch .gnulib until after the release (we've been burned too many
times by a .gnulib update after rc1).
Eric Blake (2):
error: drop old-style error reporting
build: import latest gnulib, for mingw and syntax-check fixes
.gnulib | 2 +-
gnulib/local/lib/openpty.c.diff | 26 ------
gnulib/local/lib/pty.in.h.diff | 13 ---
m4/virt-compile-warnings.m4 | 8 ++-
src/fdstream.c | 2 +-
src/libvirt_private.syms | 1 -
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_monitor_json.c | 2 +-
src/util/conf.c | 22 ++---
src/util/virterror.c | 2 +-
src/util/virterror_internal.h | 8 --
src/xen/xen_hypervisor.c | 170 ++++++++++++++++-----------------------
src/xenapi/xenapi_utils.c | 2 +-
tests/testutils.c | 4 +-
tools/virsh.c | 12 ++--
15 files changed, 98 insertions(+), 178 deletions(-)
delete mode 100644 gnulib/local/lib/openpty.c.diff
delete mode 100644 gnulib/local/lib/pty.in.h.diff
--
1.7.7.3
13 years
[libvirt] [PATCH] Avoid crash in shunloadtest
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
For unknown reasons, the shunloadtest will crash on Fedora 16
inside dlopen()
(gdb) bt
#0 0x00000000000050e6 in ?? ()
#1 0x00007ff61a77b9d5 in floor () from /lib64/libm.so.6
#2 0x00007ff61e522963 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
#3 0x00007ff61e5297e6 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#4 0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#5 0x00007ff61e52917a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ff61e0f6f26 in dlopen_doit () from /lib64/libdl.so.2
#7 0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8 0x00007ff61e0f752f in _dlerror_run () from /lib64/libdl.so.2
#9 0x00007ff61e0f6fc1 in dlopen@(a)GLIBC_2.2.5 () from /lib64/libdl.so.2
#10 0x0000000000400a15 in main (argc=<optimized out>, argv=<optimized out>) at shunloadtest.c:105
Changing from RTLD_NOW to RTLD_LAZY avoids this problem,
but quite possibly does not fix the root cause.
* shunloadtest.c: s/NOW/LAZY/
---
tests/shunloadtest.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c
index 2cdb8b8..ab6e56f 100644
--- a/tests/shunloadtest.c
+++ b/tests/shunloadtest.c
@@ -102,7 +102,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
fprintf(stderr, " .%*s 1 ", 39, "");
signal(SIGSEGV, sigHandler);
- if (!(lib = dlopen("./.libs/libshunload.so", RTLD_NOW))) {
+ if (!(lib = dlopen("./.libs/libshunload.so", RTLD_LAZY))) {
fprintf(stderr, "Cannot load ./.libs/libshunload.so %s\n", dlerror());
return 1;
}
--
1.7.7.3
13 years
[libvirt] [PATCH] build: properly skip tests
by Eric Blake
I got this failure on FreeBSD:
shunloadtest.c: In function 'main':
shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)
but inspection showed several other problems, all fixed here.
* tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
EXIT_AM_SKIP is defined.
* tests/esxutilstest.c [!WITH_ESX]: Likewise.
* tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
* tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
* tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
* tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
* tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
* tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
* tests/shunloadtest.c [!linux]: Likewise.
* tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
* tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
---
Pushing under the build-breaker rule.
tests/domainsnapshotxml2xmltest.c | 1 +
tests/esxutilstest.c | 1 +
tests/openvzutilstest.c | 1 +
tests/qemuargv2xmltest.c | 1 +
tests/qemuhelptest.c | 1 +
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmltest.c | 1 +
tests/qemuxmlnstest.c | 1 +
tests/shunloadtest.c | 1 +
tests/vmx2xmltest.c | 1 +
tests/xml2vmxtest.c | 1 +
11 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c
index c2266f4..90ff9bb 100644
--- a/tests/domainsnapshotxml2xmltest.c
+++ b/tests/domainsnapshotxml2xmltest.c
@@ -118,6 +118,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int
main(void)
diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c
index 8241ecd..201b930 100644
--- a/tests/esxutilstest.c
+++ b/tests/esxutilstest.c
@@ -279,6 +279,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c
index f04ddbb..7f5ddc9 100644
--- a/tests/openvzutilstest.c
+++ b/tests/openvzutilstest.c
@@ -160,6 +160,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index a20df06..cb3cafd 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -243,6 +243,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int
main(void)
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index df677cc..cc9f1ad 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -578,6 +578,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index e75d55e..228d052 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -669,6 +669,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 623e72c..35bfdce 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -211,6 +211,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int
main(void)
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
index ee3ad1b..86cf974 100644
--- a/tests/qemuxmlnstest.c
+++ b/tests/qemuxmlnstest.c
@@ -284,6 +284,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c
index ab6e56f..8113ef3 100644
--- a/tests/shunloadtest.c
+++ b/tests/shunloadtest.c
@@ -144,6 +144,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
}
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 5c0018a..3c566f8 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -289,6 +289,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index 5530b45..f4e4ed6 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -301,6 +301,7 @@ mymain(void)
VIRT_TEST_MAIN(mymain)
#else
+# include "testutils.h"
int main(void)
{
--
1.7.7.3
13 years