Commit Graph
1459 Commits
Author SHA1 Message Date
kfraser@localhost.localdomain 1a69fbebff [XM] Allow empty resource strings (e.g., when creating an empty CDROM
device). Also clean up error/acces-denied path.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-23 12:23:57 +01:00
kfraser@localhost.localdomain 94ee555a3a [ACM] Don't use uninitialised struct value if hypercall fails.
From: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-23 09:57:24 +01:00
kfraser@localhost.localdomain 28100f12bc [XEND] Remove lazy import of signal module.
Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-10-20 11:00:08 +01:00
kfraser@localhost.localdomain 6c96f33316 [HVM] Implement password authentication of VNC connections.
The specification is as mentioned at
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
(However, password came to describe plain text)

The difference is follows.
- protocol_authtype() without the necessity was deleted.
- The check on the protocol version was added.
- And, some small modification.

Signed-off-by: Masami Watanabe <masami.watanabe@jp.fujitsu.com>
2006-10-20 09:50:09 +01:00
kfraser@localhost.localdomain a75c9af600 Use the name of the title of the system to boot into (instead of the
kernel version) to determine where to make the entry into the grub
configuration file.

Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-20 09:32:16 +01:00
kfraser@localhost.localdomain 22323d5911 [XEND] Two small fixes/improvements from Glauber de Oliveira Costa.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-19 15:53:12 +01:00
kfraser@localhost.localdomain 2b30fc3c70 [SOLARIS] More tools fixes.
Many of the tools use C99 features such as bool, or expect certain functions.
Fix the CFLAGS to enable these on Solaris.

Also make sure the correct $CC is passed to Python.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-18 18:13:57 +01:00
kfraser@localhost.localdomain aec48f2d9d [ACM] Fix the resource representations in the resource_label
file. Without this patch, multiple representations of the same
resource can co-exist in the resource label file and lead to errors
during operation.

Ensures that all resource file names are stored with absolute
path name and are unique. Setting labels of phy-resources, relative
paths will automatically be pre-pended with '/dev/'; labeling
file-resources with relative paths will raise an error.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-10-18 17:54:58 +01:00
kfraser@localhost.localdomain 22241b17fe [SOLARIS] Xen daemons are managed separately, so we need a way to start
just xend, and we need to disable xend's self-restarter.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:52:17 +01:00
kfraser@localhost.localdomain b7fe460763 [SOLARIS] The hotplug scripts live in a different place on Solaris.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:28:27 +01:00
kfraser@localhost.localdomain b1415bc0d6 [SOLARIS] Add the correct machine name for Solaris to arch.py.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:23:24 +01:00
kfraser@localhost.localdomain dae75267fd [XEND] Check for and fail on non-existent floppy-drive file when starting HVM guest.
The qemu device model hangs when a non-existent floppy file is passed
via 'fda' or 'fdb'. The attached patch checks whether the floppy file
exists and raises an error if it does not.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-15 09:19:26 +01:00
kfraser@localhost.localdomain 741fad235c [XEND] Add missing line from changeset 11653:3b7e11cbeb940
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-10 16:02:30 +01:00
kfraser@localhost.localdomain 2abd5d1c78 [XM] Fix 'xm help' when called on a command-name prefix.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-10-05 16:17:06 +01:00
kfraser@localhost.localdomain af51f19f4b [XEND] Fix pygrub when run server-side on a domain with blktap disks.
For some slightly-crazy reason the blktap patches changed the name
of the SEXPR block containing the disk definition 'vbd' to 'tap', even
though merely changing the 'uname' fragement was sufficient. eg

 (vbd (backend 0) (dev hda:disk) (uname file:/xen/rhel4x86_64.img)
 (mode w) )

changes to

 (tap (backend 0) (dev hda:disk) (uname tap:aio:/xen/rhel4x86_64.img)
 (mode w) )

