Re: [libvirt] [PATCH 14/14] Add support for network device detach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 20, 2009 at 02:23:20PM +0100, Mark McLoughlin wrote:
> On Mon, 2009-07-20 at 15:05 +0200, Daniel Veillard wrote:
> > 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.
> 
> Looking at the code, I think the only other possible error currently is
> "empty slot". I'll address that in a follow up patch.
> 
> The current monitor protocol sucks because we don't actually have an
> error indication. For this command, we could probably say that any
> response indicates an error but you can be sure some future version of
> qemu would then add a success message :-)

  Argh, okay ... :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]