From nobody Sun Feb 8 15:30:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1667896324; cv=none; d=zohomail.com; s=zohoarc; b=gL8THjl8swZ2BTbDDLIVRim9Ka9NJ3VFUiv06Ngah1KHXa3xtLf8j4DrhrGPEz/yP6H0oDl30hmW2wtoNLxt01+kh70qSQG/yKVfJGqPo4XUuMDwjSnWFSWtd82uUqHRGyt0QGpZ7PVPUGdlF277XU3YHcu31PX049ObuUJHUtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667896324; 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=ziQMCzgzDCP2W3AHJmCfpEE/QshcHpegNhcjGA4TKqQ=; b=Sfi+dW8+p/FUmnOVcIDycRa9bkt0x+T5SlRi3AqbjoCwS5qud7B8GusMst98ooXrMXUd52nV0Cl6cGwEkMciVC2HRFEXBrBPBK84admDTc3WlWa6nob9SAbPfzsj/RUMU4IADrIOO+9hZERh2lyhCEFcR0ki8sQ/BOzsKHuJKLU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1667896324497342.07521424695915; Tue, 8 Nov 2022 00:32:04 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-yNBDs1CKMe2sLilnLzzpVg-1; Tue, 08 Nov 2022 03:30:30 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D33ED8828C9; Tue, 8 Nov 2022 08:30:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF6B82166B35; Tue, 8 Nov 2022 08:30:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9946719465B5; Tue, 8 Nov 2022 08:30:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9A9F11946A7E for ; Tue, 8 Nov 2022 08:30:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5AD1E4EA48; Tue, 8 Nov 2022 08:30:19 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id F38DC35429 for ; Tue, 8 Nov 2022 08:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667896323; 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=ziQMCzgzDCP2W3AHJmCfpEE/QshcHpegNhcjGA4TKqQ=; b=SJB1zO4qjudHqyB9ZfQTAv2ND3n8ZIb74ld4Yhe4gqe3yBKUp4gfQleO3dCLretV45jDsV m7C1B3msOKWpvCHrokD53pOpe8OO5ZzMsvhwR4sH6DwsdoTRLsTf0hx9EXPJLegX0YkZRr LW9ID5JFuA9waa9Erkf96Ag+GYpbNxk= X-MC-Unique: yNBDs1CKMe2sLilnLzzpVg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 43/48] qemu: Assume QEMU_CAPS_DISK_SHARE_RW Date: Tue, 8 Nov 2022 09:29:45 +0100 Message-Id: <5d21196a259856f254d9dc39833c867f3dca28af.1667896101.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1667896325267100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduced in QEMU's commit of v2.9.0-rc0~48^2~25 the .share-rw attribute of virtio-blk device is always available for all QEMU versions we support (4.2.0, currently). Therefore, we can assume the capability is always set and thus doesn't need to be checked for. The change in controller-order.args is justified, because the qemuxml2argvdatatest runs the test case with very minimalistic set of capabilities, that's nowhere near real life scenario. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 3 +-- tests/qemuxml2argvdata/controller-order.args | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b0c9fb7059..f775170e32 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1871,8 +1871,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, if (qemuBuildDeviceAddressProps(props, def, &disk->info) < 0) return NULL; =20 - if (disk->src->shared && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_SHARE_RW)) + if (disk->src->shared) shareRW =3D VIR_TRISTATE_SWITCH_ON; =20 if (virStorageSourceGetActualType(disk->src) =3D=3D VIR_STORAGE_TYPE_V= HOST_USER) { diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2a= rgvdata/controller-order.args index fd9eba459a..c0ba064bec 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-fdr/.config \ -device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1.1 \ -blockdev '{"driver":"file","filename":"/tmp/fdr.img","aio":"native","node= -name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-r= ead-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \ --device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-2-format,id= =3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,share-rw=3Don,drive=3Dlibvir= t-2-format,id=3Dvirtio-disk0,bootindex=3D1 \ -blockdev '{"driver":"file","filename":"/tmp/Fedora-17-x86_64-Live-Desktop= .iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unma= p"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,"file":"libvirt-1-storage"}' \ -device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= \ --=20 2.37.4