From: Chris Lalancette Date: Fri, 22 Jan 2010 17:39:15 +0000 (+0100) Subject: Fix libvirtd restart for domains with PCI passthrough devices X-Git-Tag: v0.7.6~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdc42d0a4865199a941d330dbb6ca1ef426323ae;p=thirdparty%2Flibvirt.git Fix libvirtd restart for domains with PCI passthrough devices When libvirtd shuts down, it places a tag in the XML state file it writes out for guests with PCI passthrough devices. For devices that are attached at bootup time, the state tag is empty. However, at libvirtd startup time, it ignores anything with a tag in the XML, effectively hiding the guest. This patch remove the check for VIR_DOMAIN_XML_INTERNAL_STATUS when parsing the XML. * src/conf/domain_conf.c: remove VIR_DOMAIN_XML_INTERNAL_STATUS flag check in virDomainHostdevSubsysPciDefParseXML() --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 74c233732f..595c46cafb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2876,7 +2876,7 @@ static int virDomainHostdevSubsysPciDefParseXML(virConnectPtr conn, const xmlNodePtr node, virDomainHostdevDefPtr def, - int flags) { + int flags ATTRIBUTE_UNUSED) { int ret = -1; xmlNodePtr cur; @@ -2890,8 +2890,7 @@ virDomainHostdevSubsysPciDefParseXML(virConnectPtr conn, if (virDomainDevicePCIAddressParseXML(conn, cur, addr) < 0) goto out; - } else if ((flags & VIR_DOMAIN_XML_INTERNAL_STATUS) && - xmlStrEqual(cur->name, BAD_CAST "state")) { + } else if (xmlStrEqual(cur->name, BAD_CAST "state")) { /* Legacy back-compat. Don't add any more attributes here */ char *devaddr = virXMLPropString(cur, "devaddr"); if (devaddr &&