[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] xl / xend feature parity: Missing '-a' option for xl 'shutdown' to shutdown all domains



Friday, August 31, 2012, 1:52:18 PM, you wrote:

> On Fri, 2012-08-31 at 12:32 +0100, Sander Eikelenboom wrote:
>> Friday, August 31, 2012, 12:55:06 PM, you wrote:
>> 
>> > On Fri, 2012-08-31 at 11:49 +0100, Sander Eikelenboom wrote:
>> >> Hi All,
>> >> 
>> >> Is there any reason why xl doesn't support the '-a' option for
>> >> shutdown,  to shutdown all domains ?
>> 
>> > I'd never heard of it for one thing ;-)
>> 
>> > It should be a reasonably easy patch -- I can give some pointers if you
>> > are interested.
>> 
>> > Ian.
>> 
>> Could give it a try, although my C skills are virtually non existent :-)
>> So every pointer could be handy !
> [...]
>>      - Implement the '-a' option

> In the case where -a is given you want to call libxl_list_domain, then
> loop over the list and finally call libxl_dominfo_list_free.

> main_list() might be a handy reference although its semantics are subtly
> different (it effective assumes -a if you don't give a domain, which you
> don't want for shutdown!)

> vcpulist() might also be a handy reference.

>>      - Update docs that '-a' is supported

> This should be the easiest bit ;-)

Yes it seems to be ...
Just hit another thing i'm wondering about ...

The docs say you have to supply a domain_id as argument.
But if you supply a domain_name instead it works as well.

But what if i'm stupid enough to give my domain a number as name (which seems 
to be allowed/possible)
In that case i can't shut it down by name:

serveerstertje:~# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  1024     6     r-----   22318.7
media                                       12   256     1     -b----      73.0
webproxy                                    14   768     5     -b----   41385.2
www                                         15   507     2     -b----     670.8
13                                          17   256     1     -b----       3.2

13                                          17   256     1     -b----       3.2
serveerstertje:~# xl shutdown 13
13 is an invalid domain identifier (rc=-6)



> You also want to update xl_cmdtable.c to include the new option in xl
> help etc.

>>      - Find out what "--halt" / "-H" did .. and perhaps implement that as 
>> well

> tools/python/xen/xm/shutdown.py says
>         gopts.opt('halt', short='H',
>                   fn=set_true, default=0,
>                   use='Shutdown without reboot.')

> which I guess means shutdown on xm can behave like xm reboot. Later on
> it does:
>     if opts.vals.halt:
>         return 'halt'
>     elif opts.vals.reboot:
>         return 'reboot'
>     else:
>         return 'poweroff'

> i.e.
>         xm shutdown -H -> "halt"
>         xm shutdown -R -> "reboot"
>         xm shutdown    -> "poweroff"

> Linux in a guest treats "halt" and "poweroff" identically.

> So I think --halt/-H is pointless and you can remove it from the
> defaults.

>>      - Change /etc/default to use the short option format, so it will work 
>> for both xm and xl

> In principal it is possible for xl to support long options too (see e.g.
> main_create, but changing the default would be OK for 4.2 IMHO.

> Thanks for looking into this.

> Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.