From nobody Mon Feb 9 06:27:10 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=1698234017; cv=none; d=zohomail.com; s=zohoarc; b=Dj8zpNh/vxMpJwOkdWf0NicYlMvH/aUBt8JlHEP0XV8+32D43Tev0eq1wM6epIWDYIs7FTjccoriR2+g+uOCNdMFg8JU21H/r2yJmy1NMd6zjt+waQmQxntQvLY5CZoodvD3TlTdEvdXQpqR45Yu4B7s+YkknqjdHGv4BRHrb3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234017; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=4AVnyGTjos8qXZZFeQqPnL8MmCFg2wGFXCYfHSNv9ys=; b=JRpHErmxLPFitf/EJnp1D/sxaCG2QIoyLUUkF8v9kSquVbnZVS1Ef2oIZCZU+fIlPwdYcM1qm05MovT5lmUh64ReCx5RAH+c4dQ+92cX/XbZ6eHPrcx4+u1U+lK2Xa6+RvXknKNbqFSBL5Y/kfzLFXh+gVc9wIswJkGuhSomp/E= 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 1698234017340624.5130905044085; Wed, 25 Oct 2023 04:40:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-177-YPzyuypQMdqJTU50Ccc5Zg-1; Wed, 25 Oct 2023 07:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3462811E93; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E4CF8C0A; Wed, 25 Oct 2023 11:40:02 +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 70C6B1946595; Wed, 25 Oct 2023 11:40:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B2EE19465B6 for ; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4C23A492BFA; Wed, 25 Oct 2023 11:40:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2663492BFB for ; Wed, 25 Oct 2023 11:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234016; 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=4AVnyGTjos8qXZZFeQqPnL8MmCFg2wGFXCYfHSNv9ys=; b=JY/ZlzeOeQmURfCG6lAgSOb9uEnBMUNbaxFKtQkGzrVzcrK1/aAVCtYRJ/bXNDkIvoWlgC vNfXlF+rD4BTFqFk60UnzUCDguYj1qdOi1W6d7Cfmblpv1KWm8DzWrGxBQPVRy1quTpryM kRmUD1EFxXlRMM39OKkgm5CyfqrMAsg= X-MC-Unique: YPzyuypQMdqJTU50Ccc5Zg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/22] qemuBlockStorageSourceGetBackendProps: Remove unused logic for (auto-)read-only flags Date: Wed, 25 Oct 2023 13:39:31 +0200 Message-ID: <858b5dcb61b45664c32e1efb08454f84e04a7b17.1698233503.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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.4.1 on 10.11.54.5 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: 1698234019432100001 Content-Type: text/plain; charset="utf-8" The code was refactored to format the 'read-only' and 'auto-read-only' flags via the common helper, so the logic determining their values can be removed. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 5c8d107257..a625e72a5d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -806,9 +806,7 @@ qemuBlockStorageSourceGetSshProps(virStorageSource *src) static virJSONValue * qemuBlockStorageSourceGetFileProps(virStorageSource *src, - bool onlytarget, - virTristateBool *autoReadOnly, - virTristateBool *readOnly) + bool onlytarget) { const char *path =3D src->path; const char *iomode =3D NULL; @@ -824,25 +822,8 @@ qemuBlockStorageSourceGetFileProps(virStorageSource *s= rc, if (src->iomode !=3D VIR_DOMAIN_DISK_IO_DEFAULT) iomode =3D virDomainDiskIoTypeToString(src->iomode); - if (srcpriv && srcpriv->fdpass) { + if (srcpriv && srcpriv->fdpass) path =3D qemuFDPassGetPath(srcpriv->fdpass); - - /* when passing a FD to qemu via the /dev/fdset mechanism qemu - * fetches the appropriate FD from the fdset by checking that = it has - * the correct accessmode. Now with 'auto-read-only' in effect= qemu - * wants to use a read-only FD first. If the user didn't pass = multiple - * FDs the feature will not work regardless, so we'll disable = it. */ - if (src->fdtuple->nfds =3D=3D 1) { - *autoReadOnly =3D VIR_TRISTATE_BOOL_ABSENT; - - /* now we setup the normal readonly flag. If user requeste= d write - * access honour it */ - if (src->fdtuple->writable) - *readOnly =3D VIR_TRISTATE_BOOL_NO; - else - *readOnly =3D virTristateBoolFromBool(src->readonly); - } - } } ignore_value(virJSONValueObjectAdd(&ret, @@ -1043,20 +1024,9 @@ qemuBlockStorageSourceGetBackendProps(virStorageSour= ce *src, virStorageType actualType =3D virStorageSourceGetActualType(src); g_autoptr(virJSONValue) fileprops =3D NULL; const char *driver =3D NULL; - virTristateBool aro =3D VIR_TRISTATE_BOOL_ABSENT; - virTristateBool ro =3D VIR_TRISTATE_BOOL_ABSENT; bool onlytarget =3D flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TA= RGET_ONLY; bool legacy =3D flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY; - if (flags & QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY) { - aro =3D VIR_TRISTATE_BOOL_YES; - } else { - if (src->readonly) - ro =3D VIR_TRISTATE_BOOL_YES; - else - ro =3D VIR_TRISTATE_BOOL_NO; - } - switch (actualType) { case VIR_STORAGE_TYPE_BLOCK: case VIR_STORAGE_TYPE_FILE: @@ -1069,7 +1039,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourc= e *src, driver =3D "file"; } - if (!(fileprops =3D qemuBlockStorageSourceGetFileProps(src, onlyta= rget, &aro, &ro))) + if (!(fileprops =3D qemuBlockStorageSourceGetFileProps(src, onlyta= rget))) return NULL; break; --=20 2.41.0