Commit Graph

118 Commits

Author SHA1 Message Date
Jim Fehlig
198cc1d339 libxl: provide integration with lock manager
Provide integration with libvirt's lock manager in the libxl driver.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-04-29 10:51:36 -06:00
Jim Fehlig
247b2c5388 libxl: initialize sdl.opengl defbool in libxlMakeVfb
Commit bf32462b missed initializing sdl.opengl.  Without the
initialization, libvirtd will be terminated by an assert from libxl:

Assertion `!libxl_defbool_is_default(db)' failed.

Reported-by: Olaf Hering <olaf@aepfle.de>
2015-04-24 14:11:26 -06:00
Olaf Hering
bf32462bd3 libxl: initialize vfb defbools in libxlMakeVfb
If the domU configu has sdl enabled libvirtd crashes:
libvirtd[5158]: libvirtd: libxl.c:343: libxl_defbool_val:
Assertion `!libxl_defbool_is_default(db)' failed.

Initialize the relevant defbool variables in libxl_device_vfb.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Jim Fehlig <jfehlig@suse.com>
2015-04-24 13:17:36 -06:00
Jim Fehlig
d0baac09e6 libxl: Introduce configuration file for libxl driver
Introduce libxl.conf configuration file, adding the 'autoballoon'
setting as the first knob for controlling the libxl driver.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-04-21 14:23:40 -06:00
Cole Robinson
4fa6f9b413 caps: Convert to use VIR_DOMAIN_VIRT internally 2015-04-20 16:40:26 -04:00
Cole Robinson
5f7c599456 domain: Convert os.type to VIR_DOMAIN_OSTYPE enum 2015-04-20 16:40:09 -04:00
Cole Robinson
d0440e3269 caps: Switch AddGuest to take VIR_DOMAIN_OSTYPE value
Rather than an opencoded string. This should be a no-op
2015-04-20 16:38:09 -04:00
Jim Fehlig
13e2c22099 libxl: support HVM direct kernel boot
Add support for HVM direct kernel boot in libxl.  Also add a
test to verify domXML <-> native conversions.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-04-16 16:14:51 -06:00
Jim Fehlig
2adba7d3ab libxl: use xenlight pkgconfig file if present
xen.git commit babeca32 added a pkgconfig file for libxenlight,
allowing libxl apps to determine the location of Xen binaries
such as firmware blobs, device emulator, etc.

This patch adds support for xenlight.pc in the libxl driver, falling
back to the previous configure logic if not found.  It introduces
LIBXL_FIRMWARE_DIR and LIBXL_EXECBIN_DIR to define the firmware and
libexec_bin locations.  If xenlight.pc does not exist, the defines
are set to the current hardcoded paths.  The capabilities'
<emulator> and <loader> elements are updated to use the paths.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-03-19 16:13:26 -06:00
Jim Fehlig
a7d6b94a00 libxl: fix regression introduced by commit 4ab8cd77
Commit 4ab8cd77 added a check requiring input devices to have
a bus type of VIR_DOMAIN_INPUT_BUS_USB, failing to start the
domain otherwise.  But virDomainDefParseXML adds implicit mouse
and keyboard if a graphics device is configured.  See calls to
virDomainDefMaybeAddInput.

The regression is fixed by removing the check requiring USB input
devices, and skipping non-USB input devices when populating USB
'usbdevice' in libxl_domain_build_info struct.
2015-03-16 11:49:58 -06:00
Peter Krempa
4f9907cd11 conf: Replace access to def->mem.max_balloon with accessor functions
As there are two possible approaches to define a domain's memory size -
one used with legacy, non-NUMA VMs configured in the <memory> element
and per-node based approach on NUMA machines - the user needs to make
sure that both are specified correctly in the NUMA case.

To avoid this burden on the user I'd like to replace the NUMA case with
automatic totaling of the memory size. To achieve this I need to replace
direct access to the virDomainMemtune's 'max_balloon' field with
two separate getters depending on the desired size.

The two sizes are needed as:
1) Startup memory size doesn't include memory modules in some
hypervisors.
2) After startup these count as the usable memory size.

