]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Init ext devices paths on reconnect
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2022 12:08:39 +0000 (13:08 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2022 13:25:25 +0000 (14:25 +0100)
Paths for external devices (well, so far only vTPM) are not
stored in the status XML. Therefore, we need to regenerate them
after we've been restarted and reconnecting to a running domain.
Otherwise these will remain NULL which may later lead to a NULL
dereference.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2150760
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index 19b924262353be7db959987bf64d61d89f56a586..c542be5036c5695b5ebd65f835298540abb8d787 100644 (file)
@@ -8896,6 +8896,9 @@ qemuProcessReconnect(void *opaque)
     if (qemuDomainMasterKeyReadFile(priv) < 0)
         goto error;
 
+    if (qemuExtDevicesInitPaths(driver, obj->def) < 0)
+        goto error;
+
     /* If we are connecting to a guest started by old libvirt there is no
      * allowReboot in status XML and we need to initialize it. */
     qemuProcessPrepareAllowReboot(obj);