From nobody Wed May 1 12:01:23 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.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498220245817115.6750502642459; Fri, 23 Jun 2017 05:17:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76EC8285B1; Fri, 23 Jun 2017 12:17:23 +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 EFA0052351; Fri, 23 Jun 2017 12:17:22 +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 E44FC184383F; Fri, 23 Jun 2017 12:17:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NCGiNa012779 for ; Fri, 23 Jun 2017 08:16:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 145481751E; Fri, 23 Jun 2017 12:16:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F8C91754E; Fri, 23 Jun 2017 12:16:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 76EC8285B1 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 76EC8285B1 From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 14:16:45 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH v2 1/2] Revert "qemu: Check duplicate WWNs also for hotplugged disks" 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Jun 2017 12:17:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Similarly to commit 5da28cc3069b573f54f0bcaf8eb75476bcfdc6e9 this check actually does not make sense since duplicate WWNs are used e.g. when multipathing disks. This reverts commit 780fe4e4baf7e2f10f65ba1a34f9274fc547cad2. --- src/conf/domain_conf.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0409c62ef..fdf85d5dd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25510,34 +25510,6 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr = def ATTRIBUTE_UNUSED, return 0; } - -/** - * virDomainDefGetDiskByWWN: - * @def: domain definition - * @wwn: wwn of a disk to find - * - * Returns a disk definition pointer corresponding to the given WWN identi= fier - * or NULL either if @wwn was NULL or if disk with given WWN is not presen= t in - * the domain definition. - */ -static virDomainDiskDefPtr -virDomainDefGetDiskByWWN(virDomainDefPtr def, - const char *wwn) -{ - size_t i; - - if (!wwn) - return NULL; - - for (i =3D 0; i < def->ndisks; i++) { - if (STREQ_NULLABLE(def->disks[i]->wwn, wwn)) - return def->disks[i]; - } - - return NULL; -} - - int virDomainDefCompatibleDevice(virDomainDefPtr def, virDomainDeviceDefPtr dev, @@ -25581,15 +25553,6 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, } } - if (dev->type =3D=3D VIR_DOMAIN_DEVICE_DISK) { - if (!!virDomainDefGetDiskByWWN(def, dev->data.disk->wwn)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Domain already has a disk with wwn '%s'"), - dev->data.disk->wwn); - return -1; - } - } - return 0; } --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 12:01:23 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.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498220256229129.8559582811066; Fri, 23 Jun 2017 05:17:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3A34C04F4C4; Fri, 23 Jun 2017 12:17:32 +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 D10126C415; Fri, 23 Jun 2017 12:17:32 +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 85B11261; Fri, 23 Jun 2017 12:17:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NCGjSb012803 for ; Fri, 23 Jun 2017 08:16:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2CC521751D; Fri, 23 Jun 2017 12:16:45 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AE3A6A452; Fri, 23 Jun 2017 12:16:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F3A34C04F4C4 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F3A34C04F4C4 From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 14:16:46 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH v2 2/2] tests: hotplug: Test disks with duplicate WWNs 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Jun 2017 12:17:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- tests/qemuhotplugtest.c | 5 ++ .../qemuhotplug-disk-scsi-duplicate-wwn.xml | 8 +++ ...-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 74 ++++++++++++++++++= ++++ .../qemuhotplug-base-live+disk-scsi-wwn.xml | 63 ++++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-dupl= icate-wwn.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk= -scsi-wwn+disk-scsi-duplicate-wwn.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk= -scsi-wwn.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index fe97fd0dc..79f032690 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -76,6 +76,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_DISK_WWN); if (event) virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT); @@ -809,6 +810,10 @@ mymain(void) DO_TEST_DETACH("base-live", "ivshmem-plain-detach", false, false, "device_del", QMP_OK, "object-del", QMP_OK); + DO_TEST_ATTACH("base-live+disk-scsi-wwn", + "disk-scsi-duplicate-wwn", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); #define DO_TEST_CPU_GROUP(prefix, vcpus, modernhp, expectfail) = \ do { = \ diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-duplicate-w= wn.xml b/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-duplicate-wwn.x= ml new file mode 100644 index 000000000..5d09ad973 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-duplicate-wwn.xml @@ -0,0 +1,8 @@ + + + + + + + 0x5000c50015ea71aa + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-w= wn+disk-scsi-duplicate-wwn.xml b/tests/qemuhotplugtestdomains/qemuhotplug-b= ase-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml new file mode 100644 index 000000000..4c3ea3202 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk= -scsi-duplicate-wwn.xml @@ -0,0 +1,74 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + + + + + + + 0x5000c50015ea71aa + +
+ + + + + + + + + 0x5000c50015ea71aa + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-w= wn.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn.x= ml new file mode 100644 index 000000000..0de8656d2 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn.xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + + + + + + + 0x5000c50015ea71aa + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list