From nobody Sat May 4 05:52:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579795048; cv=none; d=zohomail.com; s=zohoarc; b=n07qBljMOe4xEcp0P47t12FpwKfL1DJhEWfzXqz4OmrkmAXkjk9JpJ8JQkzspzT+/NKqulu6LqN4l4fIQzA62SrRa7heRI7rCjU6ksFzAFDW6izdFfGWueE665uVocVD0Ee4xd6TJLvBVmFOF2DarS8lwNGKTdPcV73BDCO58EY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795048; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Hx3IgAhYtORLJptT32pGtQGVmAH1aiSiRNOlYy7DgLU=; b=Dttqr7NdIl4eHiSLwGh4Re0ym/yro1Ur4+UKP5ODg/jRHJCwt+N/qpKz5ZJUlhHYI91BOcVxl1uAMFvhvuK0iTvNqD6SDgJQ7gyC8//kp6mfvB6kXqXQ3c3vOwQp7hbWDd7MV3O/gDmv0h3ZRD8jTuBqVg+LD2RDcm+xwkeK7ao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579795048446443.65720987838415; Thu, 23 Jan 2020 07:57:28 -0800 (PST) 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-316-9PDcQwybPoCKD1x6Yd1__g-1; Thu, 23 Jan 2020 10:57:24 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD6B9107ACC4; Thu, 23 Jan 2020 15:57:18 +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 4E4B65D9E2; Thu, 23 Jan 2020 15:57:18 +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 BB8DD8594A; Thu, 23 Jan 2020 15:57:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NFvDAj012634 for ; Thu, 23 Jan 2020 10:57:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1F60E28990; Thu, 23 Jan 2020 15:57:13 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75EBB38F; Thu, 23 Jan 2020 15:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579795047; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Hx3IgAhYtORLJptT32pGtQGVmAH1aiSiRNOlYy7DgLU=; b=Yrm7vaFwaWi3moiZOcnIwBrLmsqg6w1eJjRkqMBJjEXVPj/9wW4DGnJcq3PFtW/m92BQWC LXhIcxN3yw9qAWmypV1csUj9bzn8jN4JfDV3sFjEFZUAWsbKkTk8+akYB65GTxKIIzzzBk g/clkrBB2QPtX1yM7U4N4TIAa7xsp0I= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] qemu: blockcopy: Actually unplug unused images when mirror job fails to start Date: Thu, 23 Jan 2020 16:57:02 +0100 Message-Id: <4076e76ab8218a7759e2e491a970bbd4eabe6f4c.1579794423.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.14 X-MC-Unique: 9PDcQwybPoCKD1x6Yd1__g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If a mirror job fails to start in -blockdev mode we'd not unplug the backing files we added first because the code on the error path checked the wrong value. 'rc' is used as status of the code which added the images, but the state of the 'block(dev)-mirror' call is stored in 'ret' at that point. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0a1dc414ae..3218dc0e23 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18413,7 +18413,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, qemuBlockJobStarted(job, vm); endjob: - if (rc < 0 && + if (ret < 0 && virDomainObjIsActive(vm) && (data || crdata)) { qemuDomainObjEnterMonitor(driver, vm); --=20 2.24.1 From nobody Sat May 4 05:52:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579795048; cv=none; d=zohomail.com; s=zohoarc; b=jr1Pje6p2LPrWcNDy5QsJncEb4Y2MwkpM9s5OukbRbBp4EUGGAHAzGheioboRH5QdKNfrkrcyiO1umxQcDTj5A7Vx/FDVpxWWqz1bUofOSR8wK3OXVYEGK+1uyIsm7k9lyOayEQLh0aRLvqC9SNgEGrW8Wzmbl0PHs6iiXjXibw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795048; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9YM12yhxZksqdGkxzVqb3Ut8H2hxDstpKGAcCUlmJtM=; b=GuHpzzNbgHxiYko9iwhf9qUOOl1yK8p6W//CgGnjkbEfBZvjf5QHUHYE+X+Puxkvq7vdaUJCqdWD/PvhjifAOUygVHl8XfjkmFwcPMd15HzOtYN29aFBAePrO5duhggusGmuX7b/vS9Q2XYmulDsnwobUzaMCxt6nzHq4Ij3hLE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579795048161823.6479579816821; Thu, 23 Jan 2020 07:57:28 -0800 (PST) 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-170-WGjsAcivNQ6rl26O_vjjcQ-1; Thu, 23 Jan 2020 10:57:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AACD100550E; Thu, 23 Jan 2020 15:57:19 +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 D44FC5C545; Thu, 23 Jan 2020 15:57:18 +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 BBA0F8594B; Thu, 23 Jan 2020 15:57:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NFvECw012645 for ; Thu, 23 Jan 2020 10:57:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1431038F; Thu, 23 Jan 2020 15:57:14 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BD4F19C69; Thu, 23 Jan 2020 15:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579795047; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9YM12yhxZksqdGkxzVqb3Ut8H2hxDstpKGAcCUlmJtM=; b=d8sH/xQpX9S+PxVJA85OK+m/vPhR4wpxqaOm/3nWIv+k75OPjAqT38/Und7MN+xPsgLiDK ba2fI9fQ8zC2m+cGEEMZntI4hKLl3fEbpSxMbkGne1gnkTv7mrp+W2GOvcJSX/9kEQtcEq Jc96HRyQVE0ZrqQb3uL3qB+ULxMgBzI= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/4] qemu: domain: Extract code to determine topmost nodename to qemuDomainDiskGetTopNodename Date: Thu, 23 Jan 2020 16:57:03 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.16 X-MC-Unique: WGjsAcivNQ6rl26O_vjjcQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are more places which require getting the topmost nodename to be passed to qemu. Separate it out into a new function. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 38 ++++++++++++++++++++++++++------------ src/qemu/qemu_domain.h | 4 ++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 38addc7b61..4604b6c993 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11530,6 +11530,31 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driv= er, } +/** + * qemuDomainDiskGetTopNodename: + * + * @disk: disk definition object + * + * Returns the pointer to the node-name of the topmost layer used by @disk= as + * backend. Currently returns the nodename of the copy-on-read filter if e= nabled + * or the nodename of the top image's format driver. Empty disks return NU= LL. + * This must be used only when VIR_QEMU_CAPS_BLOCKDEV is enabled. + */ +const char * +qemuDomainDiskGetTopNodename(virDomainDiskDefPtr disk) +{ + qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + + if (virStorageSourceIsEmpty(disk->src)) + return NULL; + + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON) + return priv->nodeCopyOnRead; + + return disk->src->nodeformat; +} + + /** * qemuDomainDiskGetBackendAlias: * @disk: disk definition @@ -11549,8 +11574,6 @@ qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr d= isk, virQEMUCapsPtr qemuCaps, char **backendAlias) { - qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); - const char *nodename =3D NULL; *backendAlias =3D NULL; if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { @@ -11560,16 +11583,7 @@ qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr = disk, return 0; } - if (virStorageSourceIsEmpty(disk->src)) - return 0; - - if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON) - nodename =3D priv->nodeCopyOnRead; - else - nodename =3D disk->src->nodeformat; - - *backendAlias =3D g_strdup(nodename); - + *backendAlias =3D g_strdup(qemuDomainDiskGetTopNodename(disk)); return 0; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 21ece23177..c8bf621c61 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -874,6 +874,10 @@ int qemuDomainStorageFileInit(virQEMUDriverPtr driver, virStorageSourcePtr parent); char *qemuDomainStorageAlias(const char *device, int depth); +const char * +qemuDomainDiskGetTopNodename(virDomainDiskDefPtr disk) + ATTRIBUTE_NONNULL(1); + int qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps, char **backendAlias) --=20 2.24.1 From nobody Sat May 4 05:52:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579795063; cv=none; d=zohomail.com; s=zohoarc; b=Ilr4MAXWZVhya7jimL0BCydjvjDKjZMfLv3aBtD6qCqjSpRaiZqJrUtDKIuFp5S0wLxyITpQ5hn1m1ahGLu2HNfcHJYAkpzJSo1mq5bh5xmju0U4oUYpsV4XY8xXgO+BG8GCAfFuX3lzkkW94KF8cQMx0ztE1uGIbISLv2fkFW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795063; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fbPxDGu0IQBxhvUGcDltVqcwfv82m/ZHgdukY/IVrNE=; b=ELZO4te2ydbFoikOi4y254fNuTilZ2e+vzY32caCubHR1Ijq3rwmQg9NtiNdETiO16q8EBCDSGdY7MX/gFGn2K7A8S3cTg1OpBed4I6JbF1bfBrjhX/XELcv03o1IhX2wyvaNfxN5DhNVqORQB5vmeTm+MNIN+ZCbwvmv6Cly4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579795063314888.2228701948642; Thu, 23 Jan 2020 07:57:43 -0800 (PST) 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-412-K9rbv8bWMRi_GutWStooYw-1; Thu, 23 Jan 2020 10:57:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A0418010D0; Thu, 23 Jan 2020 15:57:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64AEF1001DC0; Thu, 23 Jan 2020 15:57:34 +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 272EC1832DEA; Thu, 23 Jan 2020 15:57:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NFvFsx012651 for ; Thu, 23 Jan 2020 10:57:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0ACC238F; Thu, 23 Jan 2020 15:57:15 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 617CE19C69; Thu, 23 Jan 2020 15:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579795062; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fbPxDGu0IQBxhvUGcDltVqcwfv82m/ZHgdukY/IVrNE=; b=foRAu1i4EpKXFhvi4/T1UEC02Pidj9vGUo+LphuBUh5JdpAQk2xUjjKLuKpXkIy6l1Rhnf DYeZwLKxX28CbrjpCqZP4xlGv0pYSlsxpWXtAcJiTg7dcexpr3qQ6uUutOi3EjtDVYTwii 0YQK6MhfvPJh1wC24hhfvp1Uo/FdRCs= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/4] qemu: Fix value of 'device' argument for blockdev-mirror Date: Thu, 23 Jan 2020 16:57:04 +0100 Message-Id: <5a182aeb2aac6c498230ccebdb74bffa10f4cdc2.1579794423.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.84 on 10.5.11.22 X-MC-Unique: K9rbv8bWMRi_GutWStooYw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When using blockdev configurations the 'device' argument of 'blockdev-mirror' must correspond to the topmost node in the block node graph. Libvirt didn't do this properly in case when 'copy_on_read' option was enabled on the disk. Use qemuDomainDiskGetTopNodename to fix it for the blockdev-mirror calls in qemuDomainBlockCopy and the non-shared-storage migration. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_migration.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3218dc0e23..9e2a94306c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18386,7 +18386,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, if (blockdev) { ret =3D qemuMonitorBlockdevMirror(priv->mon, job->name, true, - disk->src->nodeformat, + qemuDomainDiskGetTopNodename(disk), mirror->nodeformat, bandwidth, granularity, buf_size, mirror_shal= low); } else { diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 29d228a8d9..d7814208a2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -931,7 +931,7 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driv= er, if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { jobname =3D diskAlias; - sourcename =3D disk->src->nodeformat; + sourcename =3D qemuDomainDiskGetTopNodename(disk); persistjob =3D true; } else { jobname =3D NULL; --=20 2.24.1 From nobody Sat May 4 05:52:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579795065; cv=none; d=zohomail.com; s=zohoarc; b=iwQa6EgbGXN+eiXbRZgxsDDOFkvkb1cI6QZ7sX6VptmMYRqVIbrhBGxT4anAOX4YgejFxDns9GBsa++KPe9Zf50HvvS/YoEKJxaGMcUgpTth4w8OWqtMlx1CZ4fgd2vtnxc2y3gbjKOojrUyyqmqIcCtEDEoYLFCc6T1gV9MfwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=C3S/9f8YoOIsPW/WD0hf5wD6guPToKptfqvLEvRj4uI=; b=JmcyrURlGfmD6U56iLVrUZnYuXtCgFVcZ8bnTH5oN1CIu0sUQbrarqym12h4YrmyFEBPK2P9SsW+sbFy21AvCW8KKWGIbvlf1sHtA/rfLPaZ0e9b9/uOVWeO7IL7PBLJAgB6sVHMS15M/LWmd9SmLXlyYBZpY1QBvaKlxsWN50U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579795065881943.26111344261; Thu, 23 Jan 2020 07:57:45 -0800 (PST) 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-68-0HsSuLECMwKQ6RZCD_jiYQ-1; Thu, 23 Jan 2020 10:57:41 -0500 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 D7067DBA3; Thu, 23 Jan 2020 15:57:35 +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 A2BCC85753; Thu, 23 Jan 2020 15:57:35 +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 4FF978594A; Thu, 23 Jan 2020 15:57:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NFvHXB012669 for ; Thu, 23 Jan 2020 10:57:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id B51B938F; Thu, 23 Jan 2020 15:57:17 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16C8919C69; Thu, 23 Jan 2020 15:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579795063; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=C3S/9f8YoOIsPW/WD0hf5wD6guPToKptfqvLEvRj4uI=; b=WXoucbnzFnyPNUnFtZa4Q3cgj0/hkE2Psvdd6kHxleD7R5oQzPJ7CLMQEGKDgsuAHZPxjo jA4iSBDD+76oWRSz36ilNff/mzjXbzQlD4lBERqmAuZ9n0EO8j5h4WMN17OaRhJt5l0Qff 9RDY/KdVkkWq2HXhmFSAQwXOcwOQfZ0= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/4] qemu: Fix value of 'device' argument for block-commit Date: Thu, 23 Jan 2020 16:57:05 +0100 Message-Id: <68e9eb39123199808c40ad7d4498fb588b0bcca6.1579794423.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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 X-MC-Unique: 0HsSuLECMwKQ6RZCD_jiYQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When using blockdev configurations the 'device' argument of 'blockdev-commit' must correspond to the topmost node in the block node graph. Libvirt didn't do this properly in case when 'copy_on_read' option was enabled on the disk. Use qemuDomainDiskGetTopNodename to fix it when calling block-commit. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9e2a94306c..0b23c747ce 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18813,7 +18813,7 @@ qemuDomainBlockCommit(virDomainPtr dom, jobname =3D job->name; nodetop =3D topSource->nodeformat; nodebase =3D baseSource->nodeformat; - device =3D disk->src->nodeformat; + device =3D qemuDomainDiskGetTopNodename(disk); if (!backingPath && top_parent && !(backingPath =3D qemuBlockGetBackingStoreString(baseSource))) goto endjob; --=20 2.24.1