Xen-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Wei Liu <wl@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH] libxlu: Handle += in config files
Date: Fri, 16 Aug 2019 14:09:34 +0100
Message-ID: <20190816130934.GH1289@perard.uk.xensource.com> (raw)
In-Reply-To: <20190816124707.l4qnujnvs5epf3kp@liuwe-gateway.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net>

On Fri, Aug 16, 2019 at 12:47:07PM +0000, Wei Liu wrote:
> On Tue, Aug 13, 2019 at 05:42:15PM +0100, Anthony PERARD wrote:
> > On Tue, Aug 13, 2019 at 04:47:23PM +0100, Andrew Cooper wrote:
> > > Error between user and terminal. :)
> > > 
> > > I'd sync'd xl and libxl.so, but not libxlu.so
> > 
> > I actually made the same mistake first time I tried.
> > 
> > > Ok, so that is working now.  I think 'cmdline+=" dom0=pvh
> > > dom0-iommu=none"' is slightly less tortured syntax, but I guess there is
> > > no way that this isn't going to be horrible.
> > > 
> > > As for the general mechanism, how usable is += for anything other than
> > > cmdline?  Most strings in config files can't usefully be extended in
> > > this matter - if they need changing, they need changing wholesale.
> > 
> > That's true, but one could imaging some maybe bad example like adding a
> > suffix to the name of the guest: "name+='-ovmf';".
> > Going through `man xl.cfg', maybe a good example other than cmdline
> > could be "cpus+=',^1'" but maybe a space is fine here, or one could use
> > a list instead.
> > Other potential uses could be for "PATH", but in this case it would be
> > better reset the setting rather that attempting to add a suffix to an
> > existing one.
> > 
> > I wonder if instead of doing += on all strings, we should instead have
> > `xl' whitelist the few options where += would make sense. (and at that
> > point, it would be easy to add a ' ' where is make sense, like
> > "cmdline"s. But then, how to tell users that it can't do "name+='-new'"?
> > because xlu would just print a warning, and xl would keep going with
> > name="".  Try "xl create memory+=42" ;-).
> 
> Not sure I follow. Can you limit this in xl?

With a patch to xl, yes ;-). What could be done is to add a new API in
libxlu. The original function get_string() could return an error if +=
was used on a specific setting. A new function get_appended_string()
(working title), could return return a string with the += computation
done. That way, xl can choose which setting are allowed to have += used
(and it could even use how to do it, i.e. add spaces between strings or
not).

> Isn't += handled in libxlu already?

It's not, this patch adds the capability into libxlu.

Cheers,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 14:48 Anthony PERARD
2019-08-13 15:06 ` Andrew Cooper
2019-08-13 15:30   ` Anthony PERARD
2019-08-13 15:47     ` Andrew Cooper
2019-08-13 16:42       ` Anthony PERARD
2019-08-16 12:47         ` Wei Liu
2019-08-16 13:09           ` Anthony PERARD [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190816130934.GH1289@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Xen-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/xen-devel/0 xen-devel/git/0.git
	git clone --mirror https://lore.kernel.org/xen-devel/1 xen-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 xen-devel xen-devel/ https://lore.kernel.org/xen-devel \
		xen-devel@lists.xenproject.org xen-devel@archiver.kernel.org
	public-inbox-index xen-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.xenproject.lists.xen-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox