From: Stefano Stabellini Subject: Re: [PATCH DOCDAY] introduce an xl man page in pod format Date: Wed, 9 Nov 2011 14:41:15 +0000 Message-ID: References: <1319798611.9436.227.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <1319798611.9436.227.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 28 Oct 2011, Ian Campbell wrote: > On Thu, 2011-10-27 at 17:19 +0100, Stefano Stabellini wrote: > > This is the initial version of an xl man page, based on the old xm man > > page. > > Almost every command implemented in xl should be present, a notable > > exception are the tmem commands that are currently missing. > > I think it's worth enumerating all the commands, even with a TBD, since > it marks what is missing. the only ones that are missing are the tmem commands so I am going to add them > > Further improvements and clarifications to this man page are very welcome. > > > > Signed-off-by: Stefano Stabellini > > > > diff -r 39aa9b2441da docs/man/xl.pod.1 > > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > > +++ b/docs/man/xl.pod.1 Thu Oct 27 15:59:03 2011 +0000 > > @@ -0,0 +1,805 @@ > > +=head1 NAME > > + > > +XL - Xen management tool, based on LibXenlight > > + > > +=head1 SYNOPSIS > > + > > +B I [I] > > B [I] I [I] > > The interesting global-args are -v (verbose, can be used repeatedly) and > -N (dry-run). OK > > + > > +=head1 DESCRIPTION > > + > > +The B program is the new tool for managing Xen guest > > +domains. The program can be used to create, pause, and shutdown > > +domains. It can also be used to list current domains, enable or pin > > +VCPUs, and attach or detach virtual block devices. > > +The old B tool is deprecated and should not be used. > > + > > +The basic structure of every B command is almost always: > > + > > +=over 2 > > + > > +B I [I] I > > + > > +=back > > + > > +Where I is one of the subcommands listed below, I > > +is the numeric domain id, or the domain name (which will be internally > > +translated to domain id), and I are subcommand specific > > +options. There are a few exceptions to this rule in the cases where > > +the subcommand in question acts on all domains, the entire machine, > > +or directly on the Xen hypervisor. Those exceptions will be clear for > > +each of those subcommands. > > + > > +=head1 NOTES > > + > > +Most B operations rely upon B and B: make > > +sure you start the script B at boot time to > > +initialize all the daemons needed by B. > > + > > +In the most common network configuration, you need to setup a bridge in dom0 > > +named B in order to have a working network in the guest domains. > > +Please refer to the documentation of your Linux distribution to know how to > > +setup the bridge. > > + > > +Most B commands require root privileges to run due to the > > +communications channels used to talk to the hypervisor. Running as > > +non root will return an error. > > + > > +=head1 DOMAIN SUBCOMMANDS > > + > > +The following subcommands manipulate domains directly. As stated > > +previously, most commands take I as the first parameter. > > + > > +=over 4 > > + > > +=item B [I] I > > The I is optional and if it present it must come before the > options. > In addition to the normal --option stuff you can also pass key=value to > provide options as if they were written in a configuration file, these > override whatever is in the config file. OK > While checking this I noticed that before processing arguments > main_create() does: > > if (argv[1] && argv[1][0] != '-' && !strchr(argv[1], '=')) { > filename = argv[1]; > argc--; argv++; > } > > that use of argv[1] without checking argc is a little dubious (ok if > argc<1 then argc==0 and therefore argv[argc+1]==NULL, but still...). > > > + > > +The create subcommand requires a config file: see L for > > +full details of that file format and possible options. > > + > > +I can either be an absolute path to a file, or a relative > > +path to a file located in /etc/xen. > > This isn't actually true for xl. Arguably that's a bug in xl rather than > this doc but I seem to recall that someone had a specific reason for not > doing this. OK, I am going to update the doc > > + > > +Create will return B as the domain is started. This B > +not> mean the guest OS in the domain has actually booted, or is > > +available for input. > > + > > +B > > + > > +=over 4 > > + > > +=item B<-q>, B<--quiet> > > + > > +No console output. > > + > > +=item B<-f=FILE>, B<--defconfig=FILE> > > + > > +Use the given configuration file. > > + > > +=item B<-n>, B<--dryrun> > > + > > +Dry run - prints the resulting configuration in SXP but does not create > > +the domain. > > + > > +=item B<-p> > > + > > +Leave the domain paused after it is created. > > + > > +=item B<-c> > > + > > +Attach console to the domain as soon as it has started. This is > > +useful for determining issues with crashing domains. > > ... and just as a general convenience since you often want to watch the > domain boot. OK > > + > > +=back > > + > > +B > > + > > +=over 4 > > + > > +=item I > > + > > + xl create DebianLenny > > + > > +This creates a domain with the file /etc/xen/DebianLenny, and returns as > > +soon as it is run. > > + > > +=back > > + > > +=item B I > > + > > +Attach to domain I's console. If you've set up your domains to > > +have a traditional log in console this will look much like a normal > > +text log in screen. > > + > > +Use the key combination Ctrl+] to detach the domain console. > > This takes -t [pv|serial] and -n (num) options. I'll add those options > > + > > +=item B [I] I > > + > > +Attach to domain's VNC server, forking a vncviewer process. > > + > > +B > > + > > +=over 4 > > + > > +=item I<--autopass> > > + > > +Pass VNC password to vncviewer via stdin. > > What is the behaviour if you don't do this? I am not sure. Maybe Ian knows. > Are the sub-commands intended to be in some sort of order. In general > they seem to be alphabetical but in that case vncviewer does not belong > here. I'll order them alphabetically. > [...] > > +=item B [I] [I ...] > > + > > +Prints information about one or more domains. If no domains are > > +specified it prints out information about all domains. > > + > > + > > +B > > + > > +=over 4 > > + > > +=item B<-l>, B<--long> > > + > > +The output for B is not the table view shown below, but > > +instead presents the data in SXP compatible format. > > + > > +=item B<-Z>, B<--context> > > +Also prints the security labels. > > + > > +=item B<-v>, B<--verbose> > > + > > +Also prints the domain UUIDs, the shutdown reason and security labels. > > + > > +=back > > + > > +B > > + > > +An example format for the list is as follows: > > + > > + Name ID Mem VCPUs State Time(s) > > + Domain-0 0 750 4 r----- 11794.3 > > + win 1 1019 1 r----- 0.3 > > + linux 2 2048 2 r----- 5624.2 > > + > > +Name is the name of the domain. ID the numeric domain id. Mem is the > > +desired amount of memory to allocate to the domain (although it may > > +not be the currently allocated amount). VCPUs is the number of > > +virtual CPUs allocated to the domain. State is the run state (see > > +below). Time is the total run time of the domain as accounted for by > > +Xen. > > + > > +B > > + > > +The State field lists 6 states for a Xen domain, and which ones the > > +current domain is in. > > + > > +=over 4 > > + > > +=item B > > + > > +The domain is currently running on a CPU. > > + > > +=item B > > + > > +The domain is blocked, and not running or runnable. This can be caused > > +because the domain is waiting on IO (a traditional wait state) or has > > +gone to sleep because there was nothing else for it to do. > > + > > +=item B