Note that the comments for the functions are future aware and document
state that will be present after a few later patches.
2015-03-16 14:26:51 +01:00
Marek Marczykowski
4ab8cd77ad libxl: add tablet/mouse input device support
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2015-03-13 12:00:49 -06:00
Marek Marczykowski
d0106d5828 libxl: support backend domain setting for disk and net devices
This implement handling of <backenddomain name=''/>  parameter introduced
in previous patch.

Works on Xen >= 4.3, because only there libxl supports setting backend
domain by name.  Specifying backend domain by ID or UUID is currently not
supported.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2015-02-20 14:50:24 -07:00
Marek Marczykowski-Górecki
98780c6be6 libxl: disable VNC and SDL until explicitly enabled
When initializing a libxl_domain_build_info struct with
libxl_domain_build_info_init(), VNC is enabled by default.  As a
result, VMs configured with no graphics still have VNC enabled.
This behavior is a regression wrt to the legacy Xen driver.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2015-02-11 20:24:20 -07:00
Marek Marczykowski-Górecki
8703ee58bd libxl: pass ipaddr to libxl toolstack
Do not silently ignore its value. LibXL support only one address, so
refuse multiple IPs.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2015-02-11 16:46:36 -07:00
John Ferlan
121c09a90b Replace virNetworkFree with virObjectUnref
Since virNetworkFree will call virObjectUnref anyway, let's just use that
directly so as to avoid the possibility that we inadvertently clear out
a pending error message when using the public API.
2014-12-02 11:03:40 -05:00
Jim Fehlig
720be2eb5f libxl: fix double-free of libxl_domain_build_info
On error, libxlMakeDomBuildInfo() frees the caller-provided
libxl_domain_build_info struct embedded in libxl_domain_config,
causing a segfault

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9c13020700 (LWP 40988)]
(gdb) bt
0  0x00007f9c162f95b4 in free () from /lib64/libc.so.6
1  0x00007f9c0d0965ad in libxl_bitmap_dispose () from
   /usr/lib64/libxenlight.so.4.4
2  0x00007f9c0d0a73bf in libxl_domain_build_info_dispose ()
   from /usr/lib64/libxenlight.so.4.4
3  0x00007f9c0d0a7974 in libxl_domain_config_dispose () from
   /usr/lib64/libxenlight.so.4.4
4  0x00007f9c0d2e00c5 in libxlDomainStart (driver=0x7f9c0400e4e0,
   vm=0x7f9c0412b0d0, start_paused=false, restore_fd=-1) at
   libxl/libxl_domain.c:1323
5  0x00007f9c0d2e1d4b in libxlDomainCreateXML (conn=0x7f9c000009a0,...)
   at libxl/libxl_driver.c:660

Remove the call to libxl_domain_build_info_dispose() from
libxlMakeDomBuildInfo().  On error, callers will dispose the
libxl_domain_config object, which in turn disposes the build info.
2014-10-30 10:23:18 -06:00
Jim Fehlig
1c0bf509ef libxl: Support user-specified <emulator>
With the introduction of the libxlDomainGetEmulatorType function,
it is trivial to support a user-specfied <emulator> in the libxl
driver.  This patch is based loosely on David Scott's old patch
to do the same

https://www.redhat.com/archives/libvir-list/2013-April/msg02119.html
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-10-30 10:23:18 -06:00
Stefan Bader
1298daca29 libxl: Implement basic video device selection
This started as an investigation into an issue where libvirt (using the
libxl driver) and the Xen host, like an old couple, could not agree on
who is responsible for selecting the VNC port to use.

Things usually (and a bit surprisingly) did work because, just like that
old couple, they had the same idea on what to do by default. However it
was possible that this ended up in a big argument.

The problem is that display information exists in two different places:
in the vfbs list and in the build info. And for launching the device model,
only the latter is used. But that never gets initialized from libvirt. So
Xen allows the device model to select a default port while libvirt thinks
it has told Xen that this is done by libvirt (though the vfbs config).

While fixing that, I made a stab at actually evaluating the configuration
of the video device. So that it is now possible to at least decide between
a Cirrus or standard VGA emulation and to modify the VRAM within certain
limits using libvirt.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-10-10 15:08:45 -06:00
Jim Fehlig
c5a003508f libxl: Add function to determine device model type
This patch introduces a function to detect whether the specified
emulator is QEMU_XEN or QEMU_XEN_TRADITIONAL.  Detection is based on the
string "Options specific to the Xen version:" in '$qemu -help' output.
AFAIK, the only qemu containing that string in help output is the
old Xen fork (aka qemu-dm).

