Commit Graph
2436 Commits
Author SHA1 Message Date
Keir Fraser 3bc128ebcf pv-qemu 2/10: Add a QEMU machine type for paravirt guests
This patch adds a paravirt machine type to QEMU. This can be requested
by passing the arg '-M xenpv' to qemu-dm. Aside from -d, and
-domain-name, the only other args that are processed are the VNC / SDL
graphics related args. Any others will be ignored. A tweak to
helper2.c was made to stop it setting up a file handler watch when
there are no CPUs registered.

The paravirt machine is in hw/xen_machine_pv.c and registers an
instance of the xenfb class, integrating it with the QEMU event loop
and key/mouse handlers. A couple of methods were adding to xenfb.h to
allow direct access to the file handles for xenstore & the event
channel.

The vfbif.py device controller is modified to launch qemu-dm instead
of the old xen-vncfb / sdlfb daemons.

When receiving framebuffer updates from the guest, the update has to
be copied into QEMU's copy of the framebuffer. This is because QEMU
stores the framebuffer in the format that is native to the SDL
display, or VNC client. This is not neccessarily the same as the guest
framebuffer which is always 32bpp. If there is an exact depth match we
use memcpy for speed, but in the non-matching case we have to fallback
to slow code to convert pixel formats. It fully supports all features
of the paravirt framebuffer including the choice between absolute &
relative pointers. The overall VIRT memory image size is about same as
old xen-vncfb, but the resident memory size is a little increased due
to copy of the framebuffer & some QEMU static state overhead. Most of
this is shared across QEMU processes.

To avoid both moving the xenfb.c and making changes to it in the same
patch, this just uses a Makefile hack to link against the xenfb.o from
the tools/xenfb/ directory. This will be removed in the following
patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-25 14:35:04 +01:00
Keir Fraser 12c3839b0d xend: fix hvm domain restore failure when using vncdisplay option.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-25 09:44:11 +01:00
Keir Fraser ff5d3cc782 xend, acm: small fixes
Check that the policy is of type ACM and return an error if it is not.
Reworked the way the label of a domain is read.

Signed-off-by; Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:25:03 +01:00
Keir Fraser 40a0c5900b xend, acm: Put the __UNLABELED__ label into the mapfile if policy specifies it
Put the __UNLABELED__ label into the mapfile if policy specifies this
label rather than keeping the NULL_LABEL there. Also lock the map file
when it's rewritten and propagate the return code from compiling the
policy to callers.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:24:28 +01:00
Keir Fraser 9c14bd9596 xend: Reworked initialization of XSPolicy administration class
Rather than picking up the current policy from the managed policies
file the hypervisor is asked for the name of the current policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:23:27 +01:00
Keir Fraser 61d0b64c6c xm-test: various fixes
- recently I added an other_config field to the VTPM record which now
needs to be accounted for otherwise the test determines a bad key
- the dry-run command was throwing a different type of exception
(ACMError) than what was caught (XSMError)
- the tests based on the raw Xen-API need to build the PV_args
parameters from the old 'root' and 'extra' parameters.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:22:28 +01:00
Keir Fraser de91f88afe vt-d: Fix PCI=device parsing.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-10-22 14:26:45 +01:00
Keir Fraser e38bd7ef8e ia64: Fix ia64 PV domain creation with new vhpt-size parameter.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-22 14:21:13 +01:00
Keir Fraser 1934a762f0 ia64: Add HVM_PARAM_BUFPIOREQ_PFN constant.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-10-22 09:41:25 +01:00
Keir Fraser 88561d3058 hvm: Fix PCI-passthru string parsing.
Fixes crash of xend during HVM domain ccreation.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-20 09:30:00 +01:00
Keir Fraser 07f557cb63 Replace sysctl.physinfo.sockets_per_node with more directly useful
sysctl.physinfo.nr_cpus. This also avoids miscalculation of
sockets_per_node by Xen where the number of CPUs in the system is
clipped.
From: Elizabeth Kon <eak@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-19 18:00:10 +01:00
Keir Fraser 15f1e5e394 vt-d: Detect and report failure to assign a pass-thru PCI device.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-10-19 09:31:03 +01:00
Keir Fraser 753df0d608 ia64: configure VHPT size per domain: common part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-19 09:27:55 +01:00
Keir Fraser cefbbff3f5 tools: Remove bogus external uses of xc_private.h. Clean up libflask.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-18 15:12:03 +01:00
Keir Fraser d61d5e12e1 xend: xenapi: Suspended domain causes fault if vif.get_all_records() is called
A single suspended domain on the system causes a fault when
vif.get_all_records() is called since this returns an ErrorDescription
and no 'Value' in the 'v' dictionary. This patch now returns a 'None'
as Value which might not be optimal but better than faulting.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-16 17:41:33 +01:00
Keir Fraser 43e55cbba8 xend: Clean up hvm_build Python wrapper. Python code can get/set hvm
params directly.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-16 10:27:55 +01:00
Keir Fraser e972f8be18 xend: Fix file resouce leak on resume of suspended managed domains.
When a suspended managed domain is resumed, the checkpoint file is
removed, but xend retains a reference to the removed file. This
represents a resource leak. Fixed by ensuring that the file reference
is closed correctly.