If you create a domain with xm, then xm runs pygrub client side which
works fine. If you create a domain by feeding a block of SEXPR to Xend
over its network port, then pygrub is run server side. The code in
XenD which decides which disk to run pygrub against only looks for
'device/vbd' in the SEXPR so fails to see any blktap disks.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-10-05 16:14:50 +01:00
Christian Limpach 56525bb669 [HVM/vncserver] Implement a 'vnclisten' option to limit the interface
that the VNC server from qemu listens on. 

Defaults to only listen on 127.0.0.1

The old behaviour (listen on all interfaces) can be restored, by
- changing the system-wide default in /etc/xen/xend-config.sxp by adding:
(vnc-listen '0.0.0.0')
- changing individual domain config files by adding:
vnclisten="0.0.0.0"

Also allows specifying the hostname associated with an interface to limit
to that interface.

Signed-off-by:  Daniel P. Berrange <berrange@redhat.com>
2006-10-05 14:53:29 +01:00
kaf24@firebug.cl.cam.ac.uk 5af2ee5b88 [XEND] If 'vncused' is set, it won't specify an explicit display num to QEMU.
In the current xen-unstable.hg tree tough, XenD will always pass an
explicit '-vnc <display num>' parameter to qemu-dm, regardless of
whether 'vncunused' is set. So the 'vncunused' bit only takes effect
if the explicitly passed display already has something bound to it.

Consider what happens when the host machine has been up for a while -
the Domain ID's start getting very high. This plays havoc with
firewalls - for example an admin may know that only 10 domains will
ever be running at any time, so they should be able to simply open up
ports 5900 -> 5910.

The correct behaviour should be:

   - If 'vncdisplay' is set, use that explicit display
   - If 'vncunused' is set non-zero, allocate first port about 5900
   - Allocate fixed port based on domain-ID

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-10-04 09:42:41 +01:00
Alastair Tse f4bf67e5fd [XM] Fix rmlabel filename assignment
The patch fixes a bug in the rmlabel tool.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-03 11:24:48 +01:00
Alastair Tse 20b5981cde [XM] Fix missing security check in block-attach
This patch fixes an indentation error in main.py. The effect of this
bug is that block-attach does not check labels if the ACM is
active. This bug slipped in with change set 11572_:_ ad22c711ccb7
<http://xenbits.xensource.com/xen-unstable.hg?cs=ad22c711ccb7>.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-10-03 10:48:07 +01:00
kaf24@firebug.cl.cam.ac.uk bd769a8dd5 [HVM][TOOLS] Improve warnign message when trying to create
an HVM guest on a non-capable platform.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-30 11:35:02 +01:00
Andrew Warfield 8e7cc683c5 [BLKTAP][XEND] Fix blktap to work with a bootloader
If a Xen guest has a bootloader configured, then it will fail to start
on a blktap image.  The problem is blkdev_uname_to_file, which cannot
parse the "tap:aio:$filename" image strings: it tries to split the
string apart at ":" and assign the result to a 2-tuple, and this
results in a python error if the split results in three or more
strings.

The fix is to split only at the first ":", and then to split again
if we detect "tap:" as the image type.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-28 12:12:59 -07:00
atse@norwich.uk.xensource.com fbda4315cd [XM] Report proper ACMError(s) instead of silently exiting.
Remove try except blocks so that ACMError(s) are properly reported to
the user rather than silently fail.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:46:09 +01:00
atse@norwich.uk.xensource.com 9a7d719155 [XM] Remove traceback printing from load/makepolicy.py.
Should pass the exception along to xm/main.py to handle properly like
the rest of the commands.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:29:52 +01:00
atse@norwich.uk.xensource.com 665dff5cd1 [XM] Fix stray quotes in usage message in getlabel.py
Fixed built-in function name conflict.
Raise correct exceptions for when option is invalid to be properly
reported by xm.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:23:21 +01:00
atse@norwich.uk.xensource.com 3c9f8469ed [XM] Fix error reporting for resources.py, remove duplicate try block.
Also fixed usage message to not include misspelling of the command.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:16:11 +01:00
atse@norwich.uk.xensource.com 438289a1bd [XM] Removed traceback printing for non ACMError exceptions
Removing try,except block as cfgbootpolicy should allow exceptions to
propagate instead of printing traceback to stdout.
(http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=778)