Note:
QEMU_XEN means a qemu that contains support for Xen.

QEMU_XEN_TRADITIONAL means Xen's old forked qemu 0.10.2

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-10-10 15:08:40 -06:00
Jim Fehlig
be28ae1658 libxl: Copy user-specified keymap to libxl build info struct
Commit 4dfc34c3 missed copying the user-specified keymap to
libxl_domain_build_info struct when creating a VFB device.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-10-10 15:08:33 -06:00
Jim Fehlig
817206cdc8 libxl: fix mapping of libvirt and libxl lifecycle actions
The libxl driver was blindly assigning libvirt's
virDomainLifecycleAction to libxl's libxl_action_on_shutdown, when
in fact the various actions take on different values in these enums.

Introduce helpers to properly map the enum values.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-09-11 15:40:56 -06:00
Eric Blake
fb6d650717 maint: use consistent if-else braces in xen and friends
I'm about to add a syntax check that enforces our documented
HACKING style of always using matching {} on if-else statements.

This patch focuses on code related to xen.

* src/libxl/libxl_conf.c (libxlCapsInitGuests)
(libxlMakeDomBuildInfo): Correct use of {}.
* src/xen/xen_hypervisor.c (virXen_getvcpusinfo)
(xenHypervisorMakeCapabilitiesInternal): Likewise.
* src/xen/xend_internal.c (xenDaemonOpen)
(xenDaemonDomainMigratePerform, xend_detect_config_version)
(xenDaemonDetachDeviceFlags, xenDaemonDomainMigratePerform)
(xenDaemonDomainBlockPeek): Likewise.
* src/xenapi/xenapi_driver.c (xenapiConnectListDomains)
(xenapiDomainLookupByUUID, xenapiDomainGetOSType): Likewise.
* src/xenconfig/xen_common.c (xenParseCPUFeatures, xenFormatNet):
Likewise.
* src/xenconfig/xen_sxpr.c (xenParseSxpr, xenFormatSxprNet)
(xenFormatSxpr): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-09-04 08:53:21 -06:00
Jim Fehlig
4dfc34c301 libxl: fix memory corruption introduced by commit b55cc5f4e
Commit b55cc5f4e did a shallow copy of libxl_{sdl,vnc}_info from the
domain config to the build info, which resulted in double-freeing
strings contained in the structures during cleanup, which later
resulted in a libvirtd crash.  Fix by performing a deep copy of the
structure, VIR_STRDUP'ing embedded strings instead of simply copying
their pointers.

Fixes the following issue reported on the libvirt dev list

https://www.redhat.com/archives/libvir-list/2014-August/msg01112.html
2014-08-25 17:35:12 -06:00
John Ferlan
1c8da0d44e hostdev: Introduce virDomainHostdevSubsysPCI
Create a separate typedef for the hostdev union data describing PCI.
Then adjust the code to use the new pointer
2014-07-24 06:39:27 -04:00
Ján Tomko
3227e17d82 Introduce virTristateSwitch enum
For the values "default", "on", "off"

Replaces
virDeviceAddressPCIMulti
virDomainFeatureState
virDomainIoEventFd
virDomainVirtioEventIdx
virDomainDiskCopyOnRead
virDomainMemDump
virDomainPCIRombarMode
virDomainGraphicsSpicePlaybackCompression
2014-07-23 12:59:40 +02:00
Michele Paolino
a14abd463a support for QEMU vhost-user
This patch adds support for the QEMU vhost-user feature to libvirt.
vhost-user enables the communication between a QEMU virtual machine
and other userspace process using the Virtio transport protocol.
It uses a char dev (e.g. Unix socket) for the control plane,
while the data plane based on shared memory.

The XML looks like:

<interface type='vhostuser'>
    <mac address='52:54:00:3b:83:1a'/>
    <source type='unix' path='/tmp/vhost.sock' mode='server'/>
    <model type='virtio'/>
</interface>

Signed-off-by: Michele Paolino <m.paolino@virtualopensystems.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-07-16 18:44:57 +02:00
Eric Blake
58156f39ce capabilities: use bool instead of int
While preparing to add a capability for active commit, I noticed
that the existing code was abusing int for boolean values.

