aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/xl_cmdtable.c
Commit message (Collapse)AuthorAgeFilesLines
* xl: support for leaving domain paused after saveIan Murray2013-07-171-1/+2
| | | | | | | | | | | | | | New feature to allow xl save to leave a domain paused after its memory has been saved. This is to allow disk snapshots of domU to be taken that exactly correspond to the memory state at save time. Once the snapshot(s) have been taken or whatever, the domain can be unpaused in the usual manner. Usage: xl save -p <domid> <filespec> Signed-off-by: Ian Murray <murrayie@yahoo.co.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.Konrad Rzeszutek Wilk2013-05-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libxl_cpu_bitmap_alloc(..) function, if provided with a zero value for max CPUs will call xc_get_max_cpus() which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has. This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs. This means that a guest config like this: vcpus=8 maxvcpus=32 and on a 4 PCPU machine doing xl vcpu-set <guest name> 16 won't work. This is b/c the the size of the bitmap is one byte so it can only hold up to 8 VCPUs. Hence anything above that is going to be ignored. Note that this patch also fixes the bitmap setting - as it would set all of the bits allowed. Meaning if the user had a 4PCPU host we would still allow the user to set 8VCPUs. This second iteration of the patch fixes this. Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size: if (bit >= bitmap->size * 8) return 0; so we were never notified off this bug. This patch warns the user if they are trying to do this. If the user really wants to do this they have to provide the --ignore-host parameter to bypass this check. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* docs: Change cd-insert docs to match behaviorGeorge Dunlap2013-05-101-1/+1
| | | | | | | xl cd-insert takes a plain file. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: add node-affinity to the output of `xl list`Dario Faggioli2013-04-171-1/+2
| | | | | | | | | | | | | | | | Node-affinity is now something that is under (some) control of the user, so show it upon request as part of the output of `xl list' by the `-n' option. Re the patch, the print_bitmap() related hunk is _mostly_ code motion, although there is a very minor change in the code, basically to allow using the function for printing both cpu and node bitmaps (as, in case all bits are sets, it used to print "any cpu", which doesn't fit the nodemap case). Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: 'xl claims' print outstanding per domain claimsKonrad Rzeszutek Wilk2013-04-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to "xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)" which exposes the global claim value. This patch provides the value of the currently outstanding pages claimed for each domains. This is per domain value which is added to the global claim value which influences the hypervisors' MM system. When a claim call is done, a reservation for a specific amount of pages is set (and this patch lists said number) and also a global value is incremented. This global value is then reduced as the domain's memory is populated and eventually reaches zero. The toolstack (libxc) also sets the domain's claim to zero when the population of memory has completed as an extra step. Any call to destroy the domain will also set the domain's claim to zero. If the reservation cannot be meet the guest creation fails immediately instead of taking seconds or minutes (depending on the size of the guest) while the toolstack populates memory. See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode' global config" for details on how it is implemented. The value fluctuates quite often so the value is stale once it is provided to the user-space. However it is useful for diagnostic purposes. It is printed irregardless of global "claim_mode" option in xl.conf(5). That is b/c the user might have enabled, launched a guest, and then disabled the option - and we should still report the correct outstanding claim value. The 'man xl' shows the details of this argument. The output is close to what 'xl list' looks like: Name ID Mem VCPUs State Time(s) Claimed Domain-0 0 2047 4 r----- 19.7 0 OL5 2 2048 1 --p--- 0.0 847 OL6 3 1024 4 r----- 5.9 0 Windows_XP 4 2047 1 --p--- 0.0 1989 [In which it can be seen that the OL5 guest still has 847MB of claimed memory (out of the total 2048MB where 1191MB has been allocated to the guest).] Please note that the 'Mem' column has the cumulative value of outstanding claims and the total amount of memory that has been allocated to the guest. [v1: claims, not claim-list] [v2: Add outstanding and current memkb in the output list] [v3: Clairy docs and relax some checks] [v4: Removed comments about guest config memory being the same as 'Mem'] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* libxl: pass debug flag down to libxl_domain_suspendOlaf Hering2013-02-151-1/+2
| | | | | | | | | | | | libxl_domain_suspend is already prepared to handle LIBXL_SUSPEND_DEBUG, and xl migrate handles the -d switch as well. Pass this flag down to libxl_domain_suspend, so that finally xc_domain_save can dump huge amount of debug data to stdout. Update xl.1 and help text output. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: correct help text of xl migrateOlaf Hering2013-02-151-1/+1
| | | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: add vtpm supportMatthew Fioravante2012-11-131-0/+15
| | | | | | | | | | | | This patch adds vtpm support to libxl. It adds vtpm parsing to config files and 3 new xl commands: vtpm-attach vtpm-detach vtpm-list Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Add --wait and --all to xl reboot.Ian Campbell2012-10-181-1/+3
| | | | | | | | Inspired by a patch by Sander Eikelenboom. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Introduce xl shutdown --all support for xm compatibilityIan Campbell2012-10-181-2/+3
| | | | | | | | | | Based on a patch by Sander Eikelenboom Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> [ ijc -- fixed sizeof(foo) vs sizeof(*foo) issue pointed out by Ian J ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl/libxl: make shutdown accept the long option --wait for -wSander Eikelenboom2012-10-111-1/+1
| | | | | | | | | Make xl/libxl accept the long option --wait for -w to be compatible with xm. The long options are used in the default init and sysconfig scripts. Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: support empty CDROM devicesIan Campbell2012-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The important change here is to xlu_disk_parse to correctly set format == EMPTY for CDROM devices which are empty. Test cases are added which check for correctness here. xend accepts ',hdc:cdrom,r'[0] as an empty CDROM drive however this is not consistent with the xl syntax in docs/misc/xl-disk-configuration.txt which requires ',,hdc:cdrom,r' (the additional positional paramter is the format). I'm not sure if/how this can be fixed. Note that xend does not accept ',,hdc:cdrom,r' There are several incidental cleanups included the the cdrom-{insert,eject} commands: - add a dry-run mode - use the non-deprecated disk specification syntax - check for and report errors from libxl_cdrom_insert [0] http://wiki.xen.org/wiki/CD_Rom_Support_in_Xen Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: rename "list-vm" command to "vm-list"Matt Wilson2012-06-291-3/+3
| | | | | | | | | | | | | | | All of the other "list" verbs are of the form "$noun-list". For example: "pci-list", "vcpu-list", "network-list", "block-list", etc. Additionally, many people have well trained muscle memory from years of typing "xm li". "xl li" was ambiguous due to "xl list-vm", thus resulting in "command not implemented". Finally, this command was missing from the xl man page. Signed-off-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: Remus - xl remus commandShriram Rajagopalan2012-05-181-0/+14
| | | | | | | | | | | | | | xl remus acts as a frontend to enable remus for a given domain. * At the moment, only memory checkpointing and blackhole replication is supported. Support for disk checkpointing and network buffering will be added in future. * Replication is done over ssh connection currently (like live migration with xl). Future versions will have an option to use simple tcp socket based replication channel (for both Remus & live migration). Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Add pci_assignable_add and remove commandsGeorge Dunlap2012-05-151-0/+14
| | | | | | | | pci-assignable-add will always store the driver rebind path, but pci-assignable-remove will only actually rebind if asked to do so. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Rename pci_list_assignable to pci_assignable_listGeorge Dunlap2012-05-151-2/+2
| | | | | | | | | | | | | ...to prepare for a consistent "pci_assignable_*" naming scheme. Also move the man page entry into the PCI PASS-THROUGH section, rather than the XEN HOST section. No functional changes. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Introduce vncviewer xm compatibility optionsGoncalo Gomes2012-05-151-5/+10
| | | | | Signed-off-by: Goncalo Gomes <Goncalo.Gomes@EU.CITRIX.COM> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: prevent xl from doing operations on domains if xend is runningRoger Pau Monne2012-05-141-65/+65
| | | | | | | | | Prevent xl from doing any operation if xend daemon is running. That prevents bugs that happened when xl and xend raced to close a domain. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* [v2] xl: Don't require a config file for cpupoolsGeorge Dunlap2012-04-241-3/+5
| | | | | | | | | | | Since the key information can be fairly simply put on the command-line, there's no need to require an actual config file. Also improve the help to cross-reference the xlcpupool.cfg manpage. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Remove libxl_tmem_destroy and associated xl commandIan Campbell2012-04-161-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dan Magenheimer explains in <4c2f7fca-dda2-4598-aaab-3a6a3fe532cd@default>: I think the tmem_destroy functionality pre-dates the existence of tmem "freeable" memory* and was a way for a toolset to force the hypervisor to free up the hypervisor memory used by some or all ephemeral tmem pools. Once the tmem allocation/free process was directly linked into alloc_heap_pages() in the hypervisor (see call to tmem_relinquish_pages()), this forcing function was no longer needed. So, bottom line, I *think* it can be ripped out, or at least for now removed from the definition of the stable xl API/UI. The libxl.c routine libxl_tmem_destroy() could also be removed if you like, but I guess I'd prefer to leave the lower level droppings in xc.c and in the hypervisor in case I am misremembering. Accordingly remove this interface from libxl and xl but don't touch libxc or the hypervisor. This is the only libxl_tmem_* function which might potentially have required conversion to be asynchronous and which therefore might have been a potential API stability concern. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* xl: xl network-attach -N (dry run) optionMathieu Gagne2012-04-171-1/+1
| | | | | | | | Add dryrun for testing and debugging purposes. Signed-off-by: Mathieu Gagne <mgagne@iweb.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: provide a command to set the saved configuration for a running domainIan Campbell2012-04-021-0/+9
| | | | | | | Pickup this new configuration on reboot. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xl: Implement sched-credit schedule parameter command-line interfaceGeorge Dunlap2012-03-141-5/+8
| | | | | | | | | Add features to the sched-credit interface to allow querying and displaying scheduler parameters. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix xl create/cpupool-create -f help outputOlaf Hering2012-02-201-2/+2
| | | | | | | | xl create -f domU.cfg does not need an equal sign. This applies also to xl cpupool-create. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Add -F to usage for xl shutdown/rebootIan Campbell2012-02-131-2/+9
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Tools: Add a sharing command to xl for information about shared pagesAndres Lagar-Cavilla2012-01-261-0/+5
| | | | | | | | | | | Also add the global sharing statistics to the libxl physinfo. This is a slight departure from libxc, but there's no reason libxl physinfo can't include extra bits of useful and relevant information. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* xl: Add missing trigger for the xl trigger cmd.Jean Guyader2012-01-241-1/+1
| | | | | | | | Add s3resume trigger in the usage of the xl trigger cmd. Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Support of xl sched-sedfJuergen Gross2011-11-281-0/+16
| | | | | | | | | | | | Supports the xl subcommand sched-sedf. The man page is only a minimal version (copy from xm man page without examples). BTW: the xm man page seems not to be in sync with xm sched-sedf -h regarding the time units. I used milliseconds in the xl implementation. Only minimal semantical checks of parameters. Signed-off-by: juergen.gross@ts.fujitsu.com Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* Support of xl sched-credit2Juergen Gross2011-11-281-0/+8
| | | | | | | | Supports the xl subcommand sched-credit2. Signed-off-by: juergen.gross@ts.fujitsu.com Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* Support cpupools in xl sched-creditJuergen Gross2011-11-281-2/+3
| | | | | | | | | | | | | Adds cpupool awareness to output of xl sched-credit. Output can now be restricted to a specific cpupool. The domains are printed for each cpupool seperately. The loop over cpupools and domains is seperated from the main command implementation to be able to support other schedulers as well. Signed-off-by: juergen.gross@ts.fujitsu.com Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: fixup incorrect indentationIan Campbell2011-10-121-0/+8
| | | | | | | | | Several places which were previsously indented using hard tabs are now incorrectly indented. Fix them up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: clean up trailing whitespaces in code.Wei Liu2011-07-191-2/+2
| | | | | | | | | Commit exactly the results of running find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/' Signed-off-by: Wei Liu <liuw@liuw.name> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: xl block-attach -N (dry run) optionIan Jackson2011-06-281-1/+1
| | | | | Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xl: implement -N (dry run) global option for create and cpupool-createIan Jackson2011-06-281-4/+6
| | | | | | | | These subcommands already had "-n" dry run options. Make -N do the same thing, and deprecate those -n options. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xl: new global -N option for dry runIan Jackson2011-06-281-62/+62
| | | | | | | | | | This sets a global dryrun_only variable, which individual commands are expected to honour. To avoid accidents, we introduce a new can_dryrun member in the command table, which is initially set to 0 for each command. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xl: disks: replace block-attach disk config parser with call to xlu_parse_diskIan Jackson2011-06-281-1/+1
| | | | | Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: flask xsm supportMachon Gregory2011-06-021-1/+17
| | | | | | | | | | Adds support for assigning a label to domains, obtaining and setting the current enforcing mode, and loading a policy with xl command and libxl header when the Flask XSM is in use. Adheres to the changes made by the patch to remove exposure of libxenctrl/libxenstore headers via libxl.h. Signed-Off-By: Machon Gregory <mbgrego@tycho.ncsc.mil> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl/xl: drop support for netchannel2Ian Campbell2011-04-081-18/+0
| | | | | | | | | | | | | | | | | netchannel2 was never widely deployed and no supported kernel includes either the front- or back-ends. The last known kernel with this support was the xen.git 2.6.31 branch which has been unsupported for ages. xl will warn the user if it spots a "vif2" configration item but otherwise support is completely removed. Work is ongoing to add the interesting features of netchannel2 as protocol extensions to netchannel1. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: remove unimplemented -l stub for cpupool-listAndre Przywara2011-01-281-2/+1
| | | | | | | | | | | | Although advertised via the usage output, xl cpupool-list -l just returns ERROR_NI, which does not show up on the console. Instead the output is empty, which is not exactly what --long hints to. To avoid confusion remove the line from the help output and just ignore the -l option properly until it gets finally implemented. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Support new xl command cpupool-numa-splitJuergen Gross2010-12-091-0/+5
| | | | | | | | | New xl command cpupool-numa-split which will create one cpupool for each numa node of the machine. Can be called only if no other cpupools than Pool 0 are defined. After creation the cpupools can be managed as usual. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* Support renaming of cpupoolsJuergen Gross2010-12-091-0/+5
| | | | | | | | Add a new library function libxl_cpupool_rename() and a new xl command xl cpupool-rename to support renaming of cpupools. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* Extend cpupools to support numaJuergen Gross2010-12-091-2/+2
| | | | | | | | | | | | | | | | | | The user interfaces for cpupools are extended to support numa machines: - xl cpupool-create supports now specifying a node list instead of a cpu list. The new cpupool will be created with all free cpus of the specified numa nodes. - xl cpupool-cpu-remove and xl cpupool-cpu-add can take a node number instead of a cpu number. Using 'node:1' for the cpu parameter will, depending on the operation, either remove all cpus of node 1 in the specified cpupool, or add all free cpus of node 1 to the cpupool. libxl is extended with the following functions to support this feature: int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus) int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus) Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* support topolgy info in xl infoJuergen Gross2010-12-091-1/+1
| | | | | | | | | Adds option -n/--numa to xl info command to print topology information. No numa information up to now, as I've no machine which will give this info via xm info (could be a bug in xm, however). Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* tools: cpupools: xl: commands and library changesJuergen Gross2010-10-211-0/+35
| | | | | | | | | | | | | | | Support of cpu pools in libxl and xl: library functions xl cpupool-create xl cpupool-list xl cpupool-destroy xl cpupool-cpu-add xl cpupool-cpu-remove xl cpupool-migrate Renamed all cpu pool related names to *cpupool* Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: correct argument parsing for some sub-commands.Ian Campbell2010-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | XL sub-commands are expected to parse their arguments relative to the global variable "optind" rather than treating argc+argv as zero based. This is because the argc+argv passed to sub-commands include the entire original command line, not just the sub command specific bits. Not all commands do this and they are therefore broken if the user uses "xl -v command", correct such problems dump-core: - did not handle "-h" option. {network,network2,block}-{attach,list,detach} : - handled arguments without reference to optind - checked number of arguments before processing getopt loop, breaking "-h" option handling An example of the breakage: # xl -v block-list d32-2 Vdev BE handle state evt-ch ring-ref BE-path block-list is an invalid domain identifier 51712 0 1 4 13 8 /local/domain/0/backend/vbd/1/ Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: xenconsole[d] and libxl: multiple console supportStefano Stabellini2010-08-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the new protocol for handling pv consoles and emulated serials as described in the document docs/misc/console.txt. The changes are: - xenconsoled: do not write the pty under serial in xenstore if xenconsoled is handling a consolepath; - xenconsole: implement support for an explicit console type parameter; the parameter can be "pv", to specify that the user wants to connect to a pv console, or "serial", to specify that the user wants to connect to an emulated serial. If the type parameter hasn't been specified be the user, xenconsole tries to guess which type of console it has to connect to, defaulting to pv console for pv guests and emulated serial for hvm guests. - xenconsole: use the new xenstore paths; - libxl: rename libxl_console_constype to libxl_console_consback: constype is used to to specify whether qemu or xenconsoled provides the backend, so I renamed it to libxl_console_consback to make it more obvious that we are talking about backends; - libxl: add a new libxl_console_constype to specify if the console is an emulated serial or a pv console; - libxl: support the new xenconsole "type" command line parameter; - libxl: use the "output" node under console in xenstore to tell qemu where do we want the output of this pv console to go; - remove the legacy "serialpath" from xenconsoled altogether Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Also: update the QEMU_TAG to pull in the qemu part of these changes. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* formatting of "# xl list -h" is off (due to missing \n)Stefano Stabellini2010-08-091-2/+2
| | | | | Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: remove duplicate -d option from create help messageZhigang Wang2010-07-301-1/+0
| | | | | Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Check whether a PCI device is assignable before assigning it do a domUGianni Tedesco2010-07-291-0/+5
| | | | | | | | | | | | | | Implement a new libxl function libxl_device_pci_list_assignable. This is used to implement the xl list-assignable-pci-devices command and part of the implementation is used to make sure that PCI devices are not multiply assigned to one or more domU's before doing the passthrough assignment. The function libxl_device_pci_list changes to libxl_device_pci_list_assigned due to a parameter change for consistency with pci_list_assignable. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: consistently use typedef struct {} libxl_$typeIan Campbell2010-07-281-0/+1
| | | | | | | | typedef struct seems to be the dominant idiom in the mixture currently in use. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>