From nobody Sat May 4 21:03:54 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 153555547457153.492292998766516; Wed, 29 Aug 2018 08:11:14 -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 15D6A30001E6; Wed, 29 Aug 2018 15:11:13 +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 96D0A6A050; Wed, 29 Aug 2018 15:11:12 +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 25AB318005D0; Wed, 29 Aug 2018 15:11:12 +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 w7TFBBPV022763 for ; Wed, 29 Aug 2018 11:11:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BA562166BA1; Wed, 29 Aug 2018 15:11:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FD5A2166B41 for ; Wed, 29 Aug 2018 15:11:08 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 29 Aug 2018 17:11:05 +0200 Message-Id: <9c00d48e767235decba6819dfede60940e6d4413.1535555443.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH for v4.7.0] virDomainDefCompatibleDevice: Relax alias change check 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.40]); Wed, 29 Aug 2018 15:11:13 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1621910 When introducing this check back in 4ad54a417a1 my mindset was that if an element is missing in update XML then user is requesting for removal of the corresponding setting. For instance, if is not present in update XML any QoS previously set on is cleared out. Well this assumption is correct but only to some extent. Turns out, we have some lazy users who when updating path to ISO image construct very minimalistic disk XML and pass it to device update API. Such XML is lacking a lot of information, and alias is one of them. This triggers error in virDomainDefCompatibleDevice() because we think that user is requesting to remove the alias. Well, they are not. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 38cac07913..603a4ad652 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28785,9 +28785,9 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, =20 if (action =3D=3D VIR_DOMAIN_DEVICE_ACTION_UPDATE && live && - ((!!data.newInfo !=3D !!data.oldInfo) || - (data.newInfo && data.oldInfo && - STRNEQ_NULLABLE(data.newInfo->alias, data.oldInfo->alias)))) { + (data.newInfo && data.oldInfo && + data.newInfo->alias && data.oldInfo->alias && + STRNEQ(data.newInfo->alias, data.oldInfo->alias))) { virReportError(VIR_ERR_OPERATION_DENIED, "%s", _("changing device alias is not allowed")); return -1; --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list