> > + > > +The domain has been paused, usually occurring through the administrator > > +running B. When in a paused state the domain will still > > +consume allocated resources like memory, but will not be eligible for > > +scheduling by the Xen hypervisor. > > + > > +=item B > > + > > +FIXME: Why would you ever see this state? > > This is XEN_DOMINF_shutdown which just says "/* The guest OS has shut > down. */". It is set in response to the guest calling SCHEDOP_shutdown. > I think it corresponds to the period between the guest shutting down and > the toolstack noticing and beginning to tear it down (when it moves to > dying). OK > > +=item B > > + > > +The domain has crashed, which is always a violent ending. Usually > > +this state can only occur if the domain has been configured not to > > +restart on crash. See L for more info. > > + > > +=item B > > + > > +The domain is in process of dying, but hasn't completely shutdown or > > +crashed. > > + > > +FIXME: Is this right? > > I think so. This is XEN_DOMINF_dying which says "/* Domain is scheduled > to die. */" OK > > + > > +=item B [I] I I > > + > > +Migrate a domain to another host machine. By default B relies on ssh as a > > +transport mechanism between the two hosts. > > + > > +B > > + > > +=over 4 > > + > > +=item B<-s> I > > + > > +Use instead of ssh. String will be passed to sh. If empty, run > > + instead of ssh xl migrate-receive [-d -e]. > > + > > +=item B<-e> > > + > > +On the new host, do not wait in the background (on ) for the death of the > > +domain. > > Would be useful to reference the equivalent option to "xl create" here > just to clarify that they mean the same. Yes, good idea. > > +=item B [I] I > > + > > +Reboot a domain. This acts just as if the domain had the B > > +command run from the console. > > This relies on PV drivers, I think. yes, I'll add that > Not all guests have the option of typing "reboot" on the console but I > suppose it is clear enough what you mean. > > > The command returns as soon as it has > > +executed the reboot action, which may be significantly before the > > +domain actually reboots. > > + > > +The behavior of what happens to a domain when it reboots is set by the > > +B parameter of the xldomain.cfg file when the domain was > > +created. > > + > > +=item B [I] [I] I > > + > > +Build a domain from an B state file. See B for more info. > > + > > +B > > + > > +=over 4 > > + > > +=item B<-p> > > + > > +Do not unpause domain after restoring it. > > + > > +=item B<-e> > > + > > +Do not wait in the background for the death of the domain on the new host. > > Reference xl create? > yep > > + > > +=item B<-d> > > + > > +Enable debug messages. > > + > > +=back > > + > > +=item B [I] I I [I] > > + > > +Saves a running domain to a state file so that it can be restored > > +later. Once saved, the domain will no longer be running on the > > +system, unless the -c option is used. > > +B restores from this checkpoint file. > > +Passing a config file argument allows the user to manually select the VM config > > +file used to create the domain. > > + > > + > > +=over 4 > > + > > +=item B<-c> > > + > > +Leave domain running after creating the snapshot. > > + > > +=back > > + > > + > > +=item B [I] I > > + > > +Gracefully shuts down a domain. This coordinates with the domain OS > > +to perform graceful shutdown, so there is no guarantee that it will > > +succeed, and may take a variable length of time depending on what > > +services must be shutdown in the domain. The command returns > > +immediately after signally the domain unless that B<-w> flag is used. > > Does this rely on pv drivers or does it inject ACPI events etc on HVM? Yes, it requires PV drivers, I'll add that. > > + > > +The behavior of what happens to a domain when it reboots is set by the > behaviour ? > > > +B parameter of the xldomain.cfg file when the domain was > > +created. > > + > > +B > > + > > +=over 4 > > + > > +=item B<-w> > > + > > +Wait for the domain to complete shutdown before returning. > > + > > +=back > > + > > +=item B I I > > + > > +Send a I signal to the domain. For more > > +information on available magic sys req operations, see sysrq.txt in > > +your Linux Kernel sources. > > It would be nice to word this in a more generic fashion and point out > that the specific implementation on Linux behaves like sysrq. Other > guests might do other things? > > Relies on PV drivers. OK > > [...] > > + > > +=item B I I > > + > > +Enables the I virtual CPUs for the domain in question. > > +Like mem-set, this command can only allocate up to the maximum virtual > > +CPU count configured at boot for the domain. > > + > > +If the I is smaller than the current number of active > > +VCPUs, the highest number VCPUs will be hotplug removed. This may be > > +important for pinning purposes. > > + > > +Attempting to set the VCPUs to a number larger than the initially > > +configured VCPU count is an error. Trying to set VCPUs to < 1 will be > > +quietly ignored. > > + > > +Because this operation requires cooperation from the domain operating > > +system, there is no guarantee that it will succeed. This command will > > +not work with a full virt domain. > > I thought we supported some VCPU hotplug for HVM (using ACPI and such) > these days? Yes you are right, I'll remove it. > [...] > > +=item B I I