Changed usage of string.join, string.split when creating security
policy path name.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 11:50:51 +01:00
atse@norwich.uk.xensource.com 9bb76d3442 [XM] Set proper return code for exceptions in xm, catch ACMError.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:03:10 +01:00
atse@norwich.uk.xensource.com 7ce79f6a21 There's a typo in create.py, which affects PV bootloaders (such as
domUloader and probably pygrub).  Patch attached.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-09-28 10:10:59 +01:00
kfraser@localhost.localdomain a301105b5b [XM] Fix 'xm uptime' command.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 14:01:30 +01:00
kfraser@localhost.localdomain 3c9113ced2 [XM] Fix domain reported by 'xm sched-sedf'.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 14:00:33 +01:00
kfraser@localhost.localdomain 6681aec641 [XM] Fix 'xm rmlabel' command.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 13:59:48 +01:00
kfraser@localhost.localdomain 32b51f8b72 [XM] Reenable the '-h' option, disabled in changeset:11572.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 13:58:46 +01:00
Emmanuel Ackaouy 7ccdaed2ed Adds support for the keyword 'all' to the vcpu-pin operation.
Using 'all' in place of a specific vcpu will apply the cpumask
to all vcpus in the domain.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2006-09-26 12:17:51 +01:00
kfraser@localhost.localdomain ad27570a65 [TOOLS] Wait for backend devices to set up before resuming execution
of a restored guest.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-25 09:11:52 +01:00
atse@norwich.uk.xensource.com bfde0c9ad7 [XM] Fix argument parsing for dump-core subcommand
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-23 13:39:32 +01:00
atse@norwich.uk.xensource.com 3918261f47 [XM][ACM] Add try,catch back to main() for dry-run
Signed-off-by: Alastair Tse <atse@xensource.com>
Signed-off-by: Bryan D. Payne <bryan@thepaynes.cc>
2006-09-22 17:46:32 +01:00
atse@norwich.uk.xensource.com 3b61bd783a [XM] Move 'xm sysrq' into main.py
* There's not need for sysrq to be in its own file.
* Bonus advantage: can use arg_check rather than gopts for argument
  validation.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 16:32:30 +01:00
atse@norwich.uk.xensource.com cef39afbe9 [XEND] Do not attempt core dump to directories.
- Abort core dump if destination is a directory.
- Throw appropriate XendError expection on failure.
Reported by Masaki Kanno <kanno.masaki@jp.fujitsu.com>.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 16:20:36 +01:00
atse@norwich.uk.xensource.com 15473a42cf [XEND] Remove hard tabs from destroyDevice()
Reported by Hollis Blanchard.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 15:56:19 +01:00
atse@norwich.uk.xensource.com 8554ba8909 [XEND] Check for invalid memory sizes.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-22 15:36:11 +01:00
atse@norwich.uk.xensource.com 1681108c98 [XM] Text wrapping fix, xm create --help_config fix.
* Fix text wrap so it doesn't chop off last word in help message for
  certain cases.
* Fix handling of xm create --help_config
* Remove redundant gopts.usage() call.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 15:06:00 +01:00
atse@norwich.uk.xensource.com f88384ec46 [XM] Error handling cleanup
Introducing an OptionError exception to be used by all xm subcommands
to signal an error in the arguments. "xm" will catch these and output
the appropriate error and usage message.

Detailed Changes:

