[PATCH v1] libxl: fix refcounting in libxlDomainChangeEjectableMedia

Olaf Hering olaf at aepfle.de
Tue May 18 19:26:31 UTC 2021


The initial variant of libxlDomainChangeEjectableMedia could just leave
the function earlier. With refcounting this does not work anymore.

Fixes commit a5bf06ba34dbb226ac1b2fb63f5026c5d493bc65

Signed-off-by: Olaf Hering <olaf at aepfle.de>
---
 src/libxl/libxl_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 99a170ff2a..d54cd41785 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2997,7 +2997,7 @@ libxlDomainChangeEjectableMedia(virDomainObj *vm, virDomainDiskDef *disk)
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Removable media not supported for %s device"),
                        virDomainDiskDeviceTypeToString(disk->device));
-        return -1;
+        goto cleanup;
     }
 
     if (libxlMakeDisk(disk, &x_disk) < 0)




More information about the libvir-list mailing list