From nobody Thu May 2 00:44:21 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; dkim=fail; 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 1514201048436701.7425186816505; Mon, 25 Dec 2017 03:24:08 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82CCA356C2; Mon, 25 Dec 2017 11:24:05 +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 C3D9260BE3; Mon, 25 Dec 2017 11:24:03 +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 48794180121F; Mon, 25 Dec 2017 11:24:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vBPBO0es023145 for ; Mon, 25 Dec 2017 06:24:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3747A5D757; Mon, 25 Dec 2017 11:24:00 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30EEE5D6A2 for ; Mon, 25 Dec 2017 11:23:58 +0000 (UTC) Received: from m15-114.126.com (m15-114.126.com [220.181.15.114]) by mx1.redhat.com (Postfix) with ESMTP id 38AE0C0467D5 for ; Mon, 25 Dec 2017 11:23:56 +0000 (UTC) Received: from localhost.localdomain (unknown [58.213.111.46]) by smtp7 (Coremail) with SMTP id DsmowACnYezB30BaoJNWBA--.59590S2; Mon, 25 Dec 2017 19:23:54 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=xEr+pvQVGI5mqJl5/6 Rx9wLt5X29WKdrikISMFshD8o=; b=Cp352ipS22tKHcozG2+0vt4sootE7oNS3d 2mzmmkllBs5QpCTc2LTG7+lexipf5BCzGFQZRlj7hwmnGleSm9j22YqOvP1+jUi3 jZ1FbGm1ikDbfqOxlcjOOmT1nrdoSyXDs5cPkzFLUZ3e10Y2EwAEhGakd63Vyjd9 L8X45najs= From: Chen Hanxiao To: libvir-list@redhat.com Date: Mon, 25 Dec 2017 19:21:53 +0800 Message-Id: <20171225112153.5195-1-chen_han_xiao@126.com> X-CM-TRANSID: DsmowACnYezB30BaoJNWBA--.59590S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ww13XrykZF47Cw1rXr1DKFg_yoW8GF17pF s5KF1IvrZ5Kr15C3ZaqFy8Xas0kFWkGa17Jrnaga42gr4rGrZ5C3ySvrnYgw15trWrC3W3 AFyrXFWI93WDA3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jUZ2-UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbi4wq5rlUw8INR9gAAsP X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 25 Dec 2017 11:23:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 25 Dec 2017 11:23:57 +0000 (UTC) for IP:'220.181.15.114' DOMAIN:'m15-114.126.com' HELO:'m15-114.126.com' FROM:'chen_han_xiao@126.com' RCPT:'' X-RedHat-Spam-Score: 1.99 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_PSBL, SPF_PASS, T_RP_MATCHES_RCVD) 220.181.15.114 m15-114.126.com 220.181.15.114 m15-114.126.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Chen Hanxiao Subject: [libvirt] [PATCH] domain_conf: skip boot order check of CD-ROM or floppy device 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 25 Dec 2017 11:24:07 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Chen Hanxiao If we insert or eject a CD-ROM/floppy device with a boot order, we may get: unsupported configuration: boot order 2 is already used by another device This check should be skipped in this case. Signed-off-by: Chen Hanxiao --- src/conf/domain_conf.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9a62bc472..885ab88d2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26880,11 +26880,19 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr= def ATTRIBUTE_UNUSED, { virDomainDeviceInfoPtr newinfo =3D opaque; =20 + int disk_device =3D device->data.disk->device; if (info->bootIndex =3D=3D newinfo->bootIndex) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("boot order %u is already used by another device"= ), - newinfo->bootIndex); - return -1; + /* Skip check for insert or eject CD-ROM device */ + if (disk_device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY || + disk_device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) { + VIR_DEBUG("Skip boot index check for floppy or CDROM"); + return 0; + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("boot order %u is already used by another dev= ice"), + newinfo->bootIndex); + return -1; + } } return 0; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list