Signed-off-by: Gary Pennington <gary.pennington@sun.com>
2007-10-12 14:30:41 +01:00
Keir Fraser 1a55b4207e [vTPM] Add set/get_other_config to Xen-API.
Add get_- and set_other_config methods to the vTPM class. Write the
parameters into the xenstore while the domain is running prefixing it
with 'oc_'. Also I add the methods to the C library as well as the
documentation.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-11 09:41:16 +01:00
Keir Fraser 3e1c252345 xend, xsm: Lock domain access while modifying policy.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-08 13:43:17 +01:00
Keir Fraser f15dc94bec xend: Remove unused xoptions.netback_type.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-08 10:57:32 +01:00
Keir Fraser 10f71216a1 Fix domU reboot failure when using "pci=" option
The failure only happens on the second or later auto reboot.
See the following thread for a long discussion on this issue where
most problems were fixed.

http://lists.xensource.com/archives/html/xen-users/2006-05/msg00154.html

Signed-off-by: Charles Arnold <carnold@novell.com>
2007-10-08 10:46:45 +01:00
Keir Fraser a687f4cc2f xsview: a xenstore viewer written in PyQT.
From: Mark Williamson <mark.williamson@cl.cam.ac.uk>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-04 13:52:51 +01:00
Keir Fraser 6f10c4bf8d xm: Add accel option to xm network-attach.
Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
2007-10-03 14:56:31 +01:00
Keir Fraser 905654ba54 xend: Check access to the privcmd interface before doing the call to
fetch the currently enforced policy. Assign 'INACCESSIBLE' to the
policy if it cannot be retrieved due to the user not being
privileged.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-03 14:06:06 +01:00
Keir Fraser 8950f5c6ba Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
 - get the currently enforced policy including statistical data from
   the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
  variable or type (int) I put it into the ACM class.

I extended the Xen-API documentation with the two new functions.

Signed-off-by: Stefan Berger <Stefanb@us.ibm.com>
2007-10-03 14:04:51 +01:00
Keir Fraser 01025319d1 xend: Fix name/uuid uniqueness checks.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-02 10:01:10 +01:00
Keir Fraser c3aaa708a8 Revert 15642:207582c8d88b532783da5c6f5839336187556f0a.
This patch is now bogus since 15168:a717cb2fac90 is reverted
by 15973:8817a53c030f.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-02 09:59:39 +01:00
Keir Fraser ece8f4f259 xend: Fix refactoring done in CS 15938 in security.py.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-02 09:27:22 +01:00
Keir Fraser eaaa8ec561 xm: Print xend config via 'xm info --config'.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2007-10-01 06:39:00 +01:00
Keir Fraser 9f5581fda7 xend: Fix name uniqueness check (revert 15168:a717cb2fac90).
Changeset 15168:a717cb2fac90 altered check_name() in XendDomainInfo so
that it compares domain IDs instead of UUIDs. This breaks a number of
things

 - You can no longer use 'xm new' to define a persistent config file for
   a running guest. This breaks the key OS provisioning scenario where
   you boot a kenrel+initrd for the installer, and at the same time
   define a permanent config with pygrub.

 - It lets you define multiple inactive guests with different UUIDs, but
   the same name because all inactive guests have a domid of None. So
   you can now end up with multiple guests with same name, which is
   contrary to the goal implied by the patch which was name uniqueness.

It is unclear from the original commit logs just what scenario it was
trying to protect against, but the original checking of uniqueness
based on UUID was correct & is what was used in previous releases XenD.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-09-27 18:08:11 +01:00
Keir Fraser cd76c0a1ed xend: fix server/netif.py so that it respects type=None.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-09-27 17:44:03 +01:00
Keir Fraser a0d123d804 xend: Fix dummy security_policy_dir.
Changeset 15951:ad339d88639d split policy_dir_prefix into
security_dir_prefix and policy_dir_prefix in acm code.  I think this
needs to be reflected in the dummy module as well (otherwise we blowup
when bootloader.py tries to reference security.security_dir_prefix).
Fixed in below patch.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-09-27 15:22:29 +01:00
Keir Fraser 884ec5f334 xend: Slightly finesse allocation of vmpath in xenstore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-26 17:11:07 +01:00
Keir Fraser 4d0cfe8f1b [xend,xenapi] Fix handling of scheduler params
When creating domains that specify scheduler parameters with XenAPI,
the specified parameters are not used when starting the domain. This
patch collapses cpu_weight and cpu_cap in XendConfig into the
vcpus_params dictionary. The patch has been tested using xm and
XenAPI on config with and without scheduler parameters.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-26 14:39:56 +01:00
Keir Fraser 468eb4e36f xend: Fix VIF MAC address being lost across localhost migration.
VIF details in /vm/<uuid> directory in xenstore get deleted by old
domain dying.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-25 15:35:17 +01:00
Keir Fraser 05fcd427f8 Fix xend start after xsm:acm bootloader changes.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-25 10:40:38 +01:00
Keir Fraser 44e7c3aa10 xend memory ballooning: do not bother if guest will not fit in
physical memory constraints.

