From patchwork Wed Jun 18 08:58:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32126 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31566206A0 for ; Wed, 18 Jun 2014 09:00:55 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id y10sf1741278pdj.5 for ; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:from:to:date:in-reply-to :references:organization:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=bDjwbHi7GUC8kXV0zu80RnavQwjn9Nv7tGYi9dxvmyE=; b=Nlqon+riccdC/PAWXJxg/3ySlVBgMkG+OCltg9BUB9uKp0Fk57nVXvygyojZqciv2U zNo0HRHD81Khw666/YTtVMYyLOpnXRcjgNOUITrpHbba4DuRe4kXtIKJCuUl3BDni88J xKuEi7P6rY7QSQHR77tqhhgcjNgwYn7yYxc+A/h2n83X451EMvUDaLNxn5KvxvXDcQ0t /bBxi1InDJyCwcPTuTOQzebFORruK3LrEh1bj1YPw8Z9Ied2XB4JR0ccZ+dX1eX55dxK THR+7MfgqxAepDTb1qL/GSzxWl3cuhpbKLaeU/rebjC9xE+knQIA9XD2V+FBOWxkvdDH FmFw== X-Gm-Message-State: ALoCoQmR9VFG+GE1yMu/jfoo7OcGbPOrkc+T3sRBCmrTvFqUv21o7NKBSVBMMkOyJH+ILa/bkDCy X-Received: by 10.68.133.138 with SMTP id pc10mr255923pbb.5.1403082054504; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.70 with SMTP id 64ls7378qgi.7.gmail; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) X-Received: by 10.52.191.97 with SMTP id gx1mr89955vdc.55.1403082054300; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id lo19si584499vdb.15.2014.06.18.02.00.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Jun 2014 02:00:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so500366vcb.3 for ; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) X-Received: by 10.58.29.234 with SMTP id n10mr398114veh.16.1403082054194; Wed, 18 Jun 2014 02:00:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp268173vcb; Wed, 18 Jun 2014 02:00:53 -0700 (PDT) X-Received: by 10.50.87.102 with SMTP id w6mr2635557igz.31.1403082053001; Wed, 18 Jun 2014 02:00:53 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id sc12si2576169igb.20.2014.06.18.02.00.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Jun 2014 02:00:52 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxBhk-000240-D0; Wed, 18 Jun 2014 08:58:52 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxBhj-00023q-NV for xen-devel@lists.xen.org; Wed, 18 Jun 2014 08:58:51 +0000 Received: from [85.158.139.211:55190] by server-14.bemta-5.messagelabs.com id E0/E6-27057-AC451A35; Wed, 18 Jun 2014 08:58:50 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1403081927!10571153!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23160 invoked from network); 18 Jun 2014 08:58:48 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Jun 2014 08:58:48 -0000 X-IronPort-AV: E=Sophos;i="5.01,499,1400025600"; d="scan'208";a="144808187" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 18 Jun 2014 08:58:47 +0000 Received: from kazak.uk.xensource.com (10.80.2.80) by FTLPEX01CL01.citrite.net (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Wed, 18 Jun 2014 04:58:46 -0400 Message-ID: <1403081925.25771.62.camel@kazak.uk.xensource.com> From: Ian Campbell To: Jim Fehlig Date: Wed, 18 Jun 2014 09:58:45 +0100 In-Reply-To: <1403018646-13890-1-git-send-email-ian.campbell@citrix.com> References: <1403018646-13890-1-git-send-email-ian.campbell@citrix.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.12.2-1 MIME-Version: 1.0 X-Originating-IP: [10.80.2.80] X-DLP: MIA2 Cc: libvir-list@redhat.com, xen-devel@lists.xen.org Subject: Re: [Xen-devel] [PATCH libvirt] xen: handle root= in xen-xm configuration files. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On Tue, 2014-06-17 at 16:24 +0100, Ian Campbell wrote: > + if (xenXMConfigGetString(conf, "extra", &extra, NULL) < 0) This was subtly broken. The default needs to be "". -----8<------ >From 539412a6deac8b928c82945d692ef20a49535d65 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 17 Jun 2014 15:48:48 +0100 Subject: [PATCH] xen: handle root= in xen-xm configuration files. In addition to extra= xm supported a root= option which was supposed to be incorporated into the final command line. Handle that for "virsh domxml-from-native xen-xm". Tested with the libxl backend. Signed-off-by: Ian Campbell --- v2: extra should default to "". --- .gnulib | 2 +- ---> WTF. I stripped this out of the patch shown below... src/xenxs/xen_xm.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index b2db97d..745041b 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -339,6 +339,8 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, def->os.nBootDevs++; } } else { + const char *extra, *root; + if (xenXMConfigCopyStringOpt(conf, "bootloader", &def->os.bootloader) < 0) goto cleanup; if (xenXMConfigCopyStringOpt(conf, "bootargs", &def->os.bootloaderArgs) < 0) @@ -348,8 +350,18 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, goto cleanup; if (xenXMConfigCopyStringOpt(conf, "ramdisk", &def->os.initrd) < 0) goto cleanup; - if (xenXMConfigCopyStringOpt(conf, "extra", &def->os.cmdline) < 0) + if (xenXMConfigGetString(conf, "extra", &extra, "") < 0) + goto cleanup; + if (xenXMConfigGetString(conf, "root", &root, NULL) < 0) goto cleanup; + + if (root) { + if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0) + goto cleanup; + } else { + if (VIR_STRDUP(def->os.cmdline, extra) < 0) + goto cleanup; + } } if (xenXMConfigGetULongLong(conf, "memory", &def->mem.cur_balloon,