- To remove device info, it waits for the backend path of the device
to be removed.
- It removes device info from domain info.
- It saves domain info to the config.sxp of the managed domain.
- prevent vlans from being relabeled when they are in use by the
current policy
- fix problems when doing an update of the policy and the name of the
policy changes while doing that
- refactor code that has to take into consideration that unlabeled
domains may be defined using the label __UNLABELED__
- make 'xm list --label' show the complete label of a domain
Clean up usage of 'current' in do_iret() hypercall. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
hvm: Handle hw_cr[] array a bit more sanely.
SVM for the most part does not need to use it at all, and this makes
the code clearer. Signed-off-by: Keir Fraser <keir@xensource.com>
xentop: fix abnormal value cpu(%) when domain shutdown.
If we test multiple domain create/shutdown many times.
sometimes abnormal values of cpu(%) are appeared.
This is because shutdown domain remove failure.
(in other words, memory corruption of struct )
This corruption makes abnormal cpu(%) values are shown xentop
sometimes.
[ACM] Explicitly cast byte arrays when used in copy_from_guest
Explicitly cast the target array type to an array of 'u8' since the
number of bytes copied is calculated from the type of element in the
target array times the number of elements (3rd parameter).
xm: Fix control characters causing xm tests to fail.
On my FC7 installation some of the test in the xm test suite fail for
no apparent reason. The problem is that the python 'readline' module
puts out control characters that confuse code that parses the output
of some of the xm commands that are being run. The readline module
dumps those characters upon import. The attached patch works around
this problem.
Here's what I get in out.txt when doing 'python 2>&1 | tee out.txt'
and 'import readline' on the python command line:
Python 2.5 (r25:51908, Apr 10 2007, 10:29:13)
[GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[[?1034h>>> >>>
The characters before the '>>>' above are those printed by that
version of 'readline' and remain invisible on the screen but appear in
the file and confuse the xm test suite parser.
hvm: Fix save/restore when callback_via line is routed through a PCI
INTx wire. Signed-off-by: Edwin Zhai <edwin.zhai@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
When calling destroyDevice code path (e.g. xm block-detach dom devid),
allow specifying an integer device id or a device name such as xvdN or
/dev/xvdN. Allowing the /dev/xvdN form is useful when detaching
devices from dom0. Bootloaders may do this to unmount a disk
previously mounted in dom0.
Move examination of device ID format into the DevController,
permitting device controllers to determine a valid device ID instead
of higher level code.
Add support for removing/replacing a policy from the running
system. This operation is only successful if currently running VMs
would also be allowed to run under the new policy. Removing the
current policy means that the default policy is installed, which then
only has support for a single VM label and STE type (SystemManagement)
and is the same policy that the system starts up with when no policy
is chosen.
[ACM] Support for running unlabeled domains alongside labeled ones
Add support for running unlabeled domains alongside labeled ones, if
the policy contains a VM label with name '__UNLABELED__' and an STE
type with the same name. The ezpolicy tool has been modified to
automatically suggest a policy under which unlabeled domains can
run. The user may delete this, if this is not desired.
On debug builds, scrub pages with non-zero poison.
Will flush out guests which are relying on zeroed memory. Signed-off-by: Keir Fraser <keir@xensource.com>
libelf: Clean up and fix up BSD symtab handling.
Should now (hopefully) work for domU and dom0 builders. Signed-off-by: Keir Fraser <keir@xensource.com>
When a guest kernel specifies BSD_SYMTAB=yes, then Xen loads the ELF
symbols for it. This works with Xen 3.0.4, but not with Xen 3.1.
During the libelf work between Xen 3.0.4 and Xen 3.1 the loading got
broken in the way, that BSD_SYMTAB gets parsed but not handled.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xenstored: Do not write to stderr if we are daemonised!
This fixes client reader-thread deaths in which a 'garbage string' was
being read instead of a well-formed message header. Signed-off-by: Keir Fraser <keir@xensource.com>
The blktapctrl process is responsible for spawning individual tapdisk
processes. It does this using the 'system' method, but unfortunately
none of its file descriptors have the close-on-exec flag set. The
parent blktapctl process opens a couple of unix domain sockets
per-tapdisk it spawns. So the first tapdisk get 2 FDs leaked to it,
the second gets 4 FDs leaked to it, the 3rd gets 6 and so on. The use
of 'system' also unneccessarily invokes the shell.
Replace system with fork/execvp, and explicitly close all file handles
up to _SC_OPEN_MAX.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tim Deegan [Tue, 31 Jul 2007 10:37:27 +0000 (11:37 +0100)]
[HVM] Inject #PF when mmio instruction fetch fails
instead of crashing the guest. This can happen if one vcpu pages out
another vcpu's kernel text page while the other is performing an mmio op. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
- don't reload the policy if it has been loaded
- don't always load the policy in the test suite when the policy is
already loaded
- skip tests 07 and 09 when ACM is not enabled and xm is not using the
Xen-API
- fix a problem when trying to remove an invalid label
On some ia64 NUMA machine, we cannot boot dom0.
This issue is caused by different infomation LSAPIC and SRAT.
Xen-ia64 modify LSAPIC IDs of dom0, but it does not modify SRAT.
So we decide disabling SRAT, SLIT of dom0 as first step of NUMA
work.
Xend tries to rebuild the network configuration such as bridges and
vlan interfaces (in those bridges) when starting. Unfortunately this
fails on the first startup since the network script has not run, yet,
and for example created peth0. When restarting xend it works due to
the peth0 being there then. This patch moves the initialization of the
network to an earlier time in the xend initialization process to
mitigate this problem.
Recent changes to the setup of the peth0 interface have resulted in a
change of its MAC address. Previously it seems to have had a MAC
address of 'fe:ff:ff:ff:ff:ff', but now it has the same MAC address as
eth0. As a consequence to this the Xen-API code to create VLANs
(PIF.create_VLAN("peth0",...)) does not work anymore, since peth0 can
not be identified according to this previous criteria of fake MAC
address. This patch fixes this issue by identifying it through the
prefix 'peth'.
A domain is only authorized to run if it has a superset of Simple Type
Enforcement Types in its VM label compared to that of Domain-0, which
itself may not have all STEs available in a policy. This patch adds a
check for this into Xend and the necessary code support into Xen.
xenstored: Fix socket-based connection teardown. Reading zero bytes
*should* in fact cause the connection to be destroyed. Fix this with a
little extra code in the readfd() handler. Signed-off-by: Keir Fraser <keir@xensource.com>
xenstore: Small cleanups and fixes.
1. readfd/writefd account for EINTR/EAGAIN errno returns.
2. Handle zero return from ->read() and ->write() handlers
symmetrically.
3. Fix some indentation issues (use hard tabs). Signed-off-by: Keir Fraser <keir@xensource.com>
Add domain name check and UUID check to 'xm new' command.
Add a domain name check and a UUID check to xm new command. The check
logic is as follows:
- If the UUID is not specified
- If a VM with same name exists
=> Update the config for that existing VM
- Else no vm with same name exists
=> Define a brand new VM with auto-generated UUID
- Else UUID is specified
- If a VM with same UUID exists
- If name is different
=> Error
- Else if name is same
=> Update the config for that existing VM
- Else no VM with same UUID exists
- If name is different
=> Define a branch new VM with that name
- Else if name is same
=> Error
Tim Deegan [Tue, 24 Jul 2007 14:47:36 +0000 (15:47 +0100)]
[HVM] Live-migration fixups after 15639:c585f993385c
Use the same xenstore area for log-dirty commands as for save/continue,
and avoid a race condition by acking the save command after the save. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Tim Deegan [Tue, 24 Jul 2007 13:52:16 +0000 (14:52 +0100)]
[HVM] Control qemu's state-save via xenstore, instead of SIGUSR1
This lets us verify that qemu has indeed stopped processing before
we start saving guest memory. Also allow qemu to continue processing
after the save has happened, instead of exiting immediately. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xenstored: Fairly round-robin schedule work across all connections.
Avoids total starvation under some workloads. Signed-off-by: Keir Fraser <keir@xensource.com>
xenstored: Guarantee to fire @releaseDomain watch when a domain is destructed.
Previously this would be missed on some bail paths within xenstored
which would talloc_free() the connection. Signed-off-by: Keir Fraser <keir@xensource.com>
Tim Deegan [Tue, 24 Jul 2007 10:10:08 +0000 (11:10 +0100)]
[HVM] Shadow: release shadow lock during emulation path
and retake it only for the write-back at the end. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
There is a problem in the input of the key in the VNC connection on
the PV domain. When client's keyboard is not the same as the kind of
the keyboard of PVFB and GuestOS, it is not possible to input it correctly.
This patch handled the state of shift from the set keymap. When
client's keyboard is not same as the kind of PVFB/GuestOS, it is
possible to input it correctly. It was confirmed to input it correctly
mutually with this patch between en-us and ja.
There is a problem in the input of the key in the VNC connection on
the HVM domain. When client's keyboard is not the same as the kind of
the keyboard of qemu-dm and GuestOS, it is not possible to input it
correctly.
VNC client qemu-dm & GuestOS
--------------+-----------------------
ja en-us ==> NG
en-us en-us ==> OK
Originally, the same keysym-code between client and qemu-dm is
transmitted. However, even if it is the same character, the state of
shift is different according to the kind of keyboard.
Therefore, it is necessary to handle the state of the shift by setting
qemu-dm and GuestOS. There is information on whether shift is
necessary for each key for the keymap of qemu-dm.
This patch handled the state of shift from the set keymap.
When client's keyboard is not same as the kind of qemu-dm/GuestOS,
it is possible to input it correctly.
It was confirmed to input it correctly mutually with this patch
between en-us and ja.
Fix hypercall migration. schedule_tail() is not required
after set affinity, or else continue stub runs on current
cpu immediately before migrating is checked when switching
out.
Signed-off-by Kevin Tian <kevin.tian@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>