If users require domain memory size larger than a physical memory
size, we do not need waiting for ballooning, and should cause
xm create command error right away.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-25 09:30:00 +01:00
Keir Fraser 66ea95096a [Xend/ACM] Automatic loading of policy after xend has started.
On systems where the grub bootloader is not available or active the
to-be-activated policy is written a simple textfile. Once xend has
started the contents can be read. Using 'xm setpolicy' the policy can
be activated and the Domain-0 label set (using 'xm addlabel').
I fixed some bugs in the grub bootloader handler on the way and
removed some dead functions.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-09-24 21:52:10 +01:00
Keir Fraser af8b404f2d XSM:FLASK support for domain management under Xen-API
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-09-23 12:45:07 +01:00
kfraser@localhost.localdomain 5d942ff119 xm: Extend width of ID in 'xm list --label' to 5 digits
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-18 15:08:11 +01:00
kfraser@localhost.localdomain 9e6ca368e2 PCI passthru: tools changes (generic and vt-d)
I have added CONFIG_PASSTHROUGH in ioemu/Makefile.target and
ioemu/hw/pc.c in attached vtd_tools2.patch.  This should turn off
libpci usage by default until user specifically enables it.

This can be safely check-in without breaking builds for people who do
not care about pass-through devices.  I will try to think of a better
way to enable this.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: Guy Zana <guy@neocleus.com>
2007-09-14 16:39:27 +01:00
kfraser@localhost.localdomain e1a067a78e Fix xm dump-core command for paused domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-14 16:07:18 +01:00
kfraser@localhost.localdomain 661e422af8 Fix 'xm reboot'
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-14 16:05:39 +01:00
kfraser@localhost.localdomain d6dec5a652 Fix two memory leaks in xend.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-09-14 16:04:33 +01:00
kfraser@localhost.localdomain 337e2014c7 Fix memory leak in xend
I found that xend's memory usage grows considerably when running a
script such as

while true; do xm new foo ; sleep 2s; xm delete foo ; sleep 2s; done

XendAPIStore maintains a list of class instances and in the case of
new/create operation, an associated VMMetrics object is stashed in the
list but never removed on delete/shutdown.  This patch removes the
instance by invoking XendBase.destroy() method.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-11 13:41:15 +01:00
kfraser@localhost.localdomain 4a6a1afb1c Add 'type vnc' to vfb device sexpr for HVM guest
This patch adds 'type vnc' to vfb device sexpr for HVM guests.  PV
guests already contain this entry in sexpr, e.g.

    (device
        (vfb
            (vncunused 1)
            ...
           (type vnc)
            ...
        )
    )

Some tools, such as libvirt, look for device/vfb/type in sexpr before
publishing VNC port.  More importantly, this patch provides
consistency in vfb device sexpr between HVM and PV guests.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-11 13:40:44 +01:00
Tim Deegan e58cf9dbf9 Xend: "shadow_memory" setting in xm config is in MiB, not bytes.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-09-11 12:30:39 +01:00
kfraser@localhost.localdomain 986fc80c68 Fix error message and wait time for xm block-detach command.
- Wait time
    When xm requests a block device detach to xend, xm makes two
    requests. At first, xm requests the block device detach by device
    class 'vbd'. Next, xm requests the block device detaching by
    device class 'tap'.
    As a result, the wait time is 200 seconds because each of
    the block device detaching requests causes time-out.
 - Misleading error message
    Because the last request is by device class 'tap' to xend,
    the keyword "(tap)" is included in the error message.

This patch fixes the number of times of the block device detaching
request to one time.  At first, xm makes inquiries about device
class of a detaching target device to xend.  Then xm requires the
block device detaching by xend returned device class.  The wait
time becomes 100 seconds because the block device detaching request
is one time.  And the error message is also fixed.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:30:18 +01:00
kfraser@localhost.localdomain 214523659d xend: Fix error message for xm trigger command.
When I tested xm trigger command with a wrong argument, I saw the
following error message.

 # xm trigger vm1 xyz
 Error: __init__() takes exactly 2 arguments (3 given)
 Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

 Send a trigger to a domain.

This patch fixes the error message as follows.

 # xm trigger vm1 xyz
 Error: Invalid trigger: xyz
 Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

 Send a trigger to a domain.

The type of "TRIGGER_TYPE" is dictionary.  domain_send_trigger()
refers to the keys of "TRIGGER_TYPE" without using keys() currently.
This patch adds keys() there.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:24:28 +01:00
kfraser@localhost.localdomain 95f83e447a xend: waitForDevices() on xm reboot.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:10:32 +01:00