* src/conf/capabilities.h (_virCapsGuestFeature, _virCapsHost)
(virCapabilitiesNew, virCapabilitiesAddGuestFeature): Improve
types.
* src/conf/capabilities.c (virCapabilitiesNew)
(virCapabilitiesAddGuestFeature): Adjust signature.
* src/bhyve/bhyve_capabilities.c (virBhyveCapsBuild): Update
clients.
* src/esx/esx_driver.c (esxCapsInit): Likewise.
* src/libxl/libxl_conf.c (libxlMakeCapabilities): Likewise.
* src/lxc/lxc_conf.c (virLXCDriverCapsInit): Likewise.
* src/openvz/openvz_conf.c (openvzCapsInit): Likewise.
* src/parallels/parallels_driver.c (parallelsBuildCapabilities):
Likewise.
* src/phyp/phyp_driver.c (phypCapsInit): Likewise.
* src/qemu/qemu_capabilities.c (virQEMUCapsInit)
(virQEMUCapsInitGuestFromBinary): Likewise.
* src/security/virt-aa-helper.c (get_definition): Likewise.
* src/test/test_driver.c (testBuildCapabilities): Likewise.
* src/uml/uml_conf.c (umlCapsInit): Likewise.
* src/vbox/vbox_tmpl.c (vboxCapsInit): Likewise.
* src/vmware/vmware_conf.c (vmwareCapsInit): Likewise.
* src/xen/xen_hypervisor.c (xenHypervisorBuildCapabilities):
Likewise.
* src/xenapi/xenapi_driver.c (getCapsObject): Likewise.
* tests/qemucaps2xmltest.c (testGetCaps): Likewise.
* tests/testutils.c (virTestGenericCapsInit): Likewise.
* tests/testutilslxc.c (testLXCCapsInit): Likewise.
* tests/testutilsqemu.c (testQemuCapsInit): Likewise.
* tests/testutilsxen.c (testXenCapsInit): Likewise.
* tests/vircaps2xmltest.c (buildVirCapabilities): Likewise.
* tests/vircapstest.c (buildNUMATopology): Likewise.
* tests/vmx2xmltest.c (testCapsInit): Likewise.
* tests/xml2vmxtest.c (testCapsInit): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-07-14 08:00:46 -06:00
Ian Campbell
b1c9f79a84 libxl: Correct cast to virDomainDiskDiscard enum.
This was converted to a typedef in 5a2bd4c917 "conf: more enum
cleanups in "src/conf/domain_conf.h"" causing:
    libxl/libxl_conf.c: In function 'libxlDiskSetDiscard':
    libxl/libxl_conf.c:724:19: error: conversion to incomplete type

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2014-07-11 08:51:13 -06:00
Olaf Hering
4e7e5e9f7b libxl: add discard support to libxl_device_disk
Translate libvirt discard settings into libxl-4.5 discard settings.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2014-07-09 11:10:55 -06:00
Peter Krempa
63834faadb storage: Move readonly and shared flags to disk source from disk def
In the future we might need to track state of individual images. Move
the readonly and shared flags to the virStorageSource struct so that we
can keep them in a per-image basis.
2014-07-08 14:27:19 +02:00
Jim Fehlig
1d37a4c46b libxl: detect support for save and restore
libxl does not support save, restore, or migrate on all architectures,
notably ARM.  Detect whether libxl supports these operations using
LIBXL_HAVE_NO_SUSPEND_RESUME.  If not supported, drop advertisement of
<migration_features>.

Found by Ian Campbell while improving Xen's OSSTEST infrastructure

http://lists.xen.org/archives/html/xen-devel/2014-06/msg02171.html
2014-06-26 12:00:15 -06:00
Jim Fehlig
48d81cef3b libxl: prefer qdisk for <driver name='file'>
The libxl driver currently sets the disk backend to
LIBXL_DISK_BACKEND_TAP when <driver name='file'> is specified
in the <disk> config.  qdisk should be prefered with this
configuration, otherwise existing configuration such as the
following, which worked with the old Xen driver, will not work
with the libxl driver

  <disk type='file' device='cdrom'>
    <driver name='file'/>
    <source file='/path/to/some/iso'/>
    <target dev='hdc' bus='ide'/>
    <readonly/>
  </disk>

