From nobody Thu Apr 25 05:01:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600186365; cv=none; d=zohomail.com; s=zohoarc; b=BRO2kJ2NQvrry9TPb67AANOkas2wzBBF+stQX5XRZxZ0Q5VCUp7Z+QM/tQP925fIIgdhy07XQmLAgdknePLNiye9OINaHBXBeQyAAMqYh+Pfyl/EhFsdofv3WQ1GN0agaVqFx49IV7rwNvxHgw7nmSnouV6JUFOqcyhOSvFaISE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600186365; 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=+8VVd5RV8mzgChtqP+YZGkE/uP+wiPtudIpB31c3Rk8=; b=XFdtEwSiHAsup8uveW9ociWOJ3Pr7TVjNRYLctuKc9T0jCcsViTOdQVSP9LNNvkLZcpOE3p5EfpGCNT7fRb3qX6/UiFiRjG9LOI6Ul9kuwUiadEZYrAWJOJ0cLP2CEDS66Bh3w3EFqEmc5cY3LQu4ujF9dH8/QPc7LB+yEUDa68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600186365980460.1990071450981; Tue, 15 Sep 2020 09:12:45 -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-291-7XIAoSY0NpW39KTrmTtB5w-1; Tue, 15 Sep 2020 12:12:42 -0400 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 8DCF21006712; Tue, 15 Sep 2020 16:12:36 +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 65FEA747B0; Tue, 15 Sep 2020 16:12: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 A3C2644A5E; Tue, 15 Sep 2020 16:12:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08FGBFFx027512 for ; Tue, 15 Sep 2020 12:11:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 335C17839F; Tue, 15 Sep 2020 16:11:15 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id A74F37B7B9 for ; Tue, 15 Sep 2020 16:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600186364; 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=+8VVd5RV8mzgChtqP+YZGkE/uP+wiPtudIpB31c3Rk8=; b=NXD2X+acs9F0Pda5pAGTPgDcJ25kMCNA8UszRcgHOOa7QrWvIU801nYXhE1mAdIqNEZziX 39SpUdrkTjMmYWHMAD8u284woi4dshGk1hvqtDk3pClqAUXKc6RwUV/I17H5SPf8Sgf77l YGGLe/XfHrtDQ89QE7RwXVad4XSkRAs= X-MC-Unique: 7XIAoSY0NpW39KTrmTtB5w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add to one of the iSCSI hostdevs Date: Tue, 15 Sep 2020 18:11:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Test a readonly iSCSI backend as well. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- .../qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-2.8.0.args | 2 +- .../qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.args | 2 +- tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.xml | 1 + tests/qemuxml2xmloutdata/hostdev-scsi-virtio-scsi.xml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-2.8.0.a= rgs b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-2.8.0.args index 3f007db2c3..bb8a466f70 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-2.8.0.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-2.8.0.args @@ -47,7 +47,7 @@ format=3Draw,id=3Ddrive-hostdev2 \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D2,lun=3D4,\ drive=3Ddrive-hostdev2,id=3Dhostdev2 \ -drive file=3Discsi://example.org:3260/iqn.1992-01.com.example/1,if=3Dnone= ,\ -format=3Draw,id=3Ddrive-hostdev3 \ +format=3Draw,id=3Ddrive-hostdev3,readonly=3Don \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D2,lun=3D5,\ drive=3Ddrive-hostdev3,id=3Dhostdev3 \ -drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:\ diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.a= rgs b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.args index eb11d8f733..973ae5677a 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.args @@ -48,7 +48,7 @@ format=3Draw,id=3Ddrive-hostdev2 \ drive=3Ddrive-hostdev2,id=3Dhostdev2 \ -drive file.driver=3Discsi,file.portal=3Dexample.org:3260,\ file.target=3Diqn.1992-01.com.example,file.lun=3D1,file.transport=3Dtcp,if= =3Dnone,\ -format=3Draw,id=3Ddrive-hostdev3 \ +format=3Draw,id=3Ddrive-hostdev3,readonly=3Don \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D2,lun=3D5,\ drive=3Ddrive-hostdev3,id=3Dhostdev3 \ -object secret,id=3Dhostdev4-secret0,\ diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.xml b/tests/qe= muxml2argvdata/hostdev-scsi-virtio-scsi.xml index 4903a75d13..d096e0cb28 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.xml +++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.xml @@ -58,6 +58,7 @@ +
diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-virtio-scsi.xml b/tests/= qemuxml2xmloutdata/hostdev-scsi-virtio-scsi.xml index 3a2b10d815..3e2e21dc55 100644 --- a/tests/qemuxml2xmloutdata/hostdev-scsi-virtio-scsi.xml +++ b/tests/qemuxml2xmloutdata/hostdev-scsi-virtio-scsi.xml @@ -65,6 +65,7 @@ +
--=20 2.26.2 From nobody Thu Apr 25 05:01:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600186368; cv=none; d=zohomail.com; s=zohoarc; b=UqoloWxZRW3Y+RcqjTTeUkFNK/IUMqEBb21ATaJleXtFYYOMg0nuifFvsdVCq1aDIiJllCAl7/GF4rT+OiM/n6Je/b1RztwQkeWQ62jwaprIGUeRHrmCAeSFuAiRSNUW5fhHA9dKM2b6CZZzk6Q4LsBjE6iKKGsZzc+NuyMbZ9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600186368; 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=wfQNu9AT+z7xn3VDtsvzcLv3FZOWtwoAZeNGqAJrJ2A=; b=n/pcdTN0Z4sNZkNLRXJpGk19c+L985uiS4Mraamgw5Es7D0PlPL33oOw6TkouZk2vADvtYxwcAItN29CHLy48uzS5VMgMA/SKloqi+LlfvKZKSEQHrAWzjl+ygAuy0YOXWe/gET3e7ifAdl6GGDwZT8ht5Kxmgdv6bpCQplPY7o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600186368785785.7937523944798; Tue, 15 Sep 2020 09:12:48 -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-232-CE1ZwdSSOPOzP3-LVfc9DA-1; Tue, 15 Sep 2020 12:12:45 -0400 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 E8E301084C84; Tue, 15 Sep 2020 16:12:39 +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 C3E781002D58; Tue, 15 Sep 2020 16:12:39 +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 854C544A61; Tue, 15 Sep 2020 16:12:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08FGBGIv027522 for ; Tue, 15 Sep 2020 12:11:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CCDB7B7B1; Tue, 15 Sep 2020 16:11:16 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86F657839F for ; Tue, 15 Sep 2020 16:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600186367; 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=wfQNu9AT+z7xn3VDtsvzcLv3FZOWtwoAZeNGqAJrJ2A=; b=jHe1C/nNrMU8sILQ5DX9UecQI5joiY44UdKX/Fp9xLI+ycQQCW9z5exA1onCT6ZxfzleY7 quJFukPCFiXnhGOoBanKu3DxhA+uKOrMFDAKBTkSHahIXGe4c7gYqbzZkmPYB2fhtUth2i s0SBL8qSa8/HpbVU/Dt15xoUGwdMN1A= X-MC-Unique: CE1ZwdSSOPOzP3-LVfc9DA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemuBuildHostdevSCSIAttachPrepare: Propagate 'readonly' flag also for iSCSI Date: Tue, 15 Sep 2020 18:11:09 +0200 Message-Id: <2159cf2457275d99dae760d127c2cc093270dd9e.1600186217.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 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 'readonly' hostdev property is stored separately from the virStorageSource as some hostdevs are not described by a virStorage source. We need to propagate the flag to the virStorage source also for iSCSI backends as it's used to generate the backend properties. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1868856 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_command.c | 2 +- .../hostdev-scsi-virtio-scsi.x86_64-latest.args | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c5c587b97d..0ba348e911 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5117,7 +5117,6 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= Ptr hostdev, src =3D scsisrc->u.host.src; src->type =3D VIR_STORAGE_TYPE_BLOCK; - src->readonly =3D hostdev->readonly; src->path =3D g_strdup_printf("/dev/%s", devstr); break; @@ -5132,6 +5131,7 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= Ptr hostdev, return NULL; } + src->readonly =3D hostdev->readonly; ret->storageNodeName =3D src->nodestorage; *backendAlias =3D src->nodestorage; diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.= args b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args index 47c3f09db5..bd0d790b08 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args +++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args @@ -53,7 +53,7 @@ drive=3Dlibvirt-4-backend,id=3Dua-7996c8dc-a4fa-4012-b76f= -043d20144263 \ drive=3Dlibvirt-5-backend,id=3Dhostdev2 \ -blockdev '{"driver":"iscsi","portal":"example.org:3260",\ "target":"iqn.1992-01.com.example","lun":1,"transport":"tcp",\ -"node-name":"libvirt-6-backend","read-only":false}' \ +"node-name":"libvirt-6-backend","read-only":true}' \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D2,lun=3D5,\ drive=3Dlibvirt-6-backend,id=3Dhostdev3 \ -object secret,id=3Dlibvirt-7-backend-secret0,\ --=20 2.26.2