main.py:
 *  Cleaned up imports and moved warning filter outside of
    import block.
 *  Converted usage parameters and description to a python
    dict rather than strings to enable better usage help
    formatting.
 *  Removed unused list_label domain command.
 *  Added cmdHelp() prints out usage message for any command
 *  Added shortHelp() prints out the default help message when
    xm is invoked with no arguments.
 *  Added longHelp() prints out long help message when invoked
    with xm --help or xm help.
 *  Added extra optional paramter to getDomains() so we can
    tell Xend not to poll devices. This will speed up xm list.
    (PENDING changes to Xend itself.)
 *  Changed all references where 'dom' actually means 'domid'
    to use the correct name.
 *  Changed 'xm list' header format to use printf formatting style.
 *  Renamed xm_subcommand to xm_importcommand so it is more
    clear what it is doing (all xm commands are subcommands!)
 *  Moved cpu_make_map() inside xm_vcpu_pin as an anonymous func.
 *  Use OptionError whenever an invalid option is detected in xm.
 *  Added proper catch and error printing for XendError and
    OptionErrors in main().

addlabel.py:
cfgbootpolicy.py:
dry-run.py:
dump-policy.py:
get-label.py:
labels.py:
loadpolicy.py:
makepolicy.py:
rmlabel.py:
resources.py:
 *  Replaced usage() with help() that is called from main.py
 *  Replaced usage() invokation with raising OptionError

opts.py:
 *  Added very simple wrap() function that behaves differently
    to textwrap.wrap()
 *  Added OptionError()
 *  Replaced the string representation of Opt, Opts to output
    a nicely formatted usage message.
 *  Changed class Opts itself will throw approriate OptionErrors.
 *  Changed set_bool to recognise 'y' and 'n' as valid input

create.py:
 *  Some whitespace and column width cleanup.
 *  throws OptionError if encounters option error.

migrate.py:
 *  Replace usage() message with the string representation of
    gopts.

sysrq.py:
 * Replace usage message with throwing OptionErrors

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 11:37:31 +01:00
Tim Deegan 76ccc6e959 Merge 2006-09-21 15:04:29 +01:00
Tim Deegan 1c80d1b0a3 [XEND] Don't prepend '/dev/' to any absolute path.
Check for '/' rather than '/dev/' when translating e.g. 'hda'->'/dev/hda'
Signed-off-by: Tim Deegan <tim.deegan@xensource.com>
2006-09-21 15:00:50 +01:00
Tim Deegan fbbf99bec9 [XEND] split command-line arguments to the bootloader script properly.
Signed-off-by: Tim Deegan <tim.deegan@xensource.com>
2006-09-21 14:58:01 +01:00
Emmanuel Ackaouy 4c83c4918a This patch adds value checking of sched-credit xm options.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-21 14:10:56 +01:00
Christian Limpach 212efff62a [tools] Increases some of the timeouts
since e.g. stealing the hotplug lock after five seconds is completely insane.

From: Steven Smith <sos22@cam.ac.uk>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-09-21 13:53:49 +01:00
jchesterfield@wicket.uk.xensource.com 551365b6a0 Adding max block device timeout of 30 secs for live migrate. 2006-09-15 18:48:24 +01:00
root@procyon 805b7b3995 This patch add localtime to dumpcore filename.
And it add '-imcomplete' if failed.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2006-09-14 08:19:39 +01:00
root@procyon 34e0159ce1 xm dump command add on
xm dump-core [-L|--live][-C| --crash] <domID> [output path]

-L| --live Live dump:
        By default, xm dump does an xm pause, unpause before and
        after taking the dump, respectively.  This option disables
        the pause/unpause and simply takes the dump.

-C :| --crash crash dump:
        This executes an xm destroy after the dump file is complete.

The output path is optional, and if it is not specified, the path will be
/var/xen/dump/<domU name>.<domU ID>.core

This command uses the existant dumpCore(), which has been used for
coredump when a domU crashed.

Signed-off-by: Ken Hironaka <hironaka.ken@soft.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2006-09-14 08:19:38 +01:00