From: Ian Campbell Subject: Re: [Xen-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu Date: Mon, 16 Jun 2014 10:57:06 +0100 Message-ID: <1402912626.14282.4.camel@kazak.uk.xensource.com> References: <1401867299-7715-1-git-send-email-cyliu@suse.com> <1401867299-7715-2-git-send-email-cyliu@suse.com> <1402567125.9177.26.camel@kazak.uk.xensource.com> <539AFFEE02000066000381DC@soto.provo.novell.com> <1402648083.26678.17.camel@kazak.uk.xensource.com> <539F09EF0200006600038D6C@soto.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <539F09EF0200006600038D6C@soto.provo.novell.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Chun Yan Liu Cc: xen-devel@lists.xensource.com, Ian Jackson , qemu-devel@nongnu.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, 2014-06-16 at 01:14 -0600, Chun Yan Liu wrote: > > > > > @@ -1007,9 +1030,16 @@ static void parse_config_data(const char > > > > *config_source, > > > > > > > > > > switch(b_info->type) { > > > > > case LIBXL_DOMAIN_TYPE_HVM: > > > > > - if (!xlu_cfg_get_string (config, "kernel", &buf, 0)) > > > > > - fprintf(stderr, "WARNING: ignoring \"kernel\" directive for > > HVM > > > > guest. " > > > > > - "Use \"firmware_override\" instead if you really > > want a > > > > non-default firmware\n"); > > > > > + if (!xlu_cfg_get_string (config, "kernel", &buf, 0)) { > > > > > + if (strstr(buf, "hvmloader")) > > > > > + fprintf(stderr, "WARNING: ignoring \"kernel\" directive > > > > > > for HVM guest. " > > > > > + "Use \"firmware_override\" instead if you really > > > > > > want a non-default firmware\n"); > > > > > > > > I think we've had this for a few releases now, I wonder if it has served > > > > its purpose? Especially since the strstr check could have false > > > > positives and negatives. > > > > > > I think it's mainly to handle the old config file format, like: > > > kernel="/usr/lib/xen/boot/hvmloader" > > > in fact, in most of our hvm config files, this line still exists. > > > > Hrm. I wonder if we could check for that specific string then? Perhaps > > also $FOODIR/.../hvmloader (where $FOODIR is whichever bit of that path > > comes from autoconf)? > > Or simply check basename="hvmloader". I think that would work. Rather than writing a basename function it might be sufficient to check that the tail of the string is/isn't "/hvmloader". Ian.