From nobody Mon May 6 01:38:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1527688638715519.742182120647; Wed, 30 May 2018 06:57:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EE903118EA5; Wed, 30 May 2018 13:57:16 +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 B59E7308BDA2; Wed, 30 May 2018 13:57:15 +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 425F41800C9C; Wed, 30 May 2018 13:57:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4UDuabL008452 for ; Wed, 30 May 2018 09:56:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 009D920284DD; Wed, 30 May 2018 13:56:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9977620284D6 for ; Wed, 30 May 2018 13:56:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 30 May 2018 15:56:21 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] tests: qemublock: Test NBD with TLS 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: , MIME-Version: 1.0 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.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 30 May 2018 13:57:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- tests/qemublocktest.c | 1 + .../qemublocktestdata/xml2json/network-nbd-tls.json | 20 ++++++++++++++++= ++++ tests/qemublocktestdata/xml2json/network-nbd-tls.xml | 18 ++++++++++++++++= ++ 3 files changed, 39 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/network-nbd-tls.json create mode 100644 tests/qemublocktestdata/xml2json/network-nbd-tls.xml diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index ec882b43e1..8494c9e48a 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -486,6 +486,7 @@ mymain(void) TEST_DISK_TO_JSON("file-backing_basic-cache-unsafe"); TEST_DISK_TO_JSON("network-qcow2-backing-chain-cache-unsafe"); TEST_DISK_TO_JSON("dir-fat-cache"); + TEST_DISK_TO_JSON("network-nbd-tls"); TEST_DISK_TO_JSON("block-raw-noopts"); diff --git a/tests/qemublocktestdata/xml2json/network-nbd-tls.json b/tests/= qemublocktestdata/xml2json/network-nbd-tls.json new file mode 100644 index 0000000000..e68f421874 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/network-nbd-tls.json @@ -0,0 +1,20 @@ +{ + "node-name": "node-b-f", + "read-only": false, + "driver": "qcow2", + "file": "node-a-s", + "backing": null +} +{ + "driver": "nbd", + "server": { + "type": "inet", + "host": "host1.example.com", + "port": "10809" + }, + "export": "rbdpool/rbdimg", + "tls-creds": "node-a-s-tls0", + "node-name": "node-a-s", + "read-only": false, + "discard": "unmap" +} diff --git a/tests/qemublocktestdata/xml2json/network-nbd-tls.xml b/tests/q= emublocktestdata/xml2json/network-nbd-tls.xml new file mode 100644 index 0000000000..40102327e2 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/network-nbd-tls.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 01:38:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1527688651898621.8722963505281; Wed, 30 May 2018 06:57:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8824E317A8ED; Wed, 30 May 2018 13:57:30 +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 212203001A50; Wed, 30 May 2018 13:57:30 +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 B4EF84CA81; Wed, 30 May 2018 13:57:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4UDua3T008458 for ; Wed, 30 May 2018 09:56:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9760D20284DD; Wed, 30 May 2018 13:56:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BB4020284D6 for ; Wed, 30 May 2018 13:56:36 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 30 May 2018 15:56:22 +0200 Message-Id: <5c5356e9cc57765105e761f25333a1b9aed4fe37.1527688516.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: block: Add support for 'pr-manager' in qemuBlockStorageSourceGetFileProps 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: , MIME-Version: 1.0 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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 30 May 2018 13:57:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To keep feature parity, we need to be able to format the PR manager alias when using blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_block.c | 5 +++++ tests/qemublocktest.c | 1 + .../qemublocktestdata/xml2json/block-raw-reservations.json | 14 ++++++++++= ++++ .../qemublocktestdata/xml2json/block-raw-reservations.xml | 14 ++++++++++= ++++ 4 files changed, 34 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/block-raw-reservations= .json create mode 100644 tests/qemublocktestdata/xml2json/block-raw-reservations= .xml diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 09437cdb40..d1c2d756c2 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -998,6 +998,7 @@ qemuBlockStorageSourceGetFileProps(virStorageSourcePtr = src) { const char *driver =3D "file"; const char *iomode =3D NULL; + const char *prManagerAlias =3D NULL; virJSONValuePtr ret =3D NULL; if (src->iomode !=3D VIR_DOMAIN_DISK_IO_DEFAULT) @@ -1010,10 +1011,14 @@ qemuBlockStorageSourceGetFileProps(virStorageSource= Ptr src) driver =3D "host_device"; } + if (src->pr) + prManagerAlias =3D src->pr->mgralias; + ignore_value(virJSONValueObjectCreate(&ret, "s:driver", driver, "s:filename", src->path, "S:aio", iomode, + "S:pr-manager", prManagerAlias, NULL) < 0); return ret; } diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8494c9e48a..0c335abc5b 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -489,6 +489,7 @@ mymain(void) TEST_DISK_TO_JSON("network-nbd-tls"); TEST_DISK_TO_JSON("block-raw-noopts"); + TEST_DISK_TO_JSON("block-raw-reservations"); cleanup: virHashFree(diskxmljsondata.schema); diff --git a/tests/qemublocktestdata/xml2json/block-raw-reservations.json b= /tests/qemublocktestdata/xml2json/block-raw-reservations.json new file mode 100644 index 0000000000..2fb106d673 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/block-raw-reservations.json @@ -0,0 +1,14 @@ +{ + "node-name": "node-a-fo", + "read-only": false, + "driver": "raw", + "file": "node-a-st" +} +{ + "driver": "host_device", + "filename": "/dev/blah", + "pr-manager": "node-a-st-pr-alias", + "node-name": "node-a-st", + "read-only": false, + "discard": "unmap" +} diff --git a/tests/qemublocktestdata/xml2json/block-raw-reservations.xml b/= tests/qemublocktestdata/xml2json/block-raw-reservations.xml new file mode 100644 index 0000000000..3ebfe61186 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/block-raw-reservations.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list