From nobody Tue May 14 01:31:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621366036; cv=none; d=zohomail.com; s=zohoarc; b=IdhQtUMPC/7yfJawYP/G9jgoe68yLLkJwJj0PZqC8dfjnQDGvFz/VIooeRPViSpgXKmDmdrpfKVkFy7TangVuBa8BsAaW0cB9jhJjTFU2/89sGDINAw9PRugeHv/kNyZmSABRIZf5/FLku+a+nCzRiiajUpgeiElX89CKTkeV64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621366036; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=7mmrh132pwwljulyNN0NK5poENZQoXp1p5hV6Mr2dlw=; b=ehUrcjhVLoku6LcvZScfQfdebjk+4vuwZLzfkSr/YJJNvH+Ck4oHw9n5g5Zl6dgE1CHYrcDXUSSr09aAST8yqy/KwpJOrD+rTS/B1028UdXlqo3BB3ivBHPcGb+KX5ndkMRSOaW/xVGqiEAn7Kwke0LKtdWjmrs7a+Uk5q6Eieo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621366036213723.9433128351071; Tue, 18 May 2021 12:27:16 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-36MfDB0AN1qsodEXHAu92Q-1; Tue, 18 May 2021 15:27:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD7771005D50; Tue, 18 May 2021 19:27:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8F1539A61; Tue, 18 May 2021 19:27:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0166959CCE; Tue, 18 May 2021 19:26:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14IJQlds020824 for ; Tue, 18 May 2021 15:26:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id DA5316E1BB; Tue, 18 May 2021 19:26:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D47ACFC73A for ; Tue, 18 May 2021 19:26:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDB71858F0D for ; Tue, 18 May 2021 19:26:40 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-289-qQLNID3POqiZhnUNmW6CJQ-1; Tue, 18 May 2021 15:26:37 -0400 Received: from sender by smtp.strato.de (RZmta 47.26.1 AUTH) with ESMTPSA id c0ae88x4IJQY12W (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 18 May 2021 21:26:34 +0200 (CEST) X-MC-Unique: 36MfDB0AN1qsodEXHAu92Q-1 X-MC-Unique: qQLNID3POqiZhnUNmW6CJQ-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAgs09ValFcstyKtnZMLOo4jr88Zf5nXI1mYJUK+h" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1] libxl: fix refcounting in libxlDomainChangeEjectableMedia Date: Tue, 18 May 2021 21:26:31 +0200 Message-Id: <20210518192631.5054-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jim Fehlig --- 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, vir= DomainDiskDef *disk) virReportError(VIR_ERR_INTERNAL_ERROR, _("Removable media not supported for %s device"), virDomainDiskDeviceTypeToString(disk->device)); - return -1; + goto cleanup; } =20 if (libxlMakeDisk(disk, &x_disk) < 0)