[libvirt] [PATCH] qemu: prevent termination of guests w/hostdev on driver reconnect

This should resolve: https://bugzilla.redhat.com/show_bug.cgi?id=959191 The problem was that qemuUpdateActivePciHostdevs was returning 0 (success) when no hostdevs were present, but would otherwise return -1 (failure) even when it completed successfully. It is only called from qemuProcessReconnect(), and when qemuProcessReconnect got back an error, it would not only stop reconnecting, but would terminate the guest qemu process "to remove danger of it ending up running twice if user tries to start it again later". (This bug was introduced in commit 011cf7ad, which was pushed between v1.0.2 and v1.0.3, so all maintenance branches from v1.0.3 up to 1.0.5 will need this one line patch applied.) --- src/qemu/qemu_hostdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 48750c3..5b89bb6 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -176,6 +176,7 @@ int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver, } } + ret = 0; cleanup: virObjectUnlock(driver->activePciHostdevs); virObjectUnlock(driver->inactivePciHostdevs); -- 1.7.11.7

On 05/31/2013 12:53 PM, Laine Stump wrote:
This should resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=959191
The problem was that qemuUpdateActivePciHostdevs was returning 0 (success) when no hostdevs were present, but would otherwise return -1 (failure) even when it completed successfully. It is only called from qemuProcessReconnect(), and when qemuProcessReconnect got back an error, it would not only stop reconnecting, but would terminate the guest qemu process "to remove danger of it ending up running twice if user tries to start it again later".
(This bug was introduced in commit 011cf7ad, which was pushed between v1.0.2 and v1.0.3, so all maintenance branches from v1.0.3 up to 1.0.5 will need this one line patch applied.) --- src/qemu/qemu_hostdev.c | 1 + 1 file changed, 1 insertion(+)
ACK, and thanks for tracking this down. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 05/31/2013 02:55 PM, Eric Blake wrote:
On 05/31/2013 12:53 PM, Laine Stump wrote:
This should resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=959191
The problem was that qemuUpdateActivePciHostdevs was returning 0 (success) when no hostdevs were present, but would otherwise return -1 (failure) even when it completed successfully. It is only called from qemuProcessReconnect(), and when qemuProcessReconnect got back an error, it would not only stop reconnecting, but would terminate the guest qemu process "to remove danger of it ending up running twice if user tries to start it again later".
(This bug was introduced in commit 011cf7ad, which was pushed between v1.0.2 and v1.0.3, so all maintenance branches from v1.0.3 up to 1.0.5 will need this one line patch applied.) --- src/qemu/qemu_hostdev.c | 1 + 1 file changed, 1 insertion(+) ACK, and thanks for tracking this down.
Thanks. I pushed this to master and also to v1.0.3-maint, v1.0.4-maint, and v1.0.5-maint
participants (2)
-
Eric Blake
-
Laine Stump