From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1582897246; cv=none; d=zohomail.com; s=zohoarc; b=FT/8S+7ryDiiUlTqI1o+GGfT6UReKZ9Wcqs7jCArBhGxyDSSFI9PFn+cxYU3QwbevfYtdEAYUFEarSzF21f2HbCxtCQhs0qYUf2rKiunB3phv+gVrcZ66f8onYyjJtNaQrCtz+zVrPuG8xYWwGUZ6Dh8pcQhxurYShJnrL1uv7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897246; h=Content-Type:Content-Transfer-Encoding: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=69neW6+CRxah2STW31NBezHPZQr0q3Ca6HzTnlSk3yc=; b=mS9PgzR/ZHRsWstybbbvF2fqQ7IgIueh2n9pRPVBx2ll3pRK+pAKBsZDlTC+VaICYoz6Aos3FU6hl0U4Zi3zn1dqx8nNegPoyWDW8t5lwtIsIVGzzAhMjDW7cA1DmLP22+KVqEYyIpsPCGg8YPgaAO3Hk8NJ4o9+oS0+BvrI2Rs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582897246608188.5167977879696; Fri, 28 Feb 2020 05:40:46 -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-337-FUQ7rLq5NwqYLXDVzXM3gw-1; Fri, 28 Feb 2020 08:40:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E39F6107ACCD; Fri, 28 Feb 2020 13:40:35 +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 BD57C92D07; Fri, 28 Feb 2020 13:40: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 78D0218034ED; Fri, 28 Feb 2020 13:40:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe5W4025636 for ; Fri, 28 Feb 2020 08:40:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7EB9A101D481; Fri, 28 Feb 2020 13:40:05 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03E2A1001B2C for ; Fri, 28 Feb 2020 13:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897245; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=69neW6+CRxah2STW31NBezHPZQr0q3Ca6HzTnlSk3yc=; b=eyAxVuIDBb8T12a3qSKUqdNOgh+uBMcsmi8YslDwwl+iscQm35unYGVnXVcpUluE2mOTXa nY+rX4uhJaTVlIba5u5i2zbB2OLinVQdSo/esOgqMOwd7uqgzLHR7wxGDRpXNUU+shuhYy yIpIRti9fInxHfDTWsjn4DKLg9KQJPk= X-MC-Unique: FUQ7rLq5NwqYLXDVzXM3gw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/8] qemu: capabilities: Add QEMU_CAPS_BLOCKDEV_REOPEN Date: Fri, 28 Feb 2020 14:39:53 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.15 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" This capability will be asserted once qemu stabilizes 'blockdev-reopen'. For now we just add the capability so that we can introduce some code that will use the reopening call. This will show our willingness to adopt use of reopen and help qemu developers stabilize it. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5548ffad14..1cb8b697e0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -564,6 +564,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 355 */ "query-named-block-nodes.flat", + "blockdev-reopen", ); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ffb4206723..f7e420a006 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -545,6 +545,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 355 */ QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT, /* query-named-block-nodes= supports the 'flat' option */ + QEMU_CAPS_BLOCKDEV_REOPEN, /* 'blockdev-reopen' qmp command is support= ed */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.24.1 From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1582897226; cv=none; d=zohomail.com; s=zohoarc; b=LXFK+jmhC/DKfWi2mDXj5WgaXjvN2wOc/fha+EmzqQ9o+Iqm61mygtxiCnp0YH7Y4YKZe81eVsNCWB2VKiyafNiO3lf/EFxotS+N8PZ70uEHe2AQjIjwYRW9OeB7gmK+Tokv8vZARprOajKEC5Oo0y2NgbbfPZKaY+Zj/uGFkb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897226; h=Content-Type:Content-Transfer-Encoding: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=27Jf+l6BQ6iRcmiFmG5I1yhTJZF6XxDc8Xoqp2ZP3B4=; b=CuqgnQSL3csgQT1mACQh0Qyal2froZ4efU2hTXg/Ku+WW024Pj9Fa4pOdn+B9qG4jYlpusYJUUfpbXx364FlcdSzuuJ3XdG49uuzT+G0vgoeAJY0Wl7vlzYobUieYnyAt012chEPVRjh/ke7HaTMc7WzqK4erdwNQu0i43m8MJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582897226101354.5851364039222; Fri, 28 Feb 2020 05:40:26 -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-477-fDx1JKAHNZijUe8tLx3qAg-1; Fri, 28 Feb 2020 08:40:22 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8A3D10CE780; Fri, 28 Feb 2020 13:40:15 +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 4EB8A19C6A; Fri, 28 Feb 2020 13:40:14 +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 C0CBE84486; Fri, 28 Feb 2020 13:40:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe6Hx025644 for ; Fri, 28 Feb 2020 08:40:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 525D7101D481; Fri, 28 Feb 2020 13:40:06 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDCE41001B2C for ; Fri, 28 Feb 2020 13:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897224; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=27Jf+l6BQ6iRcmiFmG5I1yhTJZF6XxDc8Xoqp2ZP3B4=; b=FSaLzxTSHLyyWsAwcVHWB8D8YMm/Ee2EMuY04ocLn0hKURZuRUjgMkSREqGM/I/gTypXmN sqBLkXedSK1KzK2w+1y6DqJ0Ao2nQBH8YLNWBuWcCoiHoSaUnnCSUkkjQYIC/eZBTHp+PU MeJvqarW7ZagOGR1r9xHc3uzWDRggjw= X-MC-Unique: fDx1JKAHNZijUe8tLx3qAg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/8] qemu: monitor: Add handler for blockdev-reopen Date: Fri, 28 Feb 2020 14:39:54 +0100 Message-Id: <278985fc8399f1eb22e5b31c918e086215ab1c8c.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.23 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" Introduce the monitor code for using blockdev-reopen. For now we'll use x-blockdev-reopen so that the interactions between qemu and libvirt can be tested with the existing code. Since the usage will be guarded by the for-now unasserted capability we'll be able to change the called command when the command will be stabilized. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 13 +++++++++++++ src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 21 +++++++++++++++++++++ src/qemu/qemu_monitor_json.h | 4 ++++ 4 files changed, 41 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c2a61ec587..3fab31aa38 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4378,6 +4378,19 @@ qemuMonitorBlockdevAdd(qemuMonitorPtr mon, } +int +qemuMonitorBlockdevReopen(qemuMonitorPtr mon, + virJSONValuePtr *props) +{ + VIR_DEBUG("props=3D%p (node-name=3D%s)", *props, + NULLSTR(virJSONValueObjectGetString(*props, "node-name"))); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockdevReopen(mon, props); +} + + int qemuMonitorBlockdevDel(qemuMonitorPtr mon, const char *nodename) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 4e06447ffa..23b8d0a650 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1324,6 +1324,9 @@ int qemuMonitorBlockdevCreate(qemuMonitorPtr mon, int qemuMonitorBlockdevAdd(qemuMonitorPtr mon, virJSONValuePtr *props); +int qemuMonitorBlockdevReopen(qemuMonitorPtr mon, + virJSONValuePtr *props); + int qemuMonitorBlockdevDel(qemuMonitorPtr mon, const char *nodename); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 451e1afef5..0f968b7d36 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8837,6 +8837,27 @@ qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon, } +int +qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon, + virJSONValuePtr *props) +{ + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; + virJSONValuePtr pr =3D g_steal_pointer(props); + + if (!(cmd =3D qemuMonitorJSONMakeCommandInternal("x-blockdev-reopen", = pr))) + return -1; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + return -1; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + return -1; + + return 0; +} + + int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, const char *nodename) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ed48600b82..5b3bb295eb 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -602,6 +602,10 @@ int qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon, virJSONValuePtr *props) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); +int qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon, + virJSONValuePtr *props) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, const char *nodename) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --=20 2.24.1 From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1582897243; cv=none; d=zohomail.com; s=zohoarc; b=RqYnqcyCYF2HQOo8CkQHWulH9q9qhFvrcyrUWIAOj+dTMDrOitL8oFELHDWy9p1yjTOQ88HGgrbjTNrEpTwHHlLuF1MiuR/GgR02FFeHsuPyGZ1CkE7OZrBWPSn6cQyezuM/VJDWEZORV6PTJnZ//i2ppmFFI8GT/Hz2ERyreos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897243; h=Content-Type:Content-Transfer-Encoding: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=ySWeyupiUt+sstZ02C4W31oJVILjAiIM4ryTWdiMvWs=; b=eVN34AfnHsUCgJiQ81Bwi2vAyYm7MUU7DbEUIGt7af8e26skxNY/pgK9KJ7bzsU/7vtz3QImX0z/j9GZEm21A2WiqgC8Fe+7mch5GRevKBaUttlnKqXp+ZxPUyv6Vg03q90p3Y2RKWVMboj/MBHRD1VVO44RovXLNJo/WWpq144= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582897243206560.910747346729; Fri, 28 Feb 2020 05:40: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-171-C_nYtulPMkekDrneymrTyw-1; Fri, 28 Feb 2020 08:40:39 -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 35C55100550E; Fri, 28 Feb 2020 13:40:34 +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 0366F8C089; Fri, 28 Feb 2020 13:40: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 A816F8448A; Fri, 28 Feb 2020 13:40:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe7qJ025652 for ; Fri, 28 Feb 2020 08:40:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 29BDB101D481; Fri, 28 Feb 2020 13:40:07 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1AFD1001B2C for ; Fri, 28 Feb 2020 13:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897241; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=ySWeyupiUt+sstZ02C4W31oJVILjAiIM4ryTWdiMvWs=; b=bTl68+8+7Zu56MPr6nip+k4jXjCQeOGVxl5k/V2exDakPGT+8NMTETKuvtInOHtGBn4EcF NPcQrG6yTscsBLVlEquHyedN1CrfnOhKmyMCpG8Pag4VeUZPpqA3d6yk0vekyIdYINOZzj DIaVxXLqdlyEcrHmVijJT1nDQKrnRA0= X-MC-Unique: C_nYtulPMkekDrneymrTyw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/8] qemu: block: implement helpers for blockdev-reopen Date: Fri, 28 Feb 2020 14:39:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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-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" Introduce a set of helpers to call blockdev-reopen in certain scenarios Libvirt will use the QMP command to turn certain members of the backing chain read-write for bitmap manipulation and we'll also want to use it to replace/install the backing chain of a qcow2 format node. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 121 ++++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_block.h | 14 +++++ 2 files changed, 135 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 152c73f1bf..441b8ec07b 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2960,3 +2960,124 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr= src, return 0; } + + +/** + * qemuBlockReopen: + * @vm: domain object + * @props: JSON object used as argument of 'blockdev-reopen' + * @asyncJob: qemu async job type + * + * Monitor interaction to call 'blockdev-reopen' @props is consumed on suc= cessful + * call and set to NULL if consumed. + */ +static int +qemuBlockReopen(virDomainObjPtr vm, + virJSONValuePtr *props, + qemuDomainAsyncJob asyncJob) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; + int rc; + + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + + rc =3D qemuMonitorBlockdevReopen(priv->mon, props); + + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + return -1; + + return 0; +} + + +/** + * qemuBlockReopenFormat: + * @vm: domain object + * @src: storage source to reopen + * @asyncJob: qemu async job type + * + * Invokes the 'blockdev-reopen' command on the format layer of @src. This= means + * that @src must be already properly configured for the desired outcome. = The + * nodenames of @src are used to identify the specific image in qemu. This + * function enters the monitor. + */ +int +qemuBlockReopenFormat(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob) +{ + g_autoptr(virJSONValue) reopenprops =3D NULL; + + /* If we are lacking the object here, qemu might have opened an image = with + * a node name unknown to us */ + if (!src->backingStore) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("can't reopen image with unknown presence of back= ing store")); + return -1; + } + + if (!(reopenprops =3D qemuBlockStorageSourceGetBlockdevProps(src, src-= >backingStore))) + return -1; + + return qemuBlockReopen(vm, &reopenprops, asyncJob); +} + + +/** + * qemuBlockReopenReadWrite: + * @vm: domain object + * @src: storage source to reopen + * @asyncJob: qemu async job type + * + * Wrapper that reopens @src read-write. We currently depend on qemu + * reopening the storage with 'auto-read-only' enabled for us. + * After successful reopen @src's 'readonly' flag is modified. Does nothing + * if @src is already read-write. + */ +int +qemuBlockReopenReadWrite(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob) +{ + if (!src->readonly) + return 0; + + src->readonly =3D false; + if (qemuBlockReopenFormat(vm, src, asyncJob) < 0) { + src->readonly =3D true; + return -1; + } + + return 0; +} + + +/** + * qemuBlockReopenReadOnly: + * @vm: domain object + * @src: storage source to reopen + * @asyncJob: qemu async job type + * + * Wrapper that reopens @src read-only. We currently depend on qemu + * reopening the storage with 'auto-read-only' enabled for us. + * After successful reopen @src's 'readonly' flag is modified. Does nothing + * if @src is already read-only. + */ +int +qemuBlockReopenReadOnly(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob) +{ + if (src->readonly) + return 0; + + src->readonly =3D true; + if (qemuBlockReopenFormat(vm, src, asyncJob) < 0) { + src->readonly =3D false; + return -1; + } + + return 0; +} diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index eab0128d5d..b3d7d0f876 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -228,3 +228,17 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr sr= c, virHashTablePtr blockNamedNodeData, bool shallow, virJSONValuePtr *actions); + +int +qemuBlockReopenFormat(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob); + +int +qemuBlockReopenReadWrite(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob); +int +qemuBlockReopenReadOnly(virDomainObjPtr vm, + virStorageSourcePtr src, + qemuDomainAsyncJob asyncJob); --=20 2.24.1 From nobody Fri May 3 08:12:25 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=1582897250; cv=none; d=zohomail.com; s=zohoarc; b=Nt8GCvQ56xotJj9TSY6UuzeGAn+hCPqduC64BWDX7WgxK1ITJCmcWxheVfrkkDC4ADqGqPpwPQGFWZDvkaRcCEuWkeBrj4Res8CHC8zX7dRkbY8Q+2fII2/cD0hUz2kXK5B61+PsaXJScvpSYGc4PqbpwOQF7KmPyOnhpp9GYTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897250; h=Content-Type:Content-Transfer-Encoding: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=wwseleblJ6i6JSuzPvqop7iwGvFfljNVhqnRStjqAOE=; b=ltFml3HeOt+vpdUKaeU+uFvK7GhxTaq7+qmrHnB2m83J5D3fENUOdqbAo7DyuAOxPXChjN35vKOvN+oNmPfqNqUvq9/Lbjrp6mcgmrT9WCJbZtRpCQK4xqFzrKd43uGWvgY4qP04wfvHSytyiYATgNVwoZDTT0Wn0nfCt0nXBCw= 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 1582897250956930.8722038798644; Fri, 28 Feb 2020 05:40:50 -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-222-NjHiaffXMWOaXRxq2DrKIA-1; Fri, 28 Feb 2020 08:40:47 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 826E710CE781; Fri, 28 Feb 2020 13:40:40 +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 5407490CC8; Fri, 28 Feb 2020 13:40:40 +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 F197784496; Fri, 28 Feb 2020 13:40:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe8fh025659 for ; Fri, 28 Feb 2020 08:40:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id F3074101D481; Fri, 28 Feb 2020 13:40:07 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A1561001B2C for ; Fri, 28 Feb 2020 13:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897249; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=wwseleblJ6i6JSuzPvqop7iwGvFfljNVhqnRStjqAOE=; b=MOVNMK6g0ZTRLoKqQ2OUzgLfHHcl9UEYAA7M13NN3RmVhLdKrbHp83NSiVSDYcTsVc6t9T 6eL2yrvbPVH58kji3HK3fbgaPnYI4fafs/qxlONFmIUKzR+bz4Q/u9Hgz68WqG7WMxQtgO +mL6rR+tV8sd1EY2yxgg6Wv98bHdWsE= X-MC-Unique: NjHiaffXMWOaXRxq2DrKIA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/8] qemuCheckpointDiscardBitmaps: Reopen images for bitmap modifications Date: Fri, 28 Feb 2020 14:39:56 +0100 Message-Id: <39a0981dbbfb38d458b4da99772e743e9cec9e08.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.13 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" Qemu's bitmap APIs don't reopen the appropriate images read-write for modification. It's libvirt's duty to reopen them via blockdev-reopen if we wish to modify the bitmaps. Use the new helpers to reopen the images for bitmap manipulation. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index a387e7dfe7..32b0ab0faf 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -299,6 +299,9 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, if (qemuDomainStorageSourceAccessAllow(driver, vm, src, false, fal= se) < 0) goto relabel; + if (qemuBlockReopenReadWrite(vm, src, QEMU_ASYNC_JOB_NONE) < 0) + goto relabel; + relabelimages =3D g_slist_prepend(relabelimages, src); } @@ -311,6 +314,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, for (next =3D relabelimages; next; next =3D next->next) { virStorageSourcePtr src =3D next->data; + ignore_value(qemuBlockReopenReadOnly(vm, src, QEMU_ASYNC_JOB_NONE)= ); ignore_value(qemuDomainStorageSourceAccessAllow(driver, vm, src, t= rue, false)); } --=20 2.24.1 From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1582897225; cv=none; d=zohomail.com; s=zohoarc; b=JNfQhlTizHgXjnrjO35nmjZCFsO/A8Ep/gB6EE+MBvG4I2KxrRu5YOeDayaagfsSY3yNKKrjPgXQBjbpUiYspmGFYLkyF26rCuVcoPf2agO09En7qyzmEDWBjt4LEgB0T15gmykcqFMEt0FMV3134NIuxceKfA/ywWGEERaRdvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897225; h=Content-Type:Content-Transfer-Encoding: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=x0oUtNTxe+lZsq6U3j8EUxgEa7XQbQpMoYjI2imOevs=; b=jbdnkKw3oKZz+zdZhmcwMjesKkWYt2ze7fQhiV/ZRZGzNjvuoEmV/Add7MqGdEtfDlhrzuA27chlQY8yXSudaVQfR3HDI5lC89/Qkgp23/Ej8j/NZaS04qgUGU0czT7KL7d+4cdpZ0+fU2Q1EYvqy7CsfxEXgJcJm0fKY4a8DGc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582897225719931.507836633888; Fri, 28 Feb 2020 05:40:25 -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-323--3rYpo23MFSURhd1RyMmzQ-1; Fri, 28 Feb 2020 08:40:22 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7092100550E; Fri, 28 Feb 2020 13:40:15 +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 5C8A89299F; Fri, 28 Feb 2020 13:40:14 +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 67C1F84481; Fri, 28 Feb 2020 13:40:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe8lM025669 for ; Fri, 28 Feb 2020 08:40:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id C7607101D493; Fri, 28 Feb 2020 13:40:08 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E6201001B2C for ; Fri, 28 Feb 2020 13:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897224; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=x0oUtNTxe+lZsq6U3j8EUxgEa7XQbQpMoYjI2imOevs=; b=TwOxyhHmmy/l1B7oQPCQiv9poycTipeT4aQ7ZZhO6bfQM6RiWVJOTlx9u2bDw1bFhmokCH oD852aO5r4eGcSLXNExOCovAGBq9Sjia64lxC67d147KigkMVGwpkiJlUzN62hTG9uh6C0 pbZOLIMbyXxrDsPf1JPOYrHbd7chk5I= X-MC-Unique: -3rYpo23MFSURhd1RyMmzQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/8] qemuCheckpointDiscardBitmaps: Use correct field for checkpoint bitmap name Date: Fri, 28 Feb 2020 14:39:57 +0100 Message-Id: <7b4c6d4fd3ebffdbe273e3f46f2c968af7b5a5cf.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.15 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" The code deleting checkpoints needs the name of the parent checkpoint's disk's bitmap but was using the disk alias instead. This would create wrong bitmaps after deleting some checkpoints. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 32b0ab0faf..378f6c147e 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -283,7 +283,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, * ancestor. */ if ((parentchkdisk =3D qemuCheckpointFindActiveDiskInParent(vm, pa= rent, chkdisk-= >name))) - parentbitmap =3D parentchkdisk->name; + parentbitmap =3D parentchkdisk->bitmap; if (qemuCheckpointDiscardDiskBitmaps(domdisk->src, blockNamedNodeD= ata, chkdisk->bitmap, parentbitmap, --=20 2.24.1 From nobody Fri May 3 08:12:25 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=1582897246; cv=none; d=zohomail.com; s=zohoarc; b=HYTGYmIx6YcxCKqg6iB406ibSdZtsITPNKETuoekONBiIh6qW+MRGQsbhcMX+bCDkOJw31d2SEtIxQqyB2aLY6Tskqp4MqCTwrggwVusAPTi4sugMAZyBhPO/iamvd+KAyTUqUupzYyenJ2RgHg43cXAYJ2ZBUNyn75J5g5WfQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897246; h=Content-Type:Content-Transfer-Encoding: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=rdFzD96gP/SHldVU80Z05wNu8476UEtpc37H1wXJjnY=; b=ly9vk865pnbfge9e68y2ZhrwkFUo4KcrVefpi2Q0VDh4ExrsJEIiMs6SgSqCqPxZYd+CxtOoc/Pb5hHcQ+8mSGSPMg1/48j110JzJdSzyCisXNIoe4yh9XcfF4K12j22IgPR7VusT+EN1kFIhNphO9NY12eIyZpKUaW0KkC57FY= 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 1582897246149434.39035535573635; Fri, 28 Feb 2020 05:40:46 -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-398-IsHoyKGeNQaHypumSVhnTQ-1; Fri, 28 Feb 2020 08:40:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 564CA801E67; Fri, 28 Feb 2020 13:40:36 +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 28F592718F; Fri, 28 Feb 2020 13:40:36 +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 DB43118034EF; Fri, 28 Feb 2020 13:40:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDe9dn025679 for ; Fri, 28 Feb 2020 08:40:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9AF6B101D493; Fri, 28 Feb 2020 13:40:09 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22BDA1001B2C for ; Fri, 28 Feb 2020 13:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897244; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=rdFzD96gP/SHldVU80Z05wNu8476UEtpc37H1wXJjnY=; b=Qvm6+3jxP3U05BfYXDIDb73OipFRDydHQaCvlmJgi5kg5+iSFflELOG1mIAZQRx8O6rrCn T7Run747cEZkyABvBWhCASXXu4zbWCgyvIyUubFYs3yDobNTf5IHo6rZJisfpacVLZOKcU KNCLXNKxZKKiav9NhvpnNUsRWUPEGYI= X-MC-Unique: IsHoyKGeNQaHypumSVhnTQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/8] qemuDomainBlockPivot: Move check prior to executing the pivot steps Date: Fri, 28 Feb 2020 14:39:58 +0100 Message-Id: <67a17029f4247c3d5367a7ad4627bc808e58523c.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.23 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" Move the check whether the job is already synchronised to the beginning of the function so that we don't try to do some of the steps necessary for pivoting prior to actually wanting to pivot. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 35ade1ef37..76787b6ccc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17234,6 +17234,13 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); g_autoptr(virJSONValue) actions =3D NULL; + if (job->state !=3D QEMU_BLOCKJOB_STATE_READY) { + virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, + _("block job '%s' not ready for pivot yet"), + job->name); + return -1; + } + switch ((qemuBlockJobType) job->type) { case QEMU_BLOCKJOB_TYPE_NONE: case QEMU_BLOCKJOB_TYPE_LAST: @@ -17271,13 +17278,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, break; } - if (job->state !=3D QEMU_BLOCKJOB_STATE_READY) { - virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, - _("block job '%s' not ready for pivot yet"), - job->name); - return -1; - } - qemuDomainObjEnterMonitor(driver, vm); if (blockdev) { int rc =3D 0; --=20 2.24.1 From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1582897251; cv=none; d=zohomail.com; s=zohoarc; b=B7MO9ktzxrVKfQIgR8RmedlTxGa+1ZjYBO1QltI7o98eppjiTlXnWBgXe4GHbI+rcoWmtMVhv+Hd/Bkkf0xjA7efR3+LZ7OJe2E7x2S3qBl0oqj72rgPl1OMiy5D0slzy2ALmsXsF0PdeAR+ZxVeP4MSwT0bJ8CoheDj8TxgO9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897251; h=Content-Type:Content-Transfer-Encoding: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=fUA1JTYGvbmF63O/sFUEWYybEydMt4lOFu8nVig9W/A=; b=OdErrO85Af9Tcc7WM1TAXiCFFU5t4k0ds+RxQLi9cwUdCwLeWcOcmdXcUq0k0R5FW6ze7mrWfCt4as/9BkLohaPw+1/LxAQLIMBNNk3OqkbWJBikOffJwcqO71lB3HBKrtk8Oe8zQ2tas+NgnYOo0QArF5J8Gx9Mgov5++lyJrQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 158289725159620.69672888459513; Fri, 28 Feb 2020 05:40:51 -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-419-40w5lejiPi2wuQzP7sb4yA-1; Fri, 28 Feb 2020 08:40:47 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0EFB100550E; Fri, 28 Feb 2020 13:40:40 +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 B5B343A2; Fri, 28 Feb 2020 13:40:40 +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 62B9018034F9; Fri, 28 Feb 2020 13:40:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDeANI025684 for ; Fri, 28 Feb 2020 08:40:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 701A2101D481; Fri, 28 Feb 2020 13:40:10 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA64F1001B2C for ; Fri, 28 Feb 2020 13:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897250; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=fUA1JTYGvbmF63O/sFUEWYybEydMt4lOFu8nVig9W/A=; b=SrNBxu83b8oK+56E4PWeyR4ZXDtNjN3HgkyBBGhIogoTdbmPhZNa4xu+FRHar+9xrw1rYd TsekbpYBhTtfRW/RdzrXvqU/D+kBuNOvn6/kz9N7GHGqU2iuJOExx4LBLsTSoix4E4ByNX evMzw1OHaWeK+yIRC98fskCl+O72W8Q= X-MC-Unique: 40w5lejiPi2wuQzP7sb4yA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/8] qemuDomainBlockCopyCommon: Record updated flags to block job Date: Fri, 28 Feb 2020 14:39:59 +0100 Message-Id: <3eef39bf86fa9a5690ea68080c3f10d602f9802b.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.23 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" For a long time we've masked out VIR_DOMAIN_BLOCK_COPY_SHALLOW if there's no backing chain for the copied disk to simplify the code. One of the refacors of caused that we no longer update the 'flags' variable just the local copies. This was okay until in ccd4228afff I started storing the job flags in the block job data. Given that we modify how we call qemu we also should modify @flags so that the correct value is recorded in the block job data. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 76787b6ccc..c3215bccca 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17915,8 +17915,10 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, } /* clear the _SHALLOW flag if there is only one layer */ - if (!virStorageSourceHasBacking(disk->src)) + if (!virStorageSourceHasBacking(disk->src)) { + flags &=3D ~VIR_DOMAIN_BLOCK_COPY_SHALLOW; mirror_shallow =3D false; + } if (qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(mirror, mirror_sha= llow, --=20 2.24.1 From nobody Fri May 3 08:12:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1582897247; cv=none; d=zohomail.com; s=zohoarc; b=UXJ/mtGTezA8Dqjy1pWbFV5ppDfwfMN8D+fRuIoHOj510zSVzrx/AtKl8UV/MKzJuQiPYUHtVACaXrUQcoZ0OreX7jAboZgy3KIeFwYToMt/yRN1U9ZCNYCNFOY4XJp8HEYHLcEncn0ccc+Twm4DeA3KNri/PGzqBxnB4bC/u6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582897247; h=Content-Type:Content-Transfer-Encoding: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=PlBOQtQy1YhMmUi5ofQHi2wlD2KUsA5h7AB7F1tEIIs=; b=jxXWo0HBhJT1JOBOuGfbSmPMg9mALoPFze8PpsqKnZIILjaDXQtd2dNRGTO1yN2FSJO7BkFeka8QVf0u0HVcouWa5V4aXPlJK06i47q1z2/sZGGfveCW0so58KTHenVOgI4CgJ+j9J9FfOsZvcyC2lp8m/3EEK0UP4+po8rgW8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582897247858899.9396856082052; Fri, 28 Feb 2020 05:40:47 -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-401-TOk-MLygNCWb-LNCxfBiKg-1; Fri, 28 Feb 2020 08:40:44 -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 05BFE801E6C; Fri, 28 Feb 2020 13:40:38 +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 CC99C101D495; Fri, 28 Feb 2020 13:40:37 +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 7BFC284486; Fri, 28 Feb 2020 13:40:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01SDeBvS025690 for ; Fri, 28 Feb 2020 08:40:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8DF77101D493; Fri, 28 Feb 2020 13:40:11 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 153B7101D481 for ; Fri, 28 Feb 2020 13:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582897246; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=PlBOQtQy1YhMmUi5ofQHi2wlD2KUsA5h7AB7F1tEIIs=; b=NarudwRM3Aydbt5RG6kF6RDMQZwilHrDKthVwf8EzsRUsi+boMZQg4OgnWSEH66mG8OEE3 z6wfBajfCm3+IPI6eKAcKtjjaHDR36/W8QBWzngMZI5XMc6yP/AGXY12r6opkaWARV1hCd mwbCTdWJLVCe+ub7j73It5TT3D+FrX4= X-MC-Unique: TOk-MLygNCWb-LNCxfBiKg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 8/8] qemu: blockcopy: Allow late opening of the backing chain of a shallow copy Date: Fri, 28 Feb 2020 14:40:00 +0100 Message-Id: <0ae9b9da5aa27d2a29122559173cc9c075c02c46.1582895792.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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-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" oVirt used a quirk in the pre-blockdev semantics of drive-mirror which opened the backing chain of the mirror destination only once 'block-job-complete' was called. Our introduction of blockdev made qemu open the backing chain images right at the start of the job. This broke oVirt's usage of this API because they copy the data into the backing chain during the time the block copy job is running. Re-introduce late open of the backing chain if qemu supports blockdev-reopen as we can use that command to install the backing chain even for an existing image. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 53 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c3215bccca..b746cd92d9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17229,6 +17229,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, qemuBlockJobDataPtr job, virDomainDiskDefPtr disk) { + g_autoptr(qemuBlockStorageSourceChainData) chainattachdata =3D NULL; int ret =3D -1; qemuDomainObjPrivatePtr priv =3D vm->privateData; bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); @@ -17263,6 +17264,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, if (blockdev && !job->jobflagsmissing) { g_autoptr(virHashTable) blockNamedNodeData =3D NULL; bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; + bool reuse =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT; if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) return -1; @@ -17271,6 +17273,17 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, blockNamedNodeData, shallow, &actions) < 0) return -1; + + /* Open and install the backing chain of 'mirror' late if we s= upport + * blockdev-reopen. This is to appease oVirt that wants to copy + * data into the backing chain while the top image is being co= pied + * shallow */ + if (reuse && shallow && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))= { + if (!(chainattachdata =3D qemuBuildStorageSourceChainAttac= hPrepareBlockdev(disk->mirror->backingStore, + = priv->qemuCaps))) + return -1; + } } break; @@ -17278,6 +17291,23 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, break; } + if (chainattachdata) { + int rc; + + qemuDomainObjEnterMonitor(driver, vm); + rc =3D qemuBlockStorageSourceChainAttach(priv->mon, chainattachdat= a); + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + return -1; + + if (qemuBlockReopenFormat(vm, disk->mirror, QEMU_ASYNC_JOB_NONE) <= 0) { + qemuDomainObjEnterMonitor(driver, vm); + qemuBlockStorageSourceChainDetach(priv->mon, chainattachdata); + if (qemuDomainObjExitMonitor(driver, vm) < 0) + return -1; + return -1; + } + } + qemuDomainObjEnterMonitor(driver, vm); if (blockdev) { int rc =3D 0; @@ -18027,9 +18057,26 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, if (blockdev) { if (mirror_reuse) { - if (!(data =3D qemuBuildStorageSourceChainAttachPrepareBlockde= v(mirror, - = priv->qemuCaps))) - goto endjob; + /* oVirt depended on late-backing-chain-opening semantics the = old + * qemu command had to copy the backing chain data while the t= op + * level is being copied. To restore this semantics if + * blockdev-reopen is supported defer opening of the backing c= hain + * of 'mirror' to the pivot step */ + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))= { + g_autoptr(virStorageSource) terminator =3D virStorageSourc= eNew(); + + if (!terminator) + goto endjob; + + if (!(data =3D qemuBuildStorageSourceChainAttachPrepareBlo= ckdevTop(mirror, + = terminator, + = priv->qemuCaps))) + goto endjob; + } else { + if (!(data =3D qemuBuildStorageSourceChainAttachPrepareBlo= ckdev(mirror, + = priv->qemuCaps))) + goto endjob; + } } else { if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) goto endjob; --=20 2.24.1