From patchwork Tue Jun 17 15:24:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32053 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06F44206A0 for ; Tue, 17 Jun 2014 15:26:09 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf28086719pab.9 for ; Tue, 17 Jun 2014 08:26:09 -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:from:to:date:message-id :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=TNTk/Z2QZukKB9UYIS2HhKfGO72IuMVv90k5eDhQIqY=; b=ActzGmG/DkTkzyFF0htPX8iYqxo4b6mknWoJ02yemH7UE0lg0GwAmN51+LWSYwiB1v SAa6z3+Ksb5bKDMiAIrJuvdEJNWx8mc8WzVQ4YgwtVQIBYIy5dYKtj9gUYpUxITEeTFD PY6cB8zcT6cxi+sjvX9bxQnxNU+rM0Aw8G3d4OTyLQmMC8oB2k0aQCkjAOA4BgrPbjiI sq8POsm4u28xwLmzIsLfBRB5wmr1KvJbiWLofss4nk9kXPjqu2YBBYSH9YXt9XZ9mJxs L1fIVh+6ex3lP9+pQ5QusuO4CXr7KvD1boGyWBnGZnP1G72x4seFYlzFKzjhnyi6khA6 suWg== X-Gm-Message-State: ALoCoQl3dw15N7ulN9ICxPW7VIaV31F3WW/l57sdwI8vk4hAJdDSABPD9KaI5PUAXL+O6puLQnjU X-Received: by 10.66.66.35 with SMTP id c3mr292165pat.7.1403018769308; Tue, 17 Jun 2014 08:26:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.208 with SMTP id s74ls1409633qge.68.gmail; Tue, 17 Jun 2014 08:26:09 -0700 (PDT) X-Received: by 10.52.121.39 with SMTP id lh7mr821569vdb.66.1403018769141; Tue, 17 Jun 2014 08:26:09 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id yd5si2578574vec.100.2014.06.17.08.26.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so6482190vcb.41 for ; Tue, 17 Jun 2014 08:26:09 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr11087428vco.25.1403018769004; Tue, 17 Jun 2014 08:26:09 -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 vs6csp217829vcb; Tue, 17 Jun 2014 08:26:08 -0700 (PDT) X-Received: by 10.140.28.198 with SMTP id 64mr34645652qgz.49.1403018768526; Tue, 17 Jun 2014 08:26:08 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b9si17328348qaq.22.2014.06.17.08.26.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:26:08 -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 1WwvF5-0005bG-RO; Tue, 17 Jun 2014 15:24:11 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvF4-0005bA-Lp for xen-devel@lists.xen.org; Tue, 17 Jun 2014 15:24:10 +0000 Received: from [193.109.254.147:21644] by server-9.bemta-14.messagelabs.com id AF/D6-03644-A9D50A35; Tue, 17 Jun 2014 15:24:10 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1403018648!8550022!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 27863 invoked from network); 17 Jun 2014 15:24:09 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Jun 2014 15:24:09 -0000 X-IronPort-AV: E=Sophos;i="5.01,494,1400025600"; d="scan'208";a="144520772" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 17 Jun 2014 15:24:08 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Tue, 17 Jun 2014 11:24:07 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwvF1-0000yH-9r; Tue, 17 Jun 2014 16:24:07 +0100 From: Ian Campbell To: Jim Fehlig Date: Tue, 17 Jun 2014 16:24:06 +0100 Message-ID: <1403018646-13890-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA1 Cc: libvir-list@redhat.com, Ian Campbell , xen-devel@lists.xen.org Subject: [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.182 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: 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 --- .gnulib | 2 +- src/xenxs/xen_xm.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gnulib b/.gnulib index d55899f..e8e0eb6 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit d55899fd2c5794ac85ecb14d5e2f646a89e4b4dd +Subproject commit e8e0eb6bfb728685ec8d5afd924e41b18e9d928d diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index b2db97d..2cd6d4c 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, NULL) < 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,