[libvirt] [PATCH] Fix QEMU domain status after restore.

When doing a restore, we were forgetting to update the state file for the VM. That means that if you do a save/restore, then shut down libvirtd, then start it back up, you'll see the state of the guest as "paused", even though it is really running. We were just forgetting a "virDomainSaveStatus" call in the restor path. Signed-off-by: Chris Lalancette <clalance@redhat.com> --- src/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 1fb2417..d789c4d 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -4099,6 +4099,7 @@ static int qemudDomainRestore(virConnectPtr conn, } VIR_FREE(info); vm->state = VIR_DOMAIN_RUNNING; + virDomainSaveStatus(conn, driver->stateDir, vm); } ret = 0; -- 1.6.0.6

On Fri, Aug 07, 2009 at 03:42:46PM +0200, Chris Lalancette wrote:
When doing a restore, we were forgetting to update the state file for the VM. That means that if you do a save/restore, then shut down libvirtd, then start it back up, you'll see the state of the guest as "paused", even though it is really running. We were just forgetting a "virDomainSaveStatus" call in the restor path.
Signed-off-by: Chris Lalancette <clalance@redhat.com> --- src/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 1fb2417..d789c4d 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -4099,6 +4099,7 @@ static int qemudDomainRestore(virConnectPtr conn, } VIR_FREE(info); vm->state = VIR_DOMAIN_RUNNING; + virDomainSaveStatus(conn, driver->stateDir, vm); } ret = 0;
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Fri, Aug 07, 2009 at 03:42:46PM +0200, Chris Lalancette wrote:
When doing a restore, we were forgetting to update the state file for the VM. That means that if you do a save/restore, then shut down libvirtd, then start it back up, you'll see the state of the guest as "paused", even though it is really running. We were just forgetting a "virDomainSaveStatus" call in the restor path.
Signed-off-by: Chris Lalancette <clalance@redhat.com> --- src/qemu_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 1fb2417..d789c4d 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -4099,6 +4099,7 @@ static int qemudDomainRestore(virConnectPtr conn, } VIR_FREE(info); vm->state = VIR_DOMAIN_RUNNING; + virDomainSaveStatus(conn, driver->stateDir, vm); } ret = 0;
ACK
Daniel
Committed. -- Chris Lalancette
participants (2)
-
Chris Lalancette
-
Daniel P. Berrange