]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Remove interface backend only after frontend is gone
authorJiri Denemark <jdenemar@redhat.com>
Tue, 27 May 2014 09:50:41 +0000 (11:50 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 3 Jun 2014 08:58:06 +0000 (10:58 +0200)
commit81f765985ed9c3ab5de9211394392dec4089a66d
tree66b32610f25a60e98f127a3f47833217e6158817
parent8ed19d8cc5ddc94256f8cc08424aa8f74c12eb60
qemu: Remove interface backend only after frontend is gone

[1] reported that we are removing network's backend too early. I didn't
really get the reproducer but libvirt behaves strangely when a guest
does not confirm the removal, e.g., it does not support PCI hotplug. In
such case, detaching a network device leaves its frontend in place but
removes the backend, which makes the device unusable for the guest.
Moreover attaching the same device again succeeds and both the guest and
libvirt will see two network interfaces attached but only one of them is
actually working.

I checked with Paolo Bonzini and he confirmed we should only remove a
backend after seeing DEVICE_DELETED event for a corresponding frontend.

[1] https://www.redhat.com/archives/libvir-list/2014-March/msg01740.html

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_hotplug.c