From nobody Thu Apr 25 15:29:07 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; 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 152613335041745.10387615422053; Sat, 12 May 2018 06:55:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E9AD330CB1EB; Sat, 12 May 2018 13:55:47 +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 B97A530B7C44; Sat, 12 May 2018 13:55:46 +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 5DF4B180B536; Sat, 12 May 2018 13:55:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4CDteMm009427 for ; Sat, 12 May 2018 09:55:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB5A81001952; Sat, 12 May 2018 13:55:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C41BB1001944 for ; Sat, 12 May 2018 13:55:38 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) (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 8D57B3003426 for ; Sat, 12 May 2018 13:55:27 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id v5-v6so7903026wrf.9 for ; Sat, 12 May 2018 06:55:27 -0700 (PDT) Received: from localhost.localdomain ([2a02:ab04:16c0:f00:221:5dff:fe32:e1d0]) by smtp.googlemail.com with ESMTPSA id h196-v6sm4338221wme.1.2018.05.12.06.55.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 May 2018 06:55:25 -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=0uBwhNz6otEQ9OZMNaPiIO3DIDdzFi+SVp0xrRB77ao=; b=VY0ichn7gWGRf8Sq/2cutxB5fOkQv8Rtdyq6h2kTLkpMkYNI1H3dl7Xc4KS+RwUMnZ n+kKq2Y2Ny1+lrOTpj9v4C8t9syoKbOL1zaKDe+NMVGRj1K1N/v297rBtTVxyj4Isuzs AHt1GG7QOHbGDYXcOQAJCyJfYEuvLVUmq2jo+QB9Q+ZEXqS/hYw7llYPsnZY1WaNeNdc pYjUS81eI9TaFg23RCzAS7ga6zKgkyXpQuvGzTHiBp7XG9f0CaejLgvJr8qGQntl2JjF VYmWvKwydmPhPT/GySVwA0S6lOJxaOTVQOuaVx/lgk3CKobtjEWwRcVEvAehthUFiXLi 6tOw== 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=0uBwhNz6otEQ9OZMNaPiIO3DIDdzFi+SVp0xrRB77ao=; b=gZtKitAPa340HNVPxCPBQjKzzc68ObSmTZPc1Ta5KlrgVEoN8Mn+ROT1l4AgSRRmJ7 FWlQflSAAWDBt3N7vJS/+GU79DekACotR/um7G879MCx3EEP1qvEvfpYEpDTxalJ0llP Nqj+33rOgH8c0kUX+2/Cqnr/9lt0V3yy5BoOsQsS0e0QWT7hTTGYsBIW6K94phYLaFas 3H5vK0buHv4xXskbt8vk4HURESZT7c+xTHM+vwVA2tkpt+OJo8c6JvQxrUFm8WWJCS7b JA9I4r5HVnZX9cv+YixD0PQsJ3t/G0lWO7kzobvjAsI0mNv2flFMjsCHCvg45Lo7KeAP uLfw== X-Gm-Message-State: ALKqPwcsTFqlil8HmQlsjKBczQHT458vZ4nW+r8XvI2NXrlSDzCgiTPU 6UWrFQCykFGeimshdtN9BIB9+Np2 X-Google-Smtp-Source: AB8JxZoo1QC2Sxh1pLUbqzqM+4JtMVQTTnKKovJJTQ/feiKg8PLifX2LQ8Ijw82MFDloyQldkuQzVg== X-Received: by 2002:adf:c3cd:: with SMTP id d13-v6mr2225750wrg.282.1526133325856; Sat, 12 May 2018 06:55:25 -0700 (PDT) From: Filip Alac To: libvir-list@redhat.com Date: Sat, 12 May 2018 17:45:02 +0200 Message-Id: <20180512154502.1529-1-filipalac@gmail.com> In-Reply-To: <1d9ad8a3-8741-e153-4ce1-f6f41d290308@suse.com> References: <1d9ad8a3-8741-e153-4ce1-f6f41d290308@suse.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 May 2018 13:55:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 May 2018 13:55:27 +0000 (UTC) for IP:'209.85.128.193' DOMAIN:'mail-wr0-f193.google.com' HELO:'mail-wr0-f193.google.com' FROM:'filipalac@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.3 * (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.128.193 mail-wr0-f193.google.com 209.85.128.193 mail-wr0-f193.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Filip Alac Subject: [libvirt] [PATCH v2] xenconfig: xm: Fix checking for extra in parser 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 May 2018 13:55:49 +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" Parser assumed extra was always present when root was specified. Fixed by handling root and extra separately. Signed-off-by: Filip Alac Reviewed-by: Jim Fehlig --- src/xenconfig/xen_xm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c index 8ef68bbc..4becb40b 100644 --- a/src/xenconfig/xen_xm.c +++ b/src/xenconfig/xen_xm.c @@ -91,10 +91,13 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def) if (xenConfigGetString(conf, "root", &root, NULL) < 0) return -1; =20 - if (root) { + if (root && extra) { if (virAsprintf(&def->os.cmdline, "root=3D%s %s", root, extra)= < 0) return -1; - } else { + } else if (root) { + if (virAsprintf(&def->os.cmdline, "root=3D%s", root) < 0) + return -1; + } else if (extra) { if (VIR_STRDUP(def->os.cmdline, extra) < 0) return -1; } --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list