From nobody Wed May 14 10:27:11 2025 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 1526294549205523.5724547085905; Mon, 14 May 2018 03:42:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A55E6C4657; Mon, 14 May 2018 10:42:27 +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 34D0618171; Mon, 14 May 2018 10:42:27 +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 DAEAE4BB78; Mon, 14 May 2018 10:42:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4EAgIQ3003631 for ; Mon, 14 May 2018 06:42:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 953722026DFD; Mon, 14 May 2018 10:42:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C50A2026E0E; Mon, 14 May 2018 10:42:17 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 14 May 2018 12:41:55 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 04/13] qemu: Move validation of PR manager support 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 14 May 2018 10:42:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Disk source definition should be validated in qemuDomainValidateStorageSource rather than in individual generators of command line arguments. Change to the XML2XML test is required since now the definition is actually validated at define time. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 7 ------- src/qemu/qemu_domain.c | 7 +++++++ tests/qemuxml2xmltest.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d84cf6dffc..29ca2005a0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9683,7 +9683,6 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm, virJSONValuePtr *propsret, char **aliasret) { - qemuDomainObjPrivatePtr priv =3D vm->privateData; char *socketPath =3D NULL; char *alias =3D NULL; int ret =3D -1; @@ -9694,12 +9693,6 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm, if (!virStoragePRDefIsEnabled(disk->src->pr)) return 0; - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("reservations not supported with this QEMU binary= ")); - return ret; - } - if (!(socketPath =3D qemuDomainGetPRSocketPath(vm, disk->src->pr))) return ret; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 233327b906..611a96d6be 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4204,6 +4204,13 @@ qemuDomainValidateStorageSource(virStorageSourcePtr = src, } } + if (virStoragePRDefIsEnabled(src->pr) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("reservations not supported with this QEMU binary= ")); + return -1; + } + return 0; } diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 762e0e2d25..44cba97d4a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -388,7 +388,7 @@ mymain(void) DO_TEST("disk-virtio-scsi-num_queues", QEMU_CAPS_VIRTIO_SCSI); DO_TEST("disk-virtio-scsi-reservations", - QEMU_CAPS_VIRTIO_SCSI); + QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_PR_MANAGER_HELPER); DO_TEST("disk-virtio-scsi-cmd_per_lun", QEMU_CAPS_VIRTIO_SCSI); DO_TEST("disk-virtio-scsi-max_sectors", --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list