]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainAttachDeviceDiskLiveInternal: Add missing jump to 'cleanup' on error
authorPeter Krempa <pkrempa@redhat.com>
Tue, 21 Nov 2023 15:51:12 +0000 (16:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 23 Nov 2023 13:31:05 +0000 (14:31 +0100)
Commit allowing hotplug of CDROMs moved the logic forbidding the hotplug
to the appropriate blocks based on the disk frontend but forgot to
actually bail out on such error.

Fixes: 3078799fef82d45ac10624e3bacded7a285d8a4f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c

index 2d55d1d21e037382130532742d0d52b91610d3fd..80a39c159f43554677a6f01c4e8fb684293e2536 100644 (file)
@@ -944,6 +944,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
         if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                            _("cdrom device with virtio bus isn't supported"));
+            goto cleanup;
         }
         if (qemuDomainEnsureVirtioAddress(&releaseVirtio, vm, dev) < 0)
             goto cleanup;