On Mon, Jul 20, 2009 at 12:51:24PM +0100, Mark McLoughlin wrote:
qemu network devices are hot-unplugged in two stages - first the PCI
NIC
is removed using 'pci_del <pci_addr>' and then the backend is removed
using 'host_net_remove <vlan> <name>'.
In order to perform these operations we need to have retained the
PCI address, backend name and vlan number.
[...]
+ DEBUG("%s: pci_del reply: %s", vm->def->name,
reply);
+
+ /* If the command fails due to a wrong PCI address qemu prints
+ * 'invalid pci address'; nothing is printed on success */
+ if (strstr(reply, "Invalid pci address")) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ _("failed to detach network device: invalid PCI address
%s: %s"),
+ detach->pci_addr, reply);
+ goto cleanup;
+ }
Hum, is that the only possible source of error ? Seems trying to
detect failure and then possibly 'invalid pci address' as a reason
would be more reliable.
Otherwise looks fine, ACK,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/