]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Refresh state after restore from a save image
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 18 Oct 2022 07:44:54 +0000 (09:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Oct 2022 06:48:14 +0000 (08:48 +0200)
When restoring a domain from a save image, we need to query QEMU
for some runtime information that is not stored in status XML, or
even if it is, it's not parsed (e.g. virtio-mem actual size, or
soon rx-filters for macvtaps).

During migration, this is done in qemuMigrationDstFinishFresh(),
or in case of newly started domain in qemuProcessStart(). Except,
the way that the code is written, when restoring from a save
image (which is effectively a migration), the state is never
refreshed, because qemuProcessStart() sees incoming migration so
it does not refresh the state thinking it'll be done in the
finish phase. But restoring from a save image has no finish
phase. Therefore, refresh the state explicitly after the domain
was restored but before vCPUs are resumed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_saveimage.c

index 79567bf17d96d0320cdc119de7786cd97ddd33b7..ef623037283a149bad007e1bc177715ada07d377 100644 (file)
@@ -672,6 +672,8 @@ qemuSaveImageStartVM(virConnectPtr conn,
                                      VIR_DOMAIN_EVENT_STARTED_RESTORED);
     virObjectEventStateQueue(driver->domainEventState, event);
 
+    if (qemuProcessRefreshState(driver, vm, asyncJob) < 0)
+        goto cleanup;
 
     /* If it was running before, resume it now unless caller requested pause. */
     if (header->was_running && !start_paused) {