From nobody Sat Feb 7 08:13:57 2026 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1627033459; cv=none; d=zohomail.com; s=zohoarc; b=ZPcpU/85p0WwzZUtLhImUy7dkmqGMSM/Ua7VvGKtSkscorGN9ZMfReYC6d9U1FdYQAXW4V2G8TfuyzRD4Sj38Ip8gjaWK5qBB94cu4WezPdJMvYnUZxJFBtjUKlThk+QDZJm+ItZA8ud8lyCDr8D0gUZB3eENteuilCDVUngwhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627033459; 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=49TjE5SSx+JS+wjFTjB+g/xmKDohb0PhfgbKwtHwIPs=; b=S2nOGZfTWsx4bPBcZZQ2l9paMOn9wf64PYutJsbOP90nr/wJ2LFcu9xhWl9HLsOc8xhO5TdYbABfC3maGIWmIMRM9TnDx51DN4DJtS0MSk0IESDEBwv4mIaMaO9BZ6dvxbETR/4p81fQaYlOXrSnPy2B9XWLhJunesfia2zzWZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1627033459406826.9190171585794; Fri, 23 Jul 2021 02:44:19 -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-276-gLm-orGzP3SnQmBnkExYxg-1; Fri, 23 Jul 2021 05:44:16 -0400 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 D36A287D542; Fri, 23 Jul 2021 09:44:11 +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 B51F55C1D1; Fri, 23 Jul 2021 09:44:11 +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 71EAA4A7CB; Fri, 23 Jul 2021 09:44:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16N9i5Qp022893 for ; Fri, 23 Jul 2021 05:44:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDED25C22A; Fri, 23 Jul 2021 09:44:05 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4497F5C1D5 for ; Fri, 23 Jul 2021 09:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627033458; 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=49TjE5SSx+JS+wjFTjB+g/xmKDohb0PhfgbKwtHwIPs=; b=b4dyH8FkSEKA4OVCF3nWQg8bB0NYXOcLpEXfQHVqxya2/A0ZF5ZdWFEmW8RtrDXwazEWz2 3V1Q5I6QX9kGqZ9of4aKfq1cKG7otyPEwRRbQxOV2JKlcQv8nmOipmqSy7Fms8+26KJtId jtIeZmpW2ixiCQYQMBvbNKKFNLjECMk= X-MC-Unique: gLm-orGzP3SnQmBnkExYxg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/6] qemuBlockReopenFormat: Extract @src handling and monitor invocation Date: Fri, 23 Jul 2021 11:43:54 +0200 Message-Id: <3f8dd67d0fff0ce8cbe29d1fc105d3908685b9bf.1627033243.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.16 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 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1627033461601100001 Content-Type: text/plain; charset="utf-8" This will simplify testing of the blockdev-reopen code once it's enabled. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 6627d044cd..c96be8b52d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3299,6 +3299,22 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource = *topsrc, } +static int +qemuBlockReopenFormatMon(qemuMonitor *mon, + virStorageSource *src) +{ + g_autoptr(virJSONValue) reopenprops =3D NULL; + + if (!(reopenprops =3D qemuBlockStorageSourceGetBlockdevProps(src, src-= >backingStore))) + return -1; + + if (qemuMonitorBlockdevReopen(mon, &reopenprops) < 0) + return -1; + + return 0; +} + + /** * qemuBlockReopenFormat: * @vm: domain object @@ -3316,7 +3332,6 @@ qemuBlockReopenFormat(virDomainObj *vm, { qemuDomainObjPrivate *priv =3D vm->privateData; virQEMUDriver *driver =3D priv->driver; - g_autoptr(virJSONValue) reopenprops =3D NULL; int rc; /* If we are lacking the object here, qemu might have opened an image = with @@ -3327,13 +3342,10 @@ qemuBlockReopenFormat(virDomainObj *vm, return -1; } - if (!(reopenprops =3D qemuBlockStorageSourceGetBlockdevProps(src, src-= >backingStore))) - return -1; - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; - rc =3D qemuMonitorBlockdevReopen(priv->mon, &reopenprops); + rc =3D qemuBlockReopenFormatMon(priv->mon, src); if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) return -1; --=20 2.31.1