From nobody Sun Feb 8 22:57:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1560847135; cv=none; d=zoho.com; s=zohoarc; b=IjMBNaOTXyQVPPDpHPAoWRvMUY+vD4shyrG+9G70NMng/bErUrcQOLSUqIZXSF2RmPNVWgHwDCSWIxx28zQtJubkch2ZwFutcjqRRTx4NidJrvGP83lp7az6kPSoQ1Nk1Vm910URHn79kKD4+JxbNu1u2/ifAnsIh0rvRY6HyF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560847135; 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:ARC-Authentication-Results; bh=yjAxB12+1Feooog06EFNZDPonSESDvWVKWAGDX8JIWY=; b=ldit/ovu1xsDL+CeYIE4KVJeJAnZinrHID/kr8gK9ocMCooRvaO3nR0NT4sifnA/Cq8rC/cWzki6sfPyjti8FNQojSvdjCHRIULTT5P367JSj38IvYM8Y+rT9jrise9/Pwzp5nsJOewh1CrQrK2GnVE5D6UD7J9cox5afU22Jbg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560847135257730.9357750644733; Tue, 18 Jun 2019 01:38:55 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5A36E300602A; Tue, 18 Jun 2019 08:38:48 +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 30018101E667; Tue, 18 Jun 2019 08:38:48 +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 C8D061806B1A; Tue, 18 Jun 2019 08:38:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5I8bYSj026032 for ; Tue, 18 Jun 2019 04:37:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 194DC17131; Tue, 18 Jun 2019 08:37:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9914B17129 for ; Tue, 18 Jun 2019 08:37:33 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 10:37:26 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: caps: Add capability for dynamic 'auto-read-only' support for files 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 18 Jun 2019 08:38:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Initial implementation of 'auto-read-only' didn't reopen the backing files when needed. For '-blockdev' to work we need to be able to tel qemu to open a file read-only and change it during blockjobs as we label backing chains with a sVirt label which does not allow writing. The dynamic auto-read-only supports this as it reopens files when writing is demanded. Add a capability to detect that the posix file based backends support the dynamic part. --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d0fdd1da9f..4e6d71f525 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -530,6 +530,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 330 */ "bitmap-merge", "nbd-bitmap", + "blockdev-file-dynamic-auto-read-only", ); @@ -1270,6 +1271,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { { "query-iothreads/ret-type/poll-max-ns", QEMU_CAPS_IOTHREAD_POLLING }, { "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS= _EGL_HEADLESS_RENDERNODE }, { "nbd-server-add/arg-type/bitmap", QEMU_CAPS_NBD_BITMAP }, + { "blockdev-add/arg-type/+file/$dynamic-auto-read-only", QEMU_CAPS_BLO= CK_FILE_AUTO_READONLY_DYNAMIC }, }; typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3032d4edcd..399a30dc4c 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -512,6 +512,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 330 */ QEMU_CAPS_BITMAP_MERGE, /* block-dirty-bitmap-merge */ QEMU_CAPS_NBD_BITMAP, /* nbd-server-add supports bitmap */ + QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC, /* the auto-read-only prop= erty of block backends for files is dynamic */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.1.0.x86_64.xml index a22b050620..b01b57d3b1 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -204,6 +204,7 @@ + 4000050 0 43100759 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list