From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Carsten Schiers" Subject: AW: Re: AW: Possible Compatibility Bug in xl create Date: Wed, 25 May 2011 22:47:29 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: fantonifabio , "Ian.Campbell" Cc: xen-devel , "Stefano.Stabellini" List-Id: xen-devel@lists.xenproject.org OK, last message for today ;o). --wait option of xl will not wait for domain to have shut down. BR, Carsten. -----Urspr=FCngliche Nachricht----- Von: Carsten Schiers=20 Gesendet: Mittwoch, 25. Mai 2011 22:37 An: 'fantonifabio'; 'Ian.Campbell' Cc: 'xen-devel'; 'Stefano.Stabellini' Betreff: AW: Re: AW: [Xen-devel] Possible Compatibility Bug in xl create Sorry, one add-on: I have the feeling that /etc/init.d/xendomains stop=20 will not wait for the domains to=20 shut down. It is finished very quickly and I can see the domains=20 shutting down with xl list afterwards. I guess this is not the default behavior, as the xm version waits for=20 every domain to have disappeared. BR, Carsten. -----Urspr=FCngliche Nachricht----- Von: Carsten Schiers=20 Gesendet: Mittwoch, 25. Mai 2011 21:07 An: fantonifabio; Ian.Campbell Cc: xen-devel; Stefano.Stabellini Betreff: AW: Re: AW: [Xen-devel] Possible Compatibility Bug in xl create Crosscheck: renamed domain_create_info -> create_info_domain =20 domain_build_info -> build_info_domain=20 domid (in three device blocks) -> devdomid in tools/libxl/xl_cmdimpl.c and everything works as expected with=20 my /etc/default/xendomains, which ist shutting down and restarting=20 from /etc/xen/auto only. BR, Carsten. -----Urspr=FCngliche Nachricht----- Von: Carsten Schiers=20 Gesendet: Mittwoch, 25. Mai 2011 20:47 An: fantonifabio; Ian.Campbell Cc: xen-devel; Stefano.Stabellini Betreff: AW: Re: AW: [Xen-devel] Possible Compatibility Bug in xl create I found the problem. The (domain_create_info) and (domain_build_info)=20 statements from the "xl list -l" and eventually also the repeating (domid)=20 statements in the listing of devices per domain are confusing the parseln logic, which is=20 trying to=20 guess a domid/domname combo from the output: root@data:~# xm list -l | grep '(\(domain\|domid\|name\)' (domain (domid 0) (name Domain-0) (domain (domid 10) (name blip) (domain (domid 9) (name blub) root@data:~# xl list -l | grep '(\(domain\|domid\|name\)' (domain (domid 9) (domain_create_info) (name blub) (domain_build_info) (domid 0) (domid 0) (domid 0) (domain (domid 10) (domain_create_info) (name blip) (domain_build_info) (domid 0) (domid 0) (domid 0) parseln() { if [[ "$1" =3D~ '(domain' ]]; then name=3D;id=3D else if [[ "$1" =3D~ '(name' ]]; then name=3D$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/') else if [[ "$1" =3D~ '(domid' ]]; then id=3D$(echo $1 | sed -e 's/^.*(domid \(.*\))$/\1/') fi; fi; fi [ -n "$name" -a -n "$id" ] && return 0 || return 1 } is resetting on each (domain_create_info) and (domain_build_info) as=20 well the name/id pair and will set domid to 0 each time it comes across the=20 device listing (domid 0).=20 This will result in ignoring the entry also, as stop is containing: name=3D;id=3D while read LN; do parseln "$LN" || continue if test $id =3D 0; then continue; fi echo -n " $name" and I think it assumes in the "if test" part that it came across=20 Domain-0. I leave it to you guys "in charge" to either modify the "xl list -l"=20 command or rewrite /etc/init.d/xendomains. The patch is still needed. By the way: I had to patch it partly=20 manually, the last few lines didn't work for me when patching original xen-4.1.0. BR, Carsten. -----Urspr=FCngliche Nachricht----- Von: Carsten Schiers=20 Gesendet: Dienstag, 24. Mai 2011 22:19 An: Ian.Campbell Cc: xen-devel; Stefano.Stabellini Betreff: AW: Re: AW: [Xen-devel] Possible Compatibility Bug in xl create Hi, the patch is doing what you would expect, but still not solving my=20 issue. /etc/init.d/xendomains will start all domains, but is not stopping it. It's somewhere in the parseln=20 function, which is not recognizing the (name xyz) part. Unfortunately, I have not enough time today to test=20 further. I currently have no clue where the input from the parseln function will=20 come from in stop function. I would=20 Need to find out and check the differences between the xm and xl=20 version. In order to make it workable, I had by the way to modify the xendomains=20 script and remove the dependency of xend. As said, I plan to start all DomUs per /etc/xen/auto and=20 shutdown with shutdown of Dom0 without having xend running. If you don't see it by my description, I'll check more tomorrow evening. BR, Carsten. -----Urspr=FCngliche Nachricht----- Von: Ian Campbell [mailto:Ian.Campbell@eu.citrix.com]=20 Gesendet: Dienstag, 24. Mai 2011 11:43 An: Carsten Schiers Cc: xen-devel; Stefano Stabellini Betreff: Re: AW: [Xen-devel] Possible Compatibility Bug in xl create On Tue, 2011-05-24 at 10:40 +0100, Carsten Schiers wrote: > I'll check that tonight. Thanks. > Yep, I think modifying xendomains would be the > better way. Sorry that I overlooked your other day's question.=20 No worries, it was just a vague aside in some other conversation I think... Ian. >=20 > BR, > Carsten. >=20 > ----- Originalnachricht ----- > Von: Ian Campbell > Gesendet: Die, 24.5.2011 11:27 > An: Carsten Schiers > Cc: xen-devel ; Stefano Stabellini=20 > Betreff: Re: [Xen-devel] Possible Compatibility Bug in xl create >=20 > On Mon, 2011-05-23 at 21:01 +0100, Carsten Schiers wrote: > > Dear all, > >=20 > > there is a problem with xl that will still prevent it tob e a=20 > > replacement for xm in /etc/init.d/xendomains. > >=20 > > I tracked it down to the rdname function in the a.m. file, which is=20 > > expecting the command > >=20 > > xm create --dryrun --quiet > >=20 > > to create a Lisp-like structure, where the xendomain script will=20 extract=20 > > the DomU name from. > >=20 > > xl create --dryrun --quiet > >=20 > > will not output such a structure.=20 > >=20 > > xl -d -f =20 > >=20 > > will do, but as soon as combined with -n, it will not. > >=20 > > My setting is starting/shutting down only DomUs mentioned in=20 > > /etc/xen/auto. >=20 > Thanks, I was just asking the other day who/what used that sxp=20 output... >=20 > Personally think this behaviour of grepping the name out of the sxp is > pretty mad (I think an xl command to parse the configuration and=20 output > a specific request field value would be far better) but in the=20 interests > of xm compatibility does the following work for you? >=20 > 8<-------------------------------------- >=20 > # HG changeset patch > # User Ian Campbell > # Date 1306229164 -3600 > # Node ID 29bd959c779a629def4de2cda7c1cc2eae291df5 > # Parent 32d62506e3be95124097775dc79c42304a18084c > xl: print sxp on dry-run of create. >=20 > The help text for xm create's --dry-run says "Dry run - prints the=20 resulting > configuration in SXP but does not create the domain." so update xl > implementation to match. >=20 > Signed-off-by: Ian Campbell >=20 > diff -r 32d62506e3be -r 29bd959c779a tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Tue May 24 10:14:10 2011 +0100 > +++ b/tools/libxl/xl_cmdimpl.c Tue May 24 10:26:04 2011 +0100 > @@ -1470,10 +1470,6 @@ static int create_domain(struct domain_c > =20 > parse_config_data(config_file, config_data, config_len,=20 &d_config, &d_config.dm_info); > =20 > - ret =3D 0; > - if (dom_info->dryrun) > - goto out; > - > if (migrate_fd >=3D 0) { > if (d_config.c_info.name) { > /* when we receive a domain we get its name from the=20 config > @@ -1492,9 +1488,13 @@ static int create_domain(struct domain_c > } > } > =20 > - if (debug) > + if (debug || dom_info->dryrun) > printf_info(-1, &d_config, &d_config.dm_info); > =20 > + ret =3D 0; > + if (dom_info->dryrun) > + goto out; > + > start: > domid =3D -1; > =20 >=20 >=20 >=20 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel