[PATCH v1] libxl: fix refcounting in libxlDomainChangeEjectableMedia

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@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)

On 5/18/21 1:26 PM, Olaf Hering wrote:
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@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
--- 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)
participants (2)
-
Jim Fehlig
-
Olaf Hering