In addition, tap performs poorly compared to qdisk.
2014-06-23 15:52:14 -06:00
Jim Fehlig
2624dfde37 libxl: limit support for specifying an interface script
Generally, <interface> ... <script> is only supported for
type='ethernet'.  Due to the long and pervasive use of

  <interface type='bridge'>
    ...
    <script path='foo'/>
  </interface>

in Xen domain configuration, it was agreed to allow the use
of <script> with type='bridge' for backwards compatibility.  See
the following discussion thread

http://www.redhat.com/archives/libvir-list/2013-April/msg00755.html

This patch limits the use of <script> to interface types ethernet
and bridge, raising an unsupported config error if <script> is
specified for all other interface types.

While at it, use VIR_ERR_CONFIG_UNSUPPORTED instead of
VIR_ERR_INTERNAL_ERROR when reporting unsupported interface types.
2014-06-19 15:33:36 -06:00
Jim Fehlig
bf410bb8eb libxl: support interface type=network
Add support for <interface type='network'> in the libxl driver.
2014-06-19 15:33:36 -06:00
Michal Privoznik
02129b7c0e virCaps: expose pages info
There are two places where you'll find info on page sizes. The first
one is under <cpu/> element, where all supported pages sizes are
listed. Then the second one is under each <cell/> element which refers
to concrete NUMA node. At this place, the size of page's pool is
reported. So the capabilities XML looks something like this:

<capabilities>

  <host>
    <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Westmere</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='1' threads='1'/>
      ...
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
      <pages unit='KiB' size='1048576'/>
    </cpu>
    ...
    <topology>
      <cells num='4'>
        <cell id='0'>
          <memory unit='KiB'>4054408</memory>
          <pages unit='KiB' size='4'>1013602</pages>
          <pages unit='KiB' size='2048'>3</pages>
          <pages unit='KiB' size='1048576'>1</pages>
          <distances/>
          <cpus num='1'>
            <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
          </cpus>
        </cell>
        <cell id='1'>
          <memory unit='KiB'>4071072</memory>
          <pages unit='KiB' size='4'>1017768</pages>
          <pages unit='KiB' size='2048'>3</pages>
          <pages unit='KiB' size='1048576'>1</pages>
          <distances/>
          <cpus num='1'>
            <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
        ...
      </cells>
    </topology>
    ...
  </host>

  <guest/>

</capabilities>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-06-19 15:10:49 +02:00
Michal Privoznik
8ba0a58f8d virCaps: Expose distance between host NUMA nodes
If user or management application wants to create a guest,
it may be useful to know the cost of internode latencies
before the guest resources are pinned. For example:

<capabilities>

  <host>
    ...
    <topology>
      <cells num='2'>
        <cell id='0'>
          <memory unit='KiB'>4004132</memory>
          <distances>
            <sibling id='0' value='10'/>
            <sibling id='1' value='20'/>
          </distances>
          <cpus num='2'>
            <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
            <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
          </cpus>
        </cell>
        <cell id='1'>
          <memory unit='KiB'>4030064</memory>
          <distances>
            <sibling id='0' value='20'/>
            <sibling id='1' value='10'/>
          </distances>
          <cpus num='2'>
            <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
            <cpu id='3' socket_id='0' core_id='2' siblings='3'/>
          </cpus>
        </cell>
      </cells>
    </topology>
    ...
  </host>
  ...
</capabilities>

