From: Ian Campbell Subject: Re: Using "xl create" without domain config file Date: Wed, 4 Jul 2012 15:48:44 +0100 Message-ID: <1341413324.31696.74.camel@zakaz.uk.xensource.com> References: <20120531045040.GA16124@imp.flyn.org> <20425.863.785362.721748@mariner.uk.xensource.com> <20120602141903.GA2903@imp.flyn.org> <20431.13200.114406.125096@mariner.uk.xensource.com> <20432.59361.773966.629519@mariner.uk.xensource.com> <20120608183106.GA12674@imp.flyn.org> <20437.62868.542710.418122@mariner.uk.xensource.com> <20120611202224.GA22246@imp.flyn.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120611202224.GA22246@imp.flyn.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "W. Michael Petullo" Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org > # HG changeset patch > # Parent 435493696053a079ec17d6e1a63e5f2be3a2c9d0 > xl: Allow use of /dev/null with xl create to enable command-line definition > > xm allows specifying /dev/null as the domain configuration argument to its > create option; add same functionality to xl. xl treats the configuration > argument /dev/null as a special case. This allows specifying an entire > domain configuration on the command line. > > Signed-off-by: W. Michael Petullo Hi Michael, I have applied this patch but it seems to be against the xen 4.1 tree and not against xen-unstable. In this case I think I was able to trivially resolve the conflicts, but please do check I got it right. For future reference we generally require patches to be against unstable. Once applied there they can then be nominated for backporting to 4.1 but except in very unusual circumstances we would not apply a patch directly to a stable branch. You might also want to consider patching the xl config-update command? Ian. > > diff -r 435493696053 tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Fri May 25 08:18:47 2012 +0100 > +++ b/tools/libxl/xl_cmdimpl.c Mon Jun 11 15:18:23 2012 -0500 > @@ -1454,10 +1454,15 @@ static int create_domain(struct domain_c > > if (config_file) { > free(config_data); config_data = 0; > - ret = libxl_read_file_contents(&ctx, config_file, > - &config_data, &config_len); > - if (ret) { fprintf(stderr, "Failed to read config file: %s: %s\n", > - config_file, strerror(errno)); return ERROR_FAIL; } > + /* /dev/null represents special case (read config. from command line) */ > + if (!strcmp(config_file, "/dev/null")) { > + config_len = 0; > + } else { > + ret = libxl_read_file_contents(&ctx, config_file, > + &config_data, &config_len); > + if (ret) { fprintf(stderr, "Failed to read config file: %s: %s\n", > + config_file, strerror(errno)); return ERROR_FAIL; } > + } > if (!restore_file && extra_config && strlen(extra_config)) { > if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) { > fprintf(stderr, "Failed to attach extra configration\n"); > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel