From nobody Thu May 15 14:08:29 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; 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; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526296566463927.3851940788953; Mon, 14 May 2018 04:16:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0648317C67A; Mon, 14 May 2018 11:16:04 +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 5E6525C88A; Mon, 14 May 2018 11:16:04 +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 047914BB79; Mon, 14 May 2018 11:16:04 +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 w4EBFpOJ009799 for ; Mon, 14 May 2018 07:15:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23DA25C88A; Mon, 14 May 2018 11:15:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30AE55C3F7; Mon, 14 May 2018 11:15:47 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C23C109032; Mon, 14 May 2018 11:15:36 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id j20-v6so5858143pff.10; Mon, 14 May 2018 04:15:36 -0700 (PDT) Received: from ps-f25-dev.eng.nutanix.com ([205.209.132.2]) by smtp.gmail.com with ESMTPSA id d4-v6sm13292667pgv.73.2018.05.14.04.15.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 04:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I/X+5Ftjrz/QZUd9e7jCBLq9A5+g0/phBnrCn/aCpuw=; b=iwIAMNzPfcwv+VD//PBzpoG5iiwnnF7VoHyfT4WzBayu3d9T3ty7VysMdVPR+5yBnm zBYo+fRl2oDQpe7W8swMqtFCa3ztiZzdCUdX/gg9jMM1Oza6pj0rDhguJ80JkkTn2Opx 8gBi1Y3iOracQuqjf1aMkJ+cX46BuMxgSR+39bFrBG/ztOs4RpZbeCB2BAtaVzWOeYMh rrSERWTzKSbV3Vq7WUZmVcI57FI25aNhcGmgeF/lsWH2oUt0yAf+FroO/mdjC6L510Kc qUnQmw4QszWXk1Lf5R/MXuOrZnTJ9wDK87q3YlxHw7/bnFqb4FGZrL5tc8HIS7sbtXur Xc3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I/X+5Ftjrz/QZUd9e7jCBLq9A5+g0/phBnrCn/aCpuw=; b=juWpT2eCX5BJr7XQ5kz8re3sICD+OD4W1vmTTrQpHedBwGq6szKJP3enHsI49H5q4y e0cc/ezm6HOHDGJvZpqrfyfAYLTo++GrLSWtccIr4EsrPdD6hrznVCeg+L5tt39X9+AB BxqdHS95V3ZvwVP3409njbXJSAj9sVRn3p9896yUwwI8RcoYAq08uTfqVnEdwoSm3O7u 0b4417zEE5UV9DvhXph6rxaU+C8NohINPSoT7c4Ds3rVXbHu2DMUaDuYYI95BsqDeXIB lCdTh2EpyepWYQiJdgQqYzj6ShIC5QVrwPS5wqe+pZPggYtUXLsEZpQ75Dcyhs7re4IL t9fA== X-Gm-Message-State: ALKqPwdmpdL9UprjjJ2mOBVnSeLYpnIE57RuUfnNGXQTIurlZIhxKj8a ly3vvvBgRUGkxWgEC7dFii9PQg== X-Google-Smtp-Source: AB8JxZqQ179PlpdGXd/rnTjDOlceSjYgGGhojToKAPAvtVg+3eCXxVEkmjAMtkU7llFIG5sJPgmGSA== X-Received: by 2002:a63:b51a:: with SMTP id y26-v6mr8289797pge.215.1526296535472; Mon, 14 May 2018 04:15:35 -0700 (PDT) From: Prerna Saxena To: libvir-list@redhat.com Date: Mon, 14 May 2018 04:15:16 -0700 Message-Id: <20180514111522.4363-7-saxenap.ltc@gmail.com> In-Reply-To: <20180514111522.4363-1-saxenap.ltc@gmail.com> References: <20180514111522.4363-1-saxenap.ltc@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 May 2018 11:15:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 May 2018 11:15:36 +0000 (UTC) for IP:'209.85.192.195' DOMAIN:'mail-pf0-f195.google.com' HELO:'mail-pf0-f195.google.com' FROM:'saxenap.ltc@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.696 (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.192.195 mail-pf0-f195.google.com 209.85.192.195 mail-pf0-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, mprivozn@redhat.com Subject: [libvirt] [PATCH 06/12] Fix the domain def inference logic to correctly account for network-backed pflash devices. 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 14 May 2018 11:16:05 +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" Signed-off-by: Prerna Saxena --- src/qemu/qemu_parse_command.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 351425f..9b1a86e 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -650,6 +650,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, int idx =3D -1; int busid =3D -1; int unitid =3D -1; + bool is_firmware =3D false; =20 if (qemuParseKeywords(val, &keywords, @@ -772,6 +773,9 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, def->bus =3D VIR_DOMAIN_DISK_BUS_VIRTIO; } else if (STREQ(values[i], "xen")) { def->bus =3D VIR_DOMAIN_DISK_BUS_XEN; + } else if (STREQ(values[i], "pflash")) { + def->bus =3D VIR_DOMAIN_DISK_BUS_LAST; + is_firmware =3D true; } else if (STREQ(values[i], "sd")) { def->bus =3D VIR_DOMAIN_DISK_BUS_SD; } @@ -943,8 +947,25 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, ignore_value(VIR_STRDUP(def->dst, "hda")); } =20 - if (!def->dst) - goto error; + if (!def->dst) { + if (is_firmware && def->bus =3D=3D VIR_DOMAIN_DISK_BUS_LAST) { + if (!dom->os.loader && (VIR_ALLOC(dom->os.loader) < 0)) + goto error; + if (def->src->readonly) { + /* Loader spec */ + dom->os.loader->src =3D def->src; + dom->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_PFLASH; + } else { + /* NVRAM Spec */ + if (!dom->os.loader->nvram && (VIR_ALLOC(dom->os.loader->n= vram) < 0)) + goto error; + dom->os.loader->nvram =3D def->src; + } + } else { + goto error; + } + } + if (STREQ(def->dst, "xvda")) def->dst[3] =3D 'a' + idx; else @@ -2215,8 +2236,11 @@ qemuParseCommandLine(virCapsPtr caps, } else if (STREQ(arg, "-bios")) { WANT_VALUE(); if (VIR_ALLOC(def->os.loader) < 0 || - VIR_STRDUP(def->os.loader->path, val) < 0) + VIR_ALLOC(def->os.loader->src) < 0 || + VIR_STRDUP(def->os.loader->src->path, val) < 0) goto error; + def->os.loader->src->type =3D VIR_STORAGE_TYPE_FILE; + def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; } else if (STREQ(arg, "-initrd")) { WANT_VALUE(); if (VIR_STRDUP(def->os.initrd, val) < 0) --=20 1.8.1.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list