From nobody Sun Feb 8 08:43:19 2026 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 1553783751021331.6563726696703; Thu, 28 Mar 2019 07:35:51 -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 34E1830018FB; Thu, 28 Mar 2019 14:35:49 +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 0719D5E7D6; Thu, 28 Mar 2019 14:35:49 +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 BD58D3FB16; Thu, 28 Mar 2019 14:35:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2SEZJvi022407 for ; Thu, 28 Mar 2019 10:35:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 97F911A267; Thu, 28 Mar 2019 14:35:19 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 200821A265 for ; Thu, 28 Mar 2019 14:35:18 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 28 Mar 2019 15:34:54 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] qemuDomainDiskChangeSupported: use CHECK_STREQ_NULLABLE more 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: , Content-Type: text/plain; charset="utf-8" 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.46]); Thu, 28 Mar 2019 14:35:49 +0000 (UTC) Convert the other string comparisons to use the macro. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Laine Stump --- src/qemu/qemu_domain.c | 44 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e75ea15c91..836e30decf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9401,33 +9401,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr d= isk, CHECK_STREQ_NULLABLE(blkdeviotune.group_name, "blkdeviotune group name"); =20 - if (disk->serial && STRNEQ_NULLABLE(disk->serial, orig_disk->serial)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot modify field '%s' of the disk"), - "serial"); - return false; - } - - if (disk->wwn && STRNEQ_NULLABLE(disk->wwn, orig_disk->wwn)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot modify field '%s' of the disk"), - "wwn"); - return false; - } - - if (disk->vendor && STRNEQ_NULLABLE(disk->vendor, orig_disk->vendor)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot modify field '%s' of the disk"), - "vendor"); - return false; - } - - if (disk->product && STRNEQ_NULLABLE(disk->product, orig_disk->product= )) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot modify field '%s' of the disk"), - "product"); - return false; - } + CHECK_STREQ_NULLABLE(serial, + "serial"); + CHECK_STREQ_NULLABLE(wwn, + "wwn"); + CHECK_STREQ_NULLABLE(vendor, + "vendor"); + CHECK_STREQ_NULLABLE(product, + "product"); =20 CHECK_EQ(cachemode, "cache", true); CHECK_EQ(error_policy, "error_policy", true); @@ -9460,13 +9441,8 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr di= sk, CHECK_EQ(discard, "discard", true); CHECK_EQ(iothread, "iothread", true); =20 - if (disk->domain_name && - STRNEQ_NULLABLE(disk->domain_name, orig_disk->domain_name)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot modify field '%s' of the disk"), - "backenddomain"); - return false; - } + CHECK_STREQ_NULLABLE(domain_name, + "backenddomain"); =20 /* checks for fields stored in disk->src */ /* unfortunately 'readonly' and 'shared' can't be converted to tristate --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list