Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 29 participants
- 40189 discussions
16 Feb '13
This patch adds functionality to allow libvirt to configure the
'native-tagged' and 'native-untagged' modes on openvswitch networks.
---
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index ffcc33e..a5054cc 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3209,6 +3209,12 @@ qemu-kvm -net nic,model=? /dev/null
<parameters
interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
</virtualport>
</interface>
+ <interface type='bridge'>
+ <b><vlan trunk='yes' native_mode='tagged'
native_tag='123'></b>
+ <b><tag id='42'/></b>
+ <b></vlan></b>
+ ...
+ </interface>
<devices>
...</pre>
@@ -3234,7 +3240,17 @@ qemu-kvm -net nic,model=? /dev/null
attribute <code>trunk='yes'</code> can be added to the toplevel
vlan element.
</p>
-
+ <p>
+ For network connections using openvswitch it is possible to
+ configure the 'native-tagged' and 'native-untagged' vlan modes
+ <span class="since">(Since 1.0.2).</span> This uses the optional
+ <code>native_mode</code> and <code>native_tag</code> attributes
+ on the <code><vlan></code> element:
<code>native_mode</code>
+ may be set to 'tagged' or 'untagged', <code>native_tag</code>
+ sets the id of the native vlan. Setting a native vlan
implies
+ this is a trunk port, so <code>trunk='yes'</code> will be added
if not
+ explicitly set.
+ </p>
<h5><a name="elementLink">Modifying virtual link state</a></h5>
<pre>
...
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 7b42529..68c562b 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -396,6 +396,12 @@
<parameters
interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
</virtualport>
</interface>
+ <interface type='bridge'>
+ <b><vlan trunk='yes' native_mode='tagged'
native_tag='123'></b>
+ <b><tag id='42'/></b>
+ <b></vlan></b>
+ ...
+ </interface>
<devices>
...</pre>
diff --git a/docs/schemas/networkcommon.rng
b/docs/schemas/networkcommon.rng
index 51ff759..4696f43 100644
--- a/docs/schemas/networkcommon.rng
+++ b/docs/schemas/networkcommon.rng
@@ -197,6 +197,21 @@
<value>yes</value>
</attribute>
</optional>
+ <optional>
+ <attribute name="native_mode">
+ <choice>
+ <value>tagged</value>
+ <value>untagged</value>
+ </choice>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="native_tag">
+ <data type="unsignedInt">
+ <param name="maxInclusive">4095</param>
+ </data>
+ </attribute>
+ </optional>
<oneOrMore>
<element name="tag">
<attribute name="id">
diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c
index 13ba8c6..618eb4c 100644
--- a/src/conf/netdev_vlan_conf.c
+++ b/src/conf/netdev_vlan_conf.c
@@ -17,6 +17,7 @@
*
* Authors:
* Laine Stump <laine(a)redhat.com>
+ * James Robson <jrobson(a)websense.com>
*/
#include <config.h>
@@ -33,6 +34,8 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr
ctxt, virNetDevVlanPtr de
int ret = -1;
xmlNodePtr save = ctxt->node;
const char *trunk = NULL;
+ const char *nativeMode;
+ unsigned int nativeTag;
xmlNodePtr *tagNodes = NULL;
int nTags, ii;
@@ -73,16 +76,44 @@ virNetDevVlanParse(xmlNodePtr node,
xmlXPathContextPtr ctxt, virNetDevVlanPtr de
def->nTags = nTags;
- /* now that we know how many tags there are, look for an explicit
- * trunk setting.
- */
- if (nTags > 1)
- def->trunk = true;
+ def->nativeMode = 0;
+ def->nativeTag = 0;
ctxt->node = node;
+ if ((nativeMode = virXPathString("string(./@native_mode)", ctxt)) !
= NULL) {
+ if (STRCASENEQ(nativeMode, "tagged") && STRCASENEQ(nativeMode,
"untagged")) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid \"native_mode='%s'\" in <vlan> -
"
+ "native_mode must be 'tagged' or
'untagged'"), nativeMode);
+ goto error;
+ }
+ if (virXPathUInt("string(./@native_tag)", ctxt, &nativeTag) <
0) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing or invalid native_tag
attribute"));
+ goto error;
+ }
+ if (nativeTag > 4095) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("native_tag %u too large (maximum 4095)"),
nativeTag);
+ goto error;
+ }
+ def->nativeMode = STRCASEEQ(nativeMode, "tagged") ? 1 : 2;
+ def->nativeTag = nativeTag;
+ }
+
+ /* def->trunk will be set to true if:
+ * "trunk='yes'" is set in xml
+ * a native-* vlan mode has been set
+ * >1 tag has been set */
if ((trunk = virXPathString("string(./@trunk)", ctxt)) != NULL) {
def->trunk = STRCASEEQ(trunk, "yes");
if (!def->trunk) {
+ if (def->nativeMode > 0) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("invalid configuration in <vlan> -
\"trunk='no'\" is "
+ "not allowed with native_mode"));
+ goto error;
+ }
if (nTags > 1) {
virReportError(VIR_ERR_XML_ERROR,
_("invalid \"trunk='%s'\" in <vlan> -
trunk='yes' "
@@ -97,6 +128,8 @@ virNetDevVlanParse(xmlNodePtr node,
xmlXPathContextPtr ctxt, virNetDevVlanPtr de
goto error;
}
}
+ } else if (nTags > 1 || def->nativeMode > 0) {
+ def->trunk = true;
}
ret = 0;
@@ -122,8 +155,11 @@ virNetDevVlanFormat(virNetDevVlanPtr def,
virBufferPtr buf)
_("missing vlan tag data"));
return -1;
}
-
- virBufferAsprintf(buf, "<vlan%s>\n", def->trunk ? " trunk='yes'" :
"");
+ if (def->nativeMode == 0) {
+ virBufferAsprintf(buf, "<vlan%s>\n", def->trunk ? "
trunk='yes'" : "");
+ } else {
+ virBufferAsprintf(buf, "<vlan trunk='yes' native_mode='%s'
native_tag='%u'>\n", def->nativeMode == 1 ? "tagged" : "untagged",
def->nativeTag);
+ }
for (ii = 0; ii < def->nTags; ii++) {
virBufferAsprintf(buf, " <tag id='%u'/>\n", def->tag[ii]);
}
diff --git a/src/util/virnetdevopenvswitch.c
b/src/util/virnetdevopenvswitch.c
index 4fe077a..87122b0 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -19,6 +19,7 @@
* Dan Wendlandt <dan(a)nicira.com>
* Kyle Mestery <kmestery(a)cisco.com>
* Ansis Atteka <aatteka(a)nicira.com>
+ * James Robson <jrobson(a)websense.com>
*/
#include <config.h>
@@ -108,9 +109,13 @@ int virNetDevOpenvswitchAddPort(const char *brname,
const char *ifname,
virCommandAddArgList(cmd, "--timeout=5", "--", "--may-exist",
"add-port",
brname, ifname, NULL);
- if (virBufferUse(&buf) != 0)
+ if (virBufferUse(&buf) != 0) {
+ if (virtVlan->nativeMode > 0) {
+ virCommandAddArgFormat(cmd, "vlan_mode=%s",
virtVlan->nativeMode == 1 ? "native-tagged" : "native-untagged");
+ virCommandAddArgFormat(cmd, "tag=%d", virtVlan->nativeTag);
+ }
virCommandAddArgList(cmd, virBufferCurrentContent(&buf), NULL);
-
+ }
if (ovsport->profileID[0] == '\0') {
virCommandAddArgList(cmd,
"--", "set", "Interface", ifname,
attachedmac_ex_id,
diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c
index 2fe2017..298673d 100644
--- a/src/util/virnetdevvlan.c
+++ b/src/util/virnetdevvlan.c
@@ -17,6 +17,7 @@
*
* Authors:
* Laine Stump <laine(a)redhat.com>
+ * James Robson <jrobson(a)websense.com>
*/
#include <config.h>
@@ -33,6 +34,8 @@ virNetDevVlanClear(virNetDevVlanPtr vlan)
{
VIR_FREE(vlan->tag);
vlan->nTags = 0;
+ vlan->nativeMode = 0;
+ vlan->nativeTag = -1;
}
void
@@ -54,7 +57,9 @@ virNetDevVlanEqual(const virNetDevVlanPtr a, const
virNetDevVlanPtr b)
return false;
if (a->trunk != b->trunk ||
- a->nTags != b->nTags) {
+ a->nTags != b->nTags ||
+ a->nativeMode != b->nativeMode ||
+ a->nativeTag != b->nativeTag) {
return false;
}
@@ -89,6 +94,8 @@ virNetDevVlanCopy(virNetDevVlanPtr dst, const
virNetDevVlanPtr src)
dst->trunk = src->trunk;
dst->nTags = src->nTags;
+ dst->nativeMode = src->nativeMode;
+ dst->nativeTag = src->nativeTag;
memcpy(dst->tag, src->tag, src->nTags * sizeof(*src->tag));
return 0;
}
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index c6b16ef..f0f78f0 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -17,6 +17,7 @@
*
* Authors:
* Laine Stump <laine(a)redhat.com>
+ * James Robson <jrobson(a)websense.com>
*/
#ifndef __VIR_NETDEV_VLAN_H__
@@ -25,6 +26,8 @@
typedef struct _virNetDevVlan virNetDevVlan;
typedef virNetDevVlan *virNetDevVlanPtr;
struct _virNetDevVlan {
+ short int nativeMode; /* 0=off, 1=tagged, 2=untagged */
+ unsigned int nativeTag;
bool trunk; /* true if this is a trunk */
int nTags; /* number of tags in array */
unsigned int *tag; /* pointer to array of tags */
diff --git a/tests/networkxml2xmlin/openvswitch-net.xml
b/tests/networkxml2xmlin/openvswitch-net.xml
index a3d82b1..93c49d5 100644
--- a/tests/networkxml2xmlin/openvswitch-net.xml
+++ b/tests/networkxml2xmlin/openvswitch-net.xml
@@ -21,4 +21,13 @@
<parameters profileid='alice-profile'/>
</virtualport>
</portgroup>
+ <portgroup name='tagged'>
+ <vlan native_mode='tagged' native_tag='123'>
+ <tag id='555'/>
+ <tag id='444'/>
+ </vlan>
+ <virtualport>
+ <parameters profileid='tagged-profile'/>
+ </virtualport>
+ </portgroup>
</network>
diff --git a/tests/networkxml2xmlout/openvswitch-net.xml
b/tests/networkxml2xmlout/openvswitch-net.xml
index a3d82b1..ab3d797 100644
--- a/tests/networkxml2xmlout/openvswitch-net.xml
+++ b/tests/networkxml2xmlout/openvswitch-net.xml
@@ -21,4 +21,13 @@
<parameters profileid='alice-profile'/>
</virtualport>
</portgroup>
+ <portgroup name='tagged'>
+ <vlan trunk='yes' native_mode='tagged' native_tag='123'>
+ <tag id='555'/>
+ <tag id='444'/>
+ </vlan>
+ <virtualport>
+ <parameters profileid='tagged-profile'/>
+ </virtualport>
+ </portgroup>
</network>
Protected by Websense Hosted Email Security -- www.websense.com
2
1
If the running VM contains a writable raw image, creating snapshot fails
internally in QEMU, but the error is not detected by libvirt. Success is
still reported to the user, who will see the snapshot in libvirt, even
they are NOT created by qemu.
virsh # qemu-monitor-command --hmp winxp-1 savevm \"test\"
Device 'drive-fdc0-0-0' is writable but does not support snapshots.
virsh # snapshot-create-as winxp-1 test
Domain snapshot test created
Since there is no QMP command in QEMU, libvirtd sends a HMP command to the
running QEMU and parses the returned text. There only the following 4 strings
are detected as errors:
src/qemu/qemu_monitor_text.c:2822 # qemuMonitorTextCreateSnapshot()
> "Error while creating snapshot"
> "No block device can accept snapshots"
> "Could not open VM state file"
> "Error" + "while writing VM"
Since none of them match the above message, libvirt thinks the command
succeeded.
Add "does not support snapshots" as an additional error condition.
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
src/qemu/qemu_monitor_text.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index bc0a11d..5880ab9 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -2854,6 +2854,10 @@ int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name)
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
+ else if (strstr(reply, "does not support snapshots") != NULL) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
+ goto cleanup;
+ }
ret = 0;
--
1.7.10.4
2
2
Hi,
I am trying to attach a usb device to my virtualbox node using libvirt. My
node is already running, I stop my node and then I am trying to add this
usb device.
I have a separate xml file defined for usb. It looks like this:
*<device>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x4321'/>
<product id='0xfeeb'/>
</source>
</hostdev>
</device> *
*
*
I am trying to attach it using code:
*conn = libvirt.open("vbox:///session")
if conn ==None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
print 'connected to vbox hypervisor driver'
domainInstance = conn.lookupByName('SampleNode')
filed = open('/root/testFolder/usbSharedFolder.xml', 'r')
config_str = filed.read()
libvirt.virDomain.attachDevice(domainInstance, config_str)*
When it is executed I am getting an error message saying:
*libvir: VirtualBox Driver error : out of memory *
*
*
Even with virsh it is giving the same error. I am using the below command:
*attach-device SampleNode /root/testFolder/usbSharedFolder.xml*
Can anyone tell me what is going wrong. It is really very important. Please
do reply.
Thanks in advance.
2
4
15 Feb '13
Hello,
If the running VM contains a floppy, creating snapshot fails internally, but
the error is not detected by libvirt. Success is still reported to the user
success, who will see the snapshots, even they are NOT created.
virsh # qemu-monitor-command --hmp winxp-1 savevm \"test\"
Device 'drive-fdc0-0-0' is writable but does not support snapshots.
virsh # snapshot-create-as winxp-1 test
Domain snapshot test created
Since there is no QMP command in qemu, libvirtd sends a HMP command to the
running QEMU and parses the returned text. There only the following 4 strings
are detected as errors:
src/qemu/qemu_monitor_text.c:2822 # qemuMonitorTextCreateSnapshot()
"Error while creating snapshot"
"No block device can accept snapshots"
"Could not open VM state file"
"Error" + "while writing VM"
Since none of them match the above message, libvirts thinks the command
succeeded.
libvirt-0.9.12 but also exists in git, QEMU 1.1.2
Tracked at <https://forge.univention.org/bugzilla/show_bug.cgi?id=30472>
--
Philipp Hahn Open Source Software Engineer hahn(a)univention.de
Univention GmbH be open. fon: +49 421 22 232- 0
Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99
http://www.univention.de/
1
0
Now, it's impossible to arrange devices into multi-pci-bus,
for example:
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x1' slot='0x02' function='0x0'/>
</video>
libvirt will complain about "bus != 0",
fortunately, qemu supports pci-to-pci bridge,
if we want to use multi-pci-bus, we can define
2 pci bridge controllers, then attach 1 to the other
as a subordinate pci-bus, so, 2 pci-buses appear.
for example:
<controller type='pci-bridge' index='0'/>
<controller type='pci-bridge' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x01' slot='0x02' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
src/conf/domain_conf.c | 100 ++++-
src/conf/domain_conf.h | 1 +
docs/schemas/domaincommon.rng | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 70 ++++++++++++++++++++-----
6 files changed, 152 insertions(+), 23 deletions(-)
4
11
Hi,
I would like to know if libvirt support Hyper-V deployed in Windows 2012
server. Does libvirt talk to Hyper-V using the REST API provided by
Microsoft (where SCVMM & SPF are deployed)?
Many thanks in advance.
Regards,
Hassan
2
1
[libvirt] [PATCH] [nwfilter] Fix libvirt upgrade path when nwfilter is used
by Stefan Berger 15 Feb '13
by Stefan Berger 15 Feb '13
15 Feb '13
Between revision 65fb9d49 and before this patch, an upgrade of libvirt while
VMs are running and instantiating iptables filtering rules due to nwfilter
rules, may leave stray iptables rules behind when shutting VMs down.
Left-over iptables rules may look like this:
Chain FP-vnet0 (1 references)
target prot opt source destination
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:122
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
[...]
Chain libvirt-out (1 references)
target prot opt source destination
FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match
--physdev-out vnet0
The reason is that the recent nwfilter code only removed filtering rules in
the libvirt-out chain that contain the --physdev-is-bridged parameter.
Older rules didn't match and were not removed.
Note that the user-defined chain FO-vnet0 could not be removed due to the
reference from the rule in libvirt-out.
Often the work around may be done through
service iptables restart
kill -SIGHUP $(pidof libvirtd)
This patch now also removes older libvirt versions' iptables rules.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/nwfilter/nwfilter_ebiptables_driver.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -167,16 +167,24 @@ static const char ebiptables_script_set_
#define PHYSDEV_IN "--physdev-in"
#define PHYSDEV_OUT "--physdev-is-bridged --physdev-out"
+/*
+ * Previous versions of libvirt only used --physdev-out.
+ * To be able to upgrade with running VMs we need to be able to
+ * remove rules generated by those older versions of libvirt.
+ */
+#define PHYSDEV_OUT_OLD "--physdev-out"
static const char *m_state_out_str = "-m state --state NEW,ESTABLISHED";
static const char *m_state_in_str = "-m state --state ESTABLISHED";
static const char *m_physdev_in_str = "-m physdev " PHYSDEV_IN;
static const char *m_physdev_out_str = "-m physdev " PHYSDEV_OUT;
+static const char *m_physdev_out_old_str = "-m physdev " PHYSDEV_OUT_OLD;
#define MATCH_STATE_OUT m_state_out_str
#define MATCH_STATE_IN m_state_in_str
#define MATCH_PHYSDEV_IN m_physdev_in_str
#define MATCH_PHYSDEV_OUT m_physdev_out_str
+#define MATCH_PHYSDEV_OUT_OLD m_physdev_out_old_str
#define COMMENT_VARNAME "comment"
@@ -821,6 +829,8 @@ _iptablesUnlinkRootChain(virBufferPtr bu
: CHAINPREFIX_HOST_OUT;
const char *match = (incoming) ? MATCH_PHYSDEV_IN
: MATCH_PHYSDEV_OUT;
+ const char *old_match = (incoming) ? NULL
+ : MATCH_PHYSDEV_OUT_OLD;
PRINT_IPT_ROOT_CHAIN(chain, chainPrefix, ifname);
@@ -830,6 +840,18 @@ _iptablesUnlinkRootChain(virBufferPtr bu
basechain,
match, ifname, chain);
+ /*
+ * Previous versions of libvirt may have created a rule
+ * with the --physdev-is-bridged missing. Remove this one
+ * as well.
+ */
+ if (old_match)
+ virBufferAsprintf(buf,
+ "$IPT -D %s "
+ "%s %s -g %s" CMD_SEPARATOR,
+ basechain,
+ old_match, ifname, chain);
+
return 0;
}
2
1
15 Feb '13
Follow recent changes in libvirt and add --physdev-is-bridged to test cases where needed.
---
scripts/nwfilter/nwfilterxml2fwallout/ah-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/ah-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/all-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/all-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall | 8 ++++----
scripts/nwfilter/nwfilterxml2fwallout/conntrack-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/esp-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/esp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/hex-data-test.fwall | 8 ++++----
scripts/nwfilter/nwfilterxml2fwallout/icmp-direction-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/icmp-direction2-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/icmp-direction3-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/icmp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/icmpv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/igmp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/ipset-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/ipt-no-macspoof-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/iter-test1.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/iter-test2.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/iter-test3.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/sctp-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/sctp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/target-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/target-test2.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/tcp-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/tcp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/testvm.fwall.dat | 4 ++--
scripts/nwfilter/nwfilterxml2fwallout/udp-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/udp-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/udplite-ipv6-test.fwall | 2 +-
scripts/nwfilter/nwfilterxml2fwallout/udplite-test.fwall | 2 +-
31 files changed, 38 insertions(+), 38 deletions(-)
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ah-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/ah-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ah-ipv6-test.fwall
@@ -25,4 +25,4 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ah-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/ah-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ah-test.fwall
@@ -23,4 +23,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/all-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/all-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/all-ipv6-test.fwall
@@ -25,7 +25,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ip6tables -L FORWARD --line-number | grep libvirt
1 libvirt-in all anywhere anywhere
2 libvirt-out all anywhere anywhere
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/all-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/all-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/all-test.fwall
@@ -23,7 +23,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
@@ -27,7 +27,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ip6tables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
@@ -56,7 +56,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L libvirt-host-in -n | grep vnet0 | tr -s " "
HI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-in -n | grep vnet0 | tr -s " "
@@ -64,7 +64,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ip6tables -L INPUT -n --line-numbers | grep libvirt
1 libvirt-host-in all ::/0 ::/0
#ip6tables -L libvirt-host-in -n | grep vnet0 | tr -s " "
@@ -74,4 +74,4 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/conntrack-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/conntrack-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/conntrack-test.fwall
@@ -21,4 +21,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/esp-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/esp-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/esp-ipv6-test.fwall
@@ -25,4 +25,4 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/esp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/esp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/esp-test.fwall
@@ -23,4 +23,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/hex-data-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/hex-data-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/hex-data-test.fwall
@@ -27,7 +27,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ip6tables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
@@ -47,7 +47,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L libvirt-host-in -n | grep vnet0 | tr -s " "
HI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-in -n | grep vnet0 | tr -s " "
@@ -55,7 +55,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ip6tables -L INPUT -n --line-numbers | grep libvirt
1 libvirt-host-in all ::/0 ::/0
#ip6tables -L libvirt-host-in -n | grep vnet0 | tr -s " "
@@ -65,4 +65,4 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction-test.fwall
@@ -20,4 +20,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction2-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction2-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction2-test.fwall
@@ -20,4 +20,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction3-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction3-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-direction3-test.fwall
@@ -20,4 +20,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/icmp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmp-test.fwall
@@ -20,4 +20,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmpv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/icmpv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/icmpv6-test.fwall
@@ -22,5 +22,5 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/igmp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/igmp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/igmp-test.fwall
@@ -23,4 +23,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ipset-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/ipset-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ipset-test.fwall
@@ -32,7 +32,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ipt-no-macspoof-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/ipt-no-macspoof-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/ipt-no-macspoof-test.fwall
@@ -16,4 +16,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test1.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/iter-test1.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test1.fwall
@@ -23,7 +23,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test2.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/iter-test2.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test2.fwall
@@ -185,7 +185,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test3.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/iter-test3.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/iter-test3.fwall
@@ -29,7 +29,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/sctp-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/sctp-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/sctp-ipv6-test.fwall
@@ -25,7 +25,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/sctp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/sctp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/sctp-test.fwall
@@ -23,7 +23,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/target-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/target-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/target-test.fwall
@@ -41,7 +41,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/target-test2.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/target-test2.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/target-test2.fwall
@@ -26,7 +26,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FORWARD -n --line-number | grep libvirt
1 libvirt-in all -- 0.0.0.0/0 0.0.0.0/0
2 libvirt-out all -- 0.0.0.0/0 0.0.0.0/0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/tcp-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/tcp-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/tcp-ipv6-test.fwall
@@ -25,7 +25,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/tcp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/tcp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/tcp-test.fwall
@@ -27,7 +27,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/testvm.fwall.dat
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/testvm.fwall.dat
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/testvm.fwall.dat
@@ -48,7 +48,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#iptables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
@@ -68,4 +68,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udp-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/udp-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udp-ipv6-test.fwall
@@ -25,7 +25,7 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udp-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/udp-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udp-test.fwall
@@ -23,7 +23,7 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
#ebtables -t nat -L libvirt-O-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L libvirt-I-vnet0 2>/dev/null | grep -v "table:" | grep -v "^$"
#ebtables -t nat -L PREROUTING | grep vnet0
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udplite-ipv6-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/udplite-ipv6-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udplite-ipv6-test.fwall
@@ -25,4 +25,4 @@ FI-vnet0 all ::/0 ::/0 [goto] PHYSDEV ma
#ip6tables -L libvirt-in-post -n | grep vnet0
ACCEPT all ::/0 ::/0 PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udplite-test.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/udplite-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/udplite-test.fwall
@@ -23,4 +23,4 @@ FI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#iptables -L libvirt-in-post -n | grep vnet0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vnet0
#iptables -L libvirt-out -n | grep vnet0 | tr -s " "
-FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0
+FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-out vnet0 --physdev-is-bridged
3
5
[libvirt] Boot VM with HLFS driver for Libvirt network disk (Online storage management)
by harryxiyou 14 Feb '13
by harryxiyou 14 Feb '13
14 Feb '13
Hi all,
We have developed Online storage driver and Offline storage driver for
Libvirt, which are located here.
Online one:
http://cloudxy.googlecode.com/svn/branches/hlfs/person/harry/hlfs/patches/h…
Offline one:
http://cloudxy.googlecode.com/svn/branches/hlfs/person/harry/hlfs/patches/h…
HLFS(HDFS-based Log-structured FileSystem) has two modes, which
are local mode and HDFS mode. We have tested HLFS driver for Libvirt
with local way succesfully. However, when we test HDFS mode with HLFS
driver for Libvirt network disk(Online storage Management), which needs
"CLASSPATH" environment varaible, we must modify Libvirt source codes
like following to set "CLASSPATH" environment variable.
First location: Modify qemuBuildCommandLine func in src/qemu/qemu_command.c
[...]
5731 if (deviceFlagMasked)
5732 qemuCapsSet(caps, QEMU_CAPS_DEVICE);
5733 if (!optstr)
5734 goto error;
5735 virCommandAddArg(cmd, optstr);
5736 VIR_FREE(optstr);
5737 /*TODO: submit this to Libvirt community, add this line!!!*/
5738 virCommandAddEnvPass(cmd, "CLASSPATH");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5739
5740 if (!emitBootindex)
5741 bootindex = 0;
5742 else if (disk->info.bootIndex)
5743 bootindex = disk->info.bootIndex;
[...]
Second location: Modify virNetSocketForkDaemon func in /src/rpc/virnetsocket.c
[...]
118 static int virNetSocketForkDaemon(const char *binary)
119 {
120 int ret;
121 virCommandPtr cmd = virCommandNewArgList(binary,
122 "--timeout=30",
123 NULL);
124
125 virCommandAddEnvPassCommon(cmd);
126 virCommandAddEnvPass(cmd, "XDG_CACHE_HOME");
127 virCommandAddEnvPass(cmd, "XDG_CONFIG_HOME");
128 virCommandAddEnvPass(cmd, "XDG_RUNTIME_DIR");
129 /*TODO: submit this to libvirt community, add this line!!!!*/
130 virCommandAddEnvPass(cmd, "CLASSPATH");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131 virCommandClearCaps(cmd);
132 virCommandDaemonize(cmd);
133 ret = virCommandRun(cmd, NULL);
134 virCommandFree(cmd);
135 return ret;
136 }
[...]
I boot VM with HLFS volume like following two ways.
First way: Only execute "virsh create hlfs_hdfs.xml"
----------------------------------------------------------------------------
This way fails and i find this way just calls func virNetSocketForkDaemon
but qemuBuildCommandLine func.
Second way: first start "libvirtd" daemon, then execute "virsh create
hlfs_hdfs.xml"
-----------------------------------------------------------------------------------------------------------------------
This way works well. It calls qemuBuildCommandLine func, which need not call
func virNetSocketForkDaemon.
NOTE: hlfs_hdfs.xml is like this.
$ cat hlfs_hdfs.xml
<domain type='qemu'>
<name>testvm</name>
<memory>1048576</memory>
<os>
<type arch='x86_64'>hvm</type>
</os>
<devices>
<disk type='network'>
<source protocol="hlfs" name="hdfs:///tmp/testenv/testfs"/>
<target dev='hda' bus='ide'/>
</disk>
<graphics type='vnc' port='-1' autoport='yes'/>
</devices>
</domain>
I have some questions about up stuffs.
1, I wonder why first way (Only execute "virsh create hlfs_hdfs.xml")
do not call
qemuBuildCommandLine func, which may lead to fail to start VM with HLFS
volume, right?
2, Maybe i have some understanding mistakes. You may also give other perfect
ways to solve my prolems.
After first way (Only execute "virsh create hlfs_hdfs.xml"), i get
following logs(ALL).
$ ./virsh create hlfs_hdfs.xml
2013-02-14 03:32:04.311+0000: 23205: info : libvirt version: 1.0.1
2013-02-14 03:32:04.311+0000: 23205: debug : virGlobalInit:417 :
register drivers
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:747 :
driver=0x3c87e0 name=Test
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:759 :
registering Test as driver 0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterNetworkDriver:594 : registering Test as network driver 0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterInterfaceDriver:621 : registering Test as interface driver
0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterStorageDriver:648 : registering Test as storage driver 0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterDeviceMonitor:675 : registering Test as device driver 0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterSecretDriver:702 : registering Test as secret driver 0
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterNWFilterDriver:729 : registering Test as network filter
driver 0
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:747 :
driver=0x3c9120 name=OPENVZ
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:759 :
registering OPENVZ as driver 1
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:747 :
driver=0x3c9420 name=VMWARE
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:759 :
registering VMWARE as driver 2
2013-02-14 03:32:04.311+0000: 23205: debug : vboxRegister:131 :
VBoxCGlueInit failed, using dummy driver
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:747 :
driver=0x3c9740 name=VBOX
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:759 :
registering VBOX as driver 3
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterNetworkDriver:594 : registering VBOX as network driver 1
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterStorageDriver:648 : registering VBOX as storage driver 1
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:747 :
driver=0x3c8be0 name=remote
2013-02-14 03:32:04.311+0000: 23205: debug : virRegisterDriver:759 :
registering remote as driver 4
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterNetworkDriver:594 : registering remote as network driver 2
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterInterfaceDriver:621 : registering remote as interface
driver 1
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterStorageDriver:648 : registering remote as storage driver 2
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterDeviceMonitor:675 : registering remote as device driver 1
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterSecretDriver:702 : registering remote as secret driver 1
2013-02-14 03:32:04.311+0000: 23205: debug :
virRegisterNWFilterDriver:729 : registering remote as network filter
driver 1
2013-02-14 03:32:04.312+0000: 23205: debug :
virEventRegisterDefaultImpl:204 : registering default event
implementation
2013-02-14 03:32:04.312+0000: 23205: debug : virEventPollAddHandle:111
: Used 0 handle slots, adding at least 10 more
2013-02-14 03:32:04.312+0000: 23205: debug :
virEventPollInterruptLocked:712 : Skip interrupt, 0 0
2013-02-14 03:32:04.312+0000: 23205: debug : virEventPollAddHandle:136
: EVENT_POLL_ADD_HANDLE: watch=1 fd=4 events=1 cb=0x1502c7
opaque=(nil) ff=(nil)
2013-02-14 03:32:04.312+0000: 23205: debug : virEventRegisterImpl:177
: addHandle=0x14e3f4 updateHandle=0x14e67b removeHandle=0x14e81f
addTimeout=0x14ea15 updateTimeout=0x14ec7d removeTimeout=0x14eec1
2013-02-14 03:32:04.312+0000: 23205: debug : virConnectOpenAuth:1430 :
name=(null), auth=0x3c84e0, flags=0
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:04.312+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0x8d186b0 classname=virConnect
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 1
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:04.312+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:04.312+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1149 : no name,
allowing driver auto-select
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1191 : trying
driver 0 (Test) ...
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1197 : driver 0
Test returned DECLINED
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1191 : trying
driver 1 (OPENVZ) ...
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1197 : driver 1
OPENVZ returned DECLINED
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1191 : trying
driver 2 (VMWARE) ...
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1197 : driver 2
VMWARE returned DECLINED
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1191 : trying
driver 3 (VBOX) ...
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1197 : driver 3
VBOX returned DECLINED
2013-02-14 03:32:04.313+0000: 23205: debug : do_open:1191 : trying
driver 4 (remote) ...
2013-02-14 03:32:04.313+0000: 23205: debug : remoteOpen:958 :
Auto-probe remote URI
2013-02-14 03:32:04.313+0000: 23205: debug : remoteOpen:961 :
Auto-spawn user daemon instance
2013-02-14 03:32:04.313+0000: 23205: debug : doRemoteOpen:586 :
proceeding with name =
2013-02-14 03:32:04.313+0000: 23205: debug : doRemoteOpen:595 :
Connecting with transport 1
2013-02-14 03:32:04.313+0000: 23205: debug : doRemoteOpen:671 :
Proceeding with sockname /home/jiawei/.cache/libvirt/libvirt-sock
2013-02-14 03:32:04.313+0000: 23205: debug :
virNetSocketNewConnectUNIX:562 : Connection refused for
/home/jiawei/.cache/libvirt/libvirt-sock, trying to spawn
/usr/local/sbin/libvirtd
999 enter func virNetSocketForkDaemon----------
2013-02-14 03:32:04.313+0000: 23205: debug : virCommandRunAsync:2200 :
About to run LC_ALL=C
LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun/jre/lib/i386/server/:/home/jiawei/workshop3/hlfs/3part/hadoop/lib32/:/home/jiawei/workshop3/hlfs/3part/log/lib32/:/home/jiawei/workshop3/hlfs/3part/snappy/lib32/:/home/jiawei/workshop3/hlfs/output/lib32/:/usr/lib/
PATH=/usr/bin/:/usr/local/bin/:/bin/:/usr/sbin/:/sbin/:/usr/lib/jvm/java-6-sun/bin/
HOME=/home/jiawei USER=jiawei LOGNAME=jiawei
CLASSPATH=.:/usr/lib/jvm/java-6-sun/jre/lib/:/usr/lib/jvm/java-6-sun/lib/:/usr/lib/hadoop-0.20/conf:/usr/lib/jvm/java-6-sun/lib/tools.jar:/usr/lib/hadoop-0.20:/usr/lib/hadoop-0.20/hadoop-core-0.20.2-cdh3u2.jar:/usr/lib/hadoop-0.20/lib/ant-contrib-1.0b3.jar:/usr/lib/hadoop-0.20/lib/aspectjrt-1.6.5.jar:/usr/lib/hadoop-0.20/lib/aspectjtools-1.6.5.jar:/usr/lib/hadoop-0.20/lib/commons-cli-1.2.jar:/usr/lib/hadoop-0.20/lib/commons-codec-1.4.jar:/usr/lib/hadoop-0.20/lib/commons-daemon-1.0.1.jar:/usr/lib/hadoop-0.20/lib/commons-el-1.0.jar:/usr/lib/hadoop-0.20/lib/commons-httpclient-3.1.jar:/usr/lib/hadoop-0.20/lib/commons-logging-1.0.4.jar:/usr/lib/hadoop-0.20/lib/commons-logging-api-1.0.4.jar:/usr/lib/hadoop-0.20/lib/commons-net-1.4.1.jar:/usr/lib/hadoop-0.20/lib/core-3.1.1.jar:/usr/lib/hadoop-0.20/lib/hadoop-fairscheduler-0.20.2-cdh3u2.jar:/usr/lib/hadoop-0.20/lib/hsqldb-1.8.0.10.jar:/usr/lib/hadoop-0.20/lib/jackson-core-asl-1.5.2.jar:/usr/lib/hadoop-0.20/lib/jackson-mapper-asl-1.5.2.jar:/usr/lib/hadoop-0.20/lib/jasper-compiler-5.5.12.jar:/usr/lib/hadoo-0.20/lib/jasper-runtime-5.5.12.jar:/usr/lib/hadoop-0.20/lib/jets3t-0.6.1.jar:/usr/lib/hadoop-0.20/lib/jetty-6.1.26.cloudera.1.jar:/usr/lib/hadoop-0.20/lib/jetty-servlet-tester-6.1.26.cloudera.1.jar:/usr/lib/hadoop-0.20/lib/jetty-util-6.1.26.cloudera.1.jar:/usr/lib/hadoop-0.20/lib/jsch-0.1.42.jar:/usr/lib/hadoop-0.20/lib/junit-4.5.jar:/usr/lib/hadoop-0.20/lib/kfs-0.2.2.jar:/usr/lib/hadoop-0.20/lib/log4j-1.2.15.jar:/usr/lib/hadoop-0.20/lib/mockito-all-1.8.2.jar:/usr/lib/hadoop-0.20/lib/oro-2.0.8.jar:/usr/lib/hadoop-0.20/lib/servlet-api-2.5-20081211.jar:/usr/lib/hadoop-0.20/lib/servlet-api-2.5-6.1.14.jar:/usr/lib/hadoop-0.20/lib/slf4j-api-1.4.3.jar:/usr/lib/hadoop-0.20/lib/slf4j-log4j12-1.4.3.jar:/usr/lib/hadoop-0.20/lib/xmlenc-0.52.jar:/usr/lib/hadoop-0.20/lib/jsp-2.1/jsp-2.1.jar:/usr/lib/hadoop-0.20/lib/jsp-2.1/jsp-api-2.1.jar
/usr/local/sbin/libvirtd --timeout=30
2013-02-14 03:32:04.317+0000: 23205: debug : virFileClose:72 : Closed fd 7
2013-02-14 03:32:04.317+0000: 23205: debug : virCommandRunAsync:2218 :
Command result 0, with PID 23221
2013-02-14 03:32:04.317+0000: 23221: debug : virFileClose:72 : Closed fd 3
2013-02-14 03:32:04.317+0000: 23221: debug : virFileClose:72 : Closed fd 4
2013-02-14 03:32:04.317+0000: 23221: debug : virFileClose:72 : Closed fd 5
2013-02-14 03:32:04.317+0000: 23221: debug : virFileClose:72 : Closed fd 6
2013-02-14 03:32:04.318+0000: 23205: debug : virCommandRun:2016 :
Result status 0, stdout: '(null)' stderr: '(null)'
999 leave func virNetSocketForkDaemon-----ret is 0-----
2013-02-14 03:32:04.418+0000: 23205: debug :
virNetSocketNewConnectUNIX:562 : Connection refused for
/home/jiawei/.cache/libvirt/libvirt-sock, trying to spawn
/usr/local/sbin/libvirtd
2013-02-14 03:32:04.618+0000: 23205: debug : virNetSocketNew:155 :
localAddr=0xbff192d8 remoteAddr=0xbff19254 fd=6 errfd=-1 pid=0
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0xb6d005e0 classname=virNetSocket
2013-02-14 03:32:04.618+0000: 23205: debug : virNetSocketNew:212 :
RPC_SOCKET_NEW: sock=0xb6d005e0 fd=6 errfd=-1 pid=0
localAddr=127.0.0.1;0, remoteAddr=127.0.0.1;0
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0xb6d01cd8 classname=virNetClient
2013-02-14 03:32:04.618+0000: 23205: debug : virNetClientNew:342 :
RPC_CLIENT_NEW: client=0xb6d01cd8 sock=0xb6d005e0
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d01cd8
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d005e0
2013-02-14 03:32:04.618+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:04.618+0000: 23205: debug : virEventPollAddHandle:136
: EVENT_POLL_ADD_HANDLE: watch=2 fd=6 events=1 cb=0x27f8f5
opaque=0xb6d005e0 ff=0x27f960
2013-02-14 03:32:04.618+0000: 23205: debug : virKeepAliveNew:212 :
client=0xb6d01cd8, interval=-1, count=0
2013-02-14 03:32:04.618+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:04.618+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:04.618+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0xb6d00480 classname=virKeepAlive
2013-02-14 03:32:04.618+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:04.618+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:04.618+0000: 23205: debug : virKeepAliveNew:236 :
RPC_KEEPALIVE_NEW: ka=0xb6d00480 client=0xb6d01cd8
2013-02-14 03:32:04.618+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d01cd8
2013-02-14 03:32:04.618+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:04.619+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0xb6d00568 classname=virNetClientProgram
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:04.619+0000: 23205: debug : virObjectNew:110 :
OBJECT_NEW: obj=0xb6d00590 classname=virNetClientProgram
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:04.619+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d00568
2013-02-14 03:32:04.619+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d00590
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:04.619+0000: 23205: debug : doRemoteOpen:772 : Trying
authentication
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=1 d=0
2013-02-14 03:32:04.619+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d00520 tracked=0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:04.619+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=2 timeout=-1
2013-02-14 03:32:04.619+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 28
2013-02-14 03:32:04.619+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=28 prog=536903814 vers=1 proc=66 type=0 status=0
serial=0
2013-02-14 03:32:04.619+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d01d88: msg=0xb6d00520, expectReply=1, nonBlock=0
2013-02-14 03:32:04.619+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=0 proc=66 type=0
length=28 dispatch=(nil)
2013-02-14 03:32:04.619+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d01d88 call=0xb6d01d88
2013-02-14 03:32:04.619+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:04.619+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:04.619+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 2
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:04.619+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:04.624+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:04.624+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:04.624+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 36 total (32
more)
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=36 prog=536903814 vers=1 proc=66 type=1 status=0 serial=0
2013-02-14 03:32:07.411+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d01d88
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.411+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.411+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.411+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d01d88 rv=0
2013-02-14 03:32:07.411+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.411+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d00520 nfds=0 cb=(nil)
2013-02-14 03:32:07.411+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.411+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d00520 tracked=0
2013-02-14 03:32:07.411+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.411+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.411+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 32
2013-02-14 03:32:07.411+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=32 prog=536903814 vers=1 proc=60 type=0 status=0
serial=1
2013-02-14 03:32:07.411+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d01db8: msg=0xb6d00520, expectReply=1, nonBlock=0
2013-02-14 03:32:07.411+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=1 proc=60 type=0
length=32 dispatch=(nil)
2013-02-14 03:32:07.411+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d01db8 call=0xb6d01db8
2013-02-14 03:32:07.411+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:07.411+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.412+0000: 23205: debug :
virEventPollInterruptLocked:712 : Skip interrupt, 0 -1218303120
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.412+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.412+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.412+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 32 total (28
more)
2013-02-14 03:32:07.412+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=32 prog=536903814 vers=1 proc=60 type=1 status=0 serial=1
2013-02-14 03:32:07.412+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.412+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d01db8
2013-02-14 03:32:07.412+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.412+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.413+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.413+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d01db8 rv=0
2013-02-14 03:32:07.413+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d00520 nfds=0 cb=(nil)
2013-02-14 03:32:07.413+0000: 23205: debug : doRemoteOpen:798 : Trying
to open URI
2013-02-14 03:32:07.413+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d00520 tracked=0
2013-02-14 03:32:07.413+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 40
2013-02-14 03:32:07.413+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=40 prog=536903814 vers=1 proc=1 type=0 status=0
serial=2
2013-02-14 03:32:07.413+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d01d88: msg=0xb6d00520, expectReply=1, nonBlock=0
2013-02-14 03:32:07.413+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=2 proc=1 type=0
length=40 dispatch=(nil)
2013-02-14 03:32:07.413+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d01d88 call=0xb6d01d88
2013-02-14 03:32:07.413+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:07.413+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.413+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.413+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.413+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.413+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.413+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.414+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 28 total (24
more)
2013-02-14 03:32:07.414+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=28 prog=536903814 vers=1 proc=1 type=1 status=0 serial=2
2013-02-14 03:32:07.414+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.414+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d01d88
2013-02-14 03:32:07.414+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.417+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.417+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.417+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d01d88 rv=0
2013-02-14 03:32:07.417+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d00520 nfds=0 cb=(nil)
2013-02-14 03:32:07.417+0000: 23205: debug : doRemoteOpen:809 : Trying
to query remote URI
2013-02-14 03:32:07.417+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d01df0 tracked=0
2013-02-14 03:32:07.417+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 28
2013-02-14 03:32:07.417+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=28 prog=536903814 vers=1 proc=110 type=0
status=0 serial=3
2013-02-14 03:32:07.417+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d00520: msg=0xb6d01df0, expectReply=1, nonBlock=0
2013-02-14 03:32:07.417+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=3 proc=110 type=0
length=28 dispatch=(nil)
2013-02-14 03:32:07.417+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d00520 call=0xb6d00520
2013-02-14 03:32:07.417+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:07.417+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.417+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.417+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.417+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.417+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.418+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.418+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 48 total (44
more)
2013-02-14 03:32:07.418+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=48 prog=536903814 vers=1 proc=110 type=1 status=0 serial=3
2013-02-14 03:32:07.418+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.418+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d00520
2013-02-14 03:32:07.418+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.418+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.418+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.418+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d00520 rv=0
2013-02-14 03:32:07.418+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.418+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d01df0 nfds=0 cb=(nil)
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.418+0000: 23205: debug : doRemoteOpen:817 :
Auto-probed URI is qemu:///session
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.418+0000: 23205: debug : do_open:1197 : driver 4
remote returned SUCCESS
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.418+0000: 23205: debug : do_open:1221 : network
driver 0 Test returned DECLINED
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.418+0000: 23205: debug : do_open:1221 : network
driver 1 VBOX returned DECLINED
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.418+0000: 23205: debug : do_open:1221 : network
driver 2 remote returned SUCCESS
2013-02-14 03:32:07.418+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.421+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=1 d=0
2013-02-14 03:32:07.421+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.421+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1237 : interface
driver 0 Test returned DECLINED
2013-02-14 03:32:07.421+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=2 timeout=-1
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1237 : interface
driver 1 remote returned SUCCESS
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1254 : storage
driver 0 Test returned DECLINED
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1254 : storage
driver 1 VBOX returned DECLINED
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1254 : storage
driver 2 remote returned SUCCESS
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1271 : node
driver 0 Test returned DECLINED
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1271 : node
driver 1 remote returned SUCCESS
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1288 : secret
driver 0 Test returned DECLINED
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1288 : secret
driver 1 remote returned SUCCESS
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1305 : nwfilter
driver 0 Test returned DECLINED
2013-02-14 03:32:07.421+0000: 23205: debug : do_open:1305 : nwfilter
driver 1 remote returned SUCCESS
2013-02-14 03:32:07.421+0000: 23205: debug :
virConnectRegisterCloseCallback:19823 : conn=0x8d186b0
2013-02-14 03:32:07.421+0000: 23205: debug : virConnectIsAlive:19771 :
conn=0x8d186b0
2013-02-14 03:32:07.421+0000: 23205: debug : virFileClose:72 : Closed fd 9
2013-02-14 03:32:07.421+0000: 23205: debug : virDomainCreateXML:1962 :
conn=0x8d186b0, xmlDesc=<domain type='qemu'>
<name>testvm</name>
<memory>1048576</memory>
<os>
<type arch='x86_64'>hvm</type>
</os>
<devices>
<disk type='network'>
<source protocol="hlfs" name="hdfs:///tmp/testenv/testfs"/>
<target dev='hda' bus='ide'/>
</disk>
<graphics type='vnc' port='-1' autoport='yes'/>
</devices>
</domain>
, flags=0
2013-02-14 03:32:07.421+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d03de0 tracked=0
2013-02-14 03:32:07.422+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 344
2013-02-14 03:32:07.422+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=344 prog=536903814 vers=1 proc=10 type=0
status=0 serial=4
2013-02-14 03:32:07.422+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d03e28: msg=0xb6d03de0, expectReply=1, nonBlock=0
2013-02-14 03:32:07.422+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=4 proc=10 type=0
length=344 dispatch=(nil)
2013-02-14 03:32:07.422+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d03e28 call=0xb6d03e28
2013-02-14 03:32:07.422+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:07.422+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.422+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 2
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.422+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.422+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.692+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 2168 total (2164
more)
2013-02-14 03:32:07.692+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=2168 prog=536903814 vers=1 proc=10 type=1 status=1 serial=4
2013-02-14 03:32:07.692+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.692+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d03e28
2013-02-14 03:32:07.692+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.692+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.692+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.692+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d03e28 rv=0
2013-02-14 03:32:07.692+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.692+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d03de0 nfds=0 cb=(nil)
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
Error:2013-02-14 03:32:07.692+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
Create domain failure from hlfs_hdfs.xml
Error:2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
internal error process exited while connecting to monitor: ** Message:
enter func bdrv_hlbs_init
** Message: leave func bdrv_hlbs_init
enter func bdrv_new
leave func bdrv_new
999 enter func bdrv_open
999$$ filename is hlfs:hdfs:///tmp/testenv/testfs
999 enter func find_image_format
enter func bdrv_new
leave func bdrv_new
** Message: enter func hlbs_open
** Message: 999 filename is hlfs:hdfs:///tmp/testenv/testfs
** Message: 999 filename is hdfs:///tmp/testenv/testfs
** Message: enter func parse_vdiname
** Message: 999 filename is hdfs:///tmp/testenv/testfs
** Message: leave func parse_vdiname
enter func init_storage_handler
loc [fs:testfs],
uri:hdfs:///tmp/testenv/testfs,head:hdfs,dir:/tmp/testenv,fsname:testfs,hostname:default,port:0,user:kanghua
Environment variable CLASSPATH not set!
fs is null, hdfsConnect error!
ret is not 0, so error happened
leave func init_storage_handler
[uri:hdfs:///tmp/testenv/testfs] can not accessable
init raw hlfs ctrl failed
enter func hlfs_open
error params :flag 1
**
ERROR:block/hlfs.c:
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=1 d=0
2013-02-14 03:32:07.692+0000: 23205: debug : virConnectClose:1474 :
conn=0x8d186b0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.692+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0x8d186b0
2013-02-14 03:32:07.692+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.692+0000: 23205: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0x8d186b0
2013-02-14 03:32:07.692+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=2 timeout=-1
2013-02-14 03:32:07.692+0000: 23205: debug : virNetMessageNew:45 :
msg=0xb6d046e8 tracked=0
2013-02-14 03:32:07.693+0000: 23205: debug :
virNetMessageEncodePayload:358 : Encode length as 28
2013-02-14 03:32:07.693+0000: 23205: debug :
virNetClientSendInternal:1955 : RPC_CLIENT_MSG_TX_QUEUE:
client=0xb6d01cd8 len=28 prog=536903814 vers=1 proc=2 type=0 status=0
serial=5
2013-02-14 03:32:07.693+0000: 23205: debug : virNetClientCallNew:1908
: New call 0xb6d04660: msg=0xb6d046e8, expectReply=1, nonBlock=0
2013-02-14 03:32:07.693+0000: 23205: debug : virNetClientIO:1718 :
Outgoing message prog=536903814 version=1 serial=5 proc=2 type=0
length=28 dispatch=(nil)
2013-02-14 03:32:07.693+0000: 23205: debug : virNetClientIO:1777 : We
have the buck head=0xb6d04660 call=0xb6d04660
2013-02-14 03:32:07.693+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=0
2013-02-14 03:32:07.693+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.693+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 0
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 2
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.693+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventRunDefaultImpl:244 : running default event implementation
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 0
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used,
releasing 0
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=0 w=1, f=4 e=1 d=0
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollMakePollFDs:393 : Prepare n=1 w=2, f=6 e=0 d=0
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollCalculateTimeout:332 : Calculate expiry of 0 timers
2013-02-14 03:32:07.696+0000: 23220: debug :
virEventPollCalculateTimeout:361 : Timeout at 0 due in -1 ms
2013-02-14 03:32:07.696+0000: 23220: debug : virEventPollRunOnce:629 :
EVENT_POLL_RUN: nhandles=1 timeout=-1
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetMessageDecodeLength:152 : Got length, now need 28 total (24
more)
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientCallDispatch:1127 : RPC_CLIENT_MSG_RX: client=0xb6d01cd8
len=28 prog=536903814 vers=1 proc=2 type=1 status=0 serial=5
2013-02-14 03:32:07.696+0000: 23205: debug :
virKeepAliveCheckMessage:384 : ka=0xb6d00480, client=0xb6d01cd8,
msg=0xb6d01d14
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck
0xb6d04660
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.696+0000: 23205: debug :
virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=2
events=1
2013-02-14 03:32:07.696+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.696+0000: 23205: debug : virNetClientIO:1807 : All
done with our call head=(nil) call=0xb6d04660 rv=0
2013-02-14 03:32:07.696+0000: 23205: debug : virNetMessageFree:73 :
msg=0xb6d046e8 nfds=0 cb=(nil)
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientCloseInternal:698 : client=0xb6d01cd8 wantclose=0
2013-02-14 03:32:07.696+0000: 23205: debug : virNetClientMarkClose:646
: client=0xb6d01cd8, reason=3
2013-02-14 03:32:07.696+0000: 23205: debug :
virEventPollRemoveHandle:180 : EVENT_POLL_REMOVE_HANDLE: watch=2
2013-02-14 03:32:07.696+0000: 23205: debug :
virEventPollRemoveHandle:193 : mark delete 1 6
2013-02-14 03:32:07.696+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1424 : Giving up the buck (nil)
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientIOEventLoopPassTheBuck:1438 : No thread to pass the buck
to
2013-02-14 03:32:07.696+0000: 23205: debug :
virNetClientCloseLocked:659 : client=0xb6d01cd8, sock=0xb6d005e0,
reason=3
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d005e0
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectRef:168 :
OBJECT_REF: obj=0xb6d01cd8
2013-02-14 03:32:07.696+0000: 23205: debug : virKeepAliveStop:320 :
RPC_KEEPALIVE_STOP: ka=0xb6d00480 client=0xb6d01cd8
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d00480
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0xb6d00480
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d01cd8
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d01cd8
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d01cd8
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d00568
2013-02-14 03:32:07.696+0000: 23205: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d00590
2013-02-14 03:32:07.697+0000: 23205: debug :
virEventPollAddTimeout:225 : Used 0 timeout slots, adding at least 10
more
2013-02-14 03:32:07.697+0000: 23205: debug :
virEventPollInterruptLocked:716 : Interrupting
2013-02-14 03:32:07.697+0000: 23205: debug :
virEventPollAddTimeout:248 : EVENT_POLL_ADD_TIMEOUT: timer=1
frequency=0 cb=0x8055ee3 opaque=(nil) ff=(nil)
2013-02-14 03:32:07.697+0000: 23220: debug : virEventPollRunOnce:640 :
Poll got 1 event(s)
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollDispatchTimeouts:425 : Dispatch 1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollDispatchTimeouts:448 : EVENT_POLL_DISPATCH_TIMEOUT:
timer=1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollDispatchHandles:470 : Dispatch 1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollDispatchHandles:484 : i=0 w=1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1
events=1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollCleanupTimeouts:516 : Cleanup 1
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollCleanupHandles:564 : Cleanup 2
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollCleanupHandles:577 : EVENT_POLL_PURGE_HANDLE: watch=2
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d01cd8
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0xb6d01cd8
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d00568
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0xb6d00568
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d00590
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0xb6d00590
2013-02-14 03:32:07.697+0000: 23220: debug : virFileClose:72 : Closed fd 8
2013-02-14 03:32:07.697+0000: 23220: debug : virFileClose:72 : Closed fd 7
2013-02-14 03:32:07.697+0000: 23220: debug : virNetMessageClear:56 :
msg=0xb6d01d14 nfds=0
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:135 :
OBJECT_UNREF: obj=0xb6d005e0
2013-02-14 03:32:07.697+0000: 23220: debug : virObjectUnref:137 :
OBJECT_DISPOSE: obj=0xb6d005e0
2013-02-14 03:32:07.697+0000: 23220: debug : virNetSocketDispose:1005
: sock=0xb6d005e0 fd=6
2013-02-14 03:32:07.697+0000: 23220: debug :
virEventPollRemoveHandle:180 : EVENT_POLL_REMOVE_HANDLE: watch=2
2013-02-14 03:32:07.697+0000: 23220: debug : virFileClose:72 : Closed fd 6
2013-02-14 03:32:07.697+0000: 23205: debug :
virEventPollRemoveTimeout:300 : EVENT_POLL_REMOVE_TIMEOUT: timer=1
2013-02-14 03:32:07.697+0000: 23205: debug :
virEventPollInterruptLocked:712 : Skip interrupt, 0 -1218303120
--
Thanks
Harry Wei
1
1
[libvirt] [PATCH] vbox: Don't overwrite errors returned by virDomainDeviceDefParse
by Jiri Denemark 14 Feb '13
by Jiri Denemark 14 Feb '13
14 Feb '13
---
src/vbox/vbox_tmpl.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 00b4d3d..cd88579 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -5388,10 +5388,8 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
dev = virDomainDeviceDefParse(data->caps, def, xml,
VIR_DOMAIN_XML_INACTIVE);
- if (dev == NULL) {
- virReportOOMError();
+ if (dev == NULL)
goto cleanup;
- }
vboxIIDFromUUID(&iid, dom->uuid);
rc = VBOX_OBJECT_GET_MACHINE(iid.value, &machine);
@@ -5625,10 +5623,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml) {
dev = virDomainDeviceDefParse(data->caps, def, xml,
VIR_DOMAIN_XML_INACTIVE);
- if (dev == NULL) {
- virReportOOMError();
+ if (dev == NULL)
goto cleanup;
- }
vboxIIDFromUUID(&iid, dom->uuid);
rc = VBOX_OBJECT_GET_MACHINE(iid.value, &machine);
--
1.8.1.2
2
2
14 Feb '13
Originally, QEMU did not implement a native I/O bus for s390.
The initial implementation had a machine type 's390-virtio'
featuring a fully paravirtualized I/O system with an artificial
bus type 'virtio-s390'.
This bus had a number of short-comings, like the need for a
non-standard device discovery mechanism, a limited number
of devices, limited hotplugging capabilites and the lack
of persistent device addresses.
To resolve these issues a new machine type 's390-ccw-virtio'
has been recently added to QEMU which implementa the native
s390 CCW I/O bus.
Guests with arch='s390x' and machine='s390-ccw-virtio' can
now be defined with up to 262144 virtio devices.
This series adds the support for the s390-ccw-virtio
machine type and the CCW bus to libvirt. As usual we start
with the documentation/schema, the generic configuration
stuff, continue with the QEMU driver including device
hotplug and finally add qemu2xml testcases.
V2 Changes
- use an attribute triple cssid, ssid, schid instead of devno
to better represent the libvirt CCW address structure
- rebase to current upstream, mainly address qemuCapsXXX rename
J.B. Joret (1):
S390: Add hotplug support for s390 virtio devices
Viktor Mihajlovski (4):
S390: Documentation for CCW address type
S390: domain_conf support for CCW
S390: QEMU driver support for CCW addresses
S390: Testcases for virtio-ccw machines
docs/formatdomain.html.in | 14 +
docs/schemas/domaincommon.rng | 52 ++++
src/conf/domain_conf.c | 107 +++++++-
src/conf/domain_conf.h | 16 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 47 +++-
src/qemu/qemu_capabilities.h | 8 +-
src/qemu/qemu_command.c | 269 +++++++++++++++++++-
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 3 +
src/qemu/qemu_driver.c | 26 +-
src/qemu/qemu_hotplug.c | 147 +++++++----
src/qemu/qemu_hotplug.h | 14 +-
src/qemu/qemu_process.c | 12 +-
.../qemuxml2argv-console-virtio-ccw.args | 10 +
.../qemuxml2argv-console-virtio-ccw.xml | 27 ++
.../qemuxml2argv-console-virtio-s390.args | 4 +-
.../qemuxml2argv-console-virtio-s390.xml | 2 +-
.../qemuxml2argv-disk-virtio-ccw-many.args | 12 +
.../qemuxml2argv-disk-virtio-ccw-many.xml | 40 +++
.../qemuxml2argv-disk-virtio-ccw.args | 8 +
.../qemuxml2argv-disk-virtio-ccw.xml | 30 +++
.../qemuxml2argv-net-virtio-ccw.args | 8 +
.../qemuxml2argv-net-virtio-ccw.xml | 30 +++
tests/qemuxml2argvtest.c | 11 +-
tests/testutilsqemu.c | 3 +-
27 files changed, 812 insertions(+), 96 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml
--
1.7.9.5
3
13
[libvirt] [PATCHv2] Reject domain names containing '/' or starting with '.'
by Christophe Fergeau 14 Feb '13
by Christophe Fergeau 14 Feb '13
14 Feb '13
In addition to rejecting domains containing '/', this series also filter
out domains starting with a '.'.
Christophe
4
8
I'm working with a java vm vendor that is developing a multi-tenancy jvm and is trying to leverage the libvirt framework for the domain configuration. Right now the java language binding leverages the libvirt c library for parsing the domain.xml file. What are the thoughts on adding a 'jvm' domain type?
I believe there would need to be a jvm specific section in a separate namespace similar to the qemucmdline section.
3
3
Hi,
I'm able to get the CPU utilization metrics from libvirt for the guests (VM's) remotely . Is it possible to get the Host Cpu stat's through libvirt ?
I didn't find any information regarding the host cpu cycles and memory utilization to collect them remotely. Libvirt is installed on all the hosts.
Regards,
Navin
2
1
Since the BQDL has been broken, this patch tries to cleanup some
information about it in various comments.
---
To be applied after Dan's patch [1] which removes unnecessary
qemuDriverLocks.
[1] https://www.redhat.com/archives/libvir-list/2013-February/msg00641.html
src/qemu/THREADS.txt | 9 ++-------
src/qemu/qemu_conf.c | 8 +++++---
src/qemu/qemu_conf.h | 5 +----
src/qemu/qemu_domain.c | 11 +++++------
src/qemu/qemu_domain.h | 3 +--
src/qemu/qemu_driver.c | 5 +----
src/qemu/qemu_migration.c | 4 ++--
src/qemu/qemu_process.c | 40 ++++++++++++++--------------------------
8 files changed, 31 insertions(+), 54 deletions(-)
diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt
index 785be99..50a0cf9 100644
--- a/src/qemu/THREADS.txt
+++ b/src/qemu/THREADS.txt
@@ -128,7 +128,7 @@ To acquire the normal job condition
To acquire the asynchronous job condition
- qemuDomainObjBeginAsyncJob() (if driver is unlocked)
+ qemuDomainObjBeginAsyncJob()
- Increments ref count on virDomainObjPtr
- Waits until no async job is running
- Waits for job.cond condition 'job.active != 0' using virDomainObjPtr
@@ -155,8 +155,6 @@ To acquire the QEMU monitor lock
- Releases the qemuMonitorObjPtr lock
- Acquires the virDomainObjPtr lock
- NB: caller must take care to drop the driver lock if necessary
-
These functions must not be used by an asynchronous job.
@@ -166,12 +164,10 @@ To acquire the QEMU monitor lock as part of an asynchronous job
- Validates that the right async job is still running
- Acquires the qemuMonitorObjPtr lock
- Releases the virDomainObjPtr lock
- - Releases the driver lock
- Validates that the VM is still active
qemuDomainObjExitMonitor()
- Releases the qemuMonitorObjPtr lock
- - Acquires the driver lock
- Acquires the virDomainObjPtr lock
These functions are for use inside an asynchronous job; the caller
@@ -180,8 +176,7 @@ To acquire the QEMU monitor lock as part of an asynchronous job
used from a sync job (such as when first starting a domain).
-To keep a domain alive while waiting on a remote command, starting
-with the driver lock held
+To keep a domain alive while waiting on a remote command
qemuDomainObjEnterRemote()
- Increments ref count on virDomainObjPtr
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 5ac2004..4ff912d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1,7 +1,7 @@
/*
* qemu_conf.c: QEMU configuration management
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -79,11 +79,13 @@ struct _qemuDriverCloseDef {
qemuDriverCloseCallback cb;
};
-void qemuDriverLock(virQEMUDriverPtr driver)
+static void
+qemuDriverLock(virQEMUDriverPtr driver)
{
virMutexLock(&driver->lock);
}
-void qemuDriverUnlock(virQEMUDriverPtr driver)
+static void
+qemuDriverUnlock(virQEMUDriverPtr driver)
{
virMutexUnlock(&driver->lock);
}
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 09eacce..14f1427 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -1,7 +1,7 @@
/*
* qemu_conf.h: QEMU configuration management
*
- * Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -236,9 +236,6 @@ struct _qemuDomainCmdlineDef {
# define QEMUD_MIGRATION_NUM_PORTS 64
-void qemuDriverLock(virQEMUDriverPtr driver);
-void qemuDriverUnlock(virQEMUDriverPtr driver);
-
virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged);
int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ec4c8f8..482f64a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1,7 +1,7 @@
/*
* qemu_domain.h: QEMU domain private state
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -116,7 +116,6 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
}
-/* driver must be locked before calling */
void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event)
{
@@ -760,7 +759,7 @@ qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv, enum qemuDomainJob job)
#define QEMU_JOB_WAIT_TIME (1000ull * 30)
/*
- * obj must be locked before calling;
+ * obj must be locked before calling
*/
static int ATTRIBUTE_NONNULL(1)
qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
@@ -857,7 +856,7 @@ error:
}
/*
- * obj must be locked before calling, driver must NOT be locked
+ * obj must be locked before calling
*
* This must be called by anything that will change the VM state
* in any way, or anything that will use the QEMU monitor.
@@ -883,7 +882,7 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
/*
- * obj must be locked before calling, driver does not matter
+ * obj must be locked before calling
*
* To be called after completing the work associated with the
* earlier qemuDomainBeginJob() call
@@ -1734,7 +1733,7 @@ qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
}
/*
- * The caller must hold a lock on both driver and vm, and there must
+ * The caller must hold a lock the vm and there must
* be no remaining references to vm.
*/
void
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index cfc952d..905b099 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1,7 +1,7 @@
/*
* qemu_domain.h: QEMU domain private state
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -175,7 +175,6 @@ int qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
void qemuDomainEventFlush(int timer, void *opaque);
-/* driver must be locked before calling */
void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4d756f3..2ad21dc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2746,8 +2746,7 @@ cleanup:
return ret;
}
-/* This internal function expects the driver lock to already be held on
- * entry and the vm must be active + locked. Vm will be unlocked and
+/* The vm must be active + locked. Vm will be unlocked and
* potentially free'd after this returns (eg transient VMs are freed
* shutdown). So 'vm' must not be referenced by the caller after
* this returns (whether returning success or failure).
@@ -10349,8 +10348,6 @@ cleanup:
}
-
-/* this function expects the driver lock to be held by the caller */
static int
qemuDomainSnapshotFSFreeze(virDomainObjPtr vm) {
qemuDomainObjPrivatePtr priv = vm->privateData;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 60cd47a..36e55d2 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2,7 +2,7 @@
/*
* qemu_migration.c: QEMU migration handling
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -3620,7 +3620,7 @@ cleanup:
}
-/* Helper function called while driver lock is held and vm is active. */
+/* Helper function called while vm is active. */
int
qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
int fd, off_t offset, const char *path,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 306f686..e5eadc0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1,7 +1,7 @@
/*
* qemu_process.h: QEMU process management
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -599,8 +599,7 @@ endjob:
cleanup:
if (vm) {
if (ret == -1) {
- ignore_value(qemuProcessKill(vm,
- VIR_QEMU_PROCESS_KILL_FORCE));
+ ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
}
if (virObjectUnref(vm))
virObjectUnlock(vm);
@@ -625,13 +624,11 @@ qemuProcessShutdownOrReboot(virQEMUDriverPtr driver,
qemuProcessFakeReboot,
vm) < 0) {
VIR_ERROR(_("Failed to create reboot thread, killing domain"));
- ignore_value(qemuProcessKill(vm,
- VIR_QEMU_PROCESS_KILL_NOWAIT));
+ ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_NOWAIT));
virObjectUnref(vm);
}
} else {
- ignore_value(qemuProcessKill(vm,
- VIR_QEMU_PROCESS_KILL_NOWAIT));
+ ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_NOWAIT));
}
}
@@ -2792,9 +2789,8 @@ qemuProcessPrepareMonitorChr(virQEMUDriverConfigPtr cfg,
/*
- * Precondition: Both driver and vm must be locked,
- * and a job must be active. This method will call
- * {Enter,Exit}Monitor
+ * Precondition: vm must be locked, and a job must be active.
+ * This method will call {Enter,Exit}Monitor
*/
int
qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
@@ -3374,23 +3370,15 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
memcpy(data, src, sizeof(*data));
data->payload = obj;
- /* This iterator is called with driver being locked.
+ /*
* We create a separate thread to run qemuProcessReconnect in it.
* However, qemuProcessReconnect needs to:
- * 1. lock driver
- * 2. just before monitor reconnect do lightweight MonitorEnter
+ * 1. just before monitor reconnect do lightweight MonitorEnter
* (increase VM refcount, unlock VM & driver)
- * 3. reconnect to monitor
- * 4. do lightweight MonitorExit (lock driver & VM)
- * 5. continue reconnect process
- * 6. EndJob
- * 7. unlock driver
- *
- * It is necessary to NOT hold driver lock for the entire run
- * of reconnect, otherwise we will get blocked if there is
- * unresponsive qemu.
- * However, iterating over hash table MUST be done on locked
- * driver.
+ * 2. reconnect to monitor
+ * 3. do lightweight MonitorExit (lock VM)
+ * 4. continue reconnect process
+ * 5. EndJob
*
* NB, we can't do normal MonitorEnter & MonitorExit because
* these two lock the monitor lock, which does not exists in
@@ -4184,8 +4172,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
/*
- * We may unlock the driver and vm in qemuProcessKill(), and another thread
- * can lock driver and vm, and then call qemuProcessStop(). So we should
+ * We may unlock the vm in qemuProcessKill(), and another thread
+ * can lock the vm, and then call qemuProcessStop(). So we should
* set vm->def->id to -1 here to avoid qemuProcessStop() to be called twice.
*/
vm->def->id = -1;
--
1.8.1.2
3
4
13 Feb '13
From: "Daniel P. Berrange" <berrange(a)redhat.com>
With the majority of fields in the virQEMUDriverPtr struct
now immutable or self-locking, there is no need for practically
any methods to be using the QEMU driver lock. Only a handful
of helper APIs in qemu_conf.c now need it
---
src/qemu/THREADS.txt | 194 +++--------------------
src/qemu/qemu_conf.c | 50 ++++--
src/qemu/qemu_domain.c | 213 +++++--------------------
src/qemu/qemu_domain.h | 40 +----
src/qemu/qemu_driver.c | 386 +++++++++++-----------------------------------
src/qemu/qemu_hotplug.c | 118 +++++++-------
src/qemu/qemu_migration.c | 66 ++++----
src/qemu/qemu_process.c | 223 +++++++++-----------------
src/qemu/qemu_process.h | 3 +-
9 files changed, 360 insertions(+), 933 deletions(-)
diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt
index c3bad21..785be99 100644
--- a/src/qemu/THREADS.txt
+++ b/src/qemu/THREADS.txt
@@ -14,35 +14,24 @@ Basic locking primitives
There are a number of locks on various objects
- * struct qemud_driver: RWLock
+ * virQEMUDriverPtr
- This is the top level lock on the entire driver. Every API call in
- the QEMU driver is blocked while this is held, though some internal
- callbacks may still run asynchronously. This lock must never be held
- for anything which sleeps/waits (i.e. monitor commands)
+ The qemu_conf.h file has inline comments describing the locking
+ needs for each field. Any field marked immutable, self-locking
+ can be accessed without the driver lock. For other fields there
+ are typically helper APIs in qemu_conf.c that provide serialized
+ access to the data. No code outside qemu_conf.c should ever
+ acquire this lock
- When obtaining the driver lock, under *NO* circumstances must
- any lock be held on a virDomainObjPtr. This *WILL* result in
- deadlock.
-
-
-
- * virDomainObjPtr: Mutex
+ * virDomainObjPtr
Will be locked after calling any of the virDomainFindBy{ID,Name,UUID}
methods.
Lock must be held when changing/reading any variable in the virDomainObjPtr
- Once the lock is held, you must *NOT* try to lock the driver. You must
- release all virDomainObjPtr locks before locking the driver, or deadlock
- *WILL* occur.
-
If the lock needs to be dropped & then re-acquired for a short period of
time, the reference count must be incremented first using virDomainObjRef().
- If the reference count is incremented in this way, it is not necessary
- to have the driver locked when re-acquiring the dropped locked, since the
- reference count prevents it being freed by another thread.
This lock must not be held for anything which sleeps/waits (i.e. monitor
commands).
@@ -103,26 +92,10 @@ There are a number of locks on various objects
The virDomainObjPtr lock *MUST* then be released when invoking the
monitor command.
- The driver lock *MUST* be released when invoking the monitor commands.
-
- This ensures that the virDomainObjPtr & driver are both unlocked while
- sleeping/waiting for the monitor response.
-
-
Helper methods
--------------
-To lock the driver
-
- qemuDriverLock()
- - Acquires the driver lock
-
- qemuDriverUnlock()
- - Releases the driver lock
-
-
-
To lock the virDomainObjPtr
virObjectLock()
@@ -135,19 +108,8 @@ To lock the virDomainObjPtr
To acquire the normal job condition
- qemuDomainObjBeginJob() (if driver is unlocked)
- - Increments ref count on virDomainObjPtr
- - Waits until the job is compatible with current async job or no
- async job is running
- - Waits for job.cond condition 'job.active != 0' using virDomainObjPtr
- mutex
- - Rechecks if the job is still compatible and repeats waiting if it
- isn't
- - Sets job.active to the job type
-
- qemuDomainObjBeginJobWithDriver() (if driver needs to be locked)
+ qemuDomainObjBeginJob()
- Increments ref count on virDomainObjPtr
- - Unlocks driver
- Waits until the job is compatible with current async job or no
async job is running
- Waits for job.cond condition 'job.active != 0' using virDomainObjPtr
@@ -155,12 +117,6 @@ To acquire the normal job condition
- Rechecks if the job is still compatible and repeats waiting if it
isn't
- Sets job.active to the job type
- - Unlocks virDomainObjPtr
- - Locks driver
- - Locks virDomainObjPtr
-
- NB: this variant is required in order to comply with lock ordering
- rules for virDomainObjPtr vs. driver
qemuDomainObjEndJob()
@@ -181,22 +137,6 @@ To acquire the asynchronous job condition
and repeats waiting in that case
- Sets job.asyncJob to the asynchronous job type
- qemuDomainObjBeginAsyncJobWithDriver() (if driver needs to be locked)
- - Increments ref count on virDomainObjPtr
- - Unlocks driver
- - Waits until no async job is running
- - Waits for job.cond condition 'job.active != 0' using virDomainObjPtr
- mutex
- - Rechecks if any async job was started while waiting on job.cond
- and repeats waiting in that case
- - Sets job.asyncJob to the asynchronous job type
- - Unlocks virDomainObjPtr
- - Locks driver
- - Locks virDomainObjPtr
-
- NB: this variant is required in order to comply with lock ordering
- rules for virDomainObjPtr vs driver
-
qemuDomainObjEndAsyncJob()
- Sets job.asyncJob to 0
@@ -220,25 +160,7 @@ To acquire the QEMU monitor lock
These functions must not be used by an asynchronous job.
-To acquire the QEMU monitor lock with the driver lock held
-
- qemuDomainObjEnterMonitorWithDriver()
- - Acquires the qemuMonitorObjPtr lock
- - Releases the virDomainObjPtr lock
- - Releases the driver lock
-
- qemuDomainObjExitMonitorWithDriver()
- - Releases the qemuMonitorObjPtr lock
- - Acquires the driver lock
- - Acquires the virDomainObjPtr lock
-
- NB: caller must take care to drop the driver lock if necessary
-
- These functions must not be used inside an asynchronous job.
-
-
-To acquire the QEMU monitor lock with the driver lock held and as part
-of an asynchronous job
+To acquire the QEMU monitor lock as part of an asynchronous job
qemuDomainObjEnterMonitorAsync()
- Validates that the right async job is still running
@@ -247,13 +169,11 @@ of an asynchronous job
- Releases the driver lock
- Validates that the VM is still active
- qemuDomainObjExitMonitorWithDriver()
+ qemuDomainObjExitMonitor()
- Releases the qemuMonitorObjPtr lock
- Acquires the driver lock
- Acquires the virDomainObjPtr lock
- NB: caller must take care to drop the driver lock if necessary
-
These functions are for use inside an asynchronous job; the caller
must check for a return of -1 (VM not running, so nothing to exit).
Helper functions may also call this with QEMU_ASYNC_JOB_NONE when
@@ -263,13 +183,11 @@ of an asynchronous job
To keep a domain alive while waiting on a remote command, starting
with the driver lock held
- qemuDomainObjEnterRemoterWithDriver()
+ qemuDomainObjEnterRemote()
- Increments ref count on virDomainObjPtr
- Releases the virDomainObjPtr lock
- - Releases the driver lock
- qemuDomainObjExitRemoteWithDriver()
- - Acquires the driver lock
+ qemuDomainObjExitRemote()
- Acquires the virDomainObjPtr lock
- Decrements ref count on virDomainObjPtr
@@ -278,51 +196,22 @@ Design patterns
---------------
- * Accessing or updating something with just the driver
-
- qemuDriverLock(driver);
-
- ...do work...
-
- qemuDriverUnlock(driver);
-
-
-
* Accessing something directly to do with a virDomainObjPtr
virDomainObjPtr obj;
- qemuDriverLock(driver);
- obj = virDomainFindByUUID(driver->domains, dom->uuid);
- qemuDriverUnlock(driver);
-
- ...do work...
-
- virDomainObjUnlock(obj);
-
-
-
- * Accessing something directly to do with a virDomainObjPtr and driver
-
- virDomainObjPtr obj;
-
- qemuDriverLock(driver);
obj = virDomainFindByUUID(driver->domains, dom->uuid);
...do work...
virDomainObjUnlock(obj);
- qemuDriverUnlock(driver);
-
* Updating something directly to do with a virDomainObjPtr
virDomainObjPtr obj;
- qemuDriverLock(driver);
obj = virDomainFindByUUID(driver->domains, dom->uuid);
- qemuDriverUnlock(driver);
qemuDomainObjBeginJob(obj, QEMU_JOB_TYPE);
@@ -341,9 +230,7 @@ Design patterns
virDomainObjPtr obj;
qemuDomainObjPrivatePtr priv;
- qemuDriverLock(driver);
obj = virDomainFindByUUID(driver->domains, dom->uuid);
- qemuDriverUnlock(driver);
qemuDomainObjBeginJob(obj, QEMU_JOB_TYPE);
@@ -362,42 +249,14 @@ Design patterns
-
- * Invoking a monitor command on a virDomainObjPtr with driver locked too
-
+ * Running asynchronous job
virDomainObjPtr obj;
qemuDomainObjPrivatePtr priv;
- qemuDriverLock(driver);
obj = virDomainFindByUUID(driver->domains, dom->uuid);
- qemuDomainObjBeginJobWithDriver(obj, QEMU_JOB_TYPE);
-
- ...do prep work...
-
- if (virDomainObjIsActive(vm)) {
- qemuDomainObjEnterMonitorWithDriver(driver, obj);
- qemuMonitorXXXX(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, obj);
- }
-
- ...do final work...
-
- qemuDomainObjEndJob(obj);
- virDomainObjUnlock(obj);
- qemuDriverUnlock(driver);
-
-
- * Running asynchronous job with driver lock held
-
- virDomainObjPtr obj;
- qemuDomainObjPrivatePtr priv;
-
- qemuDriverLock(driver);
- obj = virDomainFindByUUID(driver->domains, dom->uuid);
-
- qemuDomainObjBeginAsyncJobWithDriver(obj, QEMU_ASYNC_JOB_TYPE);
+ qemuDomainObjBeginAsyncJob(obj, QEMU_ASYNC_JOB_TYPE);
qemuDomainObjSetAsyncJobMask(obj, allowedJobs);
...do prep work...
@@ -408,7 +267,7 @@ Design patterns
goto error;
}
...start qemu job...
- qemuDomainObjExitMonitorWithDriver(driver, obj);
+ qemuDomainObjExitMonitor(driver, obj);
while (!finished) {
if (qemuDomainObjEnterMonitorAsync(driver, obj,
@@ -417,7 +276,7 @@ Design patterns
goto error;
}
...monitor job progress...
- qemuDomainObjExitMonitorWithDriver(driver, obj);
+ qemuDomainObjExitMonitor(driver, obj);
virObjectUnlock(obj);
sleep(aWhile);
@@ -428,7 +287,6 @@ Design patterns
qemuDomainObjEndAsyncJob(obj);
virDomainObjUnlock(obj);
- qemuDriverUnlock(driver);
* Coordinating with a remote server for migration
@@ -436,17 +294,16 @@ Design patterns
virDomainObjPtr obj;
qemuDomainObjPrivatePtr priv;
- qemuDriverLock(driver);
obj = virDomainFindByUUID(driver->domains, dom->uuid);
- qemuDomainObjBeginAsyncJobWithDriver(obj, QEMU_ASYNC_JOB_TYPE);
+ qemuDomainObjBeginAsyncJob(obj, QEMU_ASYNC_JOB_TYPE);
...do prep work...
if (virDomainObjIsActive(vm)) {
- qemuDomainObjEnterRemoteWithDriver(driver, obj);
+ qemuDomainObjEnterRemote(obj);
...communicate with remote...
- qemuDomainObjExitRemoteWithDriver(driver, obj);
+ qemuDomainObjExitRemote(obj);
/* domain may have been stopped while we were talking to remote */
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -458,14 +315,3 @@ Design patterns
qemuDomainObjEndAsyncJob(obj);
virDomainObjUnlock(obj);
- qemuDriverUnlock(driver);
-
-
-Summary
--------
-
- * Respect lock ordering rules: never lock driver if anything else is
- already locked
-
- * Don't hold locks in code which sleeps: unlock driver & virDomainObjPtr
- when using monitor
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 2bd1931..5ac2004 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -523,7 +523,11 @@ no_memory:
virQEMUDriverConfigPtr virQEMUDriverGetConfig(virQEMUDriverPtr driver)
{
- return virObjectRef(driver->config);
+ virQEMUDriverConfigPtr conf;
+ qemuDriverLock(driver);
+ conf = virObjectRef(driver->config);
+ qemuDriverUnlock(driver);
+ return conf;
}
@@ -613,16 +617,22 @@ err_exit:
virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver,
bool refresh)
{
+ virCapsPtr ret = NULL;
if (refresh) {
virCapsPtr caps = NULL;
if ((caps = virQEMUDriverCreateCapabilities(driver)) == NULL)
return NULL;
+ qemuDriverLock(driver);
virObjectUnref(driver->caps);
driver->caps = caps;
+ } else {
+ qemuDriverLock(driver);
}
- return virObjectRef(driver->caps);
+ ret = virObjectRef(driver->caps);
+ qemuDriverUnlock(driver);
+ return ret;
}
@@ -657,7 +667,9 @@ qemuDriverCloseCallbackSet(virQEMUDriverPtr driver,
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
qemuDriverCloseDefPtr closeDef;
+ int ret = -1;
+ qemuDriverLock(driver);
virUUIDFormat(vm->def->uuid, uuidstr);
VIR_DEBUG("vm=%s, uuid=%s, conn=%p, cb=%p",
vm->def->name, uuidstr, conn, cb);
@@ -669,30 +681,34 @@ qemuDriverCloseCallbackSet(virQEMUDriverPtr driver,
_("Close callback for domain %s already registered"
" with another connection %p"),
vm->def->name, closeDef->conn);
- return -1;
+ goto cleanup;
}
if (closeDef->cb && closeDef->cb != cb) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Another close callback is already defined for"
" domain %s"), vm->def->name);
- return -1;
+ goto cleanup;
}
closeDef->cb = cb;
} else {
if (VIR_ALLOC(closeDef) < 0) {
virReportOOMError();
- return -1;
+ goto cleanup;
}
closeDef->conn = conn;
closeDef->cb = cb;
if (virHashAddEntry(driver->closeCallbacks, uuidstr, closeDef) < 0) {
VIR_FREE(closeDef);
- return -1;
+ goto cleanup;
}
}
- return 0;
+
+ ret = 0;
+cleanup:
+ qemuDriverUnlock(driver);
+ return ret;
}
int
@@ -702,23 +718,28 @@ qemuDriverCloseCallbackUnset(virQEMUDriverPtr driver,
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
qemuDriverCloseDefPtr closeDef;
+ int ret = -1;
+ qemuDriverLock(driver);
virUUIDFormat(vm->def->uuid, uuidstr);
VIR_DEBUG("vm=%s, uuid=%s, cb=%p",
vm->def->name, uuidstr, cb);
closeDef = virHashLookup(driver->closeCallbacks, uuidstr);
if (!closeDef)
- return -1;
+ goto cleanup;
if (closeDef->cb && closeDef->cb != cb) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Trying to remove mismatching close callback for"
" domain %s"), vm->def->name);
- return -1;
+ goto cleanup;
}
- return virHashRemoveEntry(driver->closeCallbacks, uuidstr);
+ ret = virHashRemoveEntry(driver->closeCallbacks, uuidstr);
+cleanup:
+ qemuDriverUnlock(driver);
+ return ret;
}
qemuDriverCloseCallback
@@ -730,6 +751,7 @@ qemuDriverCloseCallbackGet(virQEMUDriverPtr driver,
qemuDriverCloseDefPtr closeDef;
qemuDriverCloseCallback cb = NULL;
+ qemuDriverLock(driver);
virUUIDFormat(vm->def->uuid, uuidstr);
VIR_DEBUG("vm=%s, uuid=%s, conn=%p",
vm->def->name, uuidstr, conn);
@@ -739,6 +761,7 @@ qemuDriverCloseCallbackGet(virQEMUDriverPtr driver,
cb = closeDef->cb;
VIR_DEBUG("cb=%p", cb);
+ qemuDriverUnlock(driver);
return cb;
}
@@ -794,8 +817,9 @@ qemuDriverCloseCallbackRunAll(virQEMUDriverPtr driver,
driver, conn
};
VIR_DEBUG("conn=%p", conn);
-
+ qemuDriverLock(driver);
virHashForEach(driver->closeCallbacks, qemuDriverCloseCallbackRun, &data);
+ qemuDriverUnlock(driver);
}
/* Construct the hash key for sharedDisks as "major:minor" */
@@ -832,6 +856,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
char *key = NULL;
int ret = -1;
+ qemuDriverLock(driver);
if (!(key = qemuGetSharedDiskKey(disk_path)))
goto cleanup;
@@ -845,6 +870,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
ret = 0;
cleanup:
+ qemuDriverUnlock(driver);
VIR_FREE(key);
return ret;
}
@@ -860,6 +886,7 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver,
char *key = NULL;
int ret = -1;
+ qemuDriverLock(driver);
if (!(key = qemuGetSharedDiskKey(disk_path)))
goto cleanup;
@@ -876,6 +903,7 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver,
ret = 0;
cleanup:
+ qemuDriverUnlock(driver);
VIR_FREE(key);
return ret;
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 4917721..ec4c8f8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -760,12 +760,10 @@ qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv, enum qemuDomainJob job)
#define QEMU_JOB_WAIT_TIME (1000ull * 30)
/*
- * obj must be locked before calling; driver_locked says if qemu_driver is
- * locked or not.
+ * obj must be locked before calling;
*/
static int ATTRIBUTE_NONNULL(1)
qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
- bool driver_locked,
virDomainObjPtr obj,
enum qemuDomainJob job,
enum qemuDomainAsyncJob asyncJob)
@@ -786,8 +784,6 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
then = now + QEMU_JOB_WAIT_TIME;
virObjectRef(obj);
- if (driver_locked)
- qemuDriverUnlock(driver);
retry:
if (cfg->maxQueuedJobs &&
@@ -827,12 +823,6 @@ retry:
priv->job.start = now;
}
- if (driver_locked) {
- virObjectUnlock(obj);
- qemuDriverLock(driver);
- virObjectLock(obj);
- }
-
if (qemuDomainTrackJob(job))
qemuDomainObjSaveJob(driver, obj);
@@ -861,11 +851,6 @@ error:
virReportSystemError(errno,
"%s", _("cannot acquire job mutex"));
priv->jobs_queued--;
- if (driver_locked) {
- virObjectUnlock(obj);
- qemuDriverLock(driver);
- virObjectLock(obj);
- }
virObjectUnref(obj);
virObjectUnref(cfg);
return -1;
@@ -884,7 +869,7 @@ int qemuDomainObjBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainJob job)
{
- return qemuDomainObjBeginJobInternal(driver, false, obj, job,
+ return qemuDomainObjBeginJobInternal(driver, obj, job,
QEMU_ASYNC_JOB_NONE);
}
@@ -892,40 +877,10 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
- return qemuDomainObjBeginJobInternal(driver, false, obj, QEMU_JOB_ASYNC,
+ return qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_ASYNC,
asyncJob);
}
-/*
- * obj and driver must be locked before calling.
- *
- * This must be called by anything that will change the VM state
- * in any way, or anything that will use the QEMU monitor.
- *
- * Upon successful return, the object will have its ref count increased,
- * successful calls must be followed by EndJob eventually
- */
-int qemuDomainObjBeginJobWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj,
- enum qemuDomainJob job)
-{
- if (job <= QEMU_JOB_NONE || job >= QEMU_JOB_ASYNC) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Attempt to start invalid job"));
- return -1;
- }
-
- return qemuDomainObjBeginJobInternal(driver, true, obj, job,
- QEMU_ASYNC_JOB_NONE);
-}
-
-int qemuDomainObjBeginAsyncJobWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj,
- enum qemuDomainAsyncJob asyncJob)
-{
- return qemuDomainObjBeginJobInternal(driver, true, obj, QEMU_JOB_ASYNC,
- asyncJob);
-}
/*
* obj must be locked before calling, driver does not matter
@@ -983,9 +938,17 @@ qemuDomainObjAbortAsyncJob(virDomainObjPtr obj)
priv->job.asyncAbort = true;
}
+/*
+ * obj must be locked before calling
+ *
+ * To be called immediately before any QEMU monitor API call
+ * Must have already either called qemuDomainObjBeginJob() and checked
+ * that the VM is still active; may not be used for nested async jobs.
+ *
+ * To be followed with qemuDomainObjExitMonitor() once complete
+ */
static int
qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
- bool driver_locked,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
@@ -1000,7 +963,7 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
if (priv->job.asyncOwner != virThreadSelfID())
VIR_WARN("This thread doesn't seem to be the async job owner: %d",
priv->job.asyncOwner);
- if (qemuDomainObjBeginJobInternal(driver, driver_locked, obj,
+ if (qemuDomainObjBeginJobInternal(driver, obj,
QEMU_JOB_ASYNC_NESTED,
QEMU_ASYNC_JOB_NONE) < 0)
return -1;
@@ -1020,15 +983,12 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
virObjectRef(priv->mon);
ignore_value(virTimeMillisNow(&priv->monStart));
virObjectUnlock(obj);
- if (driver_locked)
- qemuDriverUnlock(driver);
return 0;
}
static void ATTRIBUTE_NONNULL(1)
qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver,
- bool driver_locked,
virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
@@ -1039,8 +999,6 @@ qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver,
if (hasRefs)
virObjectUnlock(priv->mon);
- if (driver_locked)
- qemuDriverLock(driver);
virObjectLock(obj);
priv->monStart = 0;
@@ -1056,59 +1014,34 @@ qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver,
}
}
-/*
- * obj must be locked before calling, driver must be unlocked
- *
- * To be called immediately before any QEMU monitor API call
- * Must have already either called qemuDomainObjBeginJob() and checked
- * that the VM is still active; may not be used for nested async jobs.
- *
- * To be followed with qemuDomainObjExitMonitor() once complete
- */
void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
- ignore_value(qemuDomainObjEnterMonitorInternal(driver, false, obj,
+ ignore_value(qemuDomainObjEnterMonitorInternal(driver, obj,
QEMU_ASYNC_JOB_NONE));
}
-/* obj must NOT be locked before calling, driver must be unlocked
+/* obj must NOT be locked before calling
*
* Should be paired with an earlier qemuDomainObjEnterMonitor() call
*/
void qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
- qemuDomainObjExitMonitorInternal(driver, false, obj);
+ qemuDomainObjExitMonitorInternal(driver, obj);
}
/*
- * obj must be locked before calling, driver must be locked
- *
- * To be called immediately before any QEMU monitor API call
- * Must have already either called qemuDomainObjBeginJobWithDriver() and
- * checked that the VM is still active; may not be used for nested async jobs.
- *
- * To be followed with qemuDomainObjExitMonitorWithDriver() once complete
- */
-void qemuDomainObjEnterMonitorWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- ignore_value(qemuDomainObjEnterMonitorInternal(driver, true, obj,
- QEMU_ASYNC_JOB_NONE));
-}
-
-/*
- * obj and driver must be locked before calling
+ * obj must be locked before calling
*
* To be called immediately before any QEMU monitor API call.
- * Must have already either called qemuDomainObjBeginJobWithDriver()
+ * Must have already either called qemuDomainObjBeginJob()
* and checked that the VM is still active, with asyncJob of
* QEMU_ASYNC_JOB_NONE; or already called qemuDomainObjBeginAsyncJob,
* with the same asyncJob.
*
* Returns 0 if job was started, in which case this must be followed with
- * qemuDomainObjExitMonitorWithDriver(); or -1 if the job could not be
+ * qemuDomainObjExitMonitor(); or -1 if the job could not be
* started (probably because the vm exited in the meantime).
*/
int
@@ -1116,26 +1049,22 @@ qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
- return qemuDomainObjEnterMonitorInternal(driver, true, obj, asyncJob);
-}
-
-/* obj must NOT be locked before calling, driver must be unlocked,
- * and will be locked after returning
- *
- * Should be paired with an earlier qemuDomainObjEnterMonitorWithDriver() call
- */
-void qemuDomainObjExitMonitorWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- qemuDomainObjExitMonitorInternal(driver, true, obj);
+ return qemuDomainObjEnterMonitorInternal(driver, obj, asyncJob);
}
-static int
-qemuDomainObjEnterAgentInternal(virQEMUDriverPtr driver,
- bool driver_locked,
- virDomainObjPtr obj)
+/*
+ * obj must be locked before calling
+ *
+ * To be called immediately before any QEMU agent API call.
+ * Must have already called qemuDomainObjBeginJob() and checked
+ * that the VM is still active.
+ *
+ * To be followed with qemuDomainObjExitAgent() once complete
+ */
+void
+qemuDomainObjEnterAgent(virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
@@ -1143,16 +1072,15 @@ qemuDomainObjEnterAgentInternal(virQEMUDriverPtr driver,
virObjectRef(priv->agent);
ignore_value(virTimeMillisNow(&priv->agentStart));
virObjectUnlock(obj);
- if (driver_locked)
- qemuDriverUnlock(driver);
-
- return 0;
}
-static void ATTRIBUTE_NONNULL(1)
-qemuDomainObjExitAgentInternal(virQEMUDriverPtr driver,
- bool driver_locked,
- virDomainObjPtr obj)
+
+/* obj must NOT be locked before calling
+ *
+ * Should be paired with an earlier qemuDomainObjEnterAgent() call
+ */
+void
+qemuDomainObjExitAgent(virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
bool hasRefs;
@@ -1162,8 +1090,6 @@ qemuDomainObjExitAgentInternal(virQEMUDriverPtr driver,
if (hasRefs)
virObjectUnlock(priv->agent);
- if (driver_locked)
- qemuDriverLock(driver);
virObjectLock(obj);
priv->agentStart = 0;
@@ -1171,69 +1097,14 @@ qemuDomainObjExitAgentInternal(virQEMUDriverPtr driver,
priv->agent = NULL;
}
-/*
- * obj must be locked before calling, driver must be unlocked
- *
- * To be called immediately before any QEMU agent API call.
- * Must have already called qemuDomainObjBeginJob() and checked
- * that the VM is still active.
- *
- * To be followed with qemuDomainObjExitAgent() once complete
- */
-void qemuDomainObjEnterAgent(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- ignore_value(qemuDomainObjEnterAgentInternal(driver, false, obj));
-}
-
-/* obj must NOT be locked before calling, driver must be unlocked
- *
- * Should be paired with an earlier qemuDomainObjEnterAgent() call
- */
-void qemuDomainObjExitAgent(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- qemuDomainObjExitAgentInternal(driver, false, obj);
-}
-
-/*
- * obj must be locked before calling, driver must be locked
- *
- * To be called immediately before any QEMU agent API call.
- * Must have already called qemuDomainObjBeginJobWithDriver() and
- * checked that the VM is still active; may not be used for nested async jobs.
- *
- * To be followed with qemuDomainObjExitAgentWithDriver() once complete
- */
-void qemuDomainObjEnterAgentWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- ignore_value(qemuDomainObjEnterAgentInternal(driver, true, obj));
-}
-
-/* obj must NOT be locked before calling, driver must be unlocked,
- * and will be locked after returning
- *
- * Should be paired with an earlier qemuDomainObjEnterAgentWithDriver() call
- */
-void qemuDomainObjExitAgentWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
-{
- qemuDomainObjExitAgentInternal(driver, true, obj);
-}
-
-void qemuDomainObjEnterRemoteWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
+void qemuDomainObjEnterRemote(virDomainObjPtr obj)
{
virObjectRef(obj);
virObjectUnlock(obj);
- qemuDriverUnlock(driver);
}
-void qemuDomainObjExitRemoteWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
+void qemuDomainObjExitRemote(virDomainObjPtr obj)
{
- qemuDriverLock(driver);
virObjectLock(obj);
virObjectUnref(obj);
}
@@ -1783,10 +1654,10 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
goto cleanup;
} else {
priv = vm->privateData;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
/* we continue on even in the face of error */
qemuMonitorDeleteSnapshot(priv->mon, snap->def->name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 51cd2dc..cfc952d 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -190,14 +190,6 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginJobWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj,
- enum qemuDomainJob job)
- ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginAsyncJobWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj,
- enum qemuDomainAsyncJob asyncJob)
- ATTRIBUTE_RETURN_CHECK;
bool qemuDomainObjEndJob(virQEMUDriverPtr driver,
virDomainObjPtr obj)
@@ -224,38 +216,22 @@ void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
void qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterMonitorWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-void qemuDomainObjExitMonitorWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterAgent(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitAgent(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterAgentWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitAgentWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+void qemuDomainObjEnterAgent(virDomainObjPtr obj)
+ ATTRIBUTE_NONNULL(1);
+void qemuDomainObjExitAgent(virDomainObjPtr obj)
+ ATTRIBUTE_NONNULL(1);
-void qemuDomainObjEnterRemoteWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitRemoteWithDriver(virQEMUDriverPtr driver,
- virDomainObjPtr obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+void qemuDomainObjEnterRemote(virDomainObjPtr obj)
+ ATTRIBUTE_NONNULL(1);
+void qemuDomainObjExitRemote(virDomainObjPtr obj)
+ ATTRIBUTE_NONNULL(1);
int qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainDefPtr vm,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a4fc0c9..4d756f3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -153,16 +153,9 @@ virQEMUDriverPtr qemu_driver = NULL;
static void
-qemuVMDriverLock(void) {
- qemuDriverLock(qemu_driver);
-};
-
-
+qemuVMDriverLock(void) {}
static void
-qemuVMDriverUnlock(void) {
- qemuDriverUnlock(qemu_driver);
-};
-
+qemuVMDriverUnlock(void) {}
static int
qemuVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED,
@@ -184,61 +177,32 @@ struct qemuAutostartData {
virConnectPtr conn;
};
+
/**
- * qemuDomObjFromDomainDriver:
+ * qemuDomObjFromDomain:
* @domain: Domain pointer that has to be looked up
- * @drv: Pointer to virQEMUDriverPtr to return the driver object
*
- * This function looks up @domain in the domain list and returns the
- * appropriate virDomainObjPtr. On successful lookup, both driver and domain
- * object are returned locked.
+ * This function looks up @domain and returns the appropriate
+ * virDomainObjPtr.
*
- * Returns the domain object if it's found and the driver. Both are locked.
- * In case of failure NULL is returned and the driver isn't locked.
+ * Returns the domain object which is locked on success, NULL
+ * otherwise.
*/
static virDomainObjPtr
-qemuDomObjFromDomainDriver(virDomainPtr domain, virQEMUDriverPtr *drv)
+qemuDomObjFromDomain(virDomainPtr domain)
{
- virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm;
+ virQEMUDriverPtr driver = domain->conn->privateData;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (!vm) {
virUUIDFormat(domain->uuid, uuidstr);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching uuid '%s'"), uuidstr);
- qemuDriverUnlock(driver);
- *drv = NULL;
return NULL;
}
- *drv = driver;
- return vm;
-}
-
-/**
- * qemuDomObjFromDomain:
- * @domain: Domain pointer that has to be looked up
- *
- * This function looks up @domain and returns the appropriate
- * virDomainObjPtr. The driver is unlocked after the call.
- *
- * Returns the domain object which is locked on success, NULL
- * otherwise. The driver remains unlocked after the call.
- */
-static virDomainObjPtr
-qemuDomObjFromDomain(virDomainPtr domain)
-{
- virDomainObjPtr vm;
- virQEMUDriverPtr driver;
-
- if (!(vm = qemuDomObjFromDomainDriver(domain, &driver)))
- return NULL;
-
- qemuDriverUnlock(driver);
-
return vm;
}
@@ -293,8 +257,8 @@ qemuAutostartDomain(virDomainObjPtr vm,
virResetLastError();
if (vm->autostart &&
!virDomainObjIsActive(vm)) {
- if (qemuDomainObjBeginJobWithDriver(data->driver, vm,
- QEMU_JOB_MODIFY) < 0) {
+ if (qemuDomainObjBeginJob(data->driver, vm,
+ QEMU_JOB_MODIFY) < 0) {
err = virGetLastError();
VIR_ERROR(_("Failed to start job on VM '%s': %s"),
vm->def->name,
@@ -335,9 +299,7 @@ qemuAutostartDomains(virQEMUDriverPtr driver)
/* Ignoring NULL conn which is mostly harmless here */
struct qemuAutostartData data = { driver, conn };
- qemuDriverLock(driver);
virDomainObjListForEach(driver->domains, qemuAutostartDomain, &data);
- qemuDriverUnlock(driver);
if (conn)
virConnectClose(conn);
@@ -603,7 +565,6 @@ qemuStartup(bool privileged,
VIR_FREE(qemu_driver);
return -1;
}
- qemuDriverLock(qemu_driver);
qemu_driver->inhibitCallback = callback;
qemu_driver->inhibitOpaque = opaque;
@@ -841,8 +802,6 @@ qemuStartup(bool privileged,
if (!qemu_driver->workerPool)
goto error;
- qemuDriverUnlock(qemu_driver);
-
qemuAutostartDomains(qemu_driver);
if (conn)
@@ -854,8 +813,6 @@ qemuStartup(bool privileged,
out_of_memory:
virReportOOMError();
error:
- if (qemu_driver)
- qemuDriverUnlock(qemu_driver);
if (conn)
virConnectClose(conn);
VIR_FREE(driverConf);
@@ -893,7 +850,6 @@ qemuReload(void) {
if (!qemu_driver)
return 0;
- qemuDriverLock(qemu_driver);
if (!(caps = virQEMUDriverGetCapabilities(qemu_driver, false)))
goto cleanup;
@@ -904,9 +860,7 @@ qemuReload(void) {
cfg->autostartDir,
0, QEMU_EXPECTED_VIRT_TYPES,
qemuNotifyLoadDomain, qemu_driver);
-
cleanup:
- qemuDriverUnlock(qemu_driver);
virObjectUnref(cfg);
virObjectUnref(caps);
return 0;
@@ -987,7 +941,6 @@ qemuShutdown(void) {
if (!qemu_driver)
return -1;
- qemuDriverLock(qemu_driver);
virNWFilterUnRegisterCallbackDriver(&qemuCallbackDriver);
virObjectUnref(qemu_driver->activePciHostdevs);
virObjectUnref(qemu_driver->inactivePciHostdevs);
@@ -1016,7 +969,6 @@ qemuShutdown(void) {
virLockManagerPluginUnref(qemu_driver->lockManager);
- qemuDriverUnlock(qemu_driver);
virMutexDestroy(&qemu_driver->lock);
virThreadPoolFree(qemu_driver->workerPool);
VIR_FREE(qemu_driver);
@@ -1100,9 +1052,7 @@ static int qemuClose(virConnectPtr conn) {
virQEMUDriverPtr driver = conn->privateData;
/* Get rid of callbacks registered for this conn */
- qemuDriverLock(driver);
qemuDriverCloseCallbackRunAll(driver, conn);
- qemuDriverUnlock(driver);
conn->privateData = NULL;
@@ -1218,9 +1168,7 @@ static char *qemuGetCapabilities(virConnectPtr conn) {
virCapsPtr caps = NULL;
char *xml = NULL;
- qemuDriverLock(driver);
-
- if (!(caps = virQEMUDriverGetCapabilities(qemu_driver, true)))
+ if (!(caps = virQEMUDriverGetCapabilities(driver, true)))
goto cleanup;
if ((xml = virCapabilitiesFormatXML(caps)) == NULL)
@@ -1228,7 +1176,6 @@ static char *qemuGetCapabilities(virConnectPtr conn) {
virObjectUnref(caps);
cleanup:
- qemuDriverUnlock(driver);
return xml;
}
@@ -1316,9 +1263,7 @@ static virDomainPtr qemuDomainLookupByID(virConnectPtr conn,
virDomainObjPtr vm;
virDomainPtr dom = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByID(driver->domains, id);
- qemuDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
@@ -1341,9 +1286,7 @@ static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn,
virDomainObjPtr vm;
virDomainPtr dom = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, uuid);
- qemuDriverUnlock(driver);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -1368,9 +1311,7 @@ static virDomainPtr qemuDomainLookupByName(virConnectPtr conn,
virDomainObjPtr vm;
virDomainPtr dom = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByName(driver->domains, name);
- qemuDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
@@ -1442,7 +1383,6 @@ static int qemuGetVersion(virConnectPtr conn, unsigned long *version) {
unsigned int qemuVersion;
virCapsPtr caps = NULL;
- qemuDriverLock(driver);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -1456,7 +1396,6 @@ static int qemuGetVersion(virConnectPtr conn, unsigned long *version) {
cleanup:
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -1464,9 +1403,7 @@ static int qemuListDomains(virConnectPtr conn, int *ids, int nids) {
virQEMUDriverPtr driver = conn->privateData;
int n;
- qemuDriverLock(driver);
n = virDomainObjListGetActiveIDs(driver->domains, ids, nids);
- qemuDriverUnlock(driver);
return n;
}
@@ -1475,9 +1412,7 @@ static int qemuNumDomains(virConnectPtr conn) {
virQEMUDriverPtr driver = conn->privateData;
int n;
- qemuDriverLock(driver);
n = virDomainObjListNumOfDomains(driver->domains, 1);
- qemuDriverUnlock(driver);
return n;
}
@@ -1525,8 +1460,6 @@ static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
if (flags & VIR_DOMAIN_START_AUTODESTROY)
start_flags |= VIR_QEMU_PROCESS_START_AUTODESROY;
- qemuDriverLock(driver);
-
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -1556,7 +1489,7 @@ static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
def = NULL;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; /* XXXX free the 'vm' we created ? */
if (qemuProcessStart(conn, driver, vm, NULL, -1, NULL, NULL,
@@ -1602,7 +1535,6 @@ cleanup:
}
virObjectUnref(caps);
virObjectUnref(qemuCaps);
- qemuDriverUnlock(driver);
return dom;
}
@@ -1619,7 +1551,6 @@ static int qemuDomainSuspend(virDomainPtr dom) {
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -1638,7 +1569,7 @@ static int qemuDomainSuspend(virDomainPtr dom) {
cfg = virQEMUDriverGetConfig(driver);
priv = vm->privateData;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_SUSPEND) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_SUSPEND) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -1690,7 +1621,6 @@ cleanup:
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -1706,7 +1636,6 @@ static int qemuDomainResume(virDomainPtr dom) {
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -1719,7 +1648,7 @@ static int qemuDomainResume(virDomainPtr dom) {
cfg = virQEMUDriverGetConfig(driver);
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -1761,7 +1690,6 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -1819,9 +1747,9 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) {
}
if (useAgent) {
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
ret = qemuAgentShutdown(priv->agent, QEMU_AGENT_SHUTDOWN_POWERDOWN);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
} else {
qemuDomainSetFakeReboot(driver, vm, false);
@@ -1916,9 +1844,9 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
}
if (useAgent) {
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
ret = qemuAgentShutdown(priv->agent, QEMU_AGENT_SHUTDOWN_REBOOT);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
} else {
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);
@@ -2004,7 +1932,6 @@ qemuDomainDestroyFlags(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -2030,18 +1957,18 @@ qemuDomainDestroyFlags(virDomainPtr dom,
* it now means the job will be released
*/
if (flags & VIR_DOMAIN_DESTROY_GRACEFUL) {
- if (qemuProcessKill(driver, vm, 0) < 0) {
+ if (qemuProcessKill(vm, 0) < 0) {
priv->beingDestroyed = false;
goto cleanup;
}
} else {
- if (qemuProcessKill(driver, vm, VIR_QEMU_PROCESS_KILL_FORCE) < 0) {
+ if (qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE) < 0) {
priv->beingDestroyed = false;
goto cleanup;
}
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_DESTROY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_DESTROY) < 0)
goto cleanup;
priv->beingDestroyed = false;
@@ -2075,7 +2002,6 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
return ret;
}
@@ -2235,7 +2161,6 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
virCheckFlags(0, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -2253,7 +2178,7 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
priv = vm->privateData;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -2262,9 +2187,9 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
goto endjob;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorInjectNMI(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) {
@@ -2275,7 +2200,6 @@ endjob:
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -2847,7 +2771,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
if (!qemuMigrationIsAllowed(driver, vm, vm->def, false))
goto cleanup;
- if (qemuDomainObjBeginAsyncJobWithDriver(driver, vm,
+ if (qemuDomainObjBeginAsyncJob(driver, vm,
QEMU_ASYNC_JOB_SAVE) < 0)
memset(&priv->job.info, 0, sizeof(priv->job.info));
@@ -2975,8 +2899,6 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
VIR_DOMAIN_SAVE_RUNNING |
VIR_DOMAIN_SAVE_PAUSED, -1);
- qemuDriverLock(driver);
-
cfg = virQEMUDriverGetConfig(driver);
if (cfg->saveImageFormat == NULL)
compressed = QEMU_SAVE_FORMAT_RAW;
@@ -3018,7 +2940,6 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(cfg);
return ret;
}
@@ -3048,7 +2969,7 @@ qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm)
static int
qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
{
- virQEMUDriverPtr driver;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
char *name = NULL;
int ret = -1;
@@ -3058,7 +2979,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
VIR_DOMAIN_SAVE_RUNNING |
VIR_DOMAIN_SAVE_PAUSED, -1);
- if (!(vm = qemuDomObjFromDomainDriver(dom, &driver)))
+ if (!(vm = qemuDomObjFromDomain(dom)))
return -1;
if (!virDomainObjIsActive(vm)) {
@@ -3087,7 +3008,6 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
VIR_FREE(name);
return ret;
@@ -3135,14 +3055,14 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
static int
qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
{
- virQEMUDriverPtr driver;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
char *name = NULL;
virCheckFlags(0, -1);
- if (!(vm = qemuDomObjFromDomainDriver(dom, &driver)))
+ if (!(vm = qemuDomObjFromDomain(dom)))
return -1;
if (!(name = qemuDomainManagedSavePath(driver, vm)))
@@ -3161,7 +3081,6 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
cleanup:
VIR_FREE(name);
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -3187,7 +3106,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
return -1;
ret = qemuMonitorDumpToFd(priv->mon, fd);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
return ret;
}
@@ -3305,7 +3224,6 @@ static int qemuDomainCoreDump(virDomainPtr dom,
VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET |
VIR_DUMP_MEMORY_ONLY, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -3316,7 +3234,7 @@ static int qemuDomainCoreDump(virDomainPtr dom,
goto cleanup;
}
- if (qemuDomainObjBeginAsyncJobWithDriver(driver, vm,
+ if (qemuDomainObjBeginAsyncJob(driver, vm,
QEMU_ASYNC_JOB_DUMP) < 0)
goto cleanup;
@@ -3367,9 +3285,9 @@ endjob:
virDomainObjIsActive(vm)) {
if ((ret == 0) && (flags & VIR_DUMP_RESET)) {
priv = vm->privateData;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemReset(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
if (resume && qemuProcessStartCPUs(driver, vm, dom->conn,
@@ -3396,7 +3314,6 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
return ret;
}
@@ -3497,7 +3414,6 @@ static void processWatchdogEvent(void *data, void *opaque)
virQEMUDriverPtr driver = opaque;
virQEMUDriverConfigPtr cfg;
- qemuDriverLock(driver);
virObjectLock(wdEvent->vm);
cfg = virQEMUDriverGetConfig(driver);
@@ -3515,7 +3431,7 @@ static void processWatchdogEvent(void *data, void *opaque)
goto unlock;
}
- if (qemuDomainObjBeginAsyncJobWithDriver(driver, wdEvent->vm,
+ if (qemuDomainObjBeginAsyncJob(driver, wdEvent->vm,
QEMU_ASYNC_JOB_DUMP) < 0) {
VIR_FREE(dumpfile);
goto unlock;
@@ -3559,7 +3475,6 @@ endjob:
unlock:
virObjectUnlock(wdEvent->vm);
virObjectUnref(wdEvent->vm);
- qemuDriverUnlock(driver);
VIR_FREE(wdEvent);
virObjectUnref(cfg);
}
@@ -4517,7 +4432,6 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl
virDomainObjPtr vm;
int ret = -1;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
memset(seclabel, 0, sizeof(*seclabel));
@@ -4565,7 +4479,6 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -4577,7 +4490,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
int i, ret = -1;
/* Protect domain data with qemu lock */
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -4638,9 +4550,10 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
+
+
static int qemuNodeGetSecurityModel(virConnectPtr conn,
virSecurityModelPtr secmodel)
{
@@ -4649,7 +4562,6 @@ static int qemuNodeGetSecurityModel(virConnectPtr conn,
int ret = 0;
virCapsPtr caps = NULL;
- qemuDriverLock(driver);
memset(secmodel, 0, sizeof(*secmodel));
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
@@ -4681,7 +4593,6 @@ static int qemuNodeGetSecurityModel(virConnectPtr conn,
strcpy(secmodel->doi, p);
cleanup:
- qemuDriverUnlock(driver);
virObjectUnref(caps);
return ret;
}
@@ -4988,7 +4899,6 @@ qemuDomainRestoreFlags(virConnectPtr conn,
VIR_DOMAIN_SAVE_RUNNING |
VIR_DOMAIN_SAVE_PAUSED, -1);
- qemuDriverLock(driver);
if (flags & VIR_DOMAIN_SAVE_RUNNING)
state = 1;
@@ -5013,7 +4923,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
goto cleanup;
def = NULL;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, &header, path,
@@ -5035,7 +4945,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -5059,8 +4968,6 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
/* We only take subset of virDomainDefFormat flags. */
virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL);
- qemuDriverLock(driver);
-
fd = qemuDomainSaveImageOpen(driver, path, &def, &header, false, NULL,
NULL, -1, false, false);
@@ -5072,7 +4979,6 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
cleanup:
virDomainDefFree(def);
VIR_FORCE_CLOSE(fd);
- qemuDriverUnlock(driver);
return ret;
}
@@ -5092,8 +4998,6 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
virCheckFlags(VIR_DOMAIN_SAVE_RUNNING |
VIR_DOMAIN_SAVE_PAUSED, -1);
- qemuDriverLock(driver);
-
if (flags & VIR_DOMAIN_SAVE_RUNNING)
state = 1;
else if (flags & VIR_DOMAIN_SAVE_PAUSED)
@@ -5144,7 +5048,6 @@ cleanup:
virDomainDefFree(def);
VIR_FORCE_CLOSE(fd);
VIR_FREE(xml);
- qemuDriverUnlock(driver);
return ret;
}
@@ -5215,7 +5118,6 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom,
/* Flags checked by virDomainDefFormat */
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -5236,7 +5138,7 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom,
/* Don't delay if someone's using the monitor, just use
* existing most recent data instead */
if (qemuDomainJobAllowed(priv, QEMU_JOB_QUERY)) {
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_QUERY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -5245,9 +5147,9 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
err = qemuMonitorGetBalloonInfo(priv->mon, &balloon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) {
@@ -5270,7 +5172,6 @@ endjob:
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -5293,14 +5194,11 @@ static char *qemuDomainXMLFromNative(virConnectPtr conn,
goto cleanup;
}
- qemuDriverLock(driver);
-
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
def = qemuParseCommandLineString(caps, config,
NULL, NULL, NULL);
- qemuDriverUnlock(driver);
if (!def)
goto cleanup;
@@ -5336,7 +5234,6 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
virCheckFlags(0, NULL);
- qemuDriverLock(driver);
cfg = virQEMUDriverGetConfig(driver);
if (STRNEQ(format, QEMU_CONFIG_FORMAT_ARGV)) {
@@ -5444,7 +5341,6 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
ret = virCommandToString(cmd);
cleanup:
- qemuDriverUnlock(driver);
virObjectUnref(qemuCaps);
virCommandFree(cmd);
@@ -5460,9 +5356,7 @@ static int qemuListDefinedDomains(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int n;
- qemuDriverLock(driver);
n = virDomainObjListGetInactiveNames(driver->domains, names, nnames);
- qemuDriverUnlock(driver);
return n;
}
@@ -5470,9 +5364,7 @@ static int qemuNumDefinedDomains(virConnectPtr conn) {
virQEMUDriverPtr driver = conn->privateData;
int n;
- qemuDriverLock(driver);
n = virDomainObjListNumOfDomains(driver->domains, 0);
- qemuDriverUnlock(driver);
return n;
}
@@ -5567,7 +5459,6 @@ qemuDomainStartWithFlags(virDomainPtr dom, unsigned int flags)
VIR_DOMAIN_START_BYPASS_CACHE |
VIR_DOMAIN_START_FORCE_BOOT, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -5578,7 +5469,7 @@ qemuDomainStartWithFlags(virDomainPtr dom, unsigned int flags)
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjIsActive(vm)) {
@@ -5599,7 +5490,6 @@ endjob:
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -5620,7 +5510,6 @@ static virDomainPtr qemuDomainDefine(virConnectPtr conn, const char *xml) {
virQEMUDriverConfigPtr cfg;
virCapsPtr caps = NULL;
- qemuDriverLock(driver);
cfg = virQEMUDriverGetConfig(driver);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
@@ -5697,7 +5586,6 @@ cleanup:
if (event)
qemuDomainEventQueue(driver, event);
virObjectUnref(qemuCaps);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return dom;
@@ -5718,7 +5606,6 @@ qemuDomainUndefineFlags(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE |
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA, -1);
- qemuDriverLock(driver);
cfg = virQEMUDriverGetConfig(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
@@ -5797,7 +5684,6 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
virObjectUnref(cfg);
return ret;
}
@@ -6446,7 +6332,6 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
affect = flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG);
- qemuDriverLock(driver);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -6460,7 +6345,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
}
priv = vm->privateData;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjIsActive(vm)) {
@@ -6588,7 +6473,6 @@ cleanup:
virDomainDeviceDefFree(dev);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -6651,7 +6535,6 @@ static int qemuDomainSetAutostart(virDomainPtr dom,
int ret = -1;
virQEMUDriverConfigPtr cfg = NULL;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
cfg = virQEMUDriverGetConfig(driver);
if (!vm) {
@@ -6708,7 +6591,6 @@ cleanup:
VIR_FREE(autostartLink);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(cfg);
return ret;
}
@@ -6754,7 +6636,6 @@ static char *qemuGetSchedulerType(virDomainPtr dom,
char *ret = NULL;
int rc;
- qemuDriverLock(driver);
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cgroup CPU controller is not mounted"));
@@ -6776,7 +6657,6 @@ static char *qemuGetSchedulerType(virDomainPtr dom,
virReportOOMError();
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -6933,7 +6813,6 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
NULL) < 0)
return -1;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (vm == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7061,7 +6940,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -7086,7 +6964,6 @@ qemuDomainGetBlkioParameters(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG |
VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
/* We blindly return a string, and let libvirt.c and
* remote_driver.c do the filtering on behalf of older clients
@@ -7254,7 +7131,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -7292,8 +7168,6 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
NULL) < 0)
return -1;
- qemuDriverLock(driver);
-
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (vm == NULL) {
@@ -7429,7 +7303,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -7454,8 +7327,6 @@ qemuDomainGetMemoryParameters(virDomainPtr dom,
VIR_DOMAIN_AFFECT_CONFIG |
VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
-
/* We don't return strings, and thus trivially support this flag. */
flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
@@ -7596,7 +7467,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -7625,8 +7495,6 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
NULL) < 0)
return -1;
- qemuDriverLock(driver);
-
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (vm == NULL) {
@@ -7751,7 +7619,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -7777,8 +7644,6 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
VIR_DOMAIN_AFFECT_CONFIG |
VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
-
/* We blindly return a string, and let libvirt.c and
* remote_driver.c do the filtering on behalf of older clients
* that can't parse it. */
@@ -7871,7 +7736,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -7993,8 +7857,6 @@ qemuSetSchedulerParametersFlags(virDomainPtr dom,
NULL) < 0)
return -1;
- qemuDriverLock(driver);
-
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (vm == NULL) {
@@ -8129,7 +7991,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -8274,8 +8135,6 @@ qemuGetSchedulerParametersFlags(virDomainPtr dom,
VIR_DOMAIN_AFFECT_CONFIG |
VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
-
/* We don't return strings, and thus trivially support this flag. */
flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
@@ -8395,7 +8254,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -8821,7 +8679,6 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
NULL) < 0)
return -1;
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (vm == NULL) {
@@ -8962,7 +8819,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -8989,8 +8845,6 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom,
VIR_DOMAIN_AFFECT_CONFIG |
VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
-
flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
@@ -9091,7 +8945,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -9452,11 +9305,9 @@ qemuDomainEventRegister(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int ret;
- qemuDriverLock(driver);
ret = virDomainEventStateRegister(conn,
driver->domainEventState,
callback, opaque, freecb);
- qemuDriverUnlock(driver);
return ret;
}
@@ -9469,11 +9320,9 @@ qemuDomainEventDeregister(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int ret;
- qemuDriverLock(driver);
ret = virDomainEventStateDeregister(conn,
driver->domainEventState,
callback);
- qemuDriverUnlock(driver);
return ret;
}
@@ -9490,13 +9339,11 @@ qemuDomainEventRegisterAny(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int ret;
- qemuDriverLock(driver);
if (virDomainEventStateRegisterID(conn,
driver->domainEventState,
dom, eventID,
callback, opaque, freecb, &ret) < 0)
ret = -1;
- qemuDriverUnlock(driver);
return ret;
}
@@ -9509,11 +9356,9 @@ qemuDomainEventDeregisterAny(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int ret;
- qemuDriverLock(driver);
ret = virDomainEventStateDeregisterID(conn,
driver->domainEventState,
callbackID);
- qemuDriverUnlock(driver);
return ret;
}
@@ -9541,8 +9386,6 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
- qemuDriverLock(driver);
-
if (!dom_xml) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no domain XML passed"));
@@ -9571,7 +9414,6 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
st, dname, dom_xml, flags);
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -9597,8 +9439,6 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
*uri_out = NULL;
- qemuDriverLock(driver);
-
if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use migrate v2 protocol with lock manager %s"),
@@ -9631,7 +9471,6 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
dname, dom_xml, flags);
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -9653,7 +9492,6 @@ qemuDomainMigratePerform(virDomainPtr dom,
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
- qemuDriverLock(driver);
if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use migrate v2 protocol with lock manager %s"),
@@ -9687,7 +9525,6 @@ qemuDomainMigratePerform(virDomainPtr dom,
flags, dname, resource, false);
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -9708,7 +9545,6 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
- qemuDriverLock(driver);
vm = virDomainObjListFindByName(driver->domains, dname);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
@@ -9725,7 +9561,6 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
flags, retcode, false);
cleanup:
- qemuDriverUnlock(driver);
return dom;
}
@@ -9750,7 +9585,6 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -9765,7 +9599,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
goto cleanup;
asyncJob = QEMU_ASYNC_JOB_MIGRATION_OUT;
} else {
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
asyncJob = QEMU_ASYNC_JOB_NONE;
}
@@ -9811,7 +9645,6 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return xml;
endjob:
@@ -9845,7 +9678,6 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
*uri_out = NULL;
- qemuDriverLock(driver);
if (flags & VIR_MIGRATE_TUNNELLED) {
/* this is a logical error; we never should have gotten here with
* VIR_MIGRATE_TUNNELLED set
@@ -9868,7 +9700,6 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
dname, dom_xml, flags);
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -9906,12 +9737,10 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn,
goto cleanup;
}
- qemuDriverLock(driver);
ret = qemuMigrationPrepareTunnel(driver, dconn,
cookiein, cookieinlen,
cookieout, cookieoutlen,
st, dname, dom_xml, flags);
- qemuDriverUnlock(driver);
cleanup:
return ret;
@@ -9937,7 +9766,6 @@ qemuDomainMigratePerform3(virDomainPtr dom,
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -9953,7 +9781,6 @@ qemuDomainMigratePerform3(virDomainPtr dom,
flags, dname, resource, true);
cleanup:
- qemuDriverUnlock(driver);
return ret;
}
@@ -9976,7 +9803,6 @@ qemuDomainMigrateFinish3(virConnectPtr dconn,
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
- qemuDriverLock(driver);
vm = virDomainObjListFindByName(driver->domains, dname);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
@@ -9990,7 +9816,6 @@ qemuDomainMigrateFinish3(virConnectPtr dconn,
flags, cancelled, true);
cleanup:
- qemuDriverUnlock(driver);
return dom;
}
@@ -10009,7 +9834,6 @@ qemuDomainMigrateConfirm3(virDomainPtr domain,
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
- qemuDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -10049,7 +9873,6 @@ qemuDomainMigrateConfirm3(virDomainPtr domain,
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(cfg);
return ret;
}
@@ -10117,7 +9940,6 @@ qemuNodeDeviceDettach(virNodeDevicePtr dev)
if (!pci)
return -1;
- qemuDriverLock(driver);
virObjectLock(driver->activePciHostdevs);
virObjectLock(driver->inactivePciHostdevs);
in_inactive_list = virPCIDeviceListFind(driver->inactivePciHostdevs, pci);
@@ -10130,7 +9952,6 @@ qemuNodeDeviceDettach(virNodeDevicePtr dev)
out:
virObjectUnlock(driver->inactivePciHostdevs);
virObjectUnlock(driver->activePciHostdevs);
- qemuDriverUnlock(driver);
if (in_inactive_list)
virPCIDeviceFree(pci);
return ret;
@@ -10152,7 +9973,6 @@ qemuNodeDeviceReAttach(virNodeDevicePtr dev)
if (!pci)
return -1;
- qemuDriverLock(driver);
virObjectLock(driver->activePciHostdevs);
virObjectLock(driver->inactivePciHostdevs);
other = virPCIDeviceListFind(driver->activePciHostdevs, pci);
@@ -10180,7 +10000,6 @@ qemuNodeDeviceReAttach(virNodeDevicePtr dev)
out:
virObjectUnlock(driver->inactivePciHostdevs);
virObjectUnlock(driver->activePciHostdevs);
- qemuDriverUnlock(driver);
virPCIDeviceFree(pci);
return ret;
}
@@ -10200,7 +10019,6 @@ qemuNodeDeviceReset(virNodeDevicePtr dev)
if (!pci)
return -1;
- qemuDriverLock(driver);
virObjectLock(driver->activePciHostdevs);
virObjectLock(driver->inactivePciHostdevs);
@@ -10212,7 +10030,6 @@ qemuNodeDeviceReset(virNodeDevicePtr dev)
out:
virObjectUnlock(driver->inactivePciHostdevs);
virObjectUnlock(driver->activePciHostdevs);
- qemuDriverUnlock(driver);
virPCIDeviceFree(pci);
return ret;
}
@@ -10228,8 +10045,6 @@ qemuCPUCompare(virConnectPtr conn,
virCheckFlags(0, VIR_CPU_COMPARE_ERROR);
- qemuDriverLock(driver);
-
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -10243,7 +10058,6 @@ qemuCPUCompare(virConnectPtr conn,
cleanup:
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -10538,8 +10352,7 @@ cleanup:
/* this function expects the driver lock to be held by the caller */
static int
-qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver,
- virDomainObjPtr vm) {
+qemuDomainSnapshotFSFreeze(virDomainObjPtr vm) {
qemuDomainObjPrivatePtr priv = vm->privateData;
int freezed;
@@ -10555,16 +10368,15 @@ qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver,
return -1;
}
- qemuDomainObjEnterAgentWithDriver(driver, vm);
+ qemuDomainObjEnterAgent(vm);
freezed = qemuAgentFSFreeze(priv->agent);
- qemuDomainObjExitAgentWithDriver(driver, vm);
+ qemuDomainObjExitAgent(vm);
return freezed;
}
static int
-qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver,
- virDomainObjPtr vm, bool report)
+qemuDomainSnapshotFSThaw(virDomainObjPtr vm, bool report)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int thawed;
@@ -10584,13 +10396,13 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver,
return -1;
}
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
if (!report)
err = virSaveLastError();
thawed = qemuAgentFSThaw(priv->agent);
if (!report)
virSetError(err);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
virFreeError(err);
return thawed;
@@ -10734,7 +10546,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
bool resume = false;
int ret = -1;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
return -1;
if (!virDomainObjIsActive(vm)) {
@@ -10760,9 +10572,9 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
}
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorCreateSnapshot(priv->mon, snap->def->name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto cleanup;
@@ -11199,7 +11011,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
}
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
cleanup:
virCgroupFree(&cgroup);
@@ -11235,7 +11047,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool pmsuspended = false;
- if (qemuDomainObjBeginAsyncJobWithDriver(driver, vm,
+ if (qemuDomainObjBeginAsyncJob(driver, vm,
QEMU_ASYNC_JOB_SNAPSHOT) < 0)
goto cleanup;
@@ -11244,7 +11056,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
* fail if the guest is paused or the guest agent is not
* running. */
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
- if (qemuDomainSnapshotFSFreeze(driver, vm) < 0) {
+ if (qemuDomainSnapshotFSFreeze(vm) < 0) {
/* helper reported the error */
thaw = -1;
goto endjob;
@@ -11375,7 +11187,7 @@ endjob:
goto cleanup;
}
if (vm && thaw != 0 &&
- qemuDomainSnapshotFSThaw(driver, vm, thaw > 0) < 0) {
+ qemuDomainSnapshotFSThaw(vm, thaw > 0) < 0) {
/* helper reported the error, if it was needed */
if (thaw > 0)
ret = -1;
@@ -11441,7 +11253,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)
parse_flags |= VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE;
- qemuDriverLock(driver);
virUUIDFormat(domain->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (!vm) {
@@ -11776,7 +11587,6 @@ cleanup:
}
virDomainSnapshotDefFree(def);
VIR_FREE(xml);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return snapshot;
@@ -12149,7 +11959,6 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
* and use of FORCE can cause multiple transitions.
*/
- qemuDriverLock(driver);
virUUIDFormat(snapshot->domain->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, snapshot->domain->uuid);
if (!vm) {
@@ -12229,7 +12038,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (snap->def->state == VIR_DOMAIN_RUNNING
@@ -12290,9 +12099,9 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
goto endjob;
}
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorLoadSnapshot(priv->mon, snap->def->name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (rc < 0) {
/* XXX resume domain if it was running before the
* failed loadvm attempt? */
@@ -12451,7 +12260,6 @@ cleanup:
}
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -12520,7 +12328,6 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY |
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY, -1);
- qemuDriverLock(driver);
virUUIDFormat(snapshot->domain->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, snapshot->domain->uuid);
if (!vm) {
@@ -12549,7 +12356,7 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
}
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
@@ -12611,7 +12418,6 @@ endjob:
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(cfg);
return ret;
}
@@ -12684,8 +12490,6 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
virCheckFlags(0, NULL);
- qemuDriverLock(driver);
-
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -12732,7 +12536,7 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
def = NULL;
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (qemuProcessAttach(conn, driver, vm, pid,
@@ -12758,7 +12562,6 @@ cleanup:
virDomainChrSourceDefFree(monConfig);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
VIR_FREE(pidfile);
virObjectUnref(caps);
return dom;
@@ -12971,10 +12774,10 @@ qemuDomainBlockPivot(virConnectPtr conn,
/* Probe the status, if needed. */
if (!disk->mirroring) {
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorBlockJob(priv->mon, device, NULL, 0, &info,
BLOCK_JOB_INFO, true);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -13056,9 +12859,9 @@ qemuDomainBlockPivot(virConnectPtr conn,
}
/* Attempt the pivot. */
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorDrivePivot(priv->mon, device, disk->mirror, format);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret == 0) {
/* XXX We want to revoke security labels and disk lease, as
@@ -13127,7 +12930,6 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
int idx;
virDomainDiskDefPtr disk;
- qemuDriverLock(driver);
virUUIDFormat(dom->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -13180,7 +12982,7 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -13195,13 +12997,13 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
goto endjob;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
/* XXX - libvirt should really be tracking the backing file chain
* itself, and validating that base is on the chain, rather than
* relying on qemu to do this. */
ret = qemuMonitorBlockJob(priv->mon, device, base, bandwidth, info, mode,
async);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto endjob;
@@ -13239,20 +13041,18 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
.tv_nsec = 50 * 1000 * 1000ull };
virDomainBlockJobInfo dummy;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorBlockJob(priv->mon, device, NULL, 0, &dummy,
BLOCK_JOB_INFO, async);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret <= 0)
break;
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
nanosleep(&ts, NULL);
- qemuDriverLock(driver);
virObjectLock(vm);
if (!virDomainObjIsActive(vm)) {
@@ -13277,7 +13077,6 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
return ret;
}
@@ -13685,7 +13484,6 @@ qemuDomainOpenGraphics(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH, -1);
- qemuDriverLock(driver);
virUUIDFormat(dom->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -13721,12 +13519,12 @@ qemuDomainOpenGraphics(virDomainPtr dom,
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (qemuDomainObjEndJob(driver, vm) == 0) {
vm = NULL;
goto cleanup;
@@ -13735,7 +13533,6 @@ qemuDomainOpenGraphics(virDomainPtr dom,
cleanup:
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -13782,7 +13579,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
memset(&info, 0, sizeof(info));
- qemuDriverLock(driver);
virUUIDFormat(dom->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -13808,7 +13604,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainLiveConfigHelperMethod(caps, vm, &flags,
@@ -13873,9 +13669,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
info.read_iops_sec = oldinfo->read_iops_sec;
info.write_iops_sec = oldinfo->write_iops_sec;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto endjob;
vm->def->disks[idx]->blkdeviotune = info;
@@ -13914,7 +13710,6 @@ cleanup:
VIR_FREE(device);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
@@ -13945,7 +13740,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
/* We don't return strings, and thus trivially support this flag. */
flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
- qemuDriverLock(driver);
virUUIDFormat(dom->uuid, uuidstr);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
if (!vm) {
@@ -13970,7 +13764,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
goto cleanup;
}
- if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainLiveConfigHelperMethod(caps, vm, &flags,
@@ -13979,9 +13773,9 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
priv = vm->privateData;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto endjob;
}
@@ -14057,7 +13851,6 @@ cleanup:
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- qemuDriverUnlock(driver);
return ret;
}
@@ -14536,8 +14329,6 @@ qemuDomainGetCPUStats(virDomainPtr domain,
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
- qemuDriverLock(driver);
-
vm = virDomainObjListFindByUUID(driver->domains, domain->uuid);
if (vm == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -14573,7 +14364,6 @@ cleanup:
virCgroupFree(&group);
if (vm)
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return ret;
}
@@ -14664,9 +14454,9 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
ret = qemuAgentSuspend(priv->agent, target);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0)
@@ -14734,9 +14524,7 @@ qemuListAllDomains(virConnectPtr conn,
virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
- qemuDriverLock(driver);
ret = virDomainObjListExport(driver->domains, conn, domains, flags);
- qemuDriverUnlock(driver);
return ret;
}
@@ -14788,9 +14576,9 @@ qemuDomainAgentCommand(virDomainPtr domain,
goto endjob;
}
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
ret = qemuAgentArbitraryCommand(priv->agent, cmd, &result, timeout);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
if (ret < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to execute agent command"));
@@ -14861,9 +14649,9 @@ qemuDomainFSTrim(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterAgent(driver, vm);
+ qemuDomainObjEnterAgent(vm);
ret = qemuAgentFSTrim(priv->agent, minimum);
- qemuDomainObjExitAgent(driver, vm);
+ qemuDomainObjExitAgent(vm);
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0c28a6a..488a440 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -107,7 +107,7 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
if (!(driveAlias = qemuDeviceDriveHostAlias(origdisk, priv->qemuCaps)))
goto error;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorEjectMedia(priv->mon, driveAlias, force);
/* we don't want to report errors from media tray_open polling */
@@ -144,7 +144,7 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
disk->src, format);
}
exit_monitor:
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, origdisk->src, disk->src, "update", ret >= 0);
@@ -194,7 +194,7 @@ qemuDomainCheckEjectableMedia(virQEMUDriverPtr driver,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
table = qemuMonitorGetBlockInfo(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
if (!table)
@@ -276,7 +276,7 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
goto error;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
@@ -305,7 +305,7 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
memcpy(&disk->info.addr.pci, &guestAddr, sizeof(guestAddr));
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0);
@@ -381,7 +381,7 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDevice(priv->mon, devstr);
} else {
@@ -389,7 +389,7 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
type,
&controller->info.addr.pci);
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret == 0) {
controller->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@@ -529,7 +529,7 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
goto error;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
@@ -555,7 +555,7 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
disk->info.addr.drive.unit = driveAddr.unit;
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0);
@@ -633,7 +633,7 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
goto error;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
@@ -648,7 +648,7 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
} else {
ret = qemuMonitorAddUSBDisk(priv->mon, disk->src);
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0);
@@ -807,24 +807,24 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorAddNetdev(priv->mon, netstr, tapfd, tapfd_name,
vhostfd, vhostfd_name) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto cleanup;
}
} else {
if (qemuMonitorAddHostNetwork(priv->mon, netstr, tapfd, tapfd_name,
vhostfd, vhostfd_name) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto cleanup;
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
VIR_FORCE_CLOSE(tapfd);
VIR_FORCE_CLOSE(vhostfd);
@@ -843,10 +843,10 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto try_remove;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorAddDevice(priv->mon, nicstr) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
@@ -854,14 +854,14 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
guestAddr = net->info.addr.pci;
if (qemuMonitorAddPCINetwork(priv->mon, nicstr,
&guestAddr) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
memcpy(&net->info.addr.pci, &guestAddr, sizeof(guestAddr));
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
/* set link state */
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
@@ -869,11 +869,11 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device alias not found: cannot set link state to down"));
} else {
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
if (qemuMonitorSetLink(priv->mon, net->info.alias, VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
@@ -882,7 +882,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
_("setting of link state not supported: Link is up"));
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
/* link set to down */
}
@@ -934,11 +934,11 @@ try_remove:
char *netdev_name;
if (virAsprintf(&netdev_name, "host%s", net->info.alias) < 0)
goto no_memory;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorRemoveNetdev(priv->mon, netdev_name) < 0)
VIR_WARN("Failed to remove network backend for netdev %s",
netdev_name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
VIR_FREE(netdev_name);
} else {
VIR_WARN("Unable to remove network backend");
@@ -947,11 +947,11 @@ try_remove:
char *hostnet_name;
if (virAsprintf(&hostnet_name, "host%s", net->info.alias) < 0)
goto no_memory;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0)
VIR_WARN("Failed to remove network backend for vlan %d, net %s",
vlan, hostnet_name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
VIR_FREE(hostnet_name);
}
goto cleanup;
@@ -1009,18 +1009,18 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
priv->qemuCaps)))
goto error;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorAddDeviceWithFd(priv->mon, devstr,
configfd, configfd_name);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
} else {
virDevicePCIAddress guestAddr = hostdev->info->addr.pci;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorAddPCIHostDevice(priv->mon,
&hostdev->source.subsys.u.pci,
&guestAddr);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
hostdev->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
memcpy(&hostdev->info->addr.pci, &guestAddr, sizeof(guestAddr));
@@ -1076,13 +1076,13 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
goto error;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
ret = qemuMonitorAddDevice(priv->mon, devstr);
else
goto error;
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditRedirdev(vm, redirdev, "attach", ret == 0);
if (ret < 0)
goto error;
@@ -1146,14 +1146,14 @@ int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
virUSBDeviceFree(usb);
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
ret = qemuMonitorAddDevice(priv->mon, devstr);
else
ret = qemuMonitorAddUSBDeviceExact(priv->mon,
hostdev->source.subsys.u.usb.bus,
hostdev->source.subsys.u.usb.device);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
if (ret < 0)
goto error;
@@ -1421,7 +1421,7 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
return -1;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate);
if (ret < 0)
@@ -1431,7 +1431,7 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
dev->linkstate = linkstate;
cleanup:
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
return ret;
}
@@ -2059,17 +2059,17 @@ int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
goto cleanup;
}
} else {
if (qemuMonitorRemovePCIDevice(priv->mon,
&detach->info.addr.pci) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
goto cleanup;
}
@@ -2078,7 +2078,7 @@ int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
/* disconnect guest from host device */
qemuMonitorDriveDel(priv->mon, drivestr);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", true);
@@ -2165,9 +2165,9 @@ int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
goto cleanup;
}
@@ -2175,7 +2175,7 @@ int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
/* disconnect guest from host device */
qemuMonitorDriveDel(priv->mon, drivestr);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", true);
@@ -2301,20 +2301,20 @@ int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
} else {
if (qemuMonitorRemovePCIDevice(priv->mon,
&detach->info.addr.pci) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainControllerRemove(vm->def, idx);
virDomainControllerDefFree(detach);
@@ -2357,13 +2357,13 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
rv = qemuMonitorDelDevice(priv->mon, detach->info->alias);
} else {
rv = qemuMonitorRemovePCIDevice(priv->mon, &detach->info->addr.pci);
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditHostdev(vm, detach, "detach", rv == 0);
if (rv < 0)
goto cleanup;
@@ -2427,9 +2427,9 @@ qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
return -1;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditHostdev(vm, detach, "detach", ret == 0);
if (ret < 0)
return -1;
@@ -2613,17 +2613,17 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
goto cleanup;
}
} else {
if (qemuMonitorRemovePCIDevice(priv->mon,
&detach->info.addr.pci) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
goto cleanup;
}
@@ -2632,18 +2632,18 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
goto cleanup;
}
} else {
if (qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
goto cleanup;
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", true);
@@ -2713,7 +2713,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
if (auth->connected)
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetPassword(priv->mon,
type,
auth->passwd ? auth->passwd : defaultPasswd,
@@ -2756,7 +2756,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
}
end_job:
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
cleanup:
virObjectUnref(cfg);
return ret;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 815f7a5..60cd47a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1188,7 +1188,7 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
ret = qemuMonitorGetSpiceMigrationStatus(priv->mon,
&spice_migrated);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0 || virTimeMillisNow(&priv->job.info.timeElapsed) < 0) {
priv->job.info.type = VIR_DOMAIN_JOB_FAILED;
@@ -1277,11 +1277,9 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, virDomainObjPtr vm,
}
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
nanosleep(&ts, NULL);
- qemuDriverLock(driver);
virObjectLock(vm);
}
@@ -1322,7 +1320,7 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver,
cookie->graphics->port,
cookie->graphics->tlsPort,
cookie->graphics->tlsSubject);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
return ret;
@@ -2265,7 +2263,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
/* explicitly do this *after* we entered the monitor,
* as this is a critical section so we are guaranteed
* priv->job.asyncAbort will not change */
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
_("canceled by client"));
@@ -2273,7 +2271,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
}
if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
@@ -2286,7 +2284,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
/* connect to the destination qemu if needed */
if (spec->destType == MIGRATION_DEST_CONNECT_HOST &&
qemuMigrationConnect(driver, vm, spec) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
@@ -2323,7 +2321,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
VIR_FORCE_CLOSE(spec->dest.fd.qemu);
break;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto cleanup;
ret = -1;
@@ -2412,7 +2410,7 @@ cancel:
if (qemuDomainObjEnterMonitorAsync(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
qemuMonitorMigrateCancel(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
}
goto cleanup;
@@ -2615,23 +2613,23 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver,
if (!(st = virStreamNew(dconn, 0)))
goto cleanup;
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepareTunnel
(dconn, st, flags, dname, resource, dom_xml);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
} else {
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepare2
(dconn, &cookie, &cookielen, NULL, &uri_out,
flags, dname, resource, dom_xml);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
}
VIR_FREE(dom_xml);
if (ret == -1)
goto cleanup;
/* the domain may have shutdown or crashed while we had the locks dropped
- * in qemuDomainObjEnterRemoteWithDriver, so check again
+ * in qemuDomainObjEnterRemote, so check again
*/
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -2678,11 +2676,11 @@ finish:
*/
dname = dname ? dname : vm->def->name;
VIR_DEBUG("Finish2 %p ret=%d", dconn, ret);
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ddomain = dconn->driver->domainMigrateFinish2
(dconn, dname, cookie, cookielen,
uri_out ? uri_out : dconnuri, flags, cancelled);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
cleanup:
if (ddomain) {
@@ -2759,18 +2757,18 @@ static int doPeer2PeerMigrate3(virQEMUDriverPtr driver,
if (!(st = virStreamNew(dconn, 0)))
goto cleanup;
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepareTunnel3
(dconn, st, cookiein, cookieinlen,
&cookieout, &cookieoutlen,
flags, dname, resource, dom_xml);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
} else {
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepare3
(dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen,
uri, &uri_out, flags, dname, resource, dom_xml);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
}
VIR_FREE(dom_xml);
if (ret == -1)
@@ -2842,11 +2840,11 @@ finish:
cookieout = NULL;
cookieoutlen = 0;
dname = dname ? dname : vm->def->name;
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
ddomain = dconn->driver->domainMigrateFinish3
(dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen,
dconnuri, uri_out ? uri_out : uri, flags, cancelled);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
/* If ddomain is NULL, then we were unable to start
* the guest on the target, and must restart on the
@@ -2934,9 +2932,9 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
* destination side is completely setup before we touch the source
*/
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
dconn = virConnectOpen(dconnuri);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
if (dconn == NULL) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to connect to remote libvirt URI %s"), dconnuri);
@@ -2948,7 +2946,7 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
cfg->keepAliveCount) < 0)
goto cleanup;
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
VIR_DRV_FEATURE_MIGRATION_P2P);
/* v3proto reflects whether the caller used Perform3, but with
@@ -2960,7 +2958,7 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
if (flags & VIR_MIGRATE_OFFLINE)
offline = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
VIR_DRV_FEATURE_MIGRATION_OFFLINE);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
if (!p2p) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
@@ -2998,9 +2996,9 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
cleanup:
orig_err = virSaveLastError();
- qemuDomainObjEnterRemoteWithDriver(driver, vm);
+ qemuDomainObjEnterRemote(vm);
virConnectClose(dconn);
- qemuDomainObjExitRemoteWithDriver(driver, vm);
+ qemuDomainObjExitRemote(vm);
if (orig_err) {
virSetError(orig_err);
virFreeError(orig_err);
@@ -3646,7 +3644,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
qemuMonitorSetMigrationSpeed(priv->mon,
QEMU_DOMAIN_MIG_BANDWIDTH_MAX);
priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
@@ -3726,11 +3724,11 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
if (virSetCloseExec(pipeFD[1]) < 0) {
virReportSystemError(errno, "%s",
_("Unable to set cloexec flag"));
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
if (virCommandRunAsync(cmd, NULL) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
rc = qemuMonitorMigrateToFd(priv->mon,
@@ -3745,7 +3743,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
args, path, offset);
}
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (rc < 0)
goto cleanup;
@@ -3765,7 +3763,7 @@ cleanup:
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
qemuMonitorSetMigrationSpeed(priv->mon, saveMigBandwidth);
priv->migMaxBandwidth = saveMigBandwidth;
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
VIR_FORCE_CLOSE(pipeFD[0]);
@@ -3799,7 +3797,7 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- if (qemuDomainObjBeginAsyncJobWithDriver(driver, vm, job) < 0)
+ if (qemuDomainObjBeginAsyncJob(driver, vm, job) < 0)
return -1;
if (job == QEMU_ASYNC_JOB_MIGRATION_IN) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 12e3544..9c93e47 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -129,12 +129,10 @@ static void
qemuProcessHandleAgentEOF(qemuAgentPtr agent,
virDomainObjPtr vm)
{
- virQEMUDriverPtr driver = qemu_driver;
qemuDomainObjPrivatePtr priv;
VIR_DEBUG("Received EOF from agent on %p '%s'", vm, vm->def->name);
- qemuDriverLock(driver);
virObjectLock(vm);
priv = vm->privateData;
@@ -152,14 +150,12 @@ qemuProcessHandleAgentEOF(qemuAgentPtr agent,
priv->agent = NULL;
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
qemuAgentClose(agent);
return;
unlock:
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
return;
}
@@ -174,12 +170,10 @@ static void
qemuProcessHandleAgentError(qemuAgentPtr agent ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- virQEMUDriverPtr driver = qemu_driver;
qemuDomainObjPrivatePtr priv;
VIR_DEBUG("Received error from agent on %p '%s'", vm, vm->def->name);
- qemuDriverLock(driver);
virObjectLock(vm);
priv = vm->privateData;
@@ -187,7 +181,6 @@ qemuProcessHandleAgentError(qemuAgentPtr agent ATTRIBUTE_UNUSED,
priv->agentError = true;
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
}
static void qemuProcessHandleAgentDestroy(qemuAgentPtr agent,
@@ -250,13 +243,11 @@ qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm)
ignore_value(virTimeMillisNow(&priv->agentStart));
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
agent = qemuAgentOpen(vm,
config,
&agentCallbacks);
- qemuDriverLock(driver);
virObjectLock(vm);
priv->agentStart = 0;
@@ -307,7 +298,6 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
VIR_DEBUG("Received EOF on %p '%s'", vm, vm->def->name);
- qemuDriverLock(driver);
virObjectLock(vm);
priv = vm->privateData;
@@ -347,7 +337,6 @@ unlock:
cleanup:
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
}
@@ -366,7 +355,6 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name);
- qemuDriverLock(driver);
virObjectLock(vm);
((qemuDomainObjPrivatePtr) vm->privateData)->monError = true;
@@ -375,7 +363,6 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
qemuDomainEventQueue(driver, event);
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
}
@@ -543,11 +530,8 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
return 0;
}
@@ -570,7 +554,6 @@ qemuProcessFakeReboot(void *opaque)
virDomainEventPtr event = NULL;
int ret = -1;
VIR_DEBUG("vm=%p", vm);
- qemuDriverLock(driver);
virObjectLock(vm);
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
@@ -581,12 +564,12 @@ qemuProcessFakeReboot(void *opaque)
goto endjob;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorSystemReset(priv->mon) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto endjob;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -616,7 +599,7 @@ endjob:
cleanup:
if (vm) {
if (ret == -1) {
- ignore_value(qemuProcessKill(driver, vm,
+ ignore_value(qemuProcessKill(vm,
VIR_QEMU_PROCESS_KILL_FORCE));
}
if (virObjectUnref(vm))
@@ -624,7 +607,6 @@ cleanup:
}
if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
}
@@ -643,12 +625,13 @@ qemuProcessShutdownOrReboot(virQEMUDriverPtr driver,
qemuProcessFakeReboot,
vm) < 0) {
VIR_ERROR(_("Failed to create reboot thread, killing domain"));
- ignore_value(qemuProcessKill(driver, vm,
+ ignore_value(qemuProcessKill(vm,
VIR_QEMU_PROCESS_KILL_NOWAIT));
virObjectUnref(vm);
}
} else {
- ignore_value(qemuProcessKill(driver, vm, VIR_QEMU_PROCESS_KILL_NOWAIT));
+ ignore_value(qemuProcessKill(vm,
+ VIR_QEMU_PROCESS_KILL_NOWAIT));
}
}
@@ -703,11 +686,8 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -759,11 +739,8 @@ unlock:
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -821,11 +798,8 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -857,11 +831,8 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -929,14 +900,10 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (watchdogEvent || lifecycleEvent) {
- qemuDriverLock(driver);
- if (watchdogEvent)
- qemuDomainEventQueue(driver, watchdogEvent);
- if (lifecycleEvent)
- qemuDomainEventQueue(driver, lifecycleEvent);
- qemuDriverUnlock(driver);
- }
+ if (watchdogEvent)
+ qemuDomainEventQueue(driver, watchdogEvent);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -999,16 +966,12 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (ioErrorEvent || ioErrorEvent2 || lifecycleEvent) {
- qemuDriverLock(driver);
- if (ioErrorEvent)
- qemuDomainEventQueue(driver, ioErrorEvent);
- if (ioErrorEvent2)
- qemuDomainEventQueue(driver, ioErrorEvent2);
- if (lifecycleEvent)
- qemuDomainEventQueue(driver, lifecycleEvent);
- qemuDriverUnlock(driver);
- }
+ if (ioErrorEvent)
+ qemuDomainEventQueue(driver, ioErrorEvent);
+ if (ioErrorEvent2)
+ qemuDomainEventQueue(driver, ioErrorEvent2);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -1050,11 +1013,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
return 0;
}
@@ -1117,11 +1077,8 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
event = virDomainEventGraphicsNewFromObj(vm, phase, localAddr, remoteAddr, authScheme, subject);
virObjectUnlock(vm);
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
return 0;
@@ -1192,11 +1149,8 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -1240,14 +1194,10 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event || lifecycleEvent) {
- qemuDriverLock(driver);
- if (event)
- qemuDomainEventQueue(driver, event);
- if (lifecycleEvent)
- qemuDomainEventQueue(driver, lifecycleEvent);
- qemuDriverUnlock(driver);
- }
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -1293,14 +1243,10 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event || lifecycleEvent) {
- qemuDriverLock(driver);
- if (event)
- qemuDomainEventQueue(driver, event);
- if (lifecycleEvent)
- qemuDomainEventQueue(driver, lifecycleEvent);
- qemuDriverUnlock(driver);
- }
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -1332,11 +1278,8 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event) {
- qemuDriverLock(driver);
+ if (event)
qemuDomainEventQueue(driver, event);
- qemuDriverUnlock(driver);
- }
virObjectUnref(caps);
virObjectUnref(cfg);
return 0;
@@ -1382,14 +1325,10 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
cleanup:
- if (event || lifecycleEvent) {
- qemuDriverLock(driver);
- if (event)
- qemuDomainEventQueue(driver, event);
- if (lifecycleEvent)
- qemuDomainEventQueue(driver, lifecycleEvent);
- qemuDriverUnlock(driver);
- }
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -1438,14 +1377,12 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm)
ignore_value(virTimeMillisNow(&priv->monStart));
virObjectUnlock(vm);
- qemuDriverUnlock(driver);
mon = qemuMonitorOpen(vm,
priv->monConfig,
priv->monJSON,
&monitorCallbacks);
- qemuDriverLock(driver);
virObjectLock(vm);
priv->monStart = 0;
@@ -1469,12 +1406,12 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm)
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetCapabilities(priv->mon);
if (ret == 0 &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON))
ret = virQEMUCapsProbeQMP(priv->qemuCaps, priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
error:
@@ -1850,9 +1787,9 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
goto cleanup;
priv = vm->privateData;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetPtyPaths(priv->mon, paths);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
VIR_DEBUG("qemuMonitorGetPtyPaths returned %i", ret);
if (ret == 0)
@@ -1900,12 +1837,12 @@ qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver,
int ncpupids;
qemuDomainObjPrivatePtr priv = vm->privateData;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
/* failure to get the VCPU<-> PID mapping or to execute the query
* command will not be treated fatal as some versions of qemu don't
* support this command */
if ((ncpupids = qemuMonitorGetCPUInfo(priv->mon, &cpupids)) <= 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
virResetLastError();
priv->nvcpupids = 1;
@@ -1916,7 +1853,7 @@ qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver,
priv->vcpupids[0] = vm->pid;
return 0;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ncpupids != vm->def->vcpus) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -2309,10 +2246,10 @@ qemuProcessInitPasswords(virConnectPtr conn,
goto cleanup;
alias = vm->def->disks[i]->info.alias;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
VIR_FREE(secret);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto cleanup;
}
@@ -2701,10 +2638,10 @@ qemuProcessInitPCIAddresses(virQEMUDriverPtr driver,
int ret;
qemuMonitorPCIAddress *addrs = NULL;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
naddrs = qemuMonitorGetAllPCIAddresses(priv->mon,
&addrs);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
ret = qemuProcessDetectPCIAddresses(vm, addrs, naddrs);
@@ -2862,7 +2799,7 @@ qemuProcessPrepareMonitorChr(virQEMUDriverConfigPtr cfg,
/*
* Precondition: Both driver and vm must be locked,
* and a job must be active. This method will call
- * {Enter,Exit}MonitorWithDriver
+ * {Enter,Exit}Monitor
*/
int
qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
@@ -2887,7 +2824,7 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
ret = qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob);
if (ret == 0) {
ret = qemuMonitorStartCPUs(priv->mon, conn);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
if (ret == 0) {
@@ -2916,7 +2853,7 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
ret = qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob);
if (ret == 0) {
ret = qemuMonitorStopCPUs(priv->mon);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
}
if (ret == 0) {
@@ -2979,9 +2916,9 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
char *msg = NULL;
int ret;
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetStatus(priv->mon, &running, &reason);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (ret < 0 || !virDomainObjIsActive(vm))
return -1;
@@ -3264,7 +3201,6 @@ qemuProcessReconnect(void *opaque)
VIR_FREE(data);
- qemuDriverLock(driver);
virObjectLock(obj);
cfg = virQEMUDriverGetConfig(driver);
@@ -3383,8 +3319,6 @@ endjob:
if (obj && virObjectUnref(obj))
virObjectUnlock(obj);
- qemuDriverUnlock(driver);
-
virConnectClose(conn);
virObjectUnref(cfg);
virObjectUnref(caps);
@@ -3399,7 +3333,6 @@ error:
if (!virDomainObjIsActive(obj)) {
if (virObjectUnref(obj))
virObjectUnlock(obj);
- qemuDriverUnlock(driver);
return;
}
@@ -3425,7 +3358,6 @@ error:
virObjectUnlock(obj);
}
}
- qemuDriverUnlock(driver);
virConnectClose(conn);
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -3474,7 +3406,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
qemuDomainObjRestoreJob(obj, &data->oldjob);
- if (qemuDomainObjBeginJobWithDriver(src->driver, obj, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(src->driver, obj, QEMU_JOB_MODIFY) < 0)
goto error;
/* Since we close the connection later on, we have to make sure
@@ -4111,13 +4043,13 @@ int qemuProcessStart(virConnectPtr conn,
/* qemu doesn't support setting this on the command line, so
* enter the monitor */
VIR_DEBUG("Setting network link states");
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuProcessSetLinkStates(vm) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
/* Technically, qemuProcessStart can be called from inside
* QEMU_ASYNC_JOB_MIGRATION_IN, but we are okay treating this like
@@ -4131,12 +4063,12 @@ int qemuProcessStart(virConnectPtr conn,
vm->def->mem.cur_balloon);
goto cleanup;
}
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (!(flags & VIR_QEMU_PROCESS_START_PAUSED)) {
VIR_DEBUG("Starting domain CPUs");
@@ -4205,8 +4137,7 @@ cleanup:
int
-qemuProcessKill(virQEMUDriverPtr driver,
- virDomainObjPtr vm, unsigned int flags)
+qemuProcessKill(virDomainObjPtr vm, unsigned int flags)
{
int ret;
@@ -4227,20 +4158,9 @@ qemuProcessKill(virQEMUDriverPtr driver,
return 0;
}
- if (driver)
- qemuDriverUnlock(driver);
-
ret = virProcessKillPainfully(vm->pid,
!!(flags & VIR_QEMU_PROCESS_KILL_FORCE));
- if (driver) {
- virObjectRef(vm);
- virObjectUnlock(vm);
- qemuDriverLock(driver);
- virObjectLock(vm);
- virObjectUnref(vm);
- }
-
return ret;
}
@@ -4346,8 +4266,9 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
/* shut it off for sure */
- ignore_value(qemuProcessKill(driver, vm, VIR_QEMU_PROCESS_KILL_FORCE|
- VIR_QEMU_PROCESS_KILL_NOCHECK));
+ ignore_value(qemuProcessKill(vm,
+ VIR_QEMU_PROCESS_KILL_FORCE|
+ VIR_QEMU_PROCESS_KILL_NOCHECK));
qemuDomainCleanupRun(driver, vm);
@@ -4646,20 +4567,20 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
}
VIR_DEBUG("Getting initial memory amount");
- qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorGetBalloonInfo(priv->mon, &vm->def->mem.cur_balloon) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
if (qemuMonitorGetStatus(priv->mon, &running, &reason) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
if (qemuMonitorGetVirtType(priv->mon, &vm->def->virtType) < 0) {
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
- qemuDomainObjExitMonitorWithDriver(driver, vm);
+ qemuDomainObjExitMonitor(driver, vm);
if (!virDomainObjIsActive(vm))
goto cleanup;
@@ -4731,8 +4652,8 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver,
qemuDomainObjDiscardAsyncJob(driver, dom);
}
- if (qemuDomainObjBeginJobWithDriver(driver, dom,
- QEMU_JOB_DESTROY) < 0)
+ if (qemuDomainObjBeginJob(driver, dom,
+ QEMU_JOB_DESTROY) < 0)
goto cleanup;
VIR_DEBUG("Killing domain");
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index cbdab24..ce44fe5 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -84,8 +84,7 @@ typedef enum {
VIR_QEMU_PROCESS_KILL_NOCHECK = 1 << 2, /* bypass the running vm check */
} virQemuProcessKillMode;
-int qemuProcessKill(virQEMUDriverPtr driver,
- virDomainObjPtr vm, unsigned int flags);
+int qemuProcessKill(virDomainObjPtr vm, unsigned int flags);
int qemuProcessAutoDestroyInit(virQEMUDriverPtr driver);
void qemuProcessAutoDestroyShutdown(virQEMUDriverPtr driver);
--
1.8.1
3
5
[libvirt] [PATCH] virCommand: Don't misuse the eventloop for async IO
by Michal Privoznik 13 Feb '13
by Michal Privoznik 13 Feb '13
13 Feb '13
Currently, if a command wants to do asynchronous IO, a callback
is registered in the libvirtd eventloop to handle writes and
reads. However, there's a race in virCommandWait. The eventloop
may already be executing the callback, while virCommandWait is
mangling internal state of virCommand. To deal with it, we need
to either introduce locking or spawn a separate thread where we
poll() on stdio from child. The former, however, requires to
unlock all mutexes held, as the event loop may execute other
callbacks which tries to lock one of the mutexes, deadlock and
thus never wake us up. So it's safer to spawn a separate thread.
---
This is an alternative to:
https://www.redhat.com/archives/libvir-list/2013-February/msg00352.html
src/util/vircommand.c | 342 +++++++++++---------------------------------------
1 file changed, 76 insertions(+), 266 deletions(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index db7dbca..160f4c2 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -42,6 +42,7 @@
#include "virpidfile.h"
#include "virprocess.h"
#include "virbuffer.h"
+#include "virthread.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -80,15 +81,13 @@ struct _virCommand {
char **errbuf;
int infd;
+ int inpipe;
int outfd;
int errfd;
int *outfdptr;
int *errfdptr;
- size_t inbufOffset;
- int inWatch;
- int outWatch;
- int errWatch;
+ virThreadPtr asyncioThread;
bool handshake;
int handshakeWait[2];
@@ -784,8 +783,7 @@ virCommandNewArgs(const char *const*args)
cmd->handshakeNotify[0] = -1;
cmd->handshakeNotify[1] = -1;
- cmd->infd = cmd->outfd = cmd->errfd = -1;
- cmd->inWatch = cmd->outWatch = cmd->errWatch = -1;
+ cmd->infd = cmd->inpipe = cmd->outfd = cmd->errfd = -1;
cmd->pid = -1;
virCommandAddArgSet(cmd, args);
@@ -1703,19 +1701,17 @@ virCommandToString(virCommandPtr cmd)
* Manage input and output to the child process.
*/
static int
-virCommandProcessIO(virCommandPtr cmd, int *inpipe)
+virCommandProcessIO(virCommandPtr cmd)
{
- int infd = -1, outfd = -1, errfd = -1;
+ int outfd = -1, errfd = -1;
size_t inlen = 0, outlen = 0, errlen = 0;
size_t inoff = 0;
int ret = 0;
/* With an input buffer, feed data to child
* via pipe */
- if (cmd->inbuf) {
+ if (cmd->inbuf)
inlen = strlen(cmd->inbuf);
- infd = *inpipe;
- }
/* With out/err buffer, the outfd/errfd have been filled with an
* FD for us. Guarantee an allocated string with partial results
@@ -1744,8 +1740,8 @@ virCommandProcessIO(virCommandPtr cmd, int *inpipe)
struct pollfd fds[3];
int nfds = 0;
- if (infd != -1) {
- fds[nfds].fd = infd;
+ if (cmd->inpipe != -1) {
+ fds[nfds].fd = cmd->inpipe;
fds[nfds].events = POLLOUT;
fds[nfds].revents = 0;
nfds++;
@@ -1817,21 +1813,19 @@ virCommandProcessIO(virCommandPtr cmd, int *inpipe)
}
if (fds[i].revents & (POLLOUT | POLLERR) &&
- fds[i].fd == infd) {
+ fds[i].fd == cmd->inpipe) {
int done;
/* Coverity 5.3.0 can't see that we only get here if
* infd is in the set because it was non-negative. */
sa_assert(infd != -1);
- done = write(infd, cmd->inbuf + inoff,
+ done = write(cmd->inpipe, cmd->inbuf + inoff,
inlen - inoff);
if (done < 0) {
if (errno == EPIPE) {
VIR_DEBUG("child closed stdin early, ignoring EPIPE "
- "on fd %d", infd);
- if (VIR_CLOSE(*inpipe) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", infd);
- infd = -1;
+ "on fd %d", cmd->inpipe);
+ VIR_FORCE_CLOSE(cmd->inpipe);
} else if (errno != EINTR && errno != EAGAIN) {
virReportSystemError(errno, "%s",
_("unable to write to child input"));
@@ -1839,11 +1833,8 @@ virCommandProcessIO(virCommandPtr cmd, int *inpipe)
}
} else {
inoff += done;
- if (inoff == inlen) {
- if (VIR_CLOSE(*inpipe) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", infd);
- infd = -1;
- }
+ if (inoff == inlen)
+ VIR_FORCE_CLOSE(cmd->inpipe);
}
}
}
@@ -1914,7 +1905,6 @@ virCommandRun(virCommandPtr cmd, int *exitstatus)
int ret = 0;
char *outbuf = NULL;
char *errbuf = NULL;
- int infd[2] = { -1, -1 };
struct stat st;
bool string_io;
bool async_io = false;
@@ -1960,18 +1950,6 @@ virCommandRun(virCommandPtr cmd, int *exitstatus)
}
}
- /* If we have an input buffer, we need
- * a pipe to feed the data to the child */
- if (cmd->inbuf) {
- if (pipe2(infd, O_CLOEXEC) < 0) {
- virReportSystemError(errno, "%s",
- _("unable to open pipe"));
- cmd->has_error = -1;
- return -1;
- }
- cmd->infd = infd[0];
- }
-
/* If caller requested the same string for stdout and stderr, then
* merge those into one string. */
if (cmd->outbuf && cmd->outbuf == cmd->errbuf) {
@@ -1999,23 +1977,14 @@ virCommandRun(virCommandPtr cmd, int *exitstatus)
cmd->flags |= VIR_EXEC_RUN_SYNC;
if (virCommandRunAsync(cmd, NULL) < 0) {
- if (cmd->inbuf) {
- tmpfd = infd[0];
- if (VIR_CLOSE(infd[0]) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", tmpfd);
- tmpfd = infd[1];
- if (VIR_CLOSE(infd[1]) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", tmpfd);
- }
cmd->has_error = -1;
return -1;
}
- tmpfd = infd[0];
- if (VIR_CLOSE(infd[0]) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", tmpfd);
- if (string_io)
- ret = virCommandProcessIO(cmd, &infd[1]);
+ if (string_io) {
+ VIR_FORCE_CLOSE(cmd->infd);
+ ret = virCommandProcessIO(cmd);
+ }
if (virCommandWait(cmd, exitstatus) < 0)
ret = -1;
@@ -2031,11 +2000,7 @@ virCommandRun(virCommandPtr cmd, int *exitstatus)
/* Reset any capturing, in case caller runs
* this identical command again */
- if (cmd->inbuf) {
- tmpfd = infd[1];
- if (VIR_CLOSE(infd[1]) < 0)
- VIR_DEBUG("ignoring failed close on fd %d", tmpfd);
- }
+ VIR_FORCE_CLOSE(cmd->inpipe);
if (cmd->outbuf == &outbuf) {
tmpfd = cmd->outfd;
if (VIR_CLOSE(cmd->outfd) < 0)
@@ -2135,177 +2100,13 @@ virCommandHook(void *data)
static void
-virCommandHandleReadWrite(int watch, int fd, int events, void *opaque)
-{
- virCommandPtr cmd = (virCommandPtr) opaque;
- char ***bufptr = NULL;
- char buf[1024];
- ssize_t nread, nwritten;
- size_t len = 0;
- int *watchPtr = NULL;
- bool eof = false;
- int *fdptr = NULL, **fdptrptr = NULL;
-
- VIR_DEBUG("watch=%d fd=%d events=%d", watch, fd, events);
- errno = 0;
-
- if (watch == cmd->inWatch) {
- watchPtr = &cmd->inWatch;
- fdptr = &cmd->infd;
-
- if (events & VIR_EVENT_HANDLE_WRITABLE) {
- len = strlen(cmd->inbuf);
-
- while (true) {
- nwritten = write(fd, cmd->inbuf + cmd->inbufOffset,
- len - cmd->inbufOffset);
- if (nwritten < 0) {
- if (errno != EAGAIN && errno != EINTR) {
- virReportSystemError(errno,
- _("Unable to write command's "
- "input to FD %d"),
- fd);
- eof = true;
- }
- break;
- }
-
- if (nwritten == 0) {
- eof = true;
- break;
- }
-
- cmd->inbufOffset += nwritten;
- if (cmd->inbufOffset == len) {
- VIR_FORCE_CLOSE(cmd->infd);
- eof = true;
- break;
- }
- }
-
- }
- } else {
- if (watch == cmd->outWatch) {
- watchPtr = &cmd->outWatch;
- bufptr = &cmd->outbuf;
- fdptr = &cmd->outfd;
- fdptrptr = &cmd->outfdptr;
- } else {
- watchPtr = &cmd->errWatch;
- bufptr = &cmd->errbuf;
- fdptr = &cmd->errfd;
- fdptrptr = &cmd->errfdptr;
- }
-
- if (events & VIR_EVENT_HANDLE_READABLE) {
- if (**bufptr)
- len = strlen(**bufptr);
-
- while (true) {
- nread = read(fd, buf, sizeof(buf));
- if (nread < 0) {
- if (errno != EAGAIN && errno != EINTR) {
- virReportSystemError(errno,
- _("unable to read command's "
- "output from FD %d"),
- fd);
- eof = true;
- }
- break;
- }
-
- if (nread == 0) {
- eof = true;
- break;
- }
-
- if (VIR_REALLOC_N(**bufptr, len + nread + 1) < 0) {
- virReportOOMError();
- break;
- }
-
- memcpy(**bufptr + len, buf, nread);
- (**bufptr)[len + nread] = '\0';
- }
-
- }
- }
-
- if (eof || (events & VIR_EVENT_HANDLE_HANGUP) ||
- (events & VIR_EVENT_HANDLE_ERROR)) {
- virEventRemoveHandle(watch);
-
- *watchPtr = -1;
- VIR_FORCE_CLOSE(*fdptr);
- if (bufptr)
- *bufptr = NULL;
- if (fdptrptr)
- *fdptrptr = NULL;
- }
-}
-
-
-static int
-virCommandRegisterEventLoop(virCommandPtr cmd)
+virCommandDoAsyncIOHelper(void *opaque)
{
- int ret = -1;
-
- if (cmd->inbuf &&
- (cmd->inWatch = virEventAddHandle(cmd->infd,
- VIR_EVENT_HANDLE_WRITABLE |
- VIR_EVENT_HANDLE_HANGUP |
- VIR_EVENT_HANDLE_ERROR,
- virCommandHandleReadWrite,
- cmd, NULL)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to register infd %d in the event loop"),
- cmd->infd);
- goto cleanup;
+ virCommandPtr cmd = opaque;
+ if (virCommandProcessIO(cmd) < 0) {
+ /* If something went wrong, save errno or -1*/
+ cmd->has_error = errno ? errno : -1;
}
-
- if (cmd->outbuf && cmd->outfdptr == &cmd->outfd &&
- (cmd->outWatch = virEventAddHandle(cmd->outfd,
- VIR_EVENT_HANDLE_READABLE |
- VIR_EVENT_HANDLE_HANGUP |
- VIR_EVENT_HANDLE_ERROR,
- virCommandHandleReadWrite,
- cmd, NULL)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to register outfd %d in the event loop"),
- cmd->outfd);
-
- if (cmd->inWatch != -1) {
- virEventRemoveHandle(cmd->inWatch);
- cmd->inWatch = -1;
- }
- goto cleanup;
- }
-
- if (cmd->errbuf && cmd->errfdptr == &cmd->errfd &&
- (cmd->errWatch = virEventAddHandle(cmd->errfd,
- VIR_EVENT_HANDLE_READABLE |
- VIR_EVENT_HANDLE_HANGUP |
- VIR_EVENT_HANDLE_ERROR,
- virCommandHandleReadWrite,
- cmd, NULL)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to register errfd %d in the event loop"),
- cmd->errfd);
- if (cmd->inWatch != -1) {
- virEventRemoveHandle(cmd->inWatch);
- cmd->inWatch = -1;
- }
- if (cmd->outWatch != -1) {
- virEventRemoveHandle(cmd->outWatch);
- cmd->outWatch = -1;
- }
- goto cleanup;
- }
-
- ret = 0;
-
-cleanup:
- return ret;
}
@@ -2351,23 +2152,21 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
synchronous = cmd->flags & VIR_EXEC_RUN_SYNC;
cmd->flags &= ~VIR_EXEC_RUN_SYNC;
- /* Buffer management can only be requested via virCommandRun, unless help
- * from the event loop has been requested via virCommandDoAsyncIO. */
- if (cmd->flags & VIR_EXEC_ASYNC_IO) {
- /* If we have an input buffer, we need
- * a pipe to feed the data to the child */
- if (cmd->inbuf && cmd->infd == -1) {
- if (pipe2(infd, O_CLOEXEC) < 0) {
- virReportSystemError(errno, "%s",
- _("unable to open pipe"));
- cmd->has_error = -1;
- return -1;
- }
- cmd->infd = infd[0];
+ /* Buffer management can only be requested via virCommandRun or
+ * virCommandDoAsyncIO. */
+ if (cmd->inbuf && cmd->infd == -1 &&
+ (synchronous || cmd->flags & VIR_EXEC_ASYNC_IO)) {
+ if (pipe2(infd, O_CLOEXEC) < 0) {
+ virReportSystemError(errno, "%s",
+ _("unable to open pipe"));
+ cmd->has_error = -1;
+ return -1;
}
+ cmd->infd = infd[0];
+ cmd->inpipe = infd[1];
} else if ((cmd->inbuf && cmd->infd == -1) ||
- (cmd->outbuf && cmd->outfdptr != &cmd->outfd) ||
- (cmd->errbuf && cmd->errfdptr != &cmd->errfd)) {
+ (cmd->outbuf && cmd->outfdptr != &cmd->outfd) ||
+ (cmd->errbuf && cmd->errfdptr != &cmd->errfd)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot mix string I/O with asynchronous command"));
return -1;
@@ -2377,24 +2176,24 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
virReportError(VIR_ERR_INTERNAL_ERROR,
_("command is already running as pid %lld"),
(long long) cmd->pid);
- return -1;
+ goto cleanup;
}
if (!synchronous && (cmd->flags & VIR_EXEC_DAEMON)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("daemonized command cannot use virCommandRunAsync"));
- return -1;
+ goto cleanup;
}
if (cmd->pwd && (cmd->flags & VIR_EXEC_DAEMON)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("daemonized command cannot set working directory %s"),
cmd->pwd);
- return -1;
+ goto cleanup;
}
if (cmd->pidfile && !(cmd->flags & VIR_EXEC_DAEMON)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("creation of pid file requires daemonized command"));
- return -1;
+ goto cleanup;
}
str = virCommandToString(cmd);
@@ -2430,15 +2229,27 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
cmd->reap = true;
if (ret == 0 && cmd->flags & VIR_EXEC_ASYNC_IO) {
- cmd->flags &= ~VIR_EXEC_ASYNC_IO;
- if (cmd->inbuf && cmd->infd != -1) {
- /* close the read end of infd and replace it with the write end */
+ if (cmd->inbuf)
VIR_FORCE_CLOSE(cmd->infd);
- cmd->infd = infd[1];
+ /* clear any error so we can catch if the helper thread reports one */
+ cmd->has_error = 0;
+ if (VIR_ALLOC(cmd->asyncioThread) < 0 ||
+ virThreadCreate(cmd->asyncioThread, true,
+ virCommandDoAsyncIOHelper, cmd) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to create thread "
+ "to process command's IO"));
+ VIR_FREE(cmd->asyncioThread);
+ virCommandAbort(cmd);
+ ret = -1;
}
- ret = virCommandRegisterEventLoop(cmd);
}
+cleanup:
+ if (ret < 0) {
+ VIR_FORCE_CLOSE(cmd->infd);
+ VIR_FORCE_CLOSE(cmd->inpipe);
+ }
return ret;
}
@@ -2459,7 +2270,6 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
{
int ret;
int status = 0;
- const int events = VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_HANGUP;
if (!cmd ||cmd->has_error == ENOMEM) {
virReportOOMError();
@@ -2484,24 +2294,20 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
* guarantee that virProcessWait only fails due to failure to wait,
* and repeat the exitstatus check code ourselves. */
ret = virProcessWait(cmd->pid, exitstatus ? exitstatus : &status);
-
- if (cmd->inWatch != -1) {
- virEventRemoveHandle(cmd->inWatch);
- cmd->inWatch = -1;
- }
-
- if (cmd->outWatch != -1) {
- virEventRemoveHandle(cmd->outWatch);
- virCommandHandleReadWrite(cmd->outWatch, cmd->outfd, events, cmd);
- cmd->outWatch = -1;
- }
-
- if (cmd->errWatch != -1) {
- virEventRemoveHandle(cmd->errWatch);
- virCommandHandleReadWrite(cmd->errWatch, cmd->errfd, events, cmd);
- cmd->errWatch = -1;
+ if (cmd->flags & VIR_EXEC_ASYNC_IO) {
+ cmd->flags &= ~VIR_EXEC_ASYNC_IO;
+ virThreadJoin(cmd->asyncioThread);
+ VIR_FREE(cmd->asyncioThread);
+ VIR_FORCE_CLOSE(cmd->inpipe);
+ if (cmd->has_error) {
+ const char *msg = _("Error while processing command's IO");
+ if (cmd->has_error < 0)
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", msg);
+ else
+ virReportSystemError(cmd->has_error, "%s", msg);
+ ret = -1;
+ }
}
-
if (ret == 0) {
cmd->pid = -1;
cmd->reap = false;
@@ -2719,6 +2525,10 @@ virCommandFree(virCommandPtr cmd)
VIR_FORCE_CLOSE(cmd->transfer[i]);
}
+ if (cmd->asyncioThread) {
+ virThreadJoin(cmd->asyncioThread);
+ VIR_FREE(cmd->asyncioThread);
+ }
VIR_FREE(cmd->inbuf);
VIR_FORCE_CLOSE(cmd->outfd);
VIR_FORCE_CLOSE(cmd->errfd);
--
1.8.0.2
2
2
[libvirt] [PATCH 00/13] Yet another c99 struct initialization conversion
by Michal Privoznik 13 Feb '13
by Michal Privoznik 13 Feb '13
13 Feb '13
I wonder if there's any syntax-check rule that we could use
to enforce this style.
Michal Privoznik (13):
virsh: Switch to c99 initialization of vshCmdDef
virsh.c: Switch to c99 initialization of vshCmdInfo
virsh-domain-monitor.c: Switch to c99 initialization of vshCmdInfo
virsh-domain.c: Switch to c99 initialization of vshCmdInfo
virsh-host.c: Switch to c99 initialization of vshCmdInfo
virsh-interface.c: Switch to c99 initialization of vshCmdInfo
virsh-network.c: Switch to c99 initialization of vshCmdInfo
virsh-nodedev.c: Switch to c99 initialization of vshCmdInfo
virsh-nwfilter.c: Switch to c99 initialization of vshCmdInfo
virsh-pool.c: Switch to c99 initialization of vshCmdInfo
virsh-secret.c: Switch to c99 initialization of vshCmdInfo
virsh-snapshot.c: Switch to c99 initialization of vshCmdInfo
virsh-volume.c: Switch to c99 initialization of vshCmdInfo
tools/virsh-domain-monitor.c | 198 ++++--
tools/virsh-domain.c | 1409 +++++++++++++++++++++++++++++++-----------
tools/virsh-host.c | 222 +++++--
tools/virsh-interface.c | 256 +++++---
tools/virsh-network.c | 230 +++++--
tools/virsh-nodedev.c | 144 +++--
tools/virsh-nwfilter.c | 92 ++-
tools/virsh-pool.c | 331 +++++++---
tools/virsh-secret.c | 109 +++-
tools/virsh-snapshot.c | 182 ++++--
tools/virsh-volume.c | 276 +++++++--
tools/virsh.c | 97 ++-
12 files changed, 2631 insertions(+), 915 deletions(-)
--
1.8.0.2
2
17
13 Feb '13
Not only does this solve the compiler warning on 32-bit machines,
but it completely gets rid of what looks like bogus pointer aliasing,
all while reducing the number of lines in xen_hypervisor.c.
Eric Blake (3):
util: add virendian.h macros
util: use new virendian.h macros
xen: clean up the mess with cpumap
.gitignore | 1 +
src/Makefile.am | 1 +
src/cpu/cpu_x86.c | 24 ++++------
src/util/virendian.h | 93 +++++++++++++++++++++++++++++++++++++++
src/util/virstoragefile.c | 109 ++++++++++------------------------------------
src/xen/xen_hypervisor.c | 16 +++----
tests/Makefile.am | 8 +++-
tests/virendiantest.c | 102 +++++++++++++++++++++++++++++++++++++++++++
8 files changed, 239 insertions(+), 115 deletions(-)
create mode 100644 src/util/virendian.h
create mode 100644 tests/virendiantest.c
--
1.8.1.2
2
7
On RHEL 5, I got:
security/security_selinux.c: In function 'getContext':
security/security_selinux.c:971: warning: unused parameter 'mgr' [-Wunused-parameter]
* src/security/security_selinux.c (getContext): Mark potentially
unused parameter.
---
Pushing under the build-breaker rule.
src/security/security_selinux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 2a9333c..8173b20 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 Red Hat, Inc.
+ * Copyright (C) 2008-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -968,7 +968,7 @@ virSecuritySELinuxFSetFilecon(int fd, char *tcon)
/* Set fcon to the appropriate label for path and mode, or return -1. */
static int
-getContext(virSecurityManagerPtr mgr,
+getContext(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
const char *newpath, mode_t mode, security_context_t *fcon)
{
#if HAVE_SELINUX_LABEL_H
--
1.8.1.2
1
0
12 Feb '13
This is a rework of a couple of patches. Initially the changes were to
just remove some Coverity warnings; however, it was pointed out that each
of the xen drivers could use some cleanup since they were duplicating
checks in libvirt.c, see:
https://www.redhat.com/archives/libvir-list/2013-January/msg01038.html
https://www.redhat.com/archives/libvir-list/2013-January/msg01057.html
While I was at it - I cleaned up some of the function headers.
Additionally, a revisit of a change to add Coverity false positive tags
to the v0 & v1 xen_hypervisor cpumap manipulation, see:
https://www.redhat.com/archives/libvir-list/2013-January/msg01527.html
and followups.
John Ferlan (11):
xs: Remove redundant validity checks
xs: Code cleanup
inotify: Code cleanup
xm: Remove redundant validity checks
xm: Clean up
xend: Remove redundant validity checks
xend: Fix a memory leak found by Coverity
xend: Clean up
hypervisor: Remove redundant validity checks
hypervisor: Clean up
hypervisor: Revisit Coverity issues regarding cpumap
src/xen/xen_hypervisor.c | 220 ++++++++--------------------------
src/xen/xen_inotify.c | 48 ++++----
src/xen/xend_internal.c | 303 ++++++++++++++---------------------------------
src/xen/xm_internal.c | 195 ++++++++++++++----------------
src/xen/xs_internal.c | 239 +++++++++++--------------------------
5 files changed, 325 insertions(+), 680 deletions(-)
--
1.7.11.7
4
29
'make check' has been failing on VPATH builds since commit
907a39e7. The tests already had magic for munging path names,
but were munging to the wrong location, thus working only on
an in-tree build.
* tests/securityselinuxlabeltest.c (testSELinuxMungePath): Munge
to correct path.
---
Pushing under the build-breaker rule.
tests/securityselinuxlabeltest.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index c0bb09b..7445ab6 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Red Hat, Inc.
+ * Copyright (C) 2011-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -61,7 +61,7 @@ testSELinuxMungePath(char **path)
char *tmp;
if (virAsprintf(&tmp, "%s/securityselinuxlabeldata%s",
- abs_srcdir, *path) < 0) {
+ abs_builddir, *path) < 0) {
virReportOOMError();
return -1;
}
--
1.7.1
1
0
* docs/news.html.in: Use correct release year.
---
Pushing under the trivial rule.
docs/news.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/news.html.in b/docs/news.html.in
index 48a039a..5f51dac 100644
--- a/docs/news.html.in
+++ b/docs/news.html.in
@@ -8,7 +8,7 @@
<p>Here is the list of official releases, it is also possible to just use the <a href="downloads.html">GIT version or snapshot</a>, contact the mailing list
and check the <a href="http://libvirt.org/git/?p=libvirt.git;a=log">GIT log</a> to gauge progress.</p>
- <h3>1.0.2: Jan 30 2012</h3>
+ <h3>1.0.2: Jan 30 2013</h3>
<ul>
<li> Features:<br/>
LXC improvements (Daniel P. Berrange),<br/>
--
1.8.1.2
1
0
12 Feb '13
Broken by incorrect formatting / spelling of remote_nonnull in commit
39758e7567b766f1df3948ea671d6ccb93daf7a9
---
Pushed under build breaker rule
src/remote_protocol-structs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index b8ca88b..7f5ff7a 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -1401,9 +1401,9 @@ struct remote_node_device_lookup_by_name_ret {
remote_nonnull_node_device dev;
};
struct remote_node_device_lookup_scsi_host_by_wwn_args {
- remote_nonull_string wwnn;
- remote_nonull_string wwpn;
- unsigned int flags;
+ remote_nonnull_string wwnn;
+ remote_nonnull_string wwpn;
+ u_int flags;
};
struct remote_node_device_lookup_scsi_host_by_wwn_ret {
remote_nonnull_node_device dev;
--
1.8.1
1
0
Fixes compilation on 32bit platforms:
xen/xen_hypervisor.c: In function 'virXen_setvcpumap':
xen/xen_hypervisor.c:1785:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
xen/xen_hypervisor.c:1785:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
---
src/xen/xen_hypervisor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 9b7dd2e..e3de0b2 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1782,7 +1782,7 @@ virXen_setvcpumap(int handle,
memset(&xen_cpumap, 0, sizeof(cpumap_t));
for (j = 0; j < maplen; j++) {
if ((j & 7) == 0)
- pm = (uint64_t *)((uint64_t)&xen_cpumap + (j & ~0x7UL));
+ pm = (uint64_t *)((intptr_t)&xen_cpumap + (j & ~0x7UL));
*pm |= (uint64_t)cpumap[j] << (8 * (j & 7));
}
--
1.7.10.4
2
1