We can see the distance from node1 to node0 is 20 and within nodes 10.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-06-04 09:35:55 +02:00
Daniel P. Berrange
3bab69c30f libxl: Move virDomainXMLOptionNew into libxlCreateXMLConf
To allow the test suite to creat the XML option object,
move the virDomainXMLOptionNew call into a libxlCreateXMLConf
method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-03 11:45:59 +01:00
Daniel P. Berrange
a6abdbf645 libxl: Don't pass libxlDriverPrivatePtr into libxlBuildDomainConfig
To make it easier to test, change libxlBuildDomainConfig so
that it takes a virPortAllocatorPtr instead of the larger
libxlDriverPrivatePtr object.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-03 11:45:59 +01:00
Daniel P. Berrange
5da28f2405 libxl: Don't pass virDomainObjPtr to libxlBuildDomainConfig
To make it easier to unit test, change libxlBuildDomainConfig
so that it takes 'virDomainDefPtr' and 'libxl_ctx *' objects
as separate parameters.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-03 11:45:59 +01:00
Chunyan Liu
fd43d1f8bd libxl: fix support for <interface type="hostdev"> syntax
A VIR_DOMAIN_NET_TYPE_HOSTDEV interface device is really a hostdev
device, which is created by the libxl driver in libxlMakePCIList().
There is no need to create a libxl_device_nic for such hostdev
devices, so skip interfaces of type VIR_DOMAIN_NET_TYPE_HOSTDEV in
libxlMakeNicList().

Signed-off-by: Chunyan Liu <cyliu@suse.com>
2014-05-12 14:52:50 -06:00
Daniel P. Berrange
3cfa19da22 Replace Pci with PCI throughout
Since it is an abbreviation, PCI should always be fully
capitalized or full lower case, never Pci.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-08 11:15:55 +01:00
Stefan Bader
7a1452f533 libxl: Set disk format for empty cdrom device
The XML config for a CDROM device can be without a source path,
indicating that there is no media present. Without this change
the libxl driver fails to start a guest in that case because
the libxl library checks for the LIBXL_DISK_FORMAT_EMPTY format
type and tries to stat the NULL pointer that gets passed on.

> libxl: error: libxl_device.c:265:libxl__device_disk_set_backend:
> Disk vdev=hdc failed to stat: (null): Bad address

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2014-04-03 17:27:46 +02:00
Stefan Bader
139efe758c libxl: Create log directory earlier
Commit d9f19c30d0 moved a lot of the
configuration setup into libxlDriverConfigNew().
However that tries to create the libxl/libxl-driver.log before the
libxl directory gets created in libxlStateInitialize().

This causes the daemon to fail on systems that have not had the directory
created before.

Move the code to create the libxl directory into libxlDriverConfigNew().

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2014-03-25 10:14:06 -06:00
Ján Tomko
37a0c27318 Indent top-level labels by one space in src/libxl/ 2014-03-25 14:58:38 +01:00
Eric Blake
f7c81d8458 conf: use disk source accessors in libxl/
Part of a series of cleanups to use new accessor methods.

* src/libxl/libxl_conf.c (libxlMakeDisk): Use accessors.
* src/libxl/libxl_driver.c (libxlDomainChangeEjectableMedia)
(libxlDomainAttachDeviceDiskLive): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-24 11:59:50 -06:00
Jim Fehlig
d8d713234e libxl: move libxlDoNodeGetInfo to libxl_conf
Move libxlDoNodeGetInfo from libxl_driver to libxl_conf
for use by other libxl modules.  For consistency, rename to
libxlDriverNodeGetInfo.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2014-03-19 14:46:55 -06:00
Jim Fehlig
b55cc5f4e3 libxl: fix framebuffer port setting for HVM domains
libxl uses the libxl_vnc_info and libxl_sdl_info fields from the
hvm union in libxl_domain_build_info struct when generating QEMU
args for VNC or SDL.  These fields were left unset by the libxl
driver, causing libxl to ignore any user settings.  E.g. with

  <graphics type='vnc' port='5950'/>

port would be ignored and QEMU would instead be invoked with

  -vnc 127.0.0.1:0,to=99

Unlike the libxl_domain_config struct, the libxl_domain_build_info
contains only a single libxl_vnc_info and libxl_sdl_info, so
populate these fields from the first vfb in
libxl_domain_config->vfbs.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: David Kiarie <davidkiarie4@gmail.com>
2014-03-18 15:14:34 -06:00
Daniel P. Berrange
2835c1e730 Add virLogSource variables to all source files
Any source file which calls the logging APIs now needs
to have a VIR_LOG_INIT("source.name") declaration at
the start of the file. This provides a static variable
of the virLogSource type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-03-18 14:29:22 +00:00
Chunyan Liu
6225cb3df5 add pci passthrough to libxl driver
Add pci passthrough to libxl driver, support attach-device, detach-device and
start a vm with pci hostdev specified.
2014-03-12 17:03:50 +00:00