1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-08-18 13:50:02 +03:00

Compare commits

...

635 Commits

Author SHA1 Message Date
31a5ee922a Release of libvirt-0.7.6
* configure.ac docs/news.html.in libvirt.spec.in: version bump and doc
  updates
* po/*.po*: updated and regenerated the localizations
2010-02-03 18:16:25 +01:00
83acdeaf17 Fix restore of QEMU guests with PCI device reservation
When restoring from a saved guest image, the XML would already
contain the PCI slot ID of the IDE controller & video card.
The attempt to explicitly reserve this upfront would thus fail
everytime.

* src/qemu/qemu_conf.c: Reserve IDE controller / video card
  slot at time of need, rather than upfront
2010-02-03 16:45:26 +00:00
730801d955 Another fork() log locking cleanup in file creation
Similar fix as previous one but for fork() usage when creating
a file or directory

* src/util/util.c: virLogLock() and virLogUnlock() around fork()
  in virFileCreate() and virDirCreateSimple()
2010-02-03 17:19:39 +01:00
cd0ef0e09b Fix log locking problem when using fork() in the library
Ad pointed out by Dan Berrange:
So if some thread in libvirtd is currently executing a logging call,
while another thread calls virExec(), that other thread no longer
exists in the child, but its lock is never released. So when the
child then does virLogReset() it deadlocks.

The only way I see to address this, is for the parent process to call
virLogLock(), immediately before fork(), and then virLogUnlock()
afterwards in both parent & child. This will ensure that no other
thread
can be holding the lock across fork().

* src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and
  virLogUnlock()
* src/util/util.c: lock just before forking and unlock just after - in
  both parent and child.
2010-02-03 17:12:57 +01:00
8d42b9b4e8 Fix locking for udev device add/remove
The original udev node device backend neglected to lock the driverState
struct containing the device list when adding and removing devices
* src/node_device/node_device_udev.c: add necessary locks in
  udevRemoveOneDevice() and udevAddOneDevice()
2010-02-03 16:56:33 +01:00
fe1183a7cd interface_conf.c: don't use a negative value as allocation size
* src/conf/interface_conf.c (virInterfaceDefParseProtoIPv4): If
virXPathNodeSet returns -1, indicate failure by returning -1 right away.
(virInterfaceDefParseProtoIPv6): Likewise.
2010-02-03 15:47:04 +01:00
71c865f4d2 virStoragePoolSourceListNewSource: avoid unconditional leak
* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
Remove an unused (and leaked) allocation.
2010-02-03 15:46:59 +01:00
361e46d6d0 xs_internal.c: don't use a negative value as allocation size
* src/xen/xs_internal.c (xenStoreDomainIntroduced): Don't use -1
as an allocation size upon xenStoreNumOfDomains failure.
(xenStoreDomainReleased): Likewise.
2010-02-03 15:46:54 +01:00
9120f00446 Ensure QEMU DAC security driver is activated at all times
If the primary security driver (SELinux/AppArmour) was disabled
then the secondary QEMU DAC security driver was also disabled.
This is mistaken, because the latter must be active at all times

* src/qemu/qemu_driver.c: Ensure DAC driver is always active
2010-02-02 19:14:31 +00:00
7efec25964 xen_hypervisor.c: remove all "domain == NULL" tests, ...
* src/xen/xen_hypervisor.c: Remove all "domain == NULL" tests.
* src/xen/xen_hypervisor.h: Instead, use ATTRIBUTE_NONNULL to
mark each "domain" parameter as "known always to be non-NULL".
2010-02-02 18:44:39 +01:00
b62bf7a700 xen_hypervisor.c: avoid NULL deref for NULL domain argument
* src/xen/xen_hypervisor.c (xenHypervisorGetVcpus): Don't attempt
to diagnose an unlikely NULL-domain or NULL-domain->conn error.
2010-02-02 18:44:32 +01:00
23d6abd23b Tweak USB hostdevice XML handling
When attaching a USB host device based on vendor/product, libvirt
will resolve the vendor/product into a device/bus pair. This means
that when printing XML we should allow device/bus info to be printed
at any time if present

* src/conf/domain_conf.c, docs/schemas/domain.rng: Allow USB device
  bus info alongside vendor/product
2010-02-02 16:31:47 +00:00
719c50caf8 Fix QEMU hotplug device alias assignment
To allow devices to be hot(un-)plugged it is neccessary to ensure
they all have a unique device aliases. This fixes the hotplug
methods to assign device aliases before invoking the monitor
commands which need them

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Expose methods
  for assigning device aliases for disks, host devices and
  controllers
* src/qemu/qemu_driver.c: Assign device aliases when hotplugging
  all types of device
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args:
  Update for changed hostdev naming scheme
2010-02-02 16:31:47 +00:00
db0b9e7d52 Disable QEMU monitor IO debugging by default 2010-02-02 16:31:47 +00:00
16478459da Re-arrange QEMU device alias assignment code
This patch re-arranges the QEMU device alias assignment code to
make it easier to call into the same codeblock when performing
device hotplug. The new code has the ability to skip over already
assigned names to facilitate hotplug

* src/qemu/qemu_driver.c: Call qemuAssignDeviceNetAlias()
  instead of qemuAssignNetNames
* src/qemu/qemu_conf.h: Export qemuAssignDeviceNetAlias()
  instead of qemuAssignNetNames
* src/qemu/qemu_driver.c: Merge the legacy disk/network alias
  assignment code into the main methods
2010-02-02 16:31:47 +00:00
0943048ad0 Remove direct storage of hostnet_name & vlan
The current way of assigning names to the host network backend and
NIC device in QEMU was over complicated, by varying naming scheme
based on the NIC model and backend type. This simplifies the naming
to simply be 'net0' and 'hostnet0', allowing code to easily determine
the host network name and vlan based off the primary device alias
name 'net0'. This in turn allows removal of alot of QEMU specific
code from the XML parser, and makes it easier to assign new unique
names for NICs that are hotplugged

* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove hostnet_name
  and vlan fields from virNetworkDefPtr
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c:
  Use a single network alias naming scheme regardless of NIC type
  or backend type. Determine VLANs from the alias name.
* tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args: Update
  for new simpler naming scheme
2010-02-02 16:31:47 +00:00
49a0f6cd99 Remove use of -netdev arg with QEMU
The QEMU 0.12.x tree has the -netdev command line argument, but not
corresponding monitor command. We can't enable the former, without
the latter since it will break hotplug/unplug.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage
  until 0.13 at earliest
* tests/qemuxml2argvtest.c: Add test for -netdev syntax
* tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test
  data files for -netdev syntax
2010-02-02 16:31:47 +00:00
d8acc44672 Assign PCI addresses before hotplugging devices
PCI disk, disk controllers, net devices and host devices need to
have PCI addresses assigned before they are hot-plugged

* src/qemu/qemu_conf.c: Add APIs for ensuring a device has an
  address and releasing unused addresses
* src/qemu/qemu_driver.c: Ensure all devices have addresses
  when hotplugging.
2010-02-02 16:31:47 +00:00
9258ec0a2e Rewrite way QEMU PCI addresses are allocated
The current QEMU code allocates PCI addresses incrementally starting
at 4. This is not satisfactory because the user may have given some
addresses in their XML config, which need to be skipped over when
allocating addresses to remaining devices.

It is thus neccessary to maintain a list of already allocated PCI
addresses and then only allocate ones that remain unused. This is
also required for domain device hotplug to work properly later.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add APIs for creating
  list of existing PCI addresses, and allocating new addresses.
  Refactor address assignment to use this code
* src/qemu/qemu_driver.c: Pull PCI address assignment up into the
  qemuStartVMDaemon() method, as a prelude to moving it into the
  'define' method. Update list of allocated addresses when connecting
  to a running VM at daemon startup.
* tests/qemuxml2argvtest.c, tests/qemuargv2xmltest.c,
  tests/qemuxml2xmltest.c: Remove USB product test since all
  passthrough is done based on address
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args,
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml: Kil
  unused data files
2010-02-02 16:31:47 +00:00
3fdef8cfca Introduce generic virDomainDeviceInfo iterator function
The virDomainDeviceInfoIterate() function will provide a
convenient way to iterate over all devices in a domain.

* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/libvirt_private.syms: Add virDomainDeviceInfoIterate()
  function.
2010-02-02 16:31:47 +00:00
264e98d6a8 Make hotplug use new device_add where possible
Since QEMU startup uses the new -device argument, the hotplug
code needs todo the same. This converts disk, network and
host device hotplug to use the device_add command

* src/qemu/qemu_driver.c: Use new device_add monitor APIs
  whereever possible
2010-02-02 16:31:46 +00:00
5ec6cf7fb8 Introduce internal QEMU monitor APIs for drive + device hotadd
The way QEMU is started has been changed to use '-device' and
the new style '-drive' syntax. This needs to be mirrored in
the hotplug code, requiring addition of two new APIs.

* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Define APIs
  qemuMonitorAddDevice() and qemuMonitorAddDrive()
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
  Implement the new monitor APIs
2010-02-02 16:31:42 +00:00
96c8608dc5 Split out QEMU code for building PCI/USB hostdev arg values
To allow for better code reuse from hotplug methods, the code for
generating PCI/USB hostdev arg values is split out into separate
methods

* qemu/qemu_conf.h, qemu/qemu_conf.c: Introduce new APis for
  qemuBuildPCIHostdevPCIDevStr, qemuBuildUSBHostdevUsbDevStr
  and qemuBuildUSBHostdevDevStr
2010-02-02 15:41:29 +00:00
c129d4fe45 Standard internal API syntax for building QEMU command line arguments
All the helper functions for building command line arguments
now return a 'char *', instead of acepting a 'char **' or
virBufferPtr argument

* qemu/qemu_conf.c: Standardize syntax for building args
* qemu/qemu_conf.h: Export all functions for building args
* qemu/qemu_driver.c: Update for changed syntax for building
  NIC/hostnet args
2010-02-02 15:41:25 +00:00
c37ff6a1ec libvirtd.c: avoid closing a negative socket file descriptor
* daemon/libvirtd.c (qemudListenUnix): Close socket only if non-negative.
2010-02-02 12:07:27 +01:00
3db3acb94e storage_backend.c: avoid closing a negative file descriptor
* src/storage/storage_backend.c (virStorageBackendRunProgRegex):
Don't close a negative (read-only) file descriptor.
2010-02-02 12:07:19 +01:00
9344e6ad1a avoid a probable EINVAL from lseek
* src/qemu/qemu_driver.c (qemudLogReadFD): Don't pass a negative
offset (from a preceding failed attempt to seek to EOF) to this use
of lseek.
2010-02-02 10:35:52 +01:00
33e25a3984 udev: Don't let strtoul parse USB busnum and devnum as octal
udevGetUintProperty was called with base set to 0 for busnum and devnum.
With base 0 strtoul parses the number as octal if it start with a 0. But
busnum and devnum are decimal and udev returns them padded with leading
zeros. So strtoul parses them as octal. This works for certain decimal
values like 001-007, but fails for values like 008.

Change udevProcessUSBDevice to use base 10 for busnum and devnum.
2010-02-02 09:54:29 +01:00
c16888a849 util.c (two more): don't use a negative value as allocation size
* src/util/util.c (virGetUserID, virGetGroupID): In the unlikely event
that sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in
the subsequent allocation.
2010-02-01 22:19:15 +01:00
1cb334efba json.c: avoid an unconditional leak from most qemuMonitorJSON* functions
* src/util/json.c (virJSONValueFree): Free the "value" pointer, too.
2010-02-01 19:48:34 +01:00
4cd188d4d5 avoid format-related warnings
* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
Use %s.
* src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
Likewise.
* tools/virsh.c (cmdSecretSetValue): Likewise.
2010-02-01 18:25:23 +01:00
6b8d8395b6 maint: avoid excess parens in STREQ
* src/internal.h (STREQ, STRCASEEQ, STRNEQ, STRCASENEQ, STREQLEN)
(STRCASEEQLEN, STRNEQLEN, STRCASENEQLEN, STRPREFIX): Avoid
redundant parenthesis.
* examples/domain-events/events-c/event-test.c (STREQ): Likewise.
* src/storage/parthelper.c (STREQ): Likewise.
2010-02-01 17:21:26 +01:00
1e44c678fa Move models/nmodels mismatch checking one level up
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-02-01 17:20:27 +01:00
0ea0128904 Log flags in virConnectCompareCPU
* src/libvirt.c: extend the debug statement to log flags too
2010-02-01 16:23:41 +01:00
29727bacd7 Fix PCI host reattach on domain detach.
Similar to the race fixed by
be34c3c7ef, make sure
to wait around for KVM to release the resources from
a hot-detached PCI device before attempting to
rebind that device to the host driver.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-02-01 10:14:39 -05:00
09080c38d1 Clarify controllers -device string in QEMU driver
The QEMU driver contained code to generate a -device string for piix4-ide, but
wasn't using it. This change removes this string generation. It also adds a
comment explaining why IDE and FDC controllers don't generate -device strings.

The change also generates an error if a sata controller is specified for a QEMU
domain, as this isn't supported.

* src/qemu/qemu_conf.c: Remove VIR_DOMAIN_CONTROLLER_TYPE_IDE handler in
  qemuBuildControllerDevStr(). Ignore IDE and FDC controllers. Error if
  SATA controller is discovered. Add comments.
2010-02-01 16:08:36 +01:00
62a30a496a Fix up a comment in virHashUpdateEntry
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-02-01 09:39:54 -05:00
b16cd226a2 Look in /usr/libexec for the qemu-kvm binary.
On RHEL-5 the qemu-kvm binary is located in /usr/libexec.
To reduce confusion for people trying to run upstream libvirt
on RHEL-5 machines, make the qemu driver look in /usr/libexec
for the qemu-kvm binary.

To make this work, I modified virFindFileInPath to handle an
absolute path correctly.  I also ran into an issue where
NULL was sometimes being passed for the file parameter
to virFindFileInPath; it didn't crash prior to this patch
since it was building paths like /usr/bin/(null).  This
is non-standard behavior, though, so I added a NULL
check at the beginning.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-02-01 09:39:42 -05:00
3fc974209a maint: fix spelling error in hacking
* HACKING: STRCASEEQ is case insensitive.
* docs/hacking.html.in: Likewise.
2010-01-29 21:48:39 +01:00
5ec55b4ff0 util.c (virGetUserEnt): don't use a negative value as allocation size
* src/util/util.c (virGetUserEnt): In the unlikely event that
sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in
the subsequent allocation.
2010-01-29 21:43:02 +01:00
3bd3d6b0bf Support Xen 4.0 sysctl version 7
xen-unstable c/s 20762 bumped XEN_SYSCTL_INTERFACE_VERSION to 7.  The
interface change does not affect libvirt, other than xenHypervisorInit()
failing since version 7 is not tried.

The attached patch accommodates the upcoming Xen 4.0 release by checking
for XEN_SYSCTL_INTERFACE_VERSION 7.  If found, it sets
XEN_DOMCTL_INTERFACE_VERSION to 6, which is also new to Xen 4.0.
2010-01-27 10:56:18 -07:00
6f4ca18d83 Add missing sata controller type to domain.rng
* docs/schemas/domain.rng: Add sata controller type
2010-01-27 14:26:49 +01:00
3970a2dc86 cpu_x86.c: avoid NULL-deref for invalid arguments
* src/cpu/cpu_x86.c (x86Decode): Do not dereference NULL
when "models" is NULL and nmodels is 1 or greater.
2010-01-27 13:39:58 +01:00
b74aadb3e5 portability to non-glibc: don't use realpath(..., NULL)
it causes a NULL-dereference on some systems like Solaris 10.
* src/node_device/node_device_linux_sysfs.c. Include <stdlib.h>.
(get_sriov_function): Use canonicalize_file_name, not realpath.
* bootstrap (modules): Add canonicalize-lgpl.
2010-01-27 13:39:46 +01:00
950176ec65 pci.c: correct an erroneous expression
* src/util/pci.c (pciDeviceDownstreamLacksACS): Fix a typo
that rendered a subexpression always false.
2010-01-27 08:10:06 +01:00
227f26afdb udev: Set the state driver name 2010-01-26 21:23:18 +01:00
0cdb9a5cfc Remove undefined symbols from libvirt_private.syms 2010-01-26 21:23:18 +01:00
d115ed59e0 udev: Remove event handle on shutdown
This fixes a segfault when the event handler is called after shutdown
when the global driver state is NULL again.

Also fix a locking issue in an error path.
2010-01-26 21:23:18 +01:00
7f7676e77b Don't call disabled timer callbacks in event-test.c
This fixes a segfault in the remote driver that occurs for example when
the event-test is run inside a domain-0 and libvirtd is also running.
2010-01-26 21:23:18 +01:00
ef088ed962 esx: Output error details from libcurl 2010-01-26 21:23:18 +01:00
594ac31b2d Add missing function parameter documentation 2010-01-26 21:23:18 +01:00
fb54230b60 hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/
* src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/
(usbFindBusByVendor): Likewise.  And closedir only if non-NULL.
2010-01-26 16:11:45 +01:00
ba1d379ce8 Cleanup of large buffer on stack in virFileMakePath
virFileMakePath is a recursive function that was creates a buffer
PATH_MAX bytes long for each recursion (one recursion for each element
in the path). This changes it to have no buffers on the stack, and to
allocate just one buffer total, no matter how many elements are in the
path. Because the modified algorithm requires a char* to be passed in
rather than const char *, it is now 2 functions - a toplevel API
function that remains identical in function, and a 2nd helper function
called for the recursions, which 1) doesn't allocate anything, and 2)
takes a char* arg, so it can modify the contents.
* src/util/util.c: rewrite virFileMakePath
2010-01-26 14:48:21 +01:00
854111f97e esx: Stop passing around virConnectPtr for error reporting 2010-01-26 01:19:23 +01:00
9757e10d6d Revert "Fix libvirtd restart for domains with PCI passthrough devices"
This reverts commit cdc42d0a48.
As DanB pointed out, this patch is actually wrong.  The real
bug that was causing me to see this problem is a bug
introduced in a RHEL-5 libvirt snapshot, and I'm going to
fix the real bug there.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-25 16:26:54 -05:00
7cc5410bfd Fix a crash when restarting libvirtd.
If you shutdown libvirtd while a domain with PCI
devices is running, then try to restart libvirtd,
libvirtd will crash.

This happens because qemuUpdateActivePciHostdevs() is calling
pciDeviceListSteal() with a dev of 0x0 (NULL), and then trying
to dereference it.  This patch fixes it up so that
qemuUpdateActivePciHostdevs() steals the devices after first
Get()'ting them, avoiding the crash.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-25 16:25:47 -05:00
a7d17c6187 Fix two instances of misspelled 'pseudo'
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-25 16:25:28 -05:00
1af75828a0 qemuMonitorTextAttachDrive: avoid two leaks
* src/qemu/qemu_monitor_text.c (qemuMonitorTextAttachDrive): Most other
failures in this function would "goto cleanup", but one mistakenly
returned directly, skipping the cleanup and resulting in a leak.
In addition, iterating the "try_command" loop would clobber, and
thus leak, the "cmd" allocated on the first iteration,
so be careful to free it in addition to "reply" beforehand.
2010-01-25 22:06:47 +01:00
731c738652 qemu: Search binaries in PATH instead of hardcoding /usr/bin 2010-01-25 21:38:28 +01:00
72a8405a47 Implement QMP support for extracting CPU thread ID
The KVM build of QEMU includs the thread ID of each vCPU in the
'query-cpus' output. This is required for pinning guests to
particular host CPUs

* src/qemu/qemu_monitor_json.c: Extract 'thread_id' from CPU info
2010-01-25 17:08:37 +00:00
2c7f5ca662 Misc fixes to QMP monitor support for QEMU
* src/util/json.c, src/util/json.h: Declare returned strings
  to be const
* src/qemu/qemu_monitor.c: Wire up JSON mode for qemuMonitorGetPtyPaths
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Fix
  const correctness. Add missing error message in the function
  qemuMonitorJSONGetAllPCIAddresses. Add implementation of the
  qemuMonitorGetPtyPaths function calling 'query-chardev'.
2010-01-25 17:08:37 +00:00
a5a46c6fc2 Add some missing include files which break build in certain platforms
Two files were using functions from <sys/stat.h> but not including
in. Most of the time they got this automatically via another header,
but certain build flag combinations can reveal the problem

* src/lxc/lxc_container.c, src/node_device/node_device_linux_sysfs.c:
  Add <sys/stat.h>
2010-01-25 17:08:37 +00:00
7d8f5eb3bc Fix setup of compatability serial devices from console device
The <console> tag is supposed to result in addition of a single
<serial> device for HVM guests. The 'targetType' attribute was
missing though causing the compatibility code to add a second
<console> device

* src/conf/domain_conf.c: Set targetType for serial device
2010-01-25 17:08:37 +00:00
3dc4268669 usbGetDevice: don't leak a "usbDevice" buffer on failure path
* src/util/hostusb.c (usbGetDevice): Free "dev" when returning NULL.
2010-01-25 17:07:06 +01:00
9827e0a42c qemuMonitorTextGetMemoryStats: plug a leak on an error path
* src/qemu/qemu_monitor_text.c (qemuMonitorCommandWithHandler):
Always free *reply, upon failure.
2010-01-25 17:04:27 +01:00
1f9da29de1 usbFindBusByVendor: don't leak a DIR buffer and FD
* src/util/hostusb.c (usbFindBusByVendor): Don't leak a DIR buffer
and file descriptor.
2010-01-25 16:50:28 +01:00
eaa2fd6939 Start modernizing configure
* configure.ac: reanmed configura.in, use AC_CONFIG_HEADERS instead of
  AM_CONFIG_HEADER
2010-01-25 16:00:43 +01:00
cdc42d0a48 Fix libvirtd restart for domains with PCI passthrough devices
When libvirtd shuts down, it places a <state/> tag in the XML
state file it writes out for guests with PCI passthrough
devices.  For devices that are attached at bootup time, the
state tag is empty.  However, at libvirtd startup time, it
ignores anything with a <state/> tag in the XML, effectively
hiding the guest.
This patch remove the check for VIR_DOMAIN_XML_INTERNAL_STATUS
when parsing the XML.
* src/conf/domain_conf.c: remove VIR_DOMAIN_XML_INTERNAL_STATUS
  flag check in virDomainHostdevSubsysPciDefParseXML()
2010-01-22 18:39:15 +01:00
be34c3c7ef qemu: Fix race between device rebind and kvm cleanup
Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
the host when doing device passthrough.  This can lead to a race
condition where the hypervisor is still cleaning up the device while
libvirt is trying to re-attach it to the host device driver.  To avoid
this situation, we look through /proc/iomem, and if the hypervisor is
still holding onto the bar (denoted by the string in the matcher variable),
then we can wait around a bit for that to clear up.

v2: Thanks to review by DV, make sure we wait the full timeout per-device

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-22 12:03:49 -05:00
654dd2902d Fix device assignment with root devices
The patches to add ACS checking to PCI device passthrough
introduced a bug.  With the current code, if you try to
passthrough a device on the root bus (i.e. bus 0), then
it denies the passthrough.  This is because the code in
pciDeviceIsBehindSwitchLackingACS() to check for a parent
device doesn't take into account the possibility of the
root bus.  If we are on the root bus, it means we
legitimately can't find a parent, and it also means that
we don't have to worry about whether ACS is enabled.
Therefore return 0 (indicating we don't lack ACS) from
pciDeviceIsBehindSwitchLackingACS().

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-22 09:42:45 -05:00
54c973d52b Add a rule to check for uses of readlink.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-22 09:42:35 -05:00
b195f20f18 Use virFileResolveLink instead of readlink in AppArmor
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-22 09:38:22 -05:00
1f703731d3 Fix a compile warning in parthelper.c
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2010-01-22 09:37:09 -05:00
912f5e5884 Add virConnectGetVersion Python API
adds a new python API call for retrieving the running
hypervisor version used by a connection: virConnectGetVersion

* python/generator.py: skip virConnectGetVersion from autogenerated
* python/libvirt-override-api.xml python/libvirt-override.c: define
  direct native bindings
2010-01-22 11:01:09 +01:00
e09086b074 Remove AppArmor compile warnings
* src/security/security_apparmor.c: unused variable in
  AppArmorSetSecurityAllLabel and unused parameter in
  AppArmorReleaseSecurityLabel
2010-01-22 10:48:34 +01:00
db2ae2044a Remove unused PROC_MOUNT_BUF_LEN #define 2010-01-22 10:25:44 +01:00
952eb15deb Update polish translation and regenerate localizations 2010-01-22 10:02:16 +01:00
e2c03da940 Add docs about new mailing list
* docs/contact.html.in: Document new users mailing list
2010-01-21 16:48:11 +01:00
80b4d20dfe domMemoryStats / qemu: Fix parsing of unknown stats
Fix a small problem with the qemu memory stats parsing algorithm.  If qemu
reports a stat that libvirt does not recognize, skip past it so parsing can
continue.  This corrects a potential infinite loop in the parsing code that can
only be triggered if new statistics are added to qemu.

* src/qemu/qemu_monitor_text.c: qemuMonitorParseExtraBalloonInfo add a
  skip for extra ','
2010-01-21 16:28:50 +01:00
2dccf5ef07 Corrected log level of WWN path message
* src/node_device/node_device_linux_sysfs.c: open_wwn_file() the
  VIR_ERROR resllay should be just a VIR_DEBUG
2010-01-21 15:55:13 +01:00
e5df24a11c Fix an error when looking for devices in syspath
* src/node_device/node_device_udev.c: udevSetupSystemDev() only print the
  error message if lookup failed in both DMI_DEVPATH and DMI_DEVPATH_FALLBACK
2010-01-21 15:45:44 +01:00
ca18b7108d Allow surrounding whitespace in uuid
* src/util/uuid.c: extend virUUIDParse to allow leading and trailing
  spaces in UUIDs
2010-01-21 15:32:37 +01:00
2c8eb68969 fix "make distcheck" failure
* tests/Makefile.am (qemuhelpdata): Add qemu-0.12.1.
2010-01-21 15:24:15 +01:00
d47b6e54fd avoid more format-related warnings
* src/qemu/qemu_conf.c (qemuBuildDriveStr): Use "%s".
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetGuestPCIAddress):
(qemuMonitorJSONGetGuestDriveAddress): Likewise.
2010-01-21 15:12:12 +01:00
dfff67c082 avoid format-related warnings
* src/conf/domain_conf.c (virDomainDeviceInfoParseXML): Use "%s".
2010-01-21 15:08:25 +01:00
6512d09cf8 Fix off-by-1 in SCSI drive hotplug
The loop looking for the controller associated with a SCI drive had
an off by one, causing it to miss the last controller.

* src/qemu/qemu_driver.c: Fix off-by-1 in searching for SCSI
  drive hotplug
2010-01-21 14:00:17 +00:00
e3a0c80f1d Fix leak in hotplug code in QEMU driver
The hotplug code in QEMU was leaking memory because although the
inner device object was being moved into the main virDomainDefPtr
config object, the outer container virDomainDeviceDefPtr was not.

 * src/qemu/qemu_driver.c: Clarify code to show that the inner
   device object is owned by the main domain config upon
   successfull attach.
2010-01-21 14:00:16 +00:00
5b6782f941 Add configuration option to turn off dynamic permissions management
Add the ability to turn off dynamic management of file permissions
for libvirt guests.

* qemu/libvirtd_qemu.aug: Support 'dynamic_ownership' flag
* qemu/qemu.conf: Document 'dynamic_ownership' flag.
* qemu/qemu_conf.c: Load 'dynamic_ownership' flag
* qemu/test_libvirtd_qemu.aug: Test 'dynamic_ownership' flag
2010-01-21 14:00:16 +00:00
2df1657686 Fix security driver calls in hotplug cleanup paths
The hotplug code was not correctly invoking the security driver
in error paths. If a hotplug attempt failed, the device would
be left with VM permissions applied, rather than restored to the
original permissions. Also, a CDROM media that is ejected was
not restored to original permissions. Finally there was a bogus
call to set hostdev permissions in the hostdev unplug code

* qemu/qemu_driver.c: Fix security driver usage in hotplug/unplug
2010-01-21 14:00:16 +00:00
b2a2ba71b4 Add missing call to re-attach host devices if VM startup fails
If there is a problem with VM startup, PCI devices may be left
assigned to pci-stub / pci-back. Adding a call to reattach
host devices in the cleanup path is required.

* qemu/qemu_driver.c: qemuDomainReAttachHostDevices() when
  VM startup fails
2010-01-21 14:00:16 +00:00
3812c7b42d Switch QEMU driver over to use the DAC security driver
Remove all the QEMU driver calls for setting file ownership and
process uid/gid. Instead wire in the QEMU DAC security driver,
stacking it ontop of the primary SELinux/AppArmour driver.

* qemu/qemu_driver.c: Switch over to new DAC security driver
2010-01-21 14:00:16 +00:00
15f5eaa098 Introduce a new DAC security driver for QEMU
This new security driver is responsible for managing UID/GID changes
to the QEMU process, and any files/disks/devices assigned to it.

* qemu/qemu_conf.h: Add flag for disabling automatic file permission
  changes
* qemu/qemu_security_dac.h, qemu/qemu_security_dac.c: New DAC driver
  for QEMU guests
* Makefile.am: Add new files
2010-01-21 14:00:16 +00:00
80fd73ca09 Introduce a stacked security driver impl for QEMU
* qemu/qemu_conf.h: Add securityPrimaryDriver and
  securitySecondaryDriver fields to 'struct qemud_driver'
* Makefile.am: Add new files
* qemu/qemu_security_stacked.c, qemu/qemu_security_stacked.h: A
  simple stacked security driver
2010-01-21 14:00:16 +00:00
08fd20b04a Pull initial disk labelling out into libvirtd instead of exec hook
Pulling the disk labelling code out of the exec hook, and into
libvirtd will allow it to access shared state in the daemon. It
will also make debugging & error reporting easier / more reliable.

* qemu/qemu_driver.c: Move initial disk labelling calls up into
  libvirtd. Add cleanup of disk labels upon failure
2010-01-21 14:00:16 +00:00
9c48360b1a Fix leak of allocated security label
If a VM fails to start, we can't simply free the security label
strings, we must call the domainReleaseSecurityLabel() method
otherwise the reserved 'mcs' level will be leaked in SElinux

* src/qemu/qemu_driver.c: Invoke domainReleaseSecurityLabel()
  when domain fails to start
2010-01-21 14:00:16 +00:00
0c0e0d0263 Refactor setup & cleanup of security labels in security driver
The current security driver architecture has the following
split of logic

 * domainGenSecurityLabel

    Allocate the unique label for the domain about to be started

 * domainGetSecurityLabel

    Retrieve the current live security label for a process

 * domainSetSecurityLabel

    Apply the previously allocated label to the current process
    Setup all disk image / device labelling

 * domainRestoreSecurityLabel

    Restore the original disk image / device labelling.
    Release the unique label for the domain

The 'domainSetSecurityLabel' method is special because it runs
in the context of the child process between the fork + exec.

This is require in order to set the process label. It is not
required in order to label disks/devices though. Having the
disk labelling code run in the child process limits what it
can do.

In particularly libvirtd would like to remember the current
disk image label, and only change shared image labels for the
first VM to start. This requires use & update of global state
in the libvirtd daemon, and thus cannot run in the child
process context.

The solution is to split domainSetSecurityLabel into two parts,
one applies process label, and the other handles disk image
labelling. At the same time domainRestoreSecurityLabel is
similarly split, just so that it matches the style. Thus the
previous 4 methods are replaced by the following 6 new methods

 * domainGenSecurityLabel

    Allocate the unique label for the domain about to be started
    No actual change here.

 * domainReleaseSecurityLabel

   Release the unique label for the domain

 * domainGetSecurityProcessLabel

   Retrieve the current live security label for a process
   Merely renamed for clarity.

 * domainSetSecurityProcessLabel

   Apply the previously allocated label to the current process

 * domainRestoreSecurityAllLabel

    Restore the original disk image / device labelling.

 * domainSetSecurityAllLabel

    Setup all disk image / device labelling

The SELinux and AppArmour drivers are then updated to comply with
this new spec. Notice that the AppArmour driver was actually a
little different. It was creating its profile for the disk image
and device labels in the 'domainGenSecurityLabel' method, where as
the SELinux driver did it in 'domainSetSecurityLabel'. With the
new method split, we can have consistency, with both drivers doing
that in the domainSetSecurityAllLabel method.

NB, the AppArmour changes here haven't been compiled so may not
build.
2010-01-21 14:00:16 +00:00
81fbb4cb23 Make security drivers responsible for checking dynamic vs static labelling
The QEMU driver is doing 90% of the calls to check for static vs
dynamic labelling. Except it is forgetting todo so in many places,
in particular hotplug is mistakenly assigning disk labels. Move
all this logic into the security drivers themselves, so the HV
drivers don't have to think about it.

* src/security/security_driver.h: Add virDomainObjPtr parameter
  to virSecurityDomainRestoreHostdevLabel and to
  virSecurityDomainRestoreSavedStateLabel
* src/security/security_selinux.c, src/security/security_apparmor.c:
  Add explicit checks for VIR_DOMAIN_SECLABEL_STATIC and skip all
  chcon() code in those cases
* src/qemu/qemu_driver.c: Remove all checks for VIR_DOMAIN_SECLABEL_STATIC
  or VIR_DOMAIN_SECLABEL_DYNAMIC. Add missing checks for possibly NULL
  driver entry points.
2010-01-21 14:00:16 +00:00
6aabcb5bd8 Implement support for multi IQN
Allows the initiator to use a variety of IQNs rather than just the
system IQN when creating iSCSI pools.
* docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
* src/conf/storage_conf.[ch]: read and stores the iqn name
* src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
  when detected
2010-01-21 12:50:52 +01:00
39d883bb3d Let make fail when XHTML validation fails
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-21 09:45:59 +01:00
623bc48ad8 Fix uses of virFileMakePath
* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
  src/network/bridge_driver.c src/qemu/qemu_driver.c
  src/uml/uml_driver.c: virFileMakePath returns 0 for success, or the
  value of errno on failure, so error checking should be to test
  if non-zero, not if lower than 0
2010-01-21 00:52:13 +01:00
62927dd8f0 Create storage pool directories with proper uid/gid/mode
Previously the uid/gid/mode in the xml was ignored when creating new
storage pool directories. This commit attempts to honor the requested
permissions, and spits out an error if it can't.

Note that when creating the directory, the rest of the path leading up
to the final element is created using current uid/gid/mode, and the
final element gets the settings from xml. It is NOT an error for the
directory to already exist; in this case, the perms for the existing
directory are just set (if necessary).

* src/storage/storage_backend_fs.c: update the virStorageBackendFileSystemBuild
  function to check the directory hierarchy separately then create the
  leaf directory with the right attributes
2010-01-21 00:46:32 +01:00
e1f2778434 Create storage volumes directly with desired uid/gid
In order to avoid problems trying to chown files that were created by
root on a root-squashing nfs server, fork a new process that setuid's
to the desired uid before creating the file. (It's only done this way
if the pool containing the new volume is of type 'netfs', otherwise
the old method of creating the file followed by chown() is used.)

This changes the semantics of the "create_func" slightly - previously
it was assumed that this function just created the file, then the
caller would chown it to the desired uid. Now, create_func does both
operations.

There are multiple functions that can take on the role of create_func:

createFileDir - previously called mkdir(), now calls virDirCreate().
virStorageBackendCreateRaw - previously called open(),
                             now calls virFileCreate().
virStorageBackendCreateQemuImg - use virRunWithHook() to setuid/gid.
virStorageBackendCreateQcowCreate - same.
virStorageBackendCreateBlockFrom - preserve old behavior (but attempt
                                   chown when necessary even if not root)

* src/storage/storage_backend.[ch] src/storage/storage_backend_disk.c
  src/storage/storage_backend_fs.c src/storage/storage_backend_logical.c
  src/storage/storage_driver.c: change the create_func implementations,
  also propagate the pool information to be able to detect NETFS ones.
2010-01-21 00:41:52 +01:00
98f6f381c8 New utility functions virFileCreate and virDirCreate
These functions create a new file or directory with the given
uid/gid. If the flag VIR_FILE_CREATE_AS_UID is given, they do this by
forking a new process, calling setuid/setgid in the new process, and
then creating the file. This is better than simply calling open then
fchown, because in the latter case, a root-squashing nfs server would
create the new file as user nobody, then refuse to allow fchown.

If VIR_FILE_CREATE_AS_UID is not specified, the simpler tactic of
creating the file/dir, then chowning is is used. This gives better
results in cases where the parent directory isn't on a root-squashing
NFS server, but doesn't give permission for the specified uid/gid to
create files. (Note that if the fork/setuid method fails to create the
file due to access privileges, the parent process will make a second
attempt using this simpler method.)

If the bit VIR_FILE_CREATE_ALLOW_EXIST is set in the flags, an
existing file/directory will not cause an error; in this case, the
function will simply set the permissions of the file/directory to
those requested. If VIR_FILE_CREATE_ALLOW_EXIST is not specified, an
existing file/directory is considered (and reported as) an error.

Return from both of these functions is 0 on success, or the value of
errno if there was a failure.

* src/util/util.[ch]: add the 2 new util functions
2010-01-21 00:33:43 +01:00
d2259ada49 Add virRunWithHook util function
* src/util/util.[ch]: similar to virExecWithHook, but waits for child to
  exit. Useful for doing things like setuid after the fork but before the
  exec.
2010-01-21 00:30:36 +01:00
1671b64702 Unset copied environment variables in qemuxml2argvtest
The test expected all environment variables copied in qemudBuildCommandLine
to have known values. So all of them have to be either set to a known value
or be unset. SDL_VIDEODRIVER and QEMU_AUDIO_DRV are not handled at all but
should be handled. Unset both, otherwise the test will fail if they are set
in the testing environment.

* src/qemu/qemu_conf.c: add a comment about copied environment variables
  and qemuxml2argvtest
* tests/qemuxml2argvtest.c: unset SDL_VIDEODRIVER and QEMU_AUDIO_DRV
2010-01-20 23:22:15 +01:00
aef969499f qemu: Don't allocate zero bytes 2010-01-20 22:50:35 +01:00
21c84e00d3 clean-up: remove unnecessary closedir call
* src/node_device/node_device_linux_sysfs.c (get_virtual_functions_linux):
Remove unnecessary closedir.  Spotted by Dave Allan.
2010-01-20 21:57:34 +01:00
2355fce3ae node_device_linux_sysfs.c: avoid opendir/fd leak on error path
* src/node_device/node_device_linux_sysfs.c(get_virtual_functions_linux):
Don't leak a DIR buffer and file descriptor on error path.
2010-01-20 21:52:51 +01:00
1825c6555a domain_conf.c: avoid a leak and the need for "cleanup:" block
* src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on
an error path, and at the same time, eliminate the need for a
"cleanup:" block.  Before, the "return -1" after the switch
would leak an "addr" string.  Now, by reversing the port,addr-
getting blocks we can free "addr" immediately and skip the goto.
2010-01-20 21:46:30 +01:00
50b6c95d62 Make all bitfields unsigned ints to avoid unexpected values in casts
The 'int virInterfaceIsActive()' method was directly returning the
value of the 'int active:1' bitfield in virIntefaceDefPtr. A bitfield
with a signed integer, will hold the values 0 and -1, not 0 and +1
as might be expected. This meant that virInterfaceIsActive() was
always returning -1 when the interface was active, not +1 & thus all
callers thought an error had occurred. To protect against this kind
of mistake again, change all bitfields to be unsigned ints

* daemon/libvirtd.h, src/conf/domain_conf.h, src/conf/interface_conf.h,
  src/conf/network_conf.h: Change bitfields to unsigned int.
2010-01-20 16:33:02 +00:00
ed00e45dba Fix QEMU driver custom domain status XML extensions
Invoking the virConnectGetCapabilities() method causes the QEMU
driver to rebuild its internal capabilities object. Unfortunately
it was forgetting to register the custom domain status XML hooks
again.

To avoid this kind of error in the future, the code which builds
capabilities is refactored into one single method, which can be
called from all locations, ensuring reliable rebuilds.

* src/qemu/qemu_driver.c: Fix rebuilding of capabilities XML and
  guarentee it is always consistent
2010-01-20 16:33:02 +00:00
704bd732b5 Document cpu-compare command in virsh man page
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-20 16:23:05 +01:00
f0088c1bfa Document <cpu> elements in capabilities and domain XML
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-20 11:04:01 +01:00
d392f4db9d docs: Remove outdated information about remote limitations 2010-01-20 10:03:17 +01:00
eb895e7407 logging: confirm that we want to ignore a write error
* src/util/logging.c (virLogMessage): Include "ignore-value.h".
Use it to ignore the return value of safewrite.
Use STDERR_FILENO, rather than "2".
* bootstrap (modules): Add ignore-value.
* gnulib: Update to latest, for ignore-value that is now LGPLv2+.
2010-01-19 21:28:41 +01:00
8cfc4c9a03 xen_driver: don't leak a parsed-config buffer
* src/xen/xen_driver.c (xenUnifiedDomainXMLFromNative): Also
free "conf" before returning.
2010-01-19 21:28:41 +01:00
77dd67087b Update interface.rng and xml test files to match netcf 0.1.5
The RNG now supports IPv6 and bonds attached to bridges, along with
some other minor tweaks. All test files from netcf have been copied to
the test directory and added to the xml2xml and schema tests (and they
all pass, of course ;-)
2010-01-19 21:13:03 +01:00
0022995555 Support bond interfaces attached to bridges in interface xml.
This was accomplished in xml parsing by doing away with the
stripped-down virInterfaceBareDef object, and just always using
virInterfaceDef, but with restrictions in certain places (eg, the type
of subordinate interface allowed in parsing depends on the parent
interface).

xml formatting was similarly adjusted. In addition, the formatting
functions keep track of the level of interface nesting, and insert
extra leading spaces on each line accordingly (using %*s).

The only change in formatted xml from previous (aside frmo supporting
new combinations of interface types) is that the subordinate ethernet
interfaces take up 2 lines rather than one, eg:

   <interface type='ethernet' name='eth0'>
   </interface>

instead of:

   <interface type='ethernet' name='eth0'/>
2010-01-19 21:13:03 +01:00
86304e35a3 Allow empty bridges in interface xml. 2010-01-19 21:13:03 +01:00
d22591efb9 Support delay property in interface bridge xml. 2010-01-19 21:13:03 +01:00
3aa13a471a storage_conf: plug a leak on OOM error path
* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
Free just-allocated "source" upon VIR_REALLOC_N failure.
2010-01-19 18:19:13 +01:00
4bc3bd7b18 Remove superfluous new lines from messages
I noticed some debug messages are printed with an empty lines after
them. This patch removes these empty lines from all invocations of the
following macros:
    VIR_DEBUG
    VIR_DEBUG0
    VIR_ERROR
    VIR_ERROR0
    VIR_INFO
    VIR_WARN
    VIR_WARN0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 17:30:41 +01:00
a3e1f04b76 Use pciDeviceIsAssignable in qemu driver
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 17:30:41 +01:00
379eb3956c Tests for ACS in PCIe switches
New pciDeviceIsAssignable() function for checking whether a given PCI
device can be assigned to a guest was added. Currently it only checks
for ACS being enabled on all PCIe switches between root and the PCI
device. In the future, it could be the right place to check whether a
device is unbound or bound to a stub driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 17:30:41 +01:00
2c2672bc9a Add Jiri Denemark <jdenemar@redhat.com> to commiters 2010-01-19 14:41:19 +01:00
ce4896fb65 Allow for CPU topology specification without model
Currently CPU topology may only be specified together with CPU model:
    <cpu match='exact'>
        <model>name</model>
        <topology sockets='1' cores='2' threads='3'/>
    </cpu>

This patch allows for CPU topology specification without the need for
also specifying CPU model:
    <cpu>
        <topology sockets='1' cores='2' threads='3'/>
    </cpu>

'match' attribute and 'model' element are made optional with the
restriction that 'match' attribute has to be set when 'model' is
present.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 12:35:22 +01:00
16a4d22b4b Add debug messages for CPU incompatibility
When comparing incompatible CPUs, the reason for this incompatibility is
logged as a debug message.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 12:33:14 +01:00
5e13b7ab5e Take disabled/forced CPU features into account
When comparing x86 CPUs, features with 'disabled' policy were mistakenly
required to be supported by the host CPU.

Likewise, features with 'force' policy which were supported by host CPU
would make CPUs incompatible if 'strict' match was used by guest CPU.

This patch fixes both issues.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 12:29:29 +01:00
5d462bd0b3 Implement CPU topology support for QEMU driver
QEMU's command line equivalent for the following domain XML fragment
    <vcpus>2</vcpus>
    <cpu ...>
        ...
        <topology sockets='1' cores='2', threads='1'/>
    </cpu>

is

    -smp 2,sockets=1,cores=2,threads=1

This syntax was introduced in QEMU-0.12.

Version 2 changes:
- -smp argument build split into a separate function
- always add ",sockets=S,cores=C,threads=T" to -smp if qemu supports it
- use qemuParseCommandLineKeywords for command line parsing

Version 3 changes:
- ADD_ARG_LIT => ADD_ARG and line reordering in qemudBuildCommandLine
- rebased

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 11:40:09 +01:00
014c9f3196 Enhance qemuParseCommandLineKeywords
Current version expects name=value,... list and when an incorrect string
such as "a,b,c=d" would be parsed as "a,b,c" keyword with "d" value
without reporting any error, which is probably not the expected
behavior.

This patch adds an extra argument called allowEmptyValue, which if
non-zero will permit keywords with no value; "a,b=c,,d=" will be parsed
as follows:
    keyword value
    "a"     NULL
    "b"     "c"
    ""      NULL
    "d"     ""

In case allowEmptyValue is zero, the string is required to contain
name=value pairs only; retvalues is guaranteed to contain non-NULL
pointers. Now, "a,b,c=d" will result in an error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 11:23:03 +01:00
b66924148a Convert VirtIO balloon over to -device syntax
Replace

   -balloon virtio

With

   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

This allows it to get correct assigned PCI address as declared in
previous patch

 * src/qemu/qemu_conf.c: Convert Virtio ballon to -device and
   give it an explicit PCI address
 * tests/qemuxml2argvdata/qemuxml2argv-*args: Add in virtio balloon
   where appropriate
2010-01-18 13:55:57 +00:00
a44d0dc26c Auto-assign PCI addresses
Instead of relying on QEMU to assign PCI addresses and then querying
them with 'info pci', manually assign all PCI addresses before starting
the guest.  These addresses are not stable across reboots. That will
come in a later patch

NB, the PIIX3 (IDE, FDC, ISA-Bridge) will always have slot 1 and
VGA will always have slot 2. We declare the Virtio Balloon gets
slot 3, and then all remaining slots are for configured devices.

* src/qemu/qemu_conf.c: If -device is supported, then assign all PCI
  addresses when building the command line
* src/qemu/qemu_driver.c: Don't query monitor for PCI addresses if
  they have already been assigned
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-sound-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args: Update
  to include PCI slot/bus information
2010-01-18 13:55:57 +00:00
febc591683 Pass -vga none if no video card specified
QEMU always configures a VGA card. If no video card is included in
the libvirt XML, it is neccessary to explicitly turn off the default
using -vga none

* src/qemu/qemu_conf.c: Pass -vga none if no video card is configured
* tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Test for
  handling -vga none.
* tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args,
  tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml: Test
  data files
2010-01-18 13:55:57 +00:00
4f6c999006 Add support for explicit -sdl flag to QEMU
Not all QEMU builds default to SDL graphics for their display.
Newer QEMU now has an explicit -sdl flag, which we can use to
explicitly request SDL intead of relying on the default. This
protects libvirt against unexpected changes in graphics default

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Probe for -sdl
  flag and use it if it is found
* tests/qemuhelptest.c: Add SDL flag to tests
2010-01-18 13:55:57 +00:00
d86c876a66 Convert guestfwd to -device, and add -sdl explicit args
The old syntax was

   -chardev SOMECONFIG
   -nic user,guestfwd=tcp:IP:PORT-chardev:CHARDEV

The new syntax is

   -chardev SOMECONFIG
   -netdev user,guestfwd=tcp:IP:PORT,chardev=ID,id=user-ID
2010-01-18 13:55:57 +00:00
16658da4e7 Convert PCI device assignment over to -device
The old syntax is

  -pcidevice host=BUS:SLOT:FUNCTION

The new syntax is

  -device pci-assign,host=BUS:SLOT:FUNCTION,addr=<PCI SLOT>,id=host0
2010-01-18 13:55:56 +00:00
e8d43d0687 Convert USB input devices to -device 2010-01-18 13:55:56 +00:00
42ce352c13 Convert USB hostdevices over to -device
The old syntax was

   -usbdevice host:PRODUCT:VENDOR

Or

   -usbdevice host:BUS.DEV

The new syntax is

   -device usb-host,product=PRODUCT,vendor=VENDOR

Or

   -device usb-host,hostbus=BUS,hostaddr=DEV
2010-01-18 13:55:56 +00:00
73370e9868 Convert USB disks over to -device
The previous syntax was severely limited in its options

  -usbdevice disk:/home/berrange/output.img

The new syntax is the same as for other disk types

  -drive file=/home/berrange/output.img,if=none,id=usb-1,index=1
  -device usb-storage,drive=usb-1

Again, the index= arg is wrong here, and will be removed in a
later merge
2010-01-18 13:55:56 +00:00
1dd6f855c3 Convert NICs over to use -device & -netdev where possible
The current syntax uses a pair of args

   -net nic,macaddr=52:54:00:56:6c:55,vlan=3,model=pcnet,name=pcnet.0
   -net user,vlan=3,name=user.0

The new syntax does not  need the vlan craziness anymore, and
so has a simplified pair of args

   -netdev user,id=user.0
   -device pcnet,netdev=user.0,id=pcnet.0,mac=52:54:00:56:6c:55,addr=<PCI SLOT>
2010-01-18 13:55:56 +00:00
6237e9c89b Convert disk drive over to use -device where available
The current preferred syntax for disk drives uses

  -drive file=/vms/plain.qcow,if=virtio,index=0,boot=on,format=qcow

The new syntax splits this up into a pair of linked args

  -drive file=/vms/plain.qcow,if=none,id=drive-virtio-0,format=qcow2
  -device virtio-blk-pci,drive=drive-virtio-0,id=virtio-0,addr=<PCI SLOT>

SCSI/IDE devices also get a bus property linking them to the
controller

  -device scsi-disk,drive=drive-scsi0-0-0,id=scsi0-0-0,bus=scsi0.0,scsi-id=0
  -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bus=ide0,unit=0
2010-01-18 13:55:56 +00:00
4886cba76a Convert audio devices over to -device syntax
The current syntax for audio devices is a horrible multiplexed
arg

    -soundhw sb16,pcspk,ac97

The new syntax is

    -device sb16,id=sound0

or

    -device AC97,id=sound1,addr=<PCI SLOT>

NB, pcspk still uses the old -soundhw syntax
2010-01-18 13:55:56 +00:00
38a22fbfaa Convert watchdog to -device
The current syntax for watchdogs is

    -watchdog i6300esb

The new syntax will now be

    -device i6300esb,id=watchdogNN,addr=<PCI-SLOT>
2010-01-18 13:55:56 +00:00
7b2f8cdd7c Convert character devices over to use -device
The current character device syntax uses either

  -serial tty,path=/dev/ttyS2

Or

  -chardev tty,id=serial0,path=/dev/ttyS2 -serial chardev:serial0

With the new -device support, we now prefer

  -chardev file,id=serial0,path=/tmp/serial.log -device isa-serial,chardev=serial0

This patch changes the existing -chardev syntax to use this new
scheme, and fallbacks to the old plain -serial syntax for old
QEMU.

The monitor device changes to

  -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor

In addition, this patch adds --nodefaults, which kills off the
default serial, parallel, vga and nic devices. THis avoids the
need for us to explicitly turn each off
2010-01-18 13:55:56 +00:00
053307175c Assign device aliases for all devices at startup
When starting a guest, give every device a unique alias. This will
be used for the 'id' parameter in -device args in later patches.
It can also be used to uniquely identify devices in the monitor

For old QEMU without -device, assign disk names based on QEMU's
historical naming scheme.

* src/qemu/qemu_conf.c: Assign unique device aliases
* src/qemu/qemu_driver.c: Remove obsolete qemudDiskDeviceName
  and use the device alias in eject & blockstats commands
2010-01-18 13:55:56 +00:00
a6e7ba9464 storage_backend_fs.c: do not ignore probe failure
* src/storage/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
Correct parentheses.  The documented intent is to ignore non-regular
files, yet due to a parenthesization error all errors were handled
that way.
2010-01-18 14:46:51 +01:00
1ed1bf3a38 Probe for -device and use -nodefaults
Probe for the new -device flag and if available set the -nodefaults
flag, instead of using -net none, -serial none or -parallel none.
Other device types will be converted to use -device in later patches.
The -nodefaults flag will help avoid unwelcome surprises from future
QEMU releases

* src/qemu/qemu_conf.c: Probe for -device. Add -nodefaults flag.
  Remove -net none, -serial none or -parallel none
* src/qemu/qemu_conf.h: Define QEMU_CMD_FLAG_DEVICE
* tests/qemuhelpdata/qemu-0.12.1: New data file for 0.12.1 QEMU
* tests/qemuhelptest.c: Test feature extraction from 0.12.1 QEMU
2010-01-18 13:39:14 +00:00
4ac290cc33 Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
  parsing / formatting device info for serial, parallel, channel
  input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
  devices, input & fs device
2010-01-18 13:38:56 +00:00
5da9c98067 Introduce device aliases
This patch introduces the support for giving all devices a short,
unique name, henceforth known as a 'device alias'.  These aliases
are not set by the end user, instead being assigned by the hypervisor
if it decides it want to support this concept.

The QEMU driver sets them whenever using the -device arg syntax
and uses them for improved hotplug/hotunplug. it is the intent
that other APIs (block / interface stats & device hotplug) be
able to accept device alias names in the future.

The XML syntax is

   <alias name="video0"/>

This may appear in any type of device that supports device info.

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add a 'alias'
  field to virDomainDeviceInfo struct & parse/format it in XML
* src/libvirt_private.syms: Export virDomainDefClearDeviceAliases
* src/qemu/qemu_conf.c: Replace use of "nic_name" field with the
  standard device alias
* src/qemu/qemu_driver.c: Clear device aliases at shutdown
2010-01-18 13:38:47 +00:00
774c757e67 Clear assigned PCI devices at shutdown
The PCI device addresses are only valid while the VM is running,
since they are auto-assigned by QEMU. After shutdown they must
all be cleared. Future QEMU driver enhancement will allow for
persistent PCI address assignment

* src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms
  Add virDomainDefClearPCIAddresses() method for wiping out auto assigned
  PCI addresses
* src/qemu/qemu_driver.c: Clear PCI addresses at VM shutdown
2010-01-18 13:35:51 +00:00
b030084f07 Auto-add disk controllers based on defined disks
Existing applications using libvirt are not aware of the disk
controller concept. Thus, after parsing the <disk> definitions
in the XML, it is neccessary to create <controller> elements
to satisfy all requested disks, as per their defined drive
addresses

* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
  method for populating disk controllers, and call it after
  parsing disk definitions.
* src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
  when doing ARGV -> XML conversion
* tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
  data to all data files which don't have it already
2010-01-18 13:35:40 +00:00
2224989c39 Avoid free'ing a constant string in chardev lookup code
* src/qemu/qemu_monitor_text.c: Don't free const string in
   qemuMonitorTextGetPtyPaths()
2010-01-18 13:33:50 +00:00
4359900ed1 Remove restriction on duplicated sound devices in parser
It is perfectly acceptable to have multiple sound devices of
same type in guest configuration. If the underlying hypervisor
does not like this, it is its job to complain, not the XML
parser's

* src/conf/domain_conf.c: Remove hack which deleted duplicated
  sound device models.
* tests/xml2sexprdata/xml2sexpr-fv-sound.xml: Remove duplicate
  models
2010-01-18 12:44:50 +00:00
989051a85e Detect PCI addresses at QEMU startup
Hotunplug of devices requires that we know their PCI address. Even
hotplug of SCSI drives, required that we know the PCI address of
the SCSI controller to attach the drive to. We can find this out
by running 'info pci' and then correlating the vendor/product IDs
with the devices we booted with.

Although this approach is somewhat fragile, it is the only viable
option with QEMU < 0.12, since there is no way for libvirto set
explicit PCI addresses when creating devices in the first place.
For QEMU > 0.12, this code will not be used.

* src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
  startup of QEMU VM, matching vendor/product IDs
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  API for fetching PCI device address mapping
2010-01-18 12:44:50 +00:00
3a6bf1bb78 Properly support SCSI drive hotplug
The current SCSI hotplug support attaches a brand new SCSI controller
for every disk. This is broken because the semantics differ from those
used when starting the VM initially. In the latter case, each SCSI
controller is filled before a new one is added.

If the user specifies an high drive index (sdazz) then at initial
startup, many intermediate SCSI controllers may be added with no
drives.

This patch changes SCSI hotplug so that it exactly matches the
behaviour of initial startup. First the SCSI controller number is
determined for the drive to be hotplugged. If any controller upto
and including that controller number is not yet present, it is
attached. Then finally the drive is attached to the last controller.

NB, this breaks SCSI hotunplug, because there is no 'drive_del'
command in current QEMU. Previous SCSI hotunplug was broken in
any case because it was unplugging the entire controller, not
just the drive in question.

A future QEMU will allow proper SCSI hotunplug of a drive.

This patch is derived from work done by Wolfgang Mauerer on disk
controllers.

* src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
 the correct controller, instead of just attaching a new
  controller.
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  support for 'drive_add' command
2010-01-18 12:44:50 +00:00
da9d937b94 Implement SCSI controller hotplug/unplug for QEMU
This patch allows for explicit hotplug/unplug of SCSI controllers.
Ordinarily this is not required, since QEMU/libvirt will attach
a new SCSI controller whenever one is required. Allowing explicit
hotplug of controllers though, enables the caller to specify a
static PCI address, instead of auto-assigning the next available
PCI slot. Or it will when we have static PCI addressing.

This patch is derived from Wolfgang Mauerer's disk controller
patch series.

* src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
  controllers
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  new API for attaching PCI SCSI controllers
2010-01-18 12:44:50 +00:00
1867004ed1 vbox_tmpl.c: remove useless array-is-non-NULL comparisons
* src/vbox/vbox_tmpl.c (vboxStorageVolDelete): Remove always-true
array-is-non-NULL test.  git grep 'key\[.*\];'|grep -F .h
src/datatypes.h:    char key[PATH_MAX];
(vboxStorageVolGetInfo): Likewise.
(vboxStorageVolGetXMLDesc): Likewise.
(vboxStorageVolGetPath): Likewise.
(vboxDomainDefineXML): Likewise. (but now with "mac[]")
2010-01-18 13:31:47 +01:00
0a6a6f5e61 lxc_driver: remove useless comparison
* src/lxc/lxc_driver.c (lxcSetupInterfaces): Remove always-true
array-is-non-NULL test.  git grep 'mac\[.*\];'|grep -F .h
src/conf/domain_conf.h:    unsigned char mac[VIR_MAC_BUFLEN];
2010-01-18 13:31:41 +01:00
8803937b59 build: update gnulib submodule to latest 2010-01-18 09:50:08 +01:00
eabb98b0a8 gnulib added a new syntax-check test: use $(VAR), not @VAR@
The latter is not officially "wrong", but *is* terribly anachronistic.
I think automake documentation or comments call that syntax obsolescent.
* cfg.mk (_makefile_at_at_check_exceptions): Exempt @SCHEMADIR@
and @SYSCONFDIR@ uses -- there are no Makefile variables for those.
* docs/Makefile.am: Use $(INSTALL), not @INSTALL@.
* examples/dominfo/Makefile.am: Similar.
* examples/domsuspend/Makefile.am: Similar.
* proxy/Makefile.am: Similar.
* python/Makefile.am: Similar.
* python/tests/Makefile.am: Similar.
* src/Makefile.am: Similar.
* tests/Makefile.am: Similar.
2010-01-18 09:50:08 +01:00
d6c99337a9 storage_backend.h: include required headers
* src/storage/storage_backend.h: Include <stdint.h>.
2010-01-18 09:50:08 +01:00
61defb6bcc esx_vi_types.c: include required headers
* src/esx/esx_vi_types.c: Include <stdint.h>.
2010-01-18 09:50:08 +01:00
73f702ff4a vbox: include required headers
* src/vbox/vbox_driver.c: Include <stdint.h> <unistd.h> <sys/types.h>.
2010-01-18 09:50:08 +01:00
3d294a1c03 cpu_x86_data.h: include required header
* src/cpu/cpu_x86_data.h: Include <stdint.h>.
2010-01-18 09:50:08 +01:00
30a9329ab1 util.c: include required header, no longer masked by gnulib
Until recently, some gnulib-generated replacement headers
included *other* headers that were not strictly necessary,
thus masking the need in this file for an explicit <stdlib.h>.
* src/util/util.c: Include <stdlib.h> for declarations of e.g.,
strtol, random_r, getenv, etc.
2010-01-18 09:50:08 +01:00
322707ba8a Use closest CPU model when decoding from CPUID
Current implementation of x86Decode() used for CPUID -> model+features
translation does not always select the closest CPU model. When walking
through all models from cpu_map.xml the function considers a new
candidate as a better choice than a previously selected candidate only
if the new one is a superset of the old one. In case the new candidate
is closer to host CPU but lacks some feature comparing to the old
candidate, the function does not choose well.

This patch changes the algorithm so that the closest model is always
selected. That is, the model which requires the lowest number of
additional features to describe host CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-18 02:40:41 +01:00
3c58896eb7 Change detection of xen so that it's actually automatic rather than forced.
This ensures that ./configure will work fine if xen development packages
are not around, rather than fail. When passing ./configure --with-xen, the
lack of xen development packages become fatal.
2010-01-18 02:12:48 +01:00
4d434da34c Standardise ./configure --help options reporting.
Always use AC_HELP_STRING for the help text for options at ./configure,
so that the output is properly aligned.

Use proper quadrigraphs for outputting the brackets.

Always use autoconf-style [default=$foo] output to state the default, both
where it was stated before and where it wasn't.

This time, include Matthias Bolte notes regarding defaults, and removing
PFX specification from phyp.
2010-01-18 02:10:46 +01:00
a0356bcc41 qemu: Use log output for pty assignment if 'info chardev' is unavailable
qemudFindCharDevicePTYsMonitor reports an error if 'info chardev' didn't
provide information for a requested device, even if the log output parsing
had found the pty path for that device. This makes pty assignment fail for
older QEMU/KVM versions. For example KVM 72 on Debian doesn't support
'info chardev', so qemuMonitorTextGetPtyPaths cannot parse any useful
information and the hash for device-id-to-pty-path mapping stays empty.

Make qemudFindCharDevicePTYsMonitor report an error only if the log output
parsing and the 'info chardev' parsing failed to provide the pty path.
2010-01-18 01:54:40 +01:00
c2c4d51b2f esx: Add VNC support
* src/conf/domain_conf.c: add defaults for the video device
* src/esx/esx_vmx.[ch]: add VNC support to the VMX handling
* tests/vmx2xmltest.c, tests/xml2vmxtest.c: add tests for the VNC support
2010-01-18 01:44:20 +01:00
58fe995e50 esx: Make the domain part of the hostname optional
Before the driver assumed that there is always a domain part. That's
not true. Now the domain part is handled as optional.
2010-01-18 01:21:37 +01:00
d6c40aaec8 esx: Add stubs for secondary driver types
This stops libvirt from probing for a libvirtd on the ESX server and
sets the base for the implementation of the secondary drivers.
2010-01-18 01:15:11 +01:00
9bca7a7e2e BZs 528709 548485 2010-01-18 09:48:39 +10:00
cebc4b8921 Fix validation of news.html 2010-01-15 19:29:50 +01:00
ad4f092443 Fix build of Xen proxy daemon
* src/conf/domain_conf.c: Allow virDomainDeviceInfoIsSet,
  virDomainDeviceInfoClear & virDomainDeviceInfoFormat when
  building Xen proxy
2010-01-15 17:55:59 +00:00
8a73fe5936 Remove obsolete comment in QEMU JSON code
* src/qemu/qemu_monitor_json.c: We fill in the PCI function number
   now, so remove obsolete XXX comment
2010-01-15 17:55:59 +00:00
d78554d884 Specify bus/unit instead of index for disks with QEMU
The current code for using -drive simply sets the -drive 'index'
parameter. QEMU internally converts this to bus/unit depending
on the type of drive. This does not give us precise control over
the bus/unit assignment though. This change switches over to make
libvirt explicitly calculate the bus/unit number.

In addition bus/unit/index are actually irrelevant for VirtIO
disks, since each virtio disk is a separate PCI device. No disk
controller is involved.

Doing the conversion to bus/unit in libvirt allows us to correctly
attach SCSI controllers when required.

* src/qemu/qemu_conf.c: Specify bus/unit instead of index for
  disks
* tests/qemuxml2argvdata/qemuxml2argv-disk*.args: Switch over from
  using index=NNNN, to bus=NN, unit=NN for SCSI/IDE/Floppy disks
2010-01-15 17:55:59 +00:00
2982d73a11 Split code for building QEMU -drive arg in separate method
To enable it to be called from multiple locations, split out
the code for building the -drive arg string. This will be needed
by later patches which do drive hotplug, the conversion to use
-device, and the conversion to controller/bus/unit addressing

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuBuildDriveStr
  for building -drive arg string
2010-01-15 17:55:58 +00:00
ab0da52b43 Convert monitor over to use virDomainDeviceAddress
Convert the QEMU monitor APIs over to use virDomainDeviceAddress
structs for passing addresses in/out, instead of individual bits.
This makes the number of parameters smaller & easier to deal with.
No functional change

* src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
  src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
  src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
  take an explicit address ptr for all host/guest addresses
2010-01-15 17:55:58 +00:00
8d6af63a8a Minor fixes for API extension doc
Update the API Extensions doc to reflect new source directory layout.
2010-01-15 10:45:18 -07:00
74ec5e65ce Add new domain device: "controller"
This augments virDomainDevice with a <controller> element
that is used to represent disk controllers (e.g., scsi
controllers). The XML format is given by

  <controller type="scsi" index="<num>">
     <address type="pci" domain="0xNUM" bus="0xNUM" slot="0xNUM"/>
  </controller>

where type denotes the disk interface (scsi, ide,...), index
is an integer that identifies the controller for association
with disks, and the <address> element specifies the controller
address on the PCI bus as described in previous commits
The address element can be omitted; in this case, an address
will be assigned automatically.

Most of the code in this patch is from Wolfgang Mauerer's
previous disk controller series

 * docs/schemas/domain.rng: Define syntax for <controller>
   XML element
 * src/conf/domain_conf.c, src/conf/domain_conf.h: Define
   virDomainControllerDef struct, and routines for parsing
   and formatting XML
* src/libvirt_private.syms: Add virDomainControllerInsert
   and virDomainControllerDefFree
2010-01-15 16:38:59 +00:00
776e37e1eb Set default disk controller/bus/unit props
When parsing the <disk> element specification, if no <address>
is provided for the disk, then automatically assign one based on
the <target dev='sdXX'/> device name. This provides for backwards
compatability with existing applications using libvirt, while also
allowing new apps to have complete fine grained control.

* src/conf/domain_conf.h, src/conf/domain_conf.c,
  src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
  for assigning a controller/bus/unit address based on disk target
* src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
  generating XML from ARGV
* tests/qemuxml2argvdata/*.xml: Add in drive address information
  to all XML files
2010-01-15 16:38:29 +00:00
a9e4ea94f1 Add address info to sound, video and watchdog devices
Add the virDomainDeviceAddress information to the sound, video
and watchdog devices. This means all of them gain the new XML
element

  <address .... />

This brings them upto par with disk/net/hostdev devices which
already have address info

* src/conf/domain_conf.h: Add virDomainDeviceAddress to sound,
  video & watchdog device struts.
* src/conf/domain_conf.c: Hook up parsing/formatting for
  virDomainDeviceAddress in sound, video & watchdog devices
* docs/schemas/domain.rng: Associate device address info
  with sound, video & watchdog
2010-01-15 16:38:08 +00:00
d812e7aeb8 Extend the virDomainDeviceAddress struture to allow disk controller addresses
Introduce a new structure

      struct _virDomainDeviceDriveAddress {
        unsigned int controller;
        unsigned int bus;
        unsigned int unit;
      };

and plug that into virDomainDeviceAddress and generates XML that
looks like

  <address type='drive' controller='1' bus='0' unit='5'/>

This syntax will be used by the QEMU driver to explicitly control
how drives are attached to the bus

* src/conf/domain_conf.h, src/conf/domain_conf.c: Parsing and
  formatting of drive addresses
* docs/schemas/domain.rng: Define new address format for drives
2010-01-15 16:37:57 +00:00
1b0cce7d3a Introduce a standardized data structure for device addresses
All guest devices now use a common device address structure
summarized by:

  enum virDomainDeviceAddressType {
    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
  };

  struct _virDomainDevicePCIAddress {
    unsigned int domain;
    unsigned int bus;
    unsigned int slot;
    unsigned int function;
  };

  struct _virDomainDeviceInfo {
    int type;
    union {
        virDomainDevicePCIAddress pci;
    } addr;
  };

This replaces the anonymous structs in Disk/Net/Hostdev data
structures. Where available, the address is *always* printed
in the XML file, instead of being hidden in the internal state
file.

  <address type='pci' domain='0x0000' bus='0x1e' slot='0x07' function='0x0'/>

The structure definition is based on Wolfgang Mauerer's disk
controller patch series.

* docs/schemas/domain.rng: Define the <address> syntax and
  associate it with disk/net/hostdev devices
* src/conf/domain_conf.h, src/conf/domain_conf.c,
  src/libvirt_private.syms: APIs for parsing/formatting address
  information. Also remove the QEMU specific 'pci_addr' attributes
* src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with
  new standardized format.
2010-01-15 16:37:44 +00:00
e8ac4a79f1 Make test suite output less verbose
Only print out '.' for each test case, full test output can be
re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX

Sample output now looks like

  TEST: statstest
        ........................................ 40
        ...................................      75  OK
  PASS: statstest
  TEST: qparamtest
        ................................         32  OK
  PASS: qparamtest
  TEST:
        ............                             12  OK
2010-01-15 16:28:05 +00:00
cfe49446d3 Fix compilation of virt-aa-helper.c
Commit 5073aa994a added an additional
'}' to a case block that messed up the block structure of the get_files
function.
2010-01-15 12:06:03 +01:00
0276587287 xen: do not report a write-to-Xen-daemon failure as a read failure
* src/xen/xend_internal.c (wr_sync): Correct the diagnostic.
2010-01-15 10:22:18 +01:00
9933c4f2f6 Fix linkage of virt-aa-helper to libgnu.a 2010-01-14 21:50:21 +01:00
522776ed4c util: Make sure virExec hook failures are raised
With the introduction virDispatchError, hook function errors are
never sent through the error callback, so users will never see
these messages.

Fix this by calling virDispatchError after hook failure.
2010-01-14 09:19:39 -05:00
5073aa994a Implement path lookup for USB by vendor:product
Based off how QEMU does it, look through /sys/bus/usb/devices/* for
matching vendor:product info, and if found, use info from the surrounding
files to build the device's /dev/bus/usb path.

This fixes USB device assignment by vendor:product when running qemu
as non-root (well, it should, but for some reason I couldn't reproduce
the failure people are seeing in [1], but it appears to work properly)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=542450
2010-01-13 15:24:41 -05:00
438fa79358 daemon: Don't blindly unregister domain events
The daemon will attempt to unregister domain events on client disconnect,
even if no events were ever registered. This raises an unneeded error.

Track in the qemu_client structure if events have been registered, and
check this when performing cleanup.
2010-01-13 14:24:13 -05:00
2d4d657695 daemon: Fix various error reporting issues
Many node device calls weren't properly relaying error messages, and
domain event registeration was not checking for error.
2010-01-13 14:24:13 -05:00
a3dddc0020 events: Report errors on failure 2010-01-13 14:24:07 -05:00
d0b97e820c node_device: udev: Fix memory leak
We are setting the same property two different ways without
free'ing in between. Just drop the second assignment.
2010-01-13 07:02:19 -05:00
c198f51a10 node_device: udev: Enumerate floppy devices
There are quite a few differences between how udev exposes legacy
and USB floppy devs, but this patch takes care of both variants.
2010-01-13 07:02:18 -05:00
3238081efd node_device: udev: Use base 16 for product/vendor
udev doesn't prefix USB product/vendor info with '0x', so the
strtol conversions were wrong for the product field (vendor already
set the correct base). Make the change for PCI product/vendor as
well to be safe.

This fixes USB device assignment via virt-manager.
2010-01-13 07:02:18 -05:00
2861390866 util: Remove logging handlers in virExec
This allows debug statements and raised errors in hook functions to
actually be logged somewhere (stderr). Users can enable debugging in the
daemon and now see more info in /var/log/libvirt/...
2010-01-13 07:02:10 -05:00
6c6fbac7a9 Fix migration in xend driver
Upstream xen has changed parameters to the migration operation
several times over the past 18 months.  Changeset 17553 removed
the resouce parameter,  Changesets 17709, 17753, and 20326 added
ssl, node, and change_home_server parameters respectively.

Fortunately, testing has revealed that xend will fail the
operation if a parameter is missing but happily honor it if
unknown parameters are provided.  Thus all currently supported
parameters can be provided, satisfying current xend but not
regressing older versions.
2010-01-12 13:49:25 -07:00
515378b34e Commit bootstrap .gitignore additions 2010-01-12 14:36:11 -05:00
978dd6d48b qemu: Disable errors in qemudShutdownVMDaemon 2010-01-12 10:48:34 -05:00
e85065b854 libvirt.c: Preserve MigratePerform failure 2010-01-12 10:48:34 -05:00
a9d12c2444 qemu: migrate: Save MigratePerform error in MigrateFinish.
This way we won't squash the original error report in
MigratePerform, as is done for P2P and Tunneled migration.
2010-01-12 10:48:34 -05:00
fd5eb45b95 virterror: Add virSetError
Can be used to re-set an old error, which may have been squashed by
other functions (like cleanup routines). Will be used in subsequent patches
2010-01-12 10:48:33 -05:00
3a80f2f7ce Ensure error handling callback functions are called from safe context
The virRaiseErrorFull() may invoke the error handler callback
functions an application has registered. This is not good
because the connection object may not be available at this
point, and the caller may be holding locks. This creates a
problem if the error handler calls back into libvirt.

The solutuon is to move invocation of the handler into the
final cleanup code in the public API entry points, where it
is guarenteed to have safe state.

* src/libvirt.c: Invoke virDispatchError() in all error paths
* src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
  replacing with virDispatchError(). Move invocation of the
  error callbacks into virDispatchError() instead of the
  virRaiseErrorFull function which is not in a safe context
2010-01-12 10:48:33 -05:00
66b3250563 Revert 7aee22939f
Revert commit 7aee22939f since it
is mistakenly adding an extra parameter to virsh that does not
belong there.
2010-01-12 12:48:34 +00:00
7aee22939f cpu_shares parameter limit documented 2010-01-12 12:24:04 +10:00
ddcee85f7c Document the domain XML cache attribute for disk devices 2010-01-11 23:58:56 +01:00
f01ee2acc8 qemu: Fix a memory leak in qemudExtractTTYPath
qemudWaitForMonitor calls qemudReadLogOutput with qemudFindCharDevicePTYs
as callback. qemudFindCharDevicePTYs calls qemudExtractTTYPath to assign
a string to chr->data.file.path. Afterwards qemudWaitForMonitor may call
qemudFindCharDevicePTYsMonitor that overwrites chr->data.file.path without
freeing the old value. This results in leaking the memory allocated by
qemudExtractTTYPath.

Report an OOM error if the strdup in qemudFindCharDevicePTYsMonitor fails.
2010-01-11 23:58:56 +01:00
4c81b0fdc5 Also look for dmi information in /sys/class
older kernels such as 2.6.26 have it there.
2010-01-11 12:49:35 +01:00
28024f2311 Fix UUID random generator to use /dev/random
Only use pseudo-random generator for uuid if using /dev/random fails.
* src/util/uuid.c: The original code. would only print the warning
  message if using /dev/random failed, but would still go ahead and call
  virUUIDGeneratePseudoRandomBytes in all cases anyway.
2010-01-11 10:06:54 +01:00
0418fa2e72 avoid another "make distcheck" failure
* docs/Makefile.am (uninstall-local): Separate $$f from preceding
dir name with a "/" and use $$(basename $$f) rather than $$f, since
some values of $$f are prefixed with devhelp/.
2010-01-09 09:56:20 +01:00
a4e9edbd77 avoid newly-introduced test failure
* tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Update
expected output to match, now that we use -mem-prealloc.
2010-01-09 09:25:04 +01:00
8287bd2996 proxy_internal.c: mark "request" parameter as nonnull
* src/xen/proxy_internal.c (xenProxyCommand): Mark "request"
as an always-non-NULL parameter.
2010-01-09 08:50:15 +01:00
3b3cdec395 don't test "res == NULL" after we've already dereferenced "res"
* src/xen/proxy_internal.c (xenProxyCommand): "res" is known to be
non-NULL at that point, so remove the "res == NULL" guard.
2010-01-09 08:50:15 +01:00
e6abf3d8f2 fix 7 "make check" test failures in non-srcdir build
* tests/capabilityschematest: Define and use $srcdir.
* tests/domainschematest: Likewise.
* tests/interfaceschematest: Likewise.
* tests/networkschematest: Likewise.
* tests/nodedevschematest: Likewise.
* tests/storagepoolschematest: Likewise.
* tests/storagevolschematest: Likewise.
2010-01-09 08:37:22 +01:00
048781fe71 let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would
evoke a "can not build a shared library" failure for libvirtmod.la
due to the new use of libtool's -shared link option in
python/Makefile.am.  Now, --disable-shared also
disables building python.

* configure.in: Make --disable-shared imply --without-python and
silently override --with-python.
Improved by: Diego Elio Pettenò <flameeyes@gmail.com>
2010-01-08 20:54:11 +01:00
7003390791 esx: Dump the raw response in case of an SOAP fault
Currently only the faultcode and faultstring are deserialized, the
detail part is ignored. The implementation of many new SOAP types
would be necessary to deserialize the detail part correctly. As an
intermediate solution the raw response is dumped to the debug log.
2010-01-08 19:28:14 +01:00
75b7f400f9 esx: Warn if the ESX server is in maintenance mode 2010-01-08 19:28:09 +01:00
728e9229b1 Replace old CVS references with GIT 2010-01-08 18:08:22 +01:00
edcae5a7c4 Qemu: ask for memory preallocation with large pages
The -mem-prealloc flag should be used when using large pages
This ensures qemu tries to allocate all required memory immediately,
rather than when first used. The latter mode will crash qemu
if hugepages aren't available when accessed, while the former
should gracefully fallback to non-hugepages.

* src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line
  when using large pages
2010-01-08 12:17:35 +01:00
98ea78b6ee xen hypervisor: xen domctl version 6
xen-unstable c/s 20685 changed the domctl interface, adding a field to
xen_domctl_getdomaininfo structure.  This additional field causes stack
corruption in libvirt.  xen-unstable c/s 20711 rightly bumped the domctl
interface version so it is at least possible to handle the new field.
This change accounts for shr_pages field added to xen_domctl_getdomaininfo
structure.
2010-01-07 13:05:35 -07:00
65160f50be network/bridge_driver.c: avoid potential NULL-dereference
* src/network/bridge_driver.c (networkBuildDnsmasqArgv): Correct
test for NULL *argv.
2010-01-07 14:25:45 +01:00
b6c87e3b7a virsh: Use VIR_FREE instead of free
virsh uses other parts of the internal API already, so use VIR_FREE also.
2010-01-07 01:38:19 +01:00
a4a38ffda1 virsh: Add persistent history using libreadline 2010-01-07 01:38:19 +01:00
96ceb12443 esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses
The MAC addresses with 00:50:56 prefix are split into several ranges:

  00:50:56:00:00:00 - 00:50:56:3f:ff:ff  'static' range (manually assigned)
  00:50:56:80:00:00 - 00:50:56:bf:ff:ff  'vpx' range (assigned by a VI Client)

Erroneously the 'vpx' range was assumed to be larger and to occupy the
remaining addresses of the 00:50:56 prefix that are not part of the 'static'
range.

00:50:56 was used as prefix for generated MAC addresses, this is not possible
anymore, because there are gaps in the allowed ranges. Therefore, change the
prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway.

Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option
to false in case the MAC address doesn't fall into any predefined range.

* docs/drvesx.html.in: update website accordingly
* src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29
* src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC
  addresses
* tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests
2010-01-07 01:38:19 +01:00
79f9419652 esx: Fix deserialization for VI API calls CancelTask and UnregisterVM 2010-01-07 01:38:19 +01:00
d9734072ff esx: Fix and improve the libcurl debug callback
The data passed to the callback is not guaranteed to be zero terminated,
take care of that by coping the data and adding a zero terminator.

Also dump the data for other types than CURLINFO_TEXT.

Set CURLOPT_VERBOSE to 1 so the debug callback is called when enabled.
2010-01-07 01:38:19 +01:00
b0367e86ee esx: Don't warn about an empty URI path 2010-01-07 01:38:19 +01:00
44112bce89 esx: Also allow virtualHW version 4 for ESX 4.0
A domain with virtualHW version 4 is allowed on an ESX 4.0 server.
If a domain is migrated from an ESX 3.5 server to an ESX 4.0 server
then the virtualHW version stays the same. So a ESX 4.0 server can
host domains with virtualHW version 4.
2010-01-07 01:38:19 +01:00
338e7c3c8d Don't free an uninitalized pointer in update_driver_name()
This invalid free results in heap corruption. Some symptoms I saw
because of this were libvirtd crashing and virt-manager hanging
while trying to enumerate devices.
2010-01-07 01:38:19 +01:00
7679f064bf xend_internal: don't let invalid input provoke NULL dereference
* src/xen/xend_internal.c (xenDaemonOpen_unix): Do not dereference
a NULL "conn".  Move first deref to follow the "conn == NULL" test.
2010-01-06 21:52:25 +01:00
7a90f21655 qemu: Always enable the virtio balloon driver
The behavior for the qemu balloon device has changed.  Formerly, a virtio
balloon device was provided by default.  Now, '-balloon virtio' must be
specified on the command line to enable it.  This patch causes libvirt to
add '-balloon virtio' to the command line whenever the -balloon option is
available.
* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
  add "-baloon vitio" to qemu command when needed
* tests/qemuhelptest.c: add the new flag for detection
2010-01-06 18:01:51 +01:00
1c06eb18c3 Don't update vol details after build
This patch removes the call to vol update after the volume build completes.
The update call is currently meaningless anyway because the vol build is passed
a copy of the definition, so the update result is thrown away.  More
importantly, if the user specified a selinux label for the volume, the update
call results in a double free of the label
* src/storage/storage_backend_fs.c: remove the update call
2010-01-06 17:53:15 +01:00
8838ee39ab Disable building of static Python module
* python/Makefile.am: python modules are loaded at runtime so the static
  version is not needed, avoid building it
2010-01-06 17:33:41 +01:00
c0a9b6a533 Fix parsing of 'info chardev' line endings
This change makes the 'info chardev' parser ignore any trailing
whitespace on a line. This fixes a specific problem handling a '\r\n'
line ending.

* src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in
  'info chardev' output.
2010-01-06 17:09:04 +01:00
aee70b7482 vbox_tmpl.c: don't leak a domain pointer upon failure to create
* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): "Unref" the domain
upon failure.  Patch by Matthias Bolte.
2010-01-05 18:14:47 +01:00
2718a3d836 vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure
* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Don't call
vboxDomainUndefine on a NULL "dom".
2010-01-05 18:14:44 +01:00
f2d8c9d087 qemu_driver.c: remove useless, warning-provoking test
* src/qemu/qemu_driver.c (qemudDomainMigratePrepare2): Remove useless
test of always-non-NULL uri_out parameter.  Use ATTRIBUTE_NONNULL to
inform tools.
2010-01-05 17:25:26 +01:00
eebf932e94 qemu_driver.c: avoid NULL dereference upon disk-op failure
* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
virCgroupDenyDevicePath only if cgroup is non-NULL.
2010-01-05 17:25:19 +01:00
c1237818d2 openvz_conf.c: don't dereference NULL upon failure
* src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref
of "dom".
2010-01-05 15:32:53 +01:00
20fa7cdb32 Distribute vmx2xml and xml2vmx test data files 2009-12-28 14:27:45 +01:00
3f24ae2eb9 Release of libvirt-0.7.5 2009-12-23 17:00:22 +01:00
8459f6e284 Update and regenerate localizations
upate of as.po bn_IN.po de.po es.po gu.po hi.po kn.po ml.po mr.po or.po
pa.po pl.po ru.po ta.po te.po zh_CN.po and regeneration
2009-12-23 15:55:47 +01:00
a26d2628c0 The secret driver is stateful, link it directly to libvirtd
All other stateful drivers are linked directly to libvirtd
instead of libvirt.so. Link the secret driver to libvirtd too.

* daemon/Makefile.am: link the secret driver to libvirtd
* daemon/libvirtd.c: add #ifdef WITH_SECRETS blocks
* src/Makefile.am: don't link the secret driver to libvirt.so
* src/libvirt_private.syms: remove the secretRegister symbol
2009-12-23 15:01:09 +01:00
f7e5ca90e6 Remove undefined symbols from libvirt_private.syms
MinGW's ld gives an error when trying to export undefined symbols.
2009-12-23 14:57:07 +01:00
ca9e601fcb boolean shadows a typedef in rpcndr.h when compiled with MinGW
Alter the offending variable names to fix this.
2009-12-23 14:57:01 +01:00
913ab198fb Rename DATADIR to PKGDATADIR to fix win32 build
* src/Makefile.am src/cpu/cpu_map.c: rename in Makefile and in the
  cpu map loading code
2009-12-23 14:29:57 +01:00
79fa4a98d1 Move cpu_map.xml to -client RPM
All the cpu code is part of libvirt library and it might be used by
drivers which do not require libvirtd to be running.
2009-12-23 14:28:42 +01:00
b9daebfee4 convert missing server entry points into unsupported errors
If using a remote access, sometimes an RPC entry point is not
available, and currently we just end up with a raw:
    error: unknown procedure: xxx
error, while this should be more cleanly reported as an unsupported
entry point like for local access

* src/remote/remote_driver.c: convert missing remote entry points into
  the unsupported feature error
2009-12-22 17:44:03 +01:00
54f868c164 fix some error report when on remote access
When querying about a domain from 0.3.3 (or RHEL 5.3) domain located
on a 0.6.3 (RHEL-5) machine, the errors are not properly reported.
This patch from Olivier Fourdan <ofourdan@redhat.com> , slightly
modified to not change the semantic when the domain os details cannot
be provided

* src/xen/proxy_internal.c src/xen/xen_hypervisor.c: add some missing
  error reports
2009-12-22 16:49:06 +01:00
457d4ad99d Fix undefined reference to 'close_used_without_including_unistd_h'
Found while trying to cross-compile libvirt on Fedora 12 for Windows.
gnulib redefines 'close' to 'close_used_without_including_unistd_h'
in sys/socket.h if winsock2.h is present and unistd.h has not been
included before sys/socket.h. Reorder some includes to fix this.
2009-12-22 13:04:50 +01:00
9501a45fc0 Fix argument type of virProcessInfoSetAffinity dummy function 2009-12-22 13:04:50 +01:00
a3bd8bbb38 Define ATTRIBUTE_SENTINEL for GCC < 4.0 too
ATTRIBUTE_SENTINEL was defined for GCC >= 4.0 only, resulting in
compile errors when using GCC < 4.0.
2009-12-22 13:04:50 +01:00
d4c1e5aeed Fix compilation with configure --disable-nls 2009-12-22 13:04:50 +01:00
434daaff9a cpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad
Also backup and restore the original ctxt->node value in x86FeatureLoad.
2009-12-22 13:04:50 +01:00
156e36a238 Fix configure check for SASL
The option --with-sasl defaults to 'check', but an inverted test logic
lets the SASL check fail with an error instead of disabling SASL.
Fix the test logic so SASL support gets disabled if SASL is missing and
--with-sasl is set to check.
2009-12-22 13:04:50 +01:00
cf30da7a25 Fix GnuTLS pkg-config check
The testlogic for $PKG_CONFIG was inverted, checking for an empty string
before using PKG_CHECK_MODULES. Use -x instead of -z and add an else branch
to the if checking for $GNUTLS_FOUND = no to add -lgcrypt in case the
GnuTLS libraries are detected by pkg-config.
2009-12-22 13:04:50 +01:00
188852c984 Report an error if no XDR library can be found 2009-12-22 13:04:50 +01:00
27c357bcfa Disable JSON mode monitor until QEMU is more mature
* src/qemu/qemu_conf.h: Remove QEMU_CMD_FLAG_0_12 and just leave
  the lone JSON flag
* src/qemu/qemu_conf.c: Enable JSON on QEMU 0.13 or later, but
  leave it disabled for now
2009-12-22 11:43:48 +00:00
8153c72b97 Only probe for CPU models if required
* src/qemu/qemu_conf.c: CPU models should be probed only if the
  a guest's XML contains CPU model, not each time a qemu command line
  is generated.
2009-12-22 12:23:56 +01:00
5dbb208a4f Add some people missing from the AUTHORS list 2009-12-22 12:16:57 +01:00
ab007c3da0 Add cpu_map.xml to libvirt.spec
* libvirt.spec.in: embbed it in the main libvirt binary rpm
2009-12-22 12:09:56 +01:00
bfeeb9a6d2 Install cpu_map.xml
* src/Makefile.am: install it in $(pkgdatadir) i.e. /usr/share/libvirt/
  usually
2009-12-22 12:06:01 +01:00
e9f468d3f9 Make Xen VT-d PCI attach/detach work
The Xen code for making HVM VT-d PCI passthrough attach and detach
wasn't working properly:

1)  In xenDaemonAttachDevice(), we were always trying to reconfigure
a PCI passthrough device, even the first time we added it.  This was
because the code in virDomainXMLDevID() was not checking xenstore for
the existence of the device, and always returning 0 (meaning that
the device already existed).

2)  In xenDaemonDetachDevice(), we were trying to use "device_destroy"
to detach a PCI device.  While you would think that is the right
method to call, it's actually wrong for PCI devices.  In particular,
in upstream Xen (and soon in RHEL-5 Xen), device_configure is actually
used to destroy a PCI device.

To fix the attach
problem I add a lookup into xenstore to see if the device we are
trying to attach already exists.  To fix the detach problem I change
it so that for PCI detach (only), we use device_configure with the
appropriate sxpr to do the detachment.

* src/xen/xend_internal.c: don't use device_destroy for PCI devices
  and fix the other issues.
* src/xen/xs_internal.c src/xen/xs_internal.h: add
  xenStoreDomainGetPCIID()
2009-12-22 10:53:51 +01:00
c90e545f83 Fix detection of JSON when restarting libvirtd
The XML XPath for detecting JSON in the running VM statefile was
wrong causing all VMs to get JSON mode enabled at libvirtd restart.

In addition if a VM was running a JSON enabled QEMU once, and then
altered to point to a non-JSON enabled QEMU later the 'monJSON'
flag would not get reset to 0.

* src/qemu/qemu_driver.c: Fix setting/detection of JSON mode
2009-12-21 23:37:37 +00:00
cc3618d77b Document the dommemstat command in the virsh man page
* tools/virsh.pod: Provide a basic mention of the dommemstat command in
  the virsh man page.
2009-12-21 15:24:56 +01:00
a858474f49 Change virsh dommemstats command to dommemstat
As Paul Jenner pointed out all other statistics commands use the
singular form

* tools/virsh.c: rename dommemstats to dommemstat as well as function
  name and associated structures
2009-12-21 13:49:45 +01:00
469b6b3a75 Fix reporting of TLS connection errors
The code for connecting to a server tries each socket in turn
until it finds one that connects. Unfortunately for TLS sockets
if it connected, but failed TLS handshake it would treat that
as a failure to connect, and try the next socket. This is bad,
it should have reported the TLS failure immediately.

$ virsh -c qemu://somehost.com/system
error: unable to connect to libvirtd at 'somehost.com': Invalid argument
error: failed to connect to the hypervisor

$ ./tools/virsh -c qemu://somehost.com/system
error: server certificate failed validation: The certificate hasn't got a known issuer.
error: failed to connect to the hypervisor

 * src/remote/remote_driver.c: Stop trying to connect if the
   TLS handshake fails
2009-12-21 12:18:38 +00:00
9b2c299a35 Fix typo in qemudDomainAttachHostPciDevice()
* src/qemu/qemu_driver.c: The 'if' statement is supposed to check return
  value of pci = pciGetDevice(conn, ...); , but check uses if (!dev),
  fix it
2009-12-21 12:32:55 +01:00
2c345831a3 python: Add python bindings for virDomainMemoryStats
Enable virDomainMemoryStats in the python API.  dom.memoryStats() will return a
dictionary containing the supported statistics.  A dictionary is required
because the meaining of each quantity cannot be inferred from its index in a
list.

* python/generator.py: reenable bindings for this entry point
* python/libvirt-override-api.xml python/libvirt-override.c: the
  generator can't handle this new function, add the new binding,
  and the XML description
2009-12-20 13:48:37 +01:00
b6798b68cb Add a new command dommemstats for virDomainMemoryStats
Define a new command 'dommemstats' to report domain memory statistics.  The
output format is inspired by 'domblkstat' and 'domifstat' and consists of
tag/value pairs, one per line.  The command can complete successfully and
print no output if virDomainMemoryStats is supported by the driver, but not
the guest operating system.

Sample output:
swap_in 0
swap_out 0
major_fault 54
minor_fault 58259
unused 487680
available 502472

All stats referring to a quantity of memory (eg. all above except major and
minor faults) represent the quantity in KBytes.

* tools/virsh.c: implements the new command
2009-12-20 13:46:24 +01:00
841d50358f Add domainMemoryStats support to remote driver
Use a dynamically sized xdr_array to pass memory stats on the wire.  This
supports the addition of future memory stats and reduces the message size
since only supported statistics are returned.

* src/remote/remote_protocol.x: provide defines for the new entry point
* src/remote/remote_driver.c daemon/remote.c: implement the client and
  server side
* daemon/remote_dispatch_args.h daemon/remote_dispatch_prototypes.h
  daemon/remote_dispatch_ret.h daemon/remote_dispatch_table.h
  src/remote/remote_protocol.c src/remote/remote_protocol.h: generated
  stubs
2009-12-20 13:43:19 +01:00
c7523b410a Implements domainMemStats in the qemu driver
Support for memory statistics reporting is accepted for qemu inclusion.
Statistics are reported via the monitor command 'info balloon' as a comma
seprated list:

(qemu) info balloon
balloon: actual=1024,mem_swapped_in=0,mem_swapped_out=0,major_page_faults=88,minor_page_faults=105535,free_mem=1017065472,total_mem=1045229568

Libvirt, qemu, and the guest operating system may support a subset of the
statistics defined by the virtio spec.  Thus, only statistics recognized by
components will be reported.

* src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement the
  new entry point by using info balloon monitor command
2009-12-20 13:36:28 +01:00
4fe975fe4e domMemoryStats: Add public symbol to libvirt API
* src/libvirt.c: implement the main entry point
* src/libvirt_public.syms: add it to the exported symbols
2009-12-20 13:34:21 +01:00
3a70131312 Add new API virDomainMemoryStats to header and drivers
Set up the types for the domainMemoryStats function and insert it into the
virDriver structure definition.  Because of static initializers, update
every driver and set the new field to NULL.

* include/libvirt/libvirt.h.in: new API
* src/driver.h src/*/*_driver.c src/vbox/vbox_tmpl.c: add the new
  entry to the driver structure
* python/generator.py: fix compiler errors, the actual python binding is
  implemented later
2009-12-20 13:28:42 +01:00
7c59337d5d esx: Add more links to external documentation 2009-12-18 19:29:39 +01:00
470764f0b4 esx: Destroy virtual machine on a vCenter if available
If a virtual machine is destroyed on a ESX server then immediately
undefining this virtual machine on a vCenter may fail, because the
vCenter has not been informed about the status change yet. Therefore,
destroy a virtual machine on a vCenter if available, so the vCenter
is up-to-date when the virtual machine should be undefined.
2009-12-18 19:29:39 +01:00
46306c9c85 esx: Undefine virtual machine on a vCenter if available
Undefining a virtual machine on an ESX server leaves a orphan on the
vCenter behind. So undefine a virtual machine on a vCenter if available
to fix this problem.
2009-12-18 19:29:39 +01:00
a5d8d265a2 esx: Don't warn about '/' paths 2009-12-18 19:29:39 +01:00
1e93e37bbf esx: Use occurrence enum to specify expected result of a SOAP call
Also move XPath expression composition into esxVI_Context_Execute().
2009-12-18 19:29:38 +01:00
cf54204e27 esx: Fix occurence typo 2009-12-18 19:29:38 +01:00
49e261d14e esx: Extend documentation about 'vcenter' and add some about 'auto_answer' 2009-12-18 19:29:38 +01:00
c23a4fd13f esx: Extend vCenter query parameter
If an ESX host is managed by a vCenter, it knows the IP address of the
vCenter. Setting the vCenter query parameter to * allows to connect to the
vCenter known to an ESX host without the need to specify its IP address
or hostname explicitly.
2009-12-18 19:29:38 +01:00
de42b8b223 esx: Removed unused inttypes.h include 2009-12-18 19:29:38 +01:00
7cdedde225 esx: Replace libxml1 'xmlChildrenNode' with libxml2 'children' 2009-12-18 19:29:38 +01:00
4106f68ccf esx: Use more suitable error code in esxVI_LookupVirtualMachineByUuid() 2009-12-18 19:29:38 +01:00
06ef64d169 esx: Improve domain lookup by UUID
esxDomainLookupByUUID() and esxDomainIsActive() lookup a domain by asking
ESX for all known domains and searching manually for the one with the
matching UUID. This is inefficient. The VI API allows to lookup by UUID
directly: FindByUuid().

* src/esx/esx_driver.c: change esxDomainLookupByUUID() and esxDomainIsActive()
  to use esxVI_LookupVirtualMachineByUuid(), also reorder some functions to
  keep them in sync with the driver struct
2009-12-18 19:29:38 +01:00
f66d574541 esx: Add automatic question handling
Questions can block tasks, to handle them automatically the driver can answers
them with the default answer. The auto_answer query parameter allows to enable
this automatic question handling.

* src/esx/README: add a detailed explanation for automatic question handling
* src/esx/esx_driver.c: add automatic question handling for all task related
  driver functions
* src/esx/esx_util.[ch]: add handling for the auto_answer query parameter
* src/esx/esx_vi.[ch], src/esx/esx_vi_methods.[ch], src/esx/esx_vi_types.[ch]:
  add new VI API methods and types and additional helper functions for
  automatic question handling
2009-12-18 19:29:38 +01:00
1c5c63338c Fix compilation with gcrypt < 1.4.2
Commit 33a198c1f6 increased the gcrypt
version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
define was added in this version.

The configure script doesn't check for the gcrypt version. To support
gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
to use GCRY_THREAD_OPTION_VERSION only if it's defined.
2009-12-18 18:56:31 +01:00
1a43d0b2c2 Don't mix LDFLAGS and LIBS in the configure script
* configure.in: If you pass libraries in the LDFLAGS variable, and then
  try AC_CHECK_FUNCS to find whether a function is present or not,
  it'll fail badly when using the --as-needed linker flag. Instead,
  pass the libraries through the LIBS library, so that they are passed
  after the conftest.c source file and the tests are done properly.
2009-12-18 18:34:40 +01:00
3a524a2b11 Don't make it possible to define HAVE_HAL but not enable it in automake
* configure.in: With the previous logic, if libhal_get_all_devices
  function was not found, HAVE_HAL would be defined for the preprocessor
  but it wouldn't be enabled in automake conditionals, causing the final
  link to fail with missing references to HAL entries.
2009-12-18 18:29:13 +01:00
3b734b78ff Implement virsh command 'cpu-compare'
* tools/virsh.c: provide a way to us teh new API with virsh
2009-12-18 16:28:15 +01:00
ffb13b1115 Implement CPU selection in QEMU driver
* src/qemu/qemu_conf.c src/qemu/qemu_conf.h src/qemu/qemu_driver.c:
  add the new entry point, extend capabilities and code to interract
  with qemu
2009-12-18 16:24:14 +01:00
d5ef0a69e9 Adds CPU map for models and features
* src/cpu/cpu_map.xml: newdescription file
* src/Makefile.am: include it in dist
2009-12-18 16:14:05 +01:00
7286882c34 Adds CPU selection infrastructure
Each driver supporting CPU selection must fill in host CPU capabilities.
When filling them, drivers for hypervisors running on the same node as
libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
such as VMware, need to implement their own way of getting such data.
Raw data can be decoded into virCPUDefPtr using cpuDecode() function.

When implementing virConnectCompareCPU(), a hypervisor driver can just
call cpuCompareXML() function with host CPU capabilities.

For each guest for which a driver supports selecting CPU models, it must
set the appropriate feature in guest's capabilities:

    virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)

Actions needed when a domain is being created depend on whether the
hypervisor understands raw CPU data (currently CPUID for i686, x86_64
architectures) or symbolic names has to be used.

Typical use by hypervisors which prefer CPUID (such as VMware and Xen):

- convert guest CPU configuration from domain's XML into a set of raw
  data structures each representing one of the feature policies:

    cpuEncode(conn, architecture, guest_cpu_config,
              &forced_data, &required_data, &optional_data,
              &disabled_data, &forbidden_data)

- create a mask or whatever the hypervisor expects to see and pass it
  to the hypervisor

Typical use by hypervisors with symbolic model names (such as QEMU):

- get raw CPU data for a computed guest CPU:

    cpuGuestData(conn, host_cpu, guest_cpu_config, &data)

- decode raw data into virCPUDefPtr with a possible restriction on
  allowed model names:

    cpuDecode(conn, guest, data, n_allowed_models, allowed_models)

- pass guest->model and guest->features to the hypervisor

* src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
  src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
  src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
* configure.in: check for CPUID instruction
* src/Makefile.am: glue the new files in
* src/libvirt_private.syms: add new private symbols
* po/POTFILES.in: add new cpu files containing translatable strings
2009-12-18 16:13:45 +01:00
e104269398 Remote driver CPU flags support
* src/remote/remote_driver.c: add the new entry point
2009-12-18 15:56:09 +01:00
3a2881fa60 CPU flags wire protocol format and server side
* src/remote/remote_protocol.x: update with new entry point
* daemon/remote.c: add the new server dispatcher
* daemon/remote_dispatch_args.h daemon/remote_dispatch_prototypes.h
  daemon/remote_dispatch_ret.h daemon/remote_dispatch_table.h
  src/remote/remote_protocol.c src/remote/remote_protocol.h: regenerated
2009-12-18 15:49:34 +01:00
0b7d2ae653 Public API implementation
* src/libvirt.c: adds the public entry point virConnectCompareCPU()
2009-12-18 15:24:34 +01:00
16e4084a10 Adds the internal driver API
* src/driver.h: add an extra entry point in the structure
* src/esx/esx_driver.c src/lxc/lxc_driver.c src/opennebula/one_driver.c
  src/openvz/openvz_driver.c src/phyp/phyp_driver.c src/qemu/qemu_driver.c
  src/remote/remote_driver.c src/test/test_driver.c src/uml/uml_driver.c
  src/vbox/vbox_tmpl.c src/xen/xen_driver.c: add NULL entry points for
  all drivers
2009-12-18 14:59:39 +01:00
a44dc266d9 New public API definition virConnectCompareCPU()
* include/libvirt/libvirt.h.in: add it in the public API as
  well as the new flags
* src/libvirt_public.syms: export it
2009-12-18 14:51:39 +01:00
c7c42a85b9 Fixes syntax-check with previous commit
* po/POTFILES.in: adds src/conf/cpu_conf.c in teh set of files with
  translatable content
* src/conf/cpu_conf.c: remove an unused include
2009-12-18 14:50:04 +01:00
6695818c03 XML parsing/formating code for CPU flags
* include/libvirt/virterror.h src/util/virterror.c: add new domain
  VIR_FROM_CPU for errors
* src/conf/cpu_conf.c src/conf/cpu_conf.h: new parsing module
* src/Makefile.am proxy/Makefile.am: include new files
* src/conf/capabilities.[ch] src/conf/domain_conf.[ch]: reference
  new code
* src/libvirt_private.syms: private export of new entry points
2009-12-18 14:44:55 +01:00
6df8b363f7 XML schema for CPU flags
XML schema for CPU flags

Firstly, CPU topology and model with optional features have to be
advertised in host capabilities:

    <host>
        <cpu>
            <arch>ARCHITECTURE</arch>
            <features>
                <!-- old-style features are here -->
            </features>
            <model>NAME</model>
            <topology sockets="S" cores="C" threads="T"/>
            <feature name="NAME"/>
        </cpu>
        ...
    </host>

Secondly, drivers which support detailed CPU specification have to
advertise
it in guest capabilities:

    <guest>
    ...
    <features>
            <cpuselection/>
        </features>
    </guest>

And finally, CPU may be configured in domain XML configuration:

<domain>
    ...
    <cpu match="MATCH">
        <model>NAME</model>
        <topology sockets="S" cores="C" threads="T"/>
        <feature policy="POLICY" name="NAME"/>
    </cpu>
</domain>

Where MATCH can be one of:
    - 'minimum'     specified CPU is the minimum requested CPU
    - 'exact'       disable all additional features provided by host CPU
    - 'strict'      fail if host CPU doesn't exactly match

POLICY can be one of:
    - 'force'       turn on the feature, even if host doesn't have it
    - 'require'     fail if host doesn't have the feature
    - 'optional'    match host
    - 'disable'     turn off the feature, even if host has it
    - 'forbid'      fail if host has the feature

'force' and 'disable' policies turn on/off the feature regardless of its
availability on host. 'force' is unlikely to be used but its there for
completeness since Xen and VMWare allow it.

'require' and 'forbid' policies prevent a guest from being started on a host
which doesn't/does have the feature. 'forbid' is for cases where you disable
the feature but a guest may still try to access it anyway and you don't want
it to succeed.

'optional' policy sets the feature according to its availability on host.
When a guest is booted on a host that has the feature and then migrated to
another host, the policy changes to 'require' as we can't take the feature
away from a running guest.

Default policy for features provided by host CPU but not specified in domain
configuration is set using match attribute of cpu tag. If 'minimum' match is
requested, additional features will be treated as if they were specified
with 'optional' policy. 'exact' match implies 'disable' policy and 'strict'
match stands for 'forbid' policy.

* docs/schemas/capability.rng docs/schemas/domain.rng: extend the
  RelaxNG schemas to add CPU flags support
2009-12-18 14:37:09 +01:00
33a198c1f6 Initialize gcrypt threading
GNUTLS uses gcrypt for its crypto functions. gcrypt requires
that the app/library initializes threading before using it.
We don't want to force apps using libvirt to know about
gcrypt, so we make virInitialize init threading on their
behalf. This location also ensures libvirtd has initialized
it correctly. This initialization is required even if libvirt
itself were only using one thread, since another non-libvirt
library (eg GTK-VNC) could also be using gcrypt from another
thread

* src/libvirt.c: Register thread functions for gcrypt
* configure.in: Add -lgcrypt to linker flags
2009-12-17 18:22:09 +00:00
84961bd3f4 Fix bug in storage driver accessing wrong private data
* src/storage/storage_driver.c: Fix IsPersistent() and IsActivE()
  methods on storage pools to use 'storagePrivateData' instead
  of 'privateData'. Also fix naming convention of objects
2009-12-17 16:51:30 +00:00
de3e38a65e esx_vi.c: do not call through NULL function pointer
* src/esx/esx_vi.c (esxVI_List_CastFromAnyType): For invalid
inputs, fail right away.  Do not "goto failure" where a NULL
input pointer would be dereferenced.
2009-12-16 13:39:15 +01:00
fa479727ff esx_util.c: avoid NULL deref for invalid inputs
* src/esx/esx_util.c (esxUtil_ParseDatastoreRelatedPath): Return
right away for invalid inputs, rather than using them (which would
dereference NULL pointers) in clean-up code.
2009-12-16 13:39:15 +01:00
576b2c7514 esx: Don't goto failure for invalid arguments in VMX code
This also fixes a NULL-deref of virtualDev in esxVMX_ParseSCSIController
found by Jim Meyering.
2009-12-15 23:49:56 +01:00
2b844f1614 Fix memory leak in qemudBuildCommandLine 2009-12-15 22:53:45 +01:00
2e5efc3d6e avoid calling exit with a constant; use EXIT_* instead
This appeases a new gnulib-provided "syntax-check".
* daemon/libvirtd.c (main): Use EXIT_FAILURE, not 1.
* proxy/libvirt_proxy.c (main): Likewise, and EXIT_SUCCESS, not 0.
* tests/conftest.c (main): Likewise.
* tests/reconnect.c (main): Likewise.
* tests/testutils.h (EXIT_AM_SKIP): Define.
* tests/nodeinfotest.c (mymain): Use EXIT_AM_SKIP, not 77.
* tests/qemuargv2xmltest.c: Likewise.
* tests/qemuxml2xmltest.c: Likewise.
* tests/virshtest.c (mymain): Likewise.
2009-12-15 17:46:04 +01:00
e7c8ab8f0e maint: remove from VC two gnulib-provided files
* build-aux/link-warning.h: Remove file from version control.
* build-aux/mktempd: Likewise.
* build-aux/.gitignore: Adjust.
2009-12-15 17:46:04 +01:00
5baa463541 avoid malfunction when virFileResolveLink is applied to non-POSIX FS
The virFileResolveLink utility function relied on the POSIX guarantee
that stat.st_size of a symlink is the length of the value.  However,
on some types of file systems, it is invalid, so do not rely on it.
Use gnulib's areadlink module instead.
* bootstrap (modules): Add areadlink.
* src/util/util.c: Include "areadlink.h".
Let areadlink perform the readlink and malloc.
* configure.in (AC_CHECK_FUNCS): Remove readlink.  No need,
since it's presence is guaranteed by gnulib.
2009-12-15 17:46:04 +01:00
f3cbd24ddc build: update gnulib submodule to latest 2009-12-15 17:46:04 +01:00
11f6cc3279 xm_internal.c: remove misleading dead code
* src/xen/xm_internal.c (xenXMConfigGetULong): Remove useless and
misleading test (always false) for val->str == NULL before code that
always dereferences val->str.  "val" comes from virConfGetValue, and
at that point, val->str is guaranteed to be non-NULL.
(xenXMConfigGetBool): Likewise.
* src/util/conf.c (virConfSetValue): Ensure that vir->str is never NULL,
not even if someone tries to set such a value via virConfSetValue.
2009-12-15 17:46:04 +01:00
d37bca86d0 libvirt.c: don't let a NULL "cpumaps" argument provoke a NULL-deref
* src/libvirt.c (virDomainGetVcpus): Describe new, stronger
requirement on "maplen"s relationship to "cpumaps".
2009-12-15 17:44:15 +01:00
643ee3fa44 qemu migration: avoid NULL-deref given an invalid input
* src/qemu/qemu_driver.c (doNonTunnelMigrate): Don't let a
NULL "uri_out" provoke a NULL-dereference in doNativeMigrate:
supply omitted goto-after-qemudReportError.
2009-12-15 11:26:24 +01:00
1428704d2a qemu_driver.c: don't unlink(NULL) on OOM error path
* src/qemu/qemu_driver.c (qemudDomainMigratePrepareTunnel): Upon an
out of memory error, we would end up with unixfile==NULL and attempt
to unlink(NULL).  Skip the unlink when it's NULL.
2009-12-15 11:26:24 +01:00
49226d2ce4 remote_driver.c: also zero out ->saslDecodedOffset member
* src/remote/remote_driver.c (remoteIOReadMessage): ...rather than
zeroing out priv->saslDecodedLength twice.
2009-12-15 11:26:24 +01:00
dd16045041 qemu_driver.c: avoid double free on error path
* src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Set
"event" to NULL after qemuDomainEventQueue frees it, so a
subsequent free (after endjob label) upon qemuMonitorStartCPUs
failure does not cause a double free.
2009-12-15 07:53:44 +01:00
63a499d3f3 libvirtd: avoid a NULL dereference on error path
* daemon/libvirtd.c (qemudDispatchServer): Since "client" may be
NULL in the "cleanup:" block, free client->rx only when it's not.
2009-12-15 07:53:27 +01:00
52a18abd94 Fix and improve domain xml video element description
The description mismatched the actual structure since the video element
was introduced. The nvram attribute is actually called vram. Specify the
unit of the vram attribute.
2009-12-14 22:14:06 +01:00
d0857c0132 Fix install location for Python bindings
Commit 66137344fe changed the Python detection
mechanism in configure to use AM_PATH_PYTHON. This results in a changed
install location for the Python bindings, at least on Fedora 12 64bit systems.

Before this commit libvirt.py and libvirtmod.so were installed to

  /usr/lib64/python2.6/site-packages

After this commit they are installed to

  /usr/lib/python2.6/site-packages

Mixed Python packages (containing *.py and *.so files) should be installed to
the pyexecdir directory detected by AM_PATH_PYTHON.

This restores the install location from before the AM_PATH_PYTHON commit.

* configure.in: remove unnecessary pythondir export
* python/Makefile.am: switch from pythondir to pyexecdir
2009-12-14 22:14:06 +01:00
803d320430 Relax the allowed values for machine type in schema
* docs/schemas/domain.rng: don't try to validate based on a list, open
  up the machine type to a regexp allowing a-z A-Z 0-9 _ - and .
2009-12-14 16:59:06 +01:00
21a2eba44f virsh: avoid double-free
* tools/virsh.c (vshCommandParse): Avoid double-free of "tkdata".
Set it to NULL immediately after free in the (cmd == NULL) case,
just as in the other case, in case the final free(tkdata) is
triggered by a syntax error.
2009-12-14 16:26:44 +01:00
b148318981 node_device_driver.c: don't write beyond EOB for 4K-byte symlink
* src/node_device/node_device_driver.c (update_driver_name): The
previous code would write one byte beyond the end of the 4KiB
stack buffer when presented with a symlink value of exactly that
length (very unlikely).  Remove the automatic buffer and use
virFileResolveLink in place of readlink.  Suggested by Daniel Veillard.
2009-12-14 16:26:38 +01:00
042956d558 Fix owner and group in example volume XML
The owner and group in the documentation examples were confusingly given as
'0744'. They should be numeric uid and gid. Changed the examples to use the
default uid and gid assigned to qemu in F12.

* docs/formatstorage.html.in: Change example owner and group in volume XML
2009-12-14 16:23:26 +01:00
2aec15bc5a add missing doc for device <shareable/> option 2009-12-14 16:20:55 +01:00
22f3ec27a3 Eliminate failure to delete empty storage pools
* src/storage/storage_backend_fs.c: virStorageBackendFileSystemDelete
  was incorrectly calling unlink() in an attempt to remove a directory.
  It should be calling rmdir() instead.
2009-12-14 16:15:28 +01:00
a645c8f0fd Fix use of virEventAddHandleImpl()
src/node_device/node_device_udev.c was using a function available only
on the daemon code, fix this and use the function available globally

* src/node_device/node_device_udev.c: replace use of virEventAddHandleImpl
  by virEventAddHandle
2009-12-14 16:09:01 +01:00
057ad3a2f5 Cleanup temporary #define after use
* src/qemu/qemu_driver.c: #undef LOOKUP_PTYS after use in
  qemudFindCharDevicePTYsMonitor()
2009-12-14 16:05:45 +01:00
94d599eccf Implement --pool option for virsh vol-path
This patch fixes the problem reported in:

https://bugzilla.redhat.com/show_bug.cgi?id=509306

The bug reporter says that vol-delete does not support the --pool
option, but that's not the case in the current head.  This patch makes
vol-path behave the same way as vol-delete

* tools/virsh.c: Modified vol-path to use the same logic as vol-delete,
  allowing the syntax: virsh vol-path --pool testdirpool testvol0
2009-12-14 15:17:35 +01:00
deae2bb57f nodedev: Add removable storage 'media_label' prop
Provides the CDROM label for current media. Only implemented for the
udev backend.
2009-12-14 14:58:23 +01:00
a010165d27 expose SR IOV physical/virtual function relationships
exposes the relationships between physical
and virtual functions on SR IOV capable devices.
2009-12-14 14:44:12 +01:00
921d2225ba Fix possible NULL pointer dereference
If there are no references remaining to the object, vm is set to NULL
and vm->persistent cannot be accessed.  Fixed by this trivial patch.

* src/qemu/qemu_driver.c (qemudDomainCoreDump): Avoid possible
  NULL pointer dereference on --crash dump.
2009-12-14 14:09:10 +01:00
ad905a195e add AppArmor test and examples to dist
tests/virt-aa-helper-test and examples/apparmor are not included in
official tarballs, but should be. Attached is a patch to fix that
which works when apparmor is and is not available.
2009-12-14 13:40:42 +01:00
1fb7af40cd add --live support to "virsh dump"
This is trivial for QEMU since you just have to not stop the vm before
starting the dump.  And for Xen, you just pass the flag down to xend.

* include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): Add VIR_DUMP_LIVE.
* src/qemu/qemu_driver.c (qemudDomainCoreDump): Support live dumping.
* src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support live dumping.
* tools/virsh.c (opts_dump): Add --live. (cmdDump): Map it to VIR_DUMP_LIVE.
2009-12-14 12:10:38 +01:00
b927aed8a3 add --crash support to "virsh dump"
This patch adds the --crash option (already present in "xm dump-core")
to "virsh dump".  virDomainCoreDump already has a flags argument, so
the API/ABI is untouched.

* include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): New flag for
  CoreDump
* src/test/test_driver.c (testDomainCoreDump): Do not crash
  after dump unless VIR_DUMP_CRASH is given.
* src/qemu/qemu_driver.c (qemudDomainCoreDump): Shutdown the domain
  instead of restarting it if --crash is passed.
* src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support --crash.
* tools/virsh.c (opts_dump): Add --crash.
  (cmdDump): Map it to flags for virDomainCoreDump and pass them.
2009-12-14 11:59:27 +01:00
f509e16241 fix various breakages in qemu Dump command
1) qemuMigrateToCommand uses ">>" so we have to truncate the file
before starting the migration;

2) the command wasn't updated to chown the driver and set/restore
the security lavels;

3) the VM does not have to be resumed if migration fails;

4) the file is not removed when migration fails.

* src/qemu/qemu_driver.c (qemuDomainCoreDump): Truncate file before
  dumping, set/restore ownership and security labels for the file.
2009-12-14 11:27:41 +01:00
a7d1eb3c44 Fix a couple of problems in last patch
Those were pointed by DanB in his review but not yet fixed

* src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
  and ExitMonitorWithDriver() there
* src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
  table add error in qemuMonitorTextGetPtyPaths()
2009-12-14 11:05:55 +01:00
60e8977fdd Get QEMU pty paths from the monitor
This change makes the QEMU driver get pty paths from the output of the
monitor 'info chardev' command. This output is structured, and contains
both the name of the device and the path on the same line. This is
considerably more reliable than parsing the startup log output, which
requires the parsing code to know which order QEMU will print pty
information in.

Note that we still need to parse the log output as the monitor itself
may be on a pty. This should be rare, however, and the new code will
replace all pty paths parsed by the log output method once the monitor
is available.

* src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
  qemuMonitorGetPtyPaths().
* src/qemu/qemu_driver.c: Get pty path information using
  qemuMonitorGetPtyPaths().
2009-12-14 10:50:01 +01:00
033eef4358 Extract the assigned pty device for QEmu channels
* src/qemu/qemu_driver.c: Parse pty devices for channels
2009-12-14 10:42:14 +01:00
a8eb010ea2 Make QEMU driver use -chardev everywhere if available
Change -monitor, -serial and -parallel output to use -chardev if it is
available.
* src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where
  available.
* tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents
  for all current serial and parallel tests.
2009-12-14 10:38:44 +01:00
2597f8ecc9 Suppress cgroup error message on sucess startup
Even if qemudStartVMDaemon suceeds, an error was logged such as
'qemuRemoveCgroup:1778 : internal error Unable to find cgroup for'.
This is because qemudStartVMDaemon calls qemuRemoveCgroup to
ensure that old cgroup does not remain. This workaround makes
sense but leaving an error message may confuse users.
* src/qemu/qemu_driver.c: a an option to the function to suppress the
  error being logged
2009-12-14 10:30:49 +01:00
e2692e25de Fix reference leak in remoteDispatchStorageVolCreateXmlFrom 2009-12-11 16:36:45 +01:00
27ba0ad905 Fix memory leak in virStorageBackendCopyToFD 2009-12-11 16:36:45 +01:00
0c3fb8d41c Fix 'make syntax-check' after iptables.c cleanup 2009-12-11 10:09:26 +01:00
5de41c06a4 retrieve paused/running state at migration start
This patch fixes the bug where paused/running state is not
transmitted during migration.  As a result, in the QEMU driver
for example the machine was always started on the destination
end.

In order to do so, just read the state and if it is appropriate and
set the VIR_MIGRATE_PAUSED flag.

* src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
  Automatically add VIR_MIGRATE_PAUSED when appropriate.
* src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
  error message when migration of paused domains is attempted.
2009-12-11 10:06:05 +01:00
edc9e78b48 add virsh --suspend arg to migrate command
This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
the migrated VM before starting it.

* include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
* src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
* tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
* tools/virsh.pod (migrate): Document it.
2009-12-11 10:00:44 +01:00
ba7d82c699 fix migration of paused vms upon failure
This makes a small change on the failed-migration path.  Up to now,
all VMs that failed non-live migration after the "stop" command
were restarted.  This must not be done when the VM was paused in
the first place.

* src/qemu/qemu_driver.c (qemudDomainMigratePerform): Do not restart
  a paused VM that fails migration.  Set paused state after "stop",
  reset it after failure.
2009-12-11 09:42:19 +01:00
25f7fa0583 Small change of RNG syntax for domain
* docs/schemas/domain.rng: As trang seems to bug with <optional><oneOrMore>
  replace it with <zeroOrMore>
2009-12-11 08:46:11 +01:00
c11a82b62a qemu driver: Fix segfault in libvirt/libvirtd when uri->path is NULL.
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=545400#c1
2009-12-10 16:39:07 +00:00
51ea18a844 Fix a wellformedness problem in secret.rng
* docs/schemas/secret.rng: ref tag for usagevolume wasn't closed
2009-12-10 17:03:47 +01:00
4ecf9c653e remove iptablesReloadRules() and related code
We don't use this method of reloading rules anymore, so we can just
kill the code.

This simplifies things a lot because we no longer need to keep a
table of the rules we've added.

* src/util/iptables.c: kill iptablesReloadRules()
2009-12-10 11:27:18 +00:00
3b3305d859 remove all traces of lokkit support
Long ago we tried to use Fedora's lokkit utility in order to register
our iptables rules so that 'service iptables restart' would
automatically load our rules.

There was one fatal flaw - if the user had configured iptables without
lokkit, then we would clobber that configuration by running lokkit.

We quickly disabled lokkit support, but never removed it. Let's do
that now.

The 'my virtual network stops working when I restart iptables' still
remains. For all the background on this saga, see:

  https://bugzilla.redhat.com/227011

* src/util/iptables.c: remove lokkit support

* configure.in: remove --enable-lokkit

* libvirt.spec.in: remove the dirs used only for saving rules for lokkit

* src/Makefile.am: ditto

* src/libvirt_private.syms, src/network/bridge_driver.c,
  src/util/iptables.h: remove references to iptablesSaveRules
2009-12-10 11:27:17 +00:00
534664c372 reload iptables rules on libvirtd restart
This is the expected behaviour, I think - reloading libvirtd should
be a subset of restarting it.

Note, we reload the rules after we've determined which networks
are active (because we only add the rules for active networks)
and before we start autostart networks (to avoid re-adding the
rules).

* src/network/bridge_driver.c: reload iptables rules on startup
2009-12-10 11:27:17 +00:00
98895e9386 reload iptables rules simply by re-adding them
Currently, when we add iptables rules, we keep them on a list so that
we can easily reload them on e.g. 'service libvirtd reload'.

However, we don't save this list to disk, so if libvirtd is restarted
we lose the ability to reload the rules.

The fix is simple - just re-add the damn things on reload.

Note, we delete the rules before re-adding them, just like the current
behaviour of iptRulesReload().

* src/network/bridge_driver.c: re-add the iptables rules on reload.
2009-12-10 11:27:17 +00:00
1b9d074493 Add virBufferFreeAndReset() and replace free()
Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
Update documentation and replace all remaining calls to free() with
calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
and virReportOOMError() in OOM error cases.
2009-12-10 00:00:50 +01:00
723bfda1ce Plumb domain description tag in xend backend
xen-unstable changesets 20321 and 20521 added support for
description in xend domain config.  This patch extends that
support in xend backend.
* src/xen/xend_internal.c: add parse and output of domain description
2009-12-09 15:25:31 +01:00
16387171c0 Update location of C# bindings. 2009-12-09 12:51:35 +00:00
cce1998a64 Make QEMU text monitor parsing more robust
The QEMU 0.10.0 release (and possibly other 0.10.x) has a bug where
it sometimes/often forgets to display the initial monitor greeting
line, soley printing a (qemu).  This in turn confuses the text
console parsing because it has a '(qemu)' it is not expecting. The
confusion results in a negative malloc. Bad things follow.

This re-writes the text console handling to be more robust. The key
idea is that it should only look for a (qemu), once it has seen the
original command echo'd back. This ensures it'll skip the bogus stray
(qemu) with broken QEMUs.

* src/qemu/qemu_monitor.c: Add some (disabled) debug code
* src/qemu/qemu_monitor_text.c: Re-write way command replies
  are detected
2009-12-09 10:32:50 +00:00
8e7d14953c Fix virDomainObj ref handling in QEMU driver
Since the monitor I/O is processed out of band from the main
thread(s) invoking monitor  commands, the virDomainObj may be
deleted by the I/O thread. The qemuDomainObjBeginJob takes an
extra reference to protect against final deletion, but this
reference is released by the corresponding EndJob call. THus
after the EndJob call it may not be valid to reference the
virDomainObj any more. To allow callers to detect this, the
EndJob call is changed to return the remaining reference count.

* src/conf/domain_conf.c: Make virDomainObjUnref return the
  remaining reference count
* src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
  after qemuDomainObjEndJob if it has been deleted.
2009-12-09 10:32:45 +00:00
604c70fd5d Fix the news file non-ascii characters
by adding an explicit HTML encoding meta description
2009-12-09 11:16:48 +01:00
66137344fe Use AM_PATH_PYTHON and python-config to detect Python configuration
Using AM_PATH_PYTHON solves the site-packages directory problem. At least
in Ubuntu with Python 2.6 and later site-packages is renamed to dist-packages
and site-packages is not part of sys.path anymore. So installing the libvirt
Python bindings to site-packages renders them unusable, because they can be
imported from there without manually including site-packages into sys.path.

AM_PATH_PYTHON detects the correct site-packages/dist-packages directory.

python-config --includes gives the correct include path for the Python header
files. The old probing code stays there as fallback mechanism.

* configure.in: use AM_PATH_PYTHON and python-config
* python/Makefile.am: remove -I because PYTHON_INCLUDES contains it now
2009-12-08 23:40:20 +01:00
10616d7a1e Add missing commas to the 0.7.4 news section 2009-12-08 23:39:12 +01:00
5362edd442 Change generated HTML to UTF-8 encoding
* docs/ChangeLog.xsl docs/newapi.xsl docs/site.xsl: change all
  stylesheets to output UTF-8 HTML instead of ISO Latin 1 which was
  breaking on some people names.
2009-12-08 16:09:33 +01:00
2b2dae816d Avoid an type-punned pointer aliasing pbm
Fix this warning, there is no need to use an intermediate,
different array pointer.
network.c: In function 'getIPv6Addr':
network.c:50: warning: dereferencing type-punned pointer will break strict-aliasing rules
* src/util/network.c: avoid an intermediary pointer cast
2009-12-08 15:01:57 +01:00
421d995005 Hook up JSON monitor to emit basic lifecycle events
* src/qemu/qemu_monitor_json.c: Hook up reset, shutdown,
  poweroff and stop events
2009-12-08 13:46:55 +00:00
89832303d7 Add QEMU monitor callbacks for basic lifecycle events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add callbacks
  for reset, shutdown, poweroff and stop events. Add convenience
  methods for emiting those events
2009-12-08 13:46:55 +00:00
e9f4c94301 Switch over to passing a callback table to QEMU monitor
With addition of events there will be alot of callbacks.
To avoid having to add many APIs to register callbacks,
provide them all at once in a big table

* src/qemu/qemu_driver.c: Pass in a callback table to QEMU
  monitor code
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h Replace
  the EOF and disk secret callbacks with a callback table
2009-12-08 13:46:55 +00:00
3a4f172fdd Support for JSON mode monitor
Initial support for the new QEMU monitor protocol  using JSON
as the data encoding format instead of plain text

* po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
  mode. Replace with a version number check on >= 0.12 later
* src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
  impl of QMP protocol
* src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
2009-12-08 13:46:54 +00:00
c5358c0e1f Introduce callbacks for serializing domain object private data to XML
Now that drivers are using a private domain object state blob,
the virDomainObjFormat/Parse methods are no longer able to
directly serialize all neccessary state to/from XML. It is
thus neccessary to introduce a pair of callbacks fo serializing
private state.

The code for serializing vCPU PIDs and the monitor device
config can now move out of domain_conf.c and into the
qemu_driver.c where they belong.

* src/conf/capabilities.h: Add callbacks for serializing private
  state to/from XML
* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
  monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
  fields from virDomainObjPtr. Remove code that serialized
  those fields
* src/libvirt_private.syms: Export virXPathBoolean
* src/qemu/qemu_driver.c: Add callbacks for serializing monitor
  and vcpupid data to/from XML
* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
  char device config into qemuMonitorOpen directly.
2009-12-08 13:46:54 +00:00
e4b07fd6a5 Switch LXC driver to use a private data blob for virDomainObj state
* src/lxc/lxc_driver.c: Introduce lxcDomainObjPrivate for storing
  monitor device state
2009-12-08 13:46:54 +00:00
f248c965ce Switch UML driver to use a private data blob for virDomainObj state
* src/uml/uml_driver.c: Introduce umlDomainObjPrivateData for storing
  monitor device state. Remove unneccessary VIR_FREE on vcpupids
2009-12-08 13:46:53 +00:00
5697aa848b Pull code to start CPUs executing out of qemudInitCpuAffinity()
The code to start CPUs executing has nothing todo with CPU
affinity masks, so pull it out of the qemudInitCpuAffinity()
method and up into qemudStartVMDaemon()

* src/qemu/qemu_driver.c: Pull code to start CPUs executing out
  of qemudInitCpuAffinity()
2009-12-08 13:46:53 +00:00
8c12b20c61 Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it
The current QEMU disk media change does not support setting the
disk format. The new JSON monitor will support this, so add an
extra parameter to pass this info in

* src/qemu/qemu_driver.c: Pass in disk format when changing media
* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
  Add a 'format' arg to qemuMonitorChangeMedia()
2009-12-08 13:46:53 +00:00
3fa3cff73c Fix migration cancellation for QEMU
* src/qemu/qemu_monitor_text.c: Add missing underscore in the
  migrate_cancel monitor command impl
2009-12-08 13:46:53 +00:00
fa1e4759db Move qemuMonitorEscape + migrate status enum into shared monitor code
The qemuMonitorEscape() method, and the VIR_ENUM for migration
status will be needed by the JSON monitor too, so move that code
into the shared qemu_monitor.c file instead of qemu_monitor_text.c

* src/qemu/qemu_monitor.h: Declare qemuMonitorMigrationStatus enum
  and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
* src/qemu/qemu_monitor.c: Implement qemuMonitorMigrationStatus enum
  and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
* src/qemu/qemu_monitor_text.c: Remove above methods/enum
2009-12-08 13:46:53 +00:00
79533da1b3 Fix crash when deleting monitor while a command is in progress
If QEMU shuts down while we're in the middle of processing a
monitor command, the monitor will be freed, and upon cleaning
up we attempt to do  qemuMonitorUnlock(priv->mon) when priv->mon
is NULL.

To address this we introduce proper reference counting into
the qemuMonitorPtr object, and hold an extra reference whenever
executing a command.

* src/qemu/qemu_driver.c: Hold a reference on the monitor while
  executing commands, and only NULL-ify the priv->mon field when
  the last reference is released
* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add reference
  counting to handle safe deletion of monitor objects
2009-12-08 13:46:48 +00:00
1f60411686 udev_device_get_devpath might return NULL
Fix crash on strdup in that case.
2009-12-08 12:01:27 +01:00
a4e09c1ed8 Fix a compilation failure if yajl not avail
configure:     yajl: no
CC     libvirt_util_la-json.lo
util/json.c:32:27: error: yajl/yajl_gen.h: No such file or directory
util/json.c:33:29: error: yajl/yajl_parse.h: No such file or directory

* src/util/json.c: remove the includes if yajl not configured in
2009-12-08 11:08:17 +01:00
1449392dce Fix compilation for configure --disable-nls 2009-12-07 22:52:55 +01:00
74c1c534a9 vbox: Update IIDs from version 3.1-beta2 to 3.1-final
This solves the 'nsIEventQueue object is null' error when trying
to connect to a VirtualBox 3.1 hypervisor instance.
2009-12-07 22:46:50 +01:00
0a4283cb94 Fix ReprotError vs ReportError typo in JSON code
* src/util/json.c: Fix ReprotError typo when YAJL is not available
2009-12-07 17:01:33 +00:00
6e547d54e5 Fix inverted conditional test in configure.ac check for yajl
* configure.in: Fix inverted conditional test when yajl is not
  found
2009-12-07 16:51:14 +00:00
9428f2ced6 Introduce a simple API for handling JSON data
This introduces simple API for handling JSON data. There is
an internal data structure 'virJSONValuePtr' which stores a
arbitrary nested JSON value (number, string, array, object,
nul, etc).  There are APIs for constructing/querying objects
and APIs for parsing/formatting string formatted JSON data.

This uses the YAJL library for parsing/formatting from

 http://lloyd.github.com/yajl/

* src/util/json.h, src/util/json.c: Data structures and APIs
  for representing JSON data, and parsing/formatting it
* configure.in: Add check for yajl library
* libvirt.spec.in: Add build requires for yajl
* src/Makefile.am: Add json.c/h
* src/libvirt_private.syms: Export JSON symbols to drivers
2009-12-07 14:14:36 +00:00
563dc5654c Add --system flag to autogen.sh to make it easy to build with right prefix
Add a --system flag to autogen.sh which gets turned into the args
--prefix=/usr --sysconfdir=/etc --localstatedir=/var to make it
easy to build with settings that match an RPM build

* autogen.sh: Add --system flag
2009-12-07 14:13:53 +00:00
e7ef4ed1d2 Export all symbols from xml.h for internal use
Some of the very useful calls for XML parsing provided by util/xml.[ch]
were not exported as private symbols. This patch fixes this.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2009-12-04 21:52:08 +01:00
03fa46886a vbox: Use virIndexToDiskName() in vboxGenerateMediumName() 2009-12-04 17:08:28 +01:00
81ea6e4d9f Tests for interface type/model configuration
add a set of tests for Xen interface type and model configurations
2009-12-04 17:01:34 +01:00
dddad4bcb4 Support for interface model='netfront'
Xen HVM guests with PV drivers end up with two network interfaces for
each configured interface. One of them being emulated by qemu and the
other one paravirtual. As this might not be desirable, the attached
patch provides a way for users to specify that only paravirtual network
interface should be presented to the guest.

The configuration was inspired by qemu/kvm driver, for which users can
specify model='virtio' to use paravirtual network interface.

The patch adds support for model='netfront' which results in
type=netfront instead of type=ioemu (or nothing for newer xen versions)
in guests native configuration. Xen's qemu ignores interfaces with
type != ioemu and only paravirtual network device will be seen in the
guest.

Four possible configuration scenarios follow:

- no model specified in domain's XML
    - libvirt will behave like before this change; it will set
      type=ioemu for HVM guests on xen host which is not newer than
      XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
    - covered by existing tests

- PV guest, any model
    - no functional change, model is passed as is (and ignored by the
      hypervisor)
    - covered by existing tests (e.g., *-net-e1000.*)
- HVM guest, model=netfront
    - type is set to "netfront", model is not specified
    - covered by new *-net-netfront.* tests

- HVM guest, model != netfront
    - type is set to "ioemu", model is passed as is
    - covered by new *-net-ioemu.* tests

The fourth scenario feels like a regression for xen newer than
XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU as users who had a model specified
in their guest's configuration won't see a paravirtual interface in
their guests any more. On the other hand, the reason for specifying a
model is most likely the fact that they want to use such model which
implies emulated interface. Users of older xen won't be affected at all
as their xen provides paravirtual interface regardless of the type used.

- src/xen/xend_internal.c: add netfront support for the xend backend
- src/xen/xm_internal.c: add netfront support for the XM serialization too
2009-12-04 16:55:59 +01:00
834d65471d vbox: Add support for version 3.1
Also fixed serial port configuration which was broken due to recent
change in virDomainChrDef where targetType was newly added.

* src/Makefile.am: add new files
* src/vbox/vbox_driver.c: add case for version 3.1
* src/vbox/vbox_tmpl.c: refactor common patterns into macros, support for
  version 3.1, serial port configuration fix
* src/vbox/vbox_CAPI_v3_1.h, src/vbox/vbox_V3_1.c: generated code
2009-12-04 14:49:45 +01:00
63166a4e0c Add virIndexToDiskName and fix mapping gap
esxVMX_IndexToDiskName handles indices up to 701. This limit comes
from a mapping gap in virDiskNameToIndex:

  sdzy -> 700
  sdzz -> 701
  sdaaa -> 728
  sdaab -> 729

This line in virDiskNameToIndex causes this gap:

  idx = (idx + i) * 26;

Fixing it by altering this line to:

  idx = (idx + (i < 1 ? 0 : 1)) * 26;

Also add a new version of virIndexToDiskName that handles the inverse
mapping for arbitrary indices.

* src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName
* src/util/util.[ch]: add virIndexToDiskName and fix mapping gap
* tests/esxutilstest.c: update test to verify that the gap is fixed
2009-12-03 18:07:49 +01:00
7a18fbeeb8 Fix some locking issues
* src/conf/domain_conf.c: don't call virDomainObjUnlock twice
* src/qemu/qemu_driver.c: relock driver lock if an error occurs in
  qemuDomainObjBeginJobWithDriver, enter/exit monitor with driver
  in qemudDomainSave
2009-12-03 17:06:38 +01:00
816d79143b Fix missing background color 2009-12-03 15:27:24 +01:00
32f021f266 Fix event test timer checks on kernels with HZ=100
On kernels with HZ=100, the resolution of sleeps in poll() is
quite bad. Doing a precise check on the expiry time vs the
current time will thus often thing the timer has not expired
even though we're within 10ms of the expected expiry time. This
then causes another pointless sleep in poll() for <10ms. Timers
do not need to have such precise expiration, so we treat a timer
as expired if it is within 20ms of the expected expiry time. This
also fixes the eventtest.c test suite on kernels with HZ=100

* daemon/event.c: Add 20ms fuzz when checking for timer expiry
2009-12-02 11:53:42 +00:00
e15bf04465 Fix typo in QEMU driver webpage
* docs/drvqemu.html.in: Fix typo describing URI driver protocol
2009-11-30 15:21:21 +00:00
fe9c8d9147 Add another SENTINEL attribute
* src/xen/xend_internal.c (xend_op): Add ATTRIBUTE_SENTINEL.
2009-11-30 10:49:05 +01:00
43d0ba5f95 Clarify documentation for private symbols
The instruction "See Makefile.am" in libvirt.private_syms
always makes me think that this file is autogenerated
and should not be touched manually. This patch spares
every reader of libvirt.private_syms the hassle of
reading Makefile.am before augmenting libvirt.private_syms.

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2009-11-26 18:52:03 +00:00
4060131927 Fix help message
The configuration file setting is overriden by -f or --config, but
not with -c

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
2009-11-26 18:51:51 +00:00
bb8d57c68a Fix threading problems in python bindings
* libvirt-override.c: Add many missing calls to allow threading
  when entering C code, otherwise python blocks & then deadlocks
  when we have an async event to dispatch back into python code.
  Fix return value check for virDomainPinVcpu binding.
2009-11-26 12:07:41 +00:00
7ed63c5312 Supress annoying libcap-ng errors from valgrind
* tests/.valgrind.supp: Ignore capng problems
2009-11-26 12:07:17 +00:00
874990dc2c Fix two leaks in test driver
* src/test/test_driver.c: Fix leak of vcpu info, and nodedevice
  info
2009-11-26 12:07:17 +00:00
db810b1148 Free cgroup device ACL list on driver shutdown
* src/qemu/qemu_driver.c: Free cgroup ACLs
2009-11-26 12:07:17 +00:00
7cfbb17978 xen: Fix unconditional freeing in xenDaemonListDefinedDomains()
Commit 790f0b3057 causes the contents of
the names array to be freed even on success, resulting in no listing of
defined but inactive Xen domains.

Spotted by Jim Fehlig
2009-11-26 00:09:40 +01:00
8f147d16f1 Fix default disk type when parsing QEMU argv
* src/qemu/qemu_conf.c: Fix default disk type to be 'FILE'
  again, after previous commit accidentally changed it
2009-11-24 10:59:05 +00:00
fb7cebb767 remove port filter when network device is detached
* src/qemu/qemu_driver.c: remove the port filter if the network device
  is detached via virDomainDetachDevice.
2009-11-24 11:25:16 +01:00
e7c78b0a94 Support QEMU's virtual FAT block device driver
Introduce a new type="dir"  mode for <disks> that allows use of
QEMU's  virtual FAT block device driver. eg

    <disk type='dir' device='floppy'>
      <source dir='/tmp/test'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>

gets turned into

  -drive file=fat:floppy:/tmp/test,if=floppy,index=0

Only read-only disks are supported with virtual FAT mode

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add type="dir"
* docs/schemas/domain.rng: Document new disk type
* src/xen/xend_internal.c, src/xen/xm_internal.c: Raise error for
  unsupported disk types
* tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Fix
  empty disk file handling
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.args,
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml,
  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args,
  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
  tests/qemuxml2argvtest.c: Test QEMU vitual FAT driver
* src/qemu/qemu_conf.c: Support generating fat:/some/dir type
  disk args
* src/security/security_selinux.c: Temporarily skip labelling
  of directory based disks
2009-11-23 12:17:16 +00:00
a73cd93b24 Alternate CPU affinity impl to cope with NR_CPUS > 1024
The cpu_set_t type can only cope with NR_CPUS <= 1024, beyond this
it is neccessary to use alternate CPU_SET maps with a dynamically
allocated CPU map

* src/util/processinfo.c: Support new unlimited size CPU set type
2009-11-23 11:58:13 +00:00
37f415da42 Pull schedular affinity code out into a separate module
* src/Makefile.am: Add processinfo.h/processinfo.c
* src/util/processinfo.c, src/util/processinfo.h: Module providing
  APIs for getting/setting process CPU affinity
* src/qemu/qemu_driver.c: Switch over to new APIs for schedular
  affinity
* src/libvirt_private.syms: Export virProcessInfoSetAffinity
  and virProcessInfoGetAffinity to internal drivers
2009-11-23 11:58:13 +00:00
af10d9baa8 Ignore docs/ directory for strcmp() syntax check
* .x-sc_prohibit_strcmp_and_strncmp: Ignore docs/
2009-11-23 11:58:13 +00:00
79d2c5831a Fix news.html validation 2009-11-22 20:08:54 +01:00
040e80f7e6 Release of libvirt-0.7.4
0.7.3 was broken

* configure.in docs/news.html.in: release of 0.7.4
* configure.in libvirt.spec.in: require netcf >= 0.1.4
* src/Makefile.am: node_device/node_device_udev.h was missing from
  NODE_DEVICE_DRIVER_UDEV_SOURCES breaking compilation on platforms with
  udev
2009-11-20 19:43:59 +01:00
b8d4b6bec9 Release of libvirt-0.7.3
* configure.in docs/news.html.in libvirt.spec.in: describe new release
* po/*.po*: regenerate
2009-11-20 17:31:13 +01:00
4811fab790 Enable udev instead of hal on F12 / RHEL-6 or later
HAL has been deprecated since F12 and RHEL-6, so if building on
these platforms, switch on the udev driver instead

* libvirt.spec.in: Activate udev on F12/RHEL6
2009-11-20 16:45:46 +01:00
eb81396863 Document overriding domain interface target
* docs/formatdomain.html.in: document that vnet and vif are reserved
  names and will be ignored if manually specified.
2009-11-20 16:25:58 +01:00
c7e1cfc9f4 python: Actually implement list*Interfaces bindings
* python/generator.py python/libvirt-override-api.xml
  python/libvirt-override.c: implement the bindings for
  virConnectListInterfaces() and virConnectListDefinedInterfaces()
2009-11-20 16:22:42 +01:00
7d43c80bc4 514532 Fix man page, most operation are synchronous
* tools/virsh.pod: the man page was stating that most operations
  are asynchronous while in fact most of them are synchronous except
  domain shutdown, setvcpus and setmem.
2009-11-20 16:09:36 +01:00
776b675861 504262 Check for duplicated UUID in XM Xen defines
* src/xen/xm_internal.c: the XM driver was not checking for previously
  defined UUID on new defines. Similar to virDomainObjIsDuplicate()
  behaviour.
2009-11-20 16:02:17 +01:00
2060a0a43e 512069 fix domain XML schemas for backward compatibility
For backward compatibility we used to add the tty path as
a tty attribute on console of type pty, duplicating the value
now found in source/@path, but the Relax-NG grammar wasn't
extended for this
    <console type='pty' tty='/dev/pts/8'>
      <source path='/dev/pts/8'/>
      <target port='0'/>
    </console>

* docs/schemas/domain.rng: allow an optional tty attribute
  containing a devicePath
2009-11-20 15:48:19 +01:00
b827338a72 qemu-kvm needs -enable-kvm flag for VT optimization
Recent qemu releases require command option '-enable-qemu' in order
for the kvm functionality be activated. Libvirt needs to pass this flag
to qemu when starting a domain. Note that without the option,
even if both the kernel and qemu support KVM, KVM will not be activated
and VMs will be very slow.

* src/qemu/qemu_conf.h src/qemu/qemu_conf.c: parse the extra command
  line option from help and add it when running kvm
* tests/qemuhelptest.c: this modified the flags output for qemu-0.10.5
  and qemu-kvm-0.11.0-rc2 regression tests
2009-11-20 15:41:05 +01:00
264f3ddac9 fix deprecated iptables command syntax
* src/util/iptables.c: `--option !  this` is deprecated in favor of
  `! --option this` syntax, change the output command accordingly
2009-11-20 15:29:59 +01:00
2cdb665b10 remove sysfs_path and parent_sysfs_path from XML
Erroneously included the sysfs_path and parent_sysfs_path elements in
the node device xml, they were not supposed to show up there

* src/conf/node_device_conf.c: remove the output of the 2 fields
2009-11-19 16:05:17 +01:00
f2f656d426 Removing devicePath member from dev struct
I realized that I inadvertently added a member to the def struct to
contain each device's sysfs path when there was an existing member in the
dev struct for "OS specific path to device metadat, eg sysfs"  Since the
udev backend needs to record the sysfs path while it's in the process of
creating the device, before the dev struct gets allocated, I chose to
remove the member from the dev struct.

* src/conf/node_device_conf.c src/conf/node_device_conf.h
  src/node_device/node_device_driver.c src/node_device/node_device_hal.c
  src/node_device/node_device_udev.c: remove devicePath from the
  structure and use def->sysfs_path instead
2009-11-19 16:02:18 +01:00
0fe553744a report OOM in two places in node_device_driver.c
* src/node_device/node_device_driver.c: two places where not calling
  virReportOOMError after strdup failure
2009-11-19 15:44:00 +01:00
278e947890 Ensure driver lock is released when entering QEMU monitor
The qemudStartVMDaemon() and several functions it calls use
the QEMU monitor. The QEMU driver is locked while this function
is executing, so it is rquired to release the driver lock and
reacquire it either side of issuing a monitor command. It
failed todo so, leading to deadlock

* qemu/qemu_driver.c: Release driver when in qemudStartVMDaemon
  and things it calls
2009-11-18 17:04:33 +00:00
bbf20165cc Updated localization and regenerated the pos
updated el.po es.po or.po pl.po ta.po te.po
ran make update-po
2009-11-17 12:24:42 +01:00
046039124d Fix typo in error message 2009-11-17 12:18:39 +01:00
afec7cf1ff Whitespace cleanup for pre-tags on the website 2009-11-16 22:42:13 +01:00
448b92c05e Fix type in configure output summary
* configure.in: Fix typo in PCIACCESS_LIBS
2009-11-16 16:54:53 +00:00
ecb0221a5f Remove a compilation warning on uninitialized var 2009-11-16 17:35:06 +01:00
91f9157e5b only remove masquerade roles for VIR_NETWORK_FORWARD_NAT
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549949
2009-11-16 13:32:00 +01:00
d42cfb4ef0 esx: Fix CPU clock Hz to MHz conversion 2009-11-15 15:22:14 +01:00
03a155a25b esx: Fix memory leak in esxVI_HostCpuIdInfo_Free() 2009-11-15 15:22:07 +01:00
645f4acafe esx: Fix MAC address formatting
VMware uses two MAC address prefixes: 00:0c:29 and 00:50:56. The 00:0c:29
prefix is used for ESX server generated addresses. The 00:50:56 prefix is
split into two parts. MAC addresses above 00:50:56:3f:ff:ff are generated
by a vCenter. The rest of the 00:50:56 prefix can be assigned manually.
Any MAC address within the 00:0c:29 and 00:50:56 prefix can be specified
in a domain XML config and the driver will handle the details internally.

* src/esx/esx_vmx.c: fix MAC address formatting
* tests/xml2vmxdata/*: update test files accordingly
2009-11-15 15:22:01 +01:00
4b3e19526c esx: Handle 'vmxnet3' in esxVMX_FormatEthernet()
In commit 3c80fac258 'vmxnet3' handling
was added to esxVMX_ParseEthernet(), but not to the inverse function
esxVMX_FormatEthernet().
2009-11-15 15:21:48 +01:00
57dbe08e74 esx: Add documentation to the website
* docs/drivers.html.in: list the ESX driver
* docs/drvesx.html.in: the new ESX driver documentation
* docs/hvsupport.html.in: add the ESX driver to the matrix
* docs/index.html.in, docs/sitemap.html.in: list the ESX driver
* src/esx/esx_driver.c: fix and cleanup some comments
2009-11-15 15:21:13 +01:00
dad6ecc6bf Change DTD references to use public instead of system identifier
Debian's /etc/xml/catalog doesn't contain system identifiers, so use
public identifiers instead.

* docs/Makefile.am: use public instead of system identifier
* docs/site.xsl: use matching public identifier
2009-11-15 15:13:03 +01:00
8d567fbcd3 Fix compilation of libvirt against xen-unstable
* src/xen/xen_hypervisor.c: xen-unstable changeset 19788 removed
  MAX_VIRT_CPUS from public headers, breaking compilation of libvirt
  on -unstable.  Its semanitc was retained with XEN_LEGACY_MAX_VCPUS.
  Ensure MAX_VIRT_CPUS is defined accordingly.
2009-11-15 09:40:36 +01:00
8c4d80d72e Fix probing for libpciaccess
If 'with_udev=check' then missing pciaccess should not be a fatal
error. It should merely disable the udev driver.

* configure.in: Fix pciaccess check to be non-fatal
2009-11-13 15:10:55 +00:00
c15a64b9b4 Remove obsolte devicekit checks
Device kit support was removed, but the configure.ac checks were
left in place. A number of the XXX_REQUIRED=X.Y.Z variables were
not declared in the correct location (ie top of the file)

* configure.in: Remove device kit checks & move mis-placed variables
  to correct location
2009-11-13 15:10:55 +00:00
5313dc372b Fix incorrect reference counting logic in qemu monitor open
The QEMU monitor open method would not take a reference on
the virDomainObjPtr until it had successfully opened the
monitor. The cleanup code upon failure to open though would
call qemuMonitorClose() which would in turn decrement the
reference count. This caused the virDoaminObjPtr to be mistakenly
freed and then the whole driver crashes

* src/qemu/qemu_monitor.c: Fix reference counting in
  qemuMonitorOpen
2009-11-13 15:10:55 +00:00
7bed630dfb Don't return fatal error in HAL driver init if HAL isn't running
The HAL driver returns a fatal error code in the case where HAL
is not running. This causes the entire libvirtd daemon to quit
which isn't desirable. Instead it should simply disable the HAL
driver

* src/node_device/node_device_hal.c: Quietly disable HAL if it is
  not running
2009-11-13 15:10:55 +00:00
4be6e024c7 Fix cleanup when state driver init fails
* daemon/libvirtd.c: Fix incorrect goto label causing cleanup to
  be missed when state driver init fails
2009-11-13 15:10:54 +00:00
da82b03fb0 Small guestfwd code cleanup
* src/qemu/qemu_conf.c: Remove and inline qemudBuildCommandLineChrDevTargetStr
2009-11-13 16:05:27 +01:00
ddfd21f815 Small indentation cleanup of domain schema 2009-11-13 16:03:43 +01:00
3cbc05012d AppArmor code cleanups
* src/security/security_apparmor.c: a few code cleanups following a
  review on the list
2009-11-13 15:32:55 +01:00
d0d4b8ad76 AppArmor handling of accesses to readonly files
Fixes https://launchpad.net/bugs/453335

* src/security/virt-aa-helper.c: suppress confusing and misleading
  apparmor denied message when kvm/qemu tries to open a libvirt specified
  readonly file (such as a cdrom) with write permissions. libvirt uses
  the readonly attribute for the security driver only, and has no way
  of telling kvm/qemu that the device should be opened readonly
2009-11-13 15:32:55 +01:00
dae7054b76 AppArmor require absolute paths
Fixes https://launchpad.net/bugs/460271

* src/security/virt-aa-helper.c: require absolute path for dynamic added
  files. This is required by AppArmor and conveniently prevents adding
  tcp consoles to the profile
2009-11-13 15:32:55 +01:00
a8a560dd3a AppArmor updates of examples
* examples/apparmor/libvirt-qemu: adds pulseaudio, alsa and preliminary
  save/restore to the example apparmor abstraction
* examples/apparmor/usr.sbin.libvirtd: allows libvirtd access to inet
  dgram, inet6 dgram, inet6 stream and /usr/lib/libvirt/*
2009-11-13 15:32:55 +01:00
c7a8e1bf74 Check that domain is running when starting console
The 'virsh console' command did not check if the domain was
already running before attempting to fetch the XML and extract
the console PTY path. This caused a slightly unhelpful / misleading
error message for the user. The explicit check ensures the user
gets an explicit 'domain is not running' message.

* tools/virsh.c: Validate that state != VIR_DOMAIN_SHUTOFF in
  virsh console command
2009-11-13 11:50:16 +00:00
007f016b2d Fix incorrect variable passed to LXC event callback
The wrong variable was being passed in with the LXC event callback
resulting in a later deadlock or crash

* src/lxc/lxc_driver.c: Pass 'vm' instead of 'driver' to event
  callback
2009-11-13 11:50:14 +00:00
d11d93f406 Fix check for existance of cgroups at creation
In the scenario where the cgroups were mounted but the
particular group did not exist, and the caller had not
requested auto-creation, the code would fail to return
an error condition. This caused the lxc_controller to
think the cgroup existed, and it then later failed when
attempting to use it

* src/util/cgroup.c: Raise an error if the cgroup path does not
  exist
2009-11-13 11:50:12 +00:00
fd2090cdb9 Fix race condition in HAL driver startup
There is a race condition in HAL driver startup where the callback
can get triggered before we have finished startup. This then causes
a deadlock in the driver.

* src/node_device/node_device_hal.c: RElease driver lock before
  registering DBus callbacks
2009-11-13 11:50:10 +00:00
f24e67d24f Fix formatting of XML for an inactive guest
If the virDomainDefPtr object has an 'id' of -1, then forcably
set the VIR_DOMAIN_XML_INACTIVE flag to ensure generated XML
does not include any cruft from the previously running guest
such as console PTY path, or VNC port.

* src/conf/domain_conf.c: Set VIR_DOMAIN_XML_INACTIVE if
  def->id is -1. Replace checks for def->id == -1 with
  check against flags & VIR_DOMAIN_XML_INACTIVE.
2009-11-13 11:50:08 +00:00
e6cbadd588 Remove capng_lock() call when spawning LXC container init process
The capng_lock() call sets the SECURE_NO_SETUID_FIXUP and SECURE_NOROOT
bits on the process. This prevents the kernel granting capabilities to
processes with an effective UID of 0, or with setuid programs. This is
not actually what we want in the container init process. It should be
allowed to run setuid processes & keep capabilities when root. All that
is required is masking a handful of dangerous capabilities from the
bounding set.

* src/lxc/lxc_container.c: Remove bogus capng_lock() call.
2009-11-13 11:50:05 +00:00
ce62916b6e Fix initscript to check daemon pidfile
The libvirtd initscript could get confused between the system and
session instances of the daemon. To avoid this it is neccessary
to check the pidfile explicitly.

* daemon/libvirtd.init.in: Always check the pidfile of the system
  daemon to avoid confusion with the session daemons
2009-11-13 10:37:11 +00:00
308b85330a Fix virt-aa-helper when host and os.type arch differ
* src/security/virt-aa-helper.c: get_definition() now calls the new
  caps_mockup() function which will parse the XML for os.type,
  os.type.arch and then sets the wordsize.  These attributes are needed
  only to get a valid virCapsPtr for virDomainDefParseString(). The -H
  and -b options are now removed from virt-aa-helper (they weren't used
  yet anyway).
* tests/virt-aa-helper-test: extend and fixes tests, chmod'ed 755
2009-11-13 11:04:23 +01:00
7023663873 Add translation of PCI vendor and product IDs
uses libpciaccess to provide human readable names for PCI vendor and
device IDs
* configure.in: add a requirement for libpciaccess >= 0.10.0
* src/Makefile.am: add the associated compilation flags and link
* src/node_device/node_device_udev.c: lookup the libpciaccess for
  vendor name and product name based on their ids
2009-11-12 23:22:00 +01:00
e99fb5ed9d Remove DevKit node device backend
* configure.in src/Makefile.am: remove the configuration check and
  build instructions
* src/node_device/node_device_devkit.c: removed the module
* src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
  removed references to the old backend
2009-11-12 23:09:24 +01:00
db19834a0a Add scsi_target device type
* src/conf/node_device_conf.h src/conf/node_device_conf.c: add specific
  support for SCSI target in node device capabilities
* src/node_device/node_device_udev.c: add some extra detection code
  when handling udev output
2009-11-12 23:03:47 +01:00
3ad6dcf3dc Implement a node device backend using libudev
* configure.in: add new --with-udev, disabled by default, and requiring
  libudev > 145
* src/node_device/node_device_udev.c src/node_device/node_device_udev.h:
  the new node device backend
* src/node_device/node_device_linux_sysfs.c: moved node_device_hal_linux.c
  to a better file name
* src/conf/node_device_conf.c src/conf/node_device_conf.h: add a couple
  of fields in node device definitions, and an API to look them up,
  remove a couple of unused fields from previous patch.
* src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
  plug the new driver
* po/POTFILES.in src/Makefile.am src/libvirt_private.syms: add the new
  files and symbols
* src/util/util.h src/util/util.c: add a new convenience macro
  virBuildPath and virBuildPathInternal() function
2009-11-12 22:48:24 +01:00
fe2af45bb2 Add several fields to node device capabilities
* src/conf/node_device_conf.h src/conf/node_device_conf.c: add the new
  fields in the structure as well as parsing and serialization
2009-11-12 22:39:40 +01:00
ce4c0bf5a2 Add virConnectGetLibvirtVersion API
There is currently no way to determine the libvirt version of a remote
libvirtd we are connected to. This is a useful piece of data to enable
feature detection.
2009-11-12 10:53:26 -05:00
632be33689 Implement finer grained migration control for Xen
* src/xen/xen_driver.c: Add support for VIR_MIGRATE_PERSIST_DEST flag
* src/xen/xend_internal.c: Add support for VIR_MIGRATE_UNDEFINE_SOURCE flag
* include/libvirt/virterror.h, src/util/virterror.c: Add new errorcode
  VIR_ERR_MIGRATE_PERSIST_FAILED
2009-11-12 16:04:43 +01:00
2e23607448 Support for SATA Disks in virDomainDiskBus
* src/conf/domain_conf.h src/conf/domain_conf.c: add the new entry in
  the enum and lists of virDomainDiskBus
* src/qemu/qemu_conf.c: same for virDomainDiskQEMUBus
2009-11-12 15:45:18 +01:00
e51cf5c192 LXC implement missing DomainInterfaceStats API
* src/lxc/lxc_driver.c: add lxcDomainInterfaceStats implementing
  virDomainInterfaceStats()
2009-11-12 14:55:44 +01:00
7c34bb2681 Filter out stale domains from xenstore listing
The xenstore database sometimes has stale domain IDs which are not
present in the hypervisor anymore. Filter these out to avoid causing
confusion

* src/xen/xs_internal.c: Filter domain IDs against HV's list
* src/xen/xen_hypervisor.h, src/xen/xen_hypervisor.c: Add new
  xenHypervisorHasDomain() method for checking ID validity
2009-11-12 11:53:54 +00:00
2659b3f5aa Fix logic in xenUnifiedNumOfDomains to match xenUnifiedListDomains
The xenUnifiedNumOfDomains and xenUnifiedListDomains methods work
together as a pair, so it is critical they both apply the same
logic. With the current mis-matched logic it is possible to sometimes
get into a state when you miss certain active guests.

* src/xen/xen_driver.c: Change xenUnifiedNumOfDomains ordering to
  match xenUnifiedListDomains.
2009-11-12 11:53:54 +00:00
730fd3b022 Disable IPv6 socket auto-binding to IPv4 socket
Sometimes getaddrinfo returns IPv4 addresses before IPv6 addresses.
IPv6 sockets default to attempting to bind to IPv4 addresses too.
So if the IPv4 address is activated first, then binding to IPv6
will unneccessarily fail.

* daemon/libvirtd.c: Bind to IPv6 and IPv4 addresses separately
2009-11-12 11:17:39 +00:00
3c3dffc285 Exclude numactl on s390[x]
The numactl package is not applicable for s390[x] arches, so do
not enable it as a build dep.

* libvirt.spec.in: Exclude numactl on s390[x]
2009-11-12 11:17:29 +00:00
45e0483dac Fix error handling in qemuMonitorOpen
* src/qemu/qemu_monitor.c: add error check for qemuMonitorOpenXXX
  returned file descriptor
2009-11-12 11:33:30 +01:00
bc0010b3d1 Fix save and restore with non-privileged guests and SELinux
When running qemu:///system instance, libvirtd runs as root,
but QEMU may optionally be configured to run non-root. When
then saving a guest to a state file, the file is initially
created as root, and thus QEMU cannot write to it. It is also
missing labelling required to allow access via SELinux.

* src/qemu/qemu_driver.c: Set ownership on save image before
  running migrate command in virDomainSave impl. Call out to
  security driver to set save image labelling
* src/security/security_driver.h: Add driver APIs for setting
  and restoring saved state file labelling
* src/security/security_selinux.c: Implement saved state file
  labelling for SELinux
2009-11-11 15:24:32 +00:00
fedad93d9e disable mac_filter config switch by default
* src/qemu/qemu.conf:  disables the mac_filter config switch by default
  to match existing convention, also document the option
2009-11-11 13:02:57 +01:00
6008cfc7c0 Prevent initializing ebtables if disabled in qemu.conf
* src/qemu/qemu_conf.c: don't initialize ebtables if
  disabled
2009-11-11 12:59:54 +01:00
4916936751 phyp: too much timeout when polling socket
* src/phyp/phyp_driver.c: a 10s timeout on socket availability was way
  too long, reduced to 1ms
2009-11-11 11:53:16 +01:00
75825e453a Fix warning on make due to missing cast (int)
* src/qemu/qemu_monitor.c src/qemu/qemu_monitor_text.c: cast size_t to
  int when passing to '%d'
2009-11-11 11:30:01 +01:00
a32c43d6fe phyp: Reorder keyboard_interactive label in openSSHSession()
Finish changes intended to be part of commit
6c70802374
2009-11-11 02:49:27 +01:00
cabc2cc98f Implmentation of new APIs to checking state/persistence of objects
This implements the virConnectIsSecure, virConnectIsEncrypted,
virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
virNetworkIsPersistent, virStoragePoolIsActive,
virStoragePoolIsPersistent, virInterfaceIsActive APIs in
(nearly) all drivers. Exceptions are:

 phyp: missing domainIsActive/Persistent
 esx: missing domainIsPersistent
 opennebula: missing domainIsActive/Persistent

* src/remote/remote_protocol.x: Define remote wire ABI for newly
  added APIs.
* daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
  src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
  src/remote/remote_driver.c, src/storage/storage_driver.c,
  src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
  src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
  src/xen/xen_inotify.h: Implement all the new APIs where possible
2009-11-10 17:00:27 +00:00
c04498b305 New APIs for checking some object properties
Introduce a number of new APIs to  expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.

 * virDomainIsActive: Checking virDomainGetID is not reliable
   since it is not possible to distinguish between error condition
   and inactive domain for ID of -1.
 * virDomainIsPersistent: Check whether a persistent config exists
   for the domain

 * virNetworkIsActive: Check whether the network is active
 * virNetworkIsPersistent: Check whether a persistent config exists
   for the network

 * virStoragePoolIsActive: Check whether the storage pool is active
 * virStoragePoolIsPersistent: Check whether a persistent config exists
   for the storage pool

 * virInterfaceIsActive: Check whether the host interface is active

 * virConnectIsSecure: whether the communication channel to the
   hypervisor is secure
 * virConnectIsEncrypted: whether any network based commnunication
   channels are encrypted

NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.

 * include/libvirt/libvirt.h.in: Define public API
 * src/driver.h: Define internal driver API
 * src/libvirt.c: Implement public API entry point
 * src/libvirt_public.syms: Export API symbols
 * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
   src/interface/netcf_driver.c, src/network/bridge_driver.c,
   src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
   src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
   src/remote/remote_driver.c, src/test/test_driver.c,
   src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
   src/xen/xen_driver.c: Stub out driver tables
2009-11-10 17:00:26 +00:00
117aa0d874 Various fixes following a code review part 2
* daemon/libvirtd.c tools/virsh.c: Steve Grubb <sgrubb@redhat.com> found
  a few more issues
2009-11-10 17:48:13 +01:00
52147a0452 Various fixes following a code review
* src/libvirt.c src/lxc/lxc_conf.c src/lxc/lxc_container.c
  src/lxc/lxc_controller.c src/node_device/node_device_hal.c
  src/openvz/openvz_conf.c src/qemu/qemu_driver.c
  src/qemu/qemu_monitor_text.c src/remote/remote_driver.c
  src/storage/storage_backend_disk.c src/storage/storage_driver.c
  src/util/logging.c src/xen/sexpr.c src/xen/xend_internal.c
  src/xen/xm_internal.c: Steve Grubb <sgrubb@redhat.com> sent a code
  review and those are the fixes correcting the problems
2009-11-10 17:48:12 +01:00
9b6efcfef1 Allow timeouts waiting for QEMU job lock
Some monitor commands may take a very long time to complete. It is
not desirable to block other incoming API calls forever. With this
change, if an existing API call is holding the job lock, additional
API calls will not wait forever. They will time out after a short
period of time, allowing application to retry later.

* include/libvirt/virterror.h, src/util/virterror.c: Add new
  VIR_ERR_OPERATION_TIMEOUT error code
* src/qemu/qemu_driver.c: Change to a timed condition variable
  wait for acquiring the monitor job lock
2009-11-10 13:27:18 +00:00
f9c56cce79 Release driver and domain lock when running monitor commands
QEMU monitor commands may sleep for a prolonged period of time.
If the virDomainObjPtr or qemu driver lock is held this will
needlessly block execution of many other API calls. it also
prevents asynchronous monitor events from being dispatched
while a monitor command is executing, because deadlock will
ensure.

To resolve this, it is neccessary to release all locks while
executing a monitor command. This change introduces a flag
indicating that a monitor job is active, and a condition
variable to synchronize access to this flag. This ensures that
only a single thread can be making a state change or executing
a monitor command at a time, while still allowing other API
calls to be completed without blocking

* src/qemu/qemu_driver.c: Release driver and domain lock when
  running monitor commands. Re-add locking to disk passphrase
  callback
* src/qemu/THREADS.txt: Document threading rules
2009-11-10 13:27:18 +00:00
1dc10a7b28 Fully asynchronous monitor I/O processing
Change the QEMU monitor file handle watch to poll for both
read & write events, as well as EOF. All I/O to/from the
QEMU monitor FD is now done in the event callback thread.

When the QEMU driver needs to send a command, it puts the
data to be sent into a qemuMonitorMessagePtr object instance,
queues it for dispatch, and then goes to sleep on a condition
variable. The event thread sends all the data, and then waits
for the reply to arrive, putting the response / error data
back into the qemuMonitorMessagePtr and notifying the condition
variable.

There is a temporary hack in the disk passphrase callback to
avoid acquiring the domain lock.  This avoids a deadlock in
the command processing, since the domain lock is still held
when running monitor commands. The next commit will remove
the locking when running commands & thus allow re-introduction
of locking the disk passphrase callback

* src/qemu/qemu_driver.c: Temporarily don't acquire lock in
  disk passphrase callback. To be reverted in next commit
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Remove
  raw I/O functions, and a generic qemuMonitorSend() for
  invoking a command
* src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
  Remove all low level I/O, and use the new qemuMonitorSend()
  API. Provide a qemuMonitorTextIOProcess() method for detecting
  command/reply/prompt boundaries in the monitor data stream
2009-11-10 13:27:18 +00:00
6c70802374 phyp: ssh authentication with public key fixed
Use ssh keyfiles from the current user's home directory instead of trying
to use keyfiles from a hardcoded /home/user directory. Fallback to
username/password authentication if keyfiles are not available or keyfile
authentication failed.
2009-11-10 13:27:15 +01:00
a340f9131a Add reference counting on virDomainObjPtr objects
Add reference counting on the virDomainObjPtr objects. With the
forthcoming asynchronous QEMU monitor, it will be neccessary to
release the lock on virDomainObjPtr while waiting for a monitor
command response. It is neccessary to ensure one thread can't
delete a virDomainObjPtr while another is waiting. By introducing
reference counting threads can make sure objects they are using
are not accidentally deleted while unlocked.

* src/conf/domain_conf.h, src/conf/domain_conf.c: Add
  virDomainObjRef/Unref APIs, remove virDomainObjFree
* src/openvz/openvz_conf.c: replace call to virDomainObjFree
  with virDomainObjUnref
2009-11-10 12:16:53 +00:00
77cfcccfa8 Locking of the qemuMonitorPtr object
In preparation of the monitor I/O process becoming fully asynchronous,
it is neccessary to ensure all access to internals of the qemuMonitorPtr
object is protected by a mutex lock.

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add mutex for locking
  monitor.
* src/qemu/qemu_driver.c: Add locking around all monitor commands
2009-11-10 12:16:44 +00:00
41d8968d43 Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs
Change the QEMU driver to not directly invoke the text mode monitor
APIs. Instead add a generic wrapper layer, which will eventually
invoke either the text or JSON protocol code as needed. Pass an
qemuMonitorPtr object into the monitor APIs instead of virDomainObjPtr
to complete the de-coupling of the monitor impl from virDomainObj
data structures

* src/qemu/qemu_conf.h: Remove qemuDomainObjPrivate definition
* src/qemu/qemu_driver.c: Add qemuDomainObjPrivate definition.
  Pass qemuMonitorPtr into all monitor APIs instead of the
  virDomainObjPtr instance.
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add thin
  wrappers for all qemuMonitorXXX command APIs, calling into
  qemu_monitor_text.c/h
* src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
  Rename qemuMonitor -> qemuMonitorText & update to accept
  qemuMonitorPtr instead of virDomainObjPtr
2009-11-10 12:15:27 +00:00
4604c18f0b Move encryption lookup back into qemu driver file
Decouple the monitor code from the virDomainDefPtr structure
by moving the disk encryption lookup code back into the
qemu_driver.c file. Instead provide a function callback to
the monitor code which can be invoked to retrieve encryption
data as required.

* src/qemu/qemu_driver.c: Add findDomainDiskEncryption,
  and findVolumeQcowPassphrase. Pass address of the method
  findVolumeQcowPassphrase into qemuMonitorOpen()
* src/qemu/qemu_monitor.c: Associate a disk
  encryption function callback with the qemuMonitorPtr
  object.
* src/qemu/qemu_monitor_text.c: Remove findDomainDiskEncryption
  and findVolumeQcowPassphrase.
2009-11-10 12:15:01 +00:00
1cfd5a00eb Make use of private data structure for monitor state
Introduce a new qemuDomainObjPrivate object which is used to store
the private QEMU specific data associated with each virDomainObjPtr
instance. This contains a single member, an instance of the new
qemuMonitorPtr object which encapsulates the QEMU monitor state.
The internals of the latter are private to the qemu_monitor* files,
not to be shown to qemu_driver.c

* src/qemu/qemu_conf.h: Definition of qemuDomainObjPrivate.
* src/qemu/qemu_driver.c: Register a functions for creating
  and freeing qemuDomainObjPrivate instances with the domain
  capabilities. Remove the qemudDispatchVMEvent() watch since
  I/O watches are now handled by the monitor code itself. Pass
  a new qemuHandleMonitorEOF() callback into qemuMonitorOpen
  to allow notification when the monitor quits.
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Introduce
  the 'qemuMonitor' object. Temporarily add new APIs
  qemuMonitorWrite, qemuMonitorRead, qemuMonitorWaitForInput
  to allow text based monitor impl to perform I/O.
* src/qemu/qemu_monitor_text.c: Call APIs for reading/writing
  to monitor instead of accessing the file handle directly.
2009-11-10 12:14:30 +00:00
ff26194143 Move code for low level QEMU monitor interaction into separate file
The qemu_driver.c code should not contain any code that interacts
with the QEMU monitor at a low level. A previous commit moved all
the command invocations out. This change moves out the code which
actually opens the monitor device.

* src/qemu/qemu_driver.c: Remove qemudOpenMonitor & methods called
  from it.
* src/Makefile.am: Add qemu_monitor.{c,h}
* src/qemu/qemu_monitor.h: Add qemuMonitorOpen()
* src/qemu/qemu_monitor.c: All code for opening the monitor
2009-11-10 12:14:22 +00:00
e40438fa7f Add a new timed condition variable wait API
* src/util/threads.h, src/util/threads-pthread.c,
  src/libvirt_private.syms: Add virCondWaitUntil()
2009-11-10 11:59:17 +00:00
15a9144609 Fix errno handling for pthreads wrappers
* src/util/threads-pthread.c: pthreads APIs do not set errno, instead
  the return value is the positive errno. Set errno based on the return
  value in the wrappers
2009-11-10 11:59:11 +00:00
dd9e9c3b54 Make pciDeviceList struct opaque
* src/util/pci.c, src/util/pci.h: Make the pciDeviceList struct
  opaque to callers of the API. Add accessor methods for managing
  devices in the list
* src/qemu/qemu_driver.c: Update to use APIs instead of directly
  accessing pciDeviceList fields
2009-11-10 11:59:03 +00:00
790f0b3057 Add missing OOM error checks, reports and cleanups 2009-11-09 23:17:45 +01:00
457a10d91d Add documentation for <channel> domain element
* src/formatdomain.html.in: Add <channel> element documentation
2009-11-09 15:38:20 +01:00
624f0c68bc Separate character device doc guest and host parts
* docs/formatdomain.html.in: refactors the existing character device
  documentation to make it explicit which directives configure the guest
  interface, and which configure the host interface.
2009-11-09 15:35:21 +01:00
df4c57ae27 Removes the ebtablesSaveRules() function
As it was basically unimplemented and more confusing than useful
at the moment.
* src/libvirt_private.syms: remove from internal symbols list
* src/qemu/qemu_bridge_filter.c src/util/ebtables.c: remove code and
  one use of the unimplemented function
2009-11-09 15:30:15 +01:00
0f04b58730 opennebula: Fix potential memory/mutex leak in state driver startup
In case of an error the domains hash and the driver mutex may leak.

* src/opennebula/one_driver.c: free/destroy domains hash and driver
  mutex in error cases
2009-11-08 15:26:33 +01:00
5469686bfd Add a Python example that lists active ESX domains
It also demonstrates how to use the libvirt.openAuth() method.

* examples/python/Makefile.am: add esxlist.py to EXTRA_DIST
* examples/python/README: add some notes about esxlist.py
* examples/python/esxlist.py: the new example
2009-11-08 01:03:24 +01:00
ec3fa12e94 phyp: Use actual error code instead of 0 2009-11-07 00:15:38 +01:00
6f5e63324f phyp: Don't use VIR_ALLOC if a stack variable is good enough 2009-11-06 21:28:49 +01:00
64a4c60e9e phyp: Fix several UUID table related problems
- Make reading ID from file working for IDs > 127
- Fix inverse error check for writing ID to file
- Use feof() to distinguish EOF from real error of fread()
- Don't interpret libssh2 error codes as number of bytes
2009-11-06 21:28:49 +01:00
cdf7a40d9c phyp: Check for exit_status < 0 before parsing the result 2009-11-06 21:28:49 +01:00
7ecb50c2a6 phyp: memcpy/memmove/memset can't fail, so don't check for error
Also reset UUID to all 0 instead of all 48 (== '0') in phypUUIDTable_RemLpar()
2009-11-06 21:28:49 +01:00
4c9afe08e4 phyp: Make generic domain listing functions return -1 in case of error
phypNumDomainsGeneric() and phypListDomainsGeneric() return 0 in case
of an error. This makes it impossible to distinguish between an actual
error and no domains being defined on the hypervisor. It also turn the
no domains situation into an error. Return -1 in case of an error to
fix this problem.
2009-11-06 21:28:49 +01:00
8d6a1b2c88 phyp: Break potential infinite loops 2009-11-06 21:28:49 +01:00
3cc8a66052 phyp: Fix memory/session leaks and potential invalid frees 2009-11-06 21:28:49 +01:00
11dc7786f4 Fix configure check for libssh2
* configure.in: add -L$libssh2_path to LIBS for the AC_TRY_LINK check
2009-11-06 21:28:48 +01:00
f0006d9792 524280 pass max lease option to dnsmasq
* src/network/bridge_driver.c: when exec'ing dnsmaq, if there are
  DHCP ranges defined, then compute and pass the --dhcp-lease-max
  deriving the maximum number of leases
2009-11-06 18:07:24 +01:00
8a659e3186 Store the range size when adding a DHCP range
* src/conf/network_conf.h: extend the structure to store the range
* src/conf/network_conf.c: before adding a range parse the IP addresses
  do some checking and keep the size
2009-11-06 18:07:24 +01:00
784b5030c1 Repair getIPv4Addr after the ntohl conversion
* src/util/network.c: getIPv4Addr() got broken when the input
  network address value got converted from network to host byte order
2009-11-06 18:07:24 +01:00
cd04abcc8e qemu: Allow cpu pinning for all logical CPUs, not just physical
This is what virsh already expects when printing output, and what
'man cpuset' claims to support.
2009-11-06 10:12:33 -05:00
c26cb9234f qemu: Use same create/define overwrite logic for migration prepare. 2009-11-06 10:12:32 -05:00
e02f691a90 qemu: Break out function to check if we can create/define/restore
Use this function in the qemu, uml, lxc, and test drivers.
2009-11-06 10:12:32 -05:00
c6d5ac174e Cleanup whitespace in docs
This patch is the result of running the following command in the docs
directory: sed -i 's/\t/        /g; s/\s*$//' *.html.in

* docs/*.html.in:convert tabs into 8 spaces and remove trailing whitespace
2009-11-06 16:05:18 +01:00
bb4ec5550b Use virBuffer when building QEMU char dev command line
* src/qemu/qemu_conf.c: Update qemudBuildCommandLineChrDevStr to use a
  virBuffer
2009-11-06 14:44:25 +01:00
8f67f6448b Cleanup virBuffer usage in qemdBuildCommandLine
* src/qemu_qemu_conf.c: Cleanup usage of virBuffer in qemudBuildCommandLine
2009-11-06 12:19:21 +01:00
649bcd72fe Add sentinel attribute for NULL terminated arg lists
* src/internal.h (ATTRIBUTE_SENTINEL): New, it's a ggc feature and
  protected as such
* src/util/buf.c (virBufferStrcat): Use it.
* src/util/ebtables.c (ebtablesAddRemoveRule): Use it.
* src/util/iptables.c (iptableAddRemoveRule: Use it.
* src/util/qparams.h (new_qparam_set, append_qparams): Use it.
* docs/apibuild.py: avoid breaking the API generator with that new
  internal keyword macro
2009-11-06 10:39:13 +01:00
4fbad2e049 test: Update inactive guest config on shutdown
This matches the expected behavior of state drivers such as QEMU.
2009-11-05 12:51:46 -05:00
b712bfb46c test: Add testDomainShutdownState helper
Performs changes needed when stopping a VM (which are currently duplicated
in several places, and forgotten in others).
2009-11-05 12:51:46 -05:00
7d10811312 Fix some cut-and-paste error in migration code
* src/qemu/qemu_driver.c: in qemudDomainMigratePerform call
  doPeer2PeerMigrate for VIR_MIGRATE_PEER2PEER.
2009-11-05 18:06:31 +01:00
91b009cde4 Properly convert port numbers to/from network byte order
* src/util/network.c: Add htons and ntohs in virSocket(Get|Set)Port
2009-11-05 17:56:08 +01:00
3811eaaa63 POWER add create() and destroy() support
* src/phyp/phyp_driver.[ch]: add new entry points and a number of
  cleanups
2009-11-05 17:18:07 +01:00
3023ec5ee7 Ensure guestfwd address is IPv4 and various cleanups
* include/libvirt/virterror.h src/util/virterror.c: add a new error
  VIR_ERR_CONFIG_UNSUPPORTED for valid but unsupported configuration options
* src/conf/domain_conf.c: Throw an error if guestfwd address isn't IPv4
  and cleanup a number of parsing return error values.
2009-11-05 16:04:34 +01:00
bea92f968e Forgot test case on previous commit 2009-11-05 15:45:53 +01:00
af249ea468 Support for <channel> in domain and QEmu backend
allows the following to be specified in a domain:
<channel type='pipe'>
  <source path='/tmp/guestfwd'/>
  <target type='guestfwd' address='10.0.2.1' port='4600'/>
</channel>

* proxy/Makefile.am: add network.c as dep of domain_conf.c
* docs/schemas/domain.rng src/conf/domain_conf.[ch]: extend the domain
  schemas and the parsing/serialization side for the new construct

QEmu support will add the following on the qemu command line:
 -chardev pipe,id=channel0,path=/tmp/guestfwd
 -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0

* src/qemu/qemu_conf.c: Add argument output for channel
* tests/qemuxml2(argv|xml)test.c: Add test for <channel> domain syntax
2009-11-05 15:31:03 +01:00
7400396801 Detect availability of QEMU -chardev CLI option
* src/qemu/qemu_conf.h: defines a new QEMUD_CMD_FLAG_CHARDEV flag
* src/qemu/qemu_conf.c: parse the output for -chardev and set flag
  appropriately
2009-11-05 14:41:24 +01:00
89d549c3eb Allow character devices to have different target types
A character device's target (it's interface in the guest) had only a
single property: port. This patch is in preparation for adding targets
which require other properties.
Since this changes the conf type for character devices this affects
a number of drivers:

* src/conf/domain_conf.[ch] src/esx/esx_vmx.c src/qemu/qemu_conf.c
  src/qemu/qemu_driver.c src/uml/uml_conf.c src/uml/uml_driver.c
  src/vbox/vbox_tmpl.c src/xen/xend_internal.c src/xen/xm_internal.c:
  target properties are moved into a union in virDomainChrDef, and a
  targetType field is added to identify which union member should be
  used. All current code which touches a virDomainChrDef is updated both
  to use the new union field, and to populate targetType if necessary.
2009-11-05 14:28:39 +01:00
8db32571ba LXC allow container to have ethN interfaces
Current implementation of lxc driver creates vethN named
interface(s) in the host and passes as it is to a container.
The reason why it doesn't use ethN is due to the limitation
that one namespace cannot have multiple iterfaces that have
an identical name so that we give up creating ethN named
interface in the host for the container.

However, we should be able to allow the container to have
ethN by changing the name after clone(CLONE_NEWNET).

* src/lxc/lxc_container.c src/lxc/veth.c src/lxc/veth.h: do the clone
  and then renames interfaces eth0 ... ethN to keep the interface names
  familiar in the domain
2009-11-05 14:11:30 +01:00
a9cb354833 LXC cleanup deep indentation in lxcDomainSetAutostart
* src/lxc/lxc_driver.c: refactor lxcDomainSetAutostart() to avoid deep
  indentation of the code
2009-11-05 13:41:14 +01:00
24e3b35c6c LXC messages cleanup and fix lxcError
* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
  src/lxc/veth.c: most of cleanups are just capitalizing their messages
  though, some fixes wrong error messages and awkward indentations, and
  improves error messages.
2009-11-05 13:39:09 +01:00
15941b2bc7 LXC fix wrong or out-of-date function descriptions
* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
  src/lxc/veth.c: fix broken function comments
2009-11-05 13:35:13 +01:00
45bd290b64 docs: <clock> property is 'offset', not 'sync' 2009-11-04 14:31:34 -05:00
0aa72ac6fd add MAC address based port filtering to qemu
* src/qemu/qemu.conf src/qemu/qemu_conf.c src/qemu/qemu_conf.h: there is
  a new config type option for mac filtering
* src/qemu/qemu_bridge_filter.[ch]: new module for the ebtable entry points
* src/qemu/qemu_driver.c: plug the MAC filtering at the right places
  in the domain life cycle
* src/Makefile.am po/POTFILES.in: add the new module
2009-11-03 23:44:48 +01:00
1fc3816d0f New ebtables module wrapper
* configure.in: look for ebtables binary location if present
* src/Makefile.am: add the new module
* src/util/ebtables.[ch]: new module and internal APIs around
  the ebtables binary
* src/libvirt_private.syms: export the symbols only internally
2009-11-03 23:44:48 +01:00
104fdbf038 test: Implement virDomainPinVcpu 2009-11-03 17:31:17 -05:00
07a107f0da test: Implement virDomainGetVcpus 2009-11-03 17:31:17 -05:00
08dce95a74 test: Update vcpu runtime info in SetVcpus 2009-11-03 17:31:17 -05:00
667ce28946 test: Use privateData to track running VM vcpu state 2009-11-03 17:31:17 -05:00
4e40aee273 test: Break out wrapper for setting up started domain state.
This should be a no op for now, but we will use this function to set up
transient state in the future.
2009-11-03 17:31:16 -05:00
7624b47d1e test: Fixes for SetVcpus
- Implement DomainGetMaxVCPUs
- Use GetMaxVCPUs to validate requested CPU amount
- Deny the 'hotplug' for a running domain.
2009-11-03 17:31:16 -05:00
2f5115627b qemu: Remove compiled out localhost migration support
Pretty sure this would deadlock now that we have proper locking, so
remove the code.
2009-11-03 16:46:54 -05:00
030db0c2ec storage: conf: Fix memory leak in encryption parsing 2009-11-03 16:46:54 -05:00
4c44cdcce3 Various error reporting fixes
- Don't duplicate SystemError
- Use proper error code in domain_conf
- Fix a broken error call in qemu_conf
- Don't use VIR_ERR_ERROR in security driver (isn't a valid code in this case)
2009-11-03 16:46:54 -05:00
517761fd96 Improve error reporting for virConnectGetHostname calls
All drivers have copy + pasted inadequate error reporting which wraps
util.c:virGetHostname. Move all error reporting to this function, and improve
what we report.

Changes from v1:
  Drop the driver wrappers around virGetHostname. This means we still need
  to keep the new conn argument to virGetHostname, but I think it's worth
  it.
2009-11-03 16:46:54 -05:00
af1e2ede26 Fix improper error return in virInterfaceDefParseProtoIPvX
* src/conf/interface_conf.c: the code was erronously returning -1
  in the two functions if <dhcp> is not provided
2009-11-03 21:04:56 +01:00
468439854b Make monitor type (miimon/arpmon) optional in bond xml
* src/conf/interface_conf.c: lack of one of these in the live xml output
  was causing the parse in virInterfaceDefParseBond() to fail
2009-11-03 21:04:56 +01:00
23eaae9aff Fix virInterfaceIpDefPtr leak during virInterfaceIpDefFree
* src/conf/interface_conf.c: forgot to free the structure itself
2009-11-03 21:04:56 +01:00
3d4c1d94d7 Support for IPv6 / multiple addresses per interfaces
This patch updates the xml parsing and formatting, and the associated
virInterfaceDef data structure to support IPv6, along the way adding
support for multiple protocols per interface, and multiple IP
addresses per protocol.
* src/conf/interface_conf.[ch]: update the structures, code for parsing
  and serialization
2009-11-03 21:04:56 +01:00
753c6c9c75 Support reporting live interface IP/netmask
This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
live interface info will be returned in the XML (in particular, the IP
address(es) and netmask(s) will be retrieved by querying the interface
directly, rather than  reporting what's in the config file). The
backend of this is in netcf's ncf_if_xml_state() function.

* configure.in libvirt.spec.in: requires netcf >= 0.1.3
* include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
* src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
  update the parsing and backend routines accordingly
* tools/virsh.c: change interface edit to inactive definition and
  adds the inactive flag for interface dump
2009-11-03 21:04:56 +01:00
ef591ef7b9 Make startmode optional in toplevel interface definition
The minimal XML returned from ncf_if_xml_state() doesn't contain this
attribute (which makes no sense in the case of reporting current
status of the interface), and it was preventing it from passing
through the parse/format step.

* src/conf/interface_conf.[ch]: add a new virInterfaceStartMode value
  and modify loading/saving accordingly
2009-11-03 21:04:56 +01:00
075bb5f1aa Move libvirtd event loop into background thread
The virStateInitialize() call for starting up stateful drivers
may require that the event loop is running already. This it is
neccessary to start the event loop before this call. At the
same time, network clients must not be processed until afte
virStateInitialize has completed.

The qemudListenUnix() and remoteListenTCP() methods must
therefore not register file handle watches, merely open the
network sockets & listen() on them. This means clients can
connected and are queued, pending completion of initialization

The qemudRunLoop() method is moved into a background thread
that is started early to allow access to the event loop during
driver initialization. The main process thread leader pretty
much does nothing once the daemon is running, merely waits
for the event loop thread to quit

* daemon/libvirtd.c, daemon/libvirtd.h: Move event loop into
  a background thread
* daemon/THREADING.txt: Rewrite docs to better reflect reality
2009-11-03 14:45:43 -05:00
9ae8fa5839 give up python interpreter lock before calling cb
suggested by danpb on irc, patch by danken fixed for proper C syntax

* python/libvirt-override.c: on event callback release the python
  interpreter lock and take it again when coming back so that the
  callback can reinvoke libvirt.
2009-11-03 18:42:16 +01:00
4728bad403 Allow NULL mac address in virGetInterface
There are places where an interface will not have a mac address, and netcf
returns this as a NULL pointer rather than a pointer to an empty string.
Rather than checking for this all over the place in libvirt, just save it
in the virInterface object as an empty string.

* src/datatypes.c: allow NULL mac in virGetInterface()
2009-11-03 16:42:53 +01:00
112ed8f50d Fix compilation problems
introduced on commit 9231aa7d95
* src/qemu/qemu_driver.c: in qemudRemoveDomainStatus fix a reference
  to an undefined variable buf and free up an allocated string
2009-11-03 16:24:46 +01:00
991be60403 Fix up NLS warnings.
When building with --disable-nls, I got a few messages like this:

storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
storage/storage_backend.c:571: warning: format not a string literal and no format arguments

Fix these up.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-11-03 16:19:40 +01:00
9231aa7d95 Remove redundant virFileDeletePID() call
qemudShutdownVMDaemon() calls qemudRemoveDomainStatus(), which
then calls virFileDeletePID().  qemudShutdownVMDaemon() then
unnecessarily calls virFileDeletePID() again.  Remove this second
usage of it, and also slightly refactor qemudRemoveDomainStatus()
to VIR_WARN appropriate error messages.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-11-03 16:19:28 +01:00
979218cdd9 Fix return value in virStateInitialize impl for LXC
The LXC driver was mistakenly returning -1 for lxcStartup()
in scenarios that are not an error. This caused the libvirtd
to quit for unprivileged users. This fixes the return code
of LXC driver, and also adds a "name" field to the virStateDriver
struct and logging to make it easier to find these problems
in the future

* src/driver.h: Add a 'name' field to state driver to allow
  easy identification during failures
* src/libvirt.c: Log name of failed driver for virStateInit
  failures
* src/lxc/lxc_driver.c: Don't return a failure code for
  lxcStartup() if LXC is not available on this host, simply
  disable the driver.
* src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
  src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/secret/secret_driver.c, src/storage/storage_driver.c,
  src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
  field in virStateDriver struct
2009-11-02 18:20:14 -05:00
680c92ae7e ESX: Fix memory leak in list handling functions.
If an error occurs between the allocation of an item and appending it
to the list, the item leaks. Free such orphaned items in error cases.

* src/esx/esx_vi.c: free orphaned items in error cases
2009-11-02 22:22:13 +01:00
b79aaf91b8 ESX: Don't automatically follow redirects.
The default transport for the VI API is HTTPS. If the server redirects
from HTTPS to HTTP the driver would silently follow that redirection.
The user assumes to communicate with the server over a secure transport
but isn't.

This patch disables automatical redirection following. The driver reports
an error if the server tries to redirect.

* src/esx/esx_vi.c: refactor the call to curl_easy_perform() into a
  function and do error handling there, disable automatical redirection
  following for curl
* src/esx/esx_vi.h: change the type of responseCode to int
2009-11-02 22:22:13 +01:00
447ef8863c ESX: Unify naming of VI API utility and convenience functions.
Unified function naming scheme:
- 'lookup' functions query the ESX or vCenter for information
- 'get' functions return information from a local object

* src/esx/esx_driver.c, src/esx/esx_vi.[ch]: unify function naming
2009-11-02 22:22:12 +01:00
7c7681dd90 ESX: Change disk selection for datastore detection.
In order to register a new virtual machine the ESX driver needs to upload
a VMX file to a datastore. Try to put this file beside the main VMDK file
of the virtual machine. Change the disk selection for datastore detection
to choose the first file-based harddisk instead of just the first disk.
The first disk may be a CDROM disk and ISO images are normaly not located
in the virtual machine's directory.

* src/esx/esx_driver.c: change disk selection for datastore detection
2009-11-02 22:22:12 +01:00
b7abcf9d71 ESX: Fallback to the preliminary name if the datastore cannot be found.
This allows to use domain-xml-from-native with VMX files that reference
unavailable datastores.

* src/esx/esx_vmx.c: fallback to the preliminary name if the datastore
  cannot be found
2009-11-02 22:22:12 +01:00
fc8d199188 Rename internal APis
Rename virDomainIsActive to virDomainObjIsActive, and
virInterfaceIsActive to virInterfaceObjIsActive and finally
virNetworkIsActive to virNetworkObjIsActive.

* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/conf/interface_conf.h, src/conf/network_conf.c,
  src/conf/network_conf.h, src/lxc/lxc_driver.c,
  src/network/bridge_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
  src/test/test_driver.c, src/uml/uml_driver.c: Update for
  renamed APIs.
2009-11-02 11:58:55 -05:00
958c366b21 Fix --with-init-script configure option
* configure.in daemon/Makefile.am: the --with-init-script configure
  option was broken, and always defaulted based on the existence of
  /etc/redhat-release. This was a systematic typo based on
  mixed use of init-script and init-scripts.
2009-11-02 17:57:05 +01:00
4296cea2b2 Don't let parent of daemon exit until basic initialization is done
The daemonizing code lets the parent exit almost immediately. This
means that it may think it has successfully started even when
important failures occur like not being able to acquire the PID
file. It also means network sockets are not yet open.

To address this when daemonizing the parent passes an open pipe
file descriptor to the child. The child does its basic initialization
and then writes a status code to the pipe indicating either success,
or failure. This ensures that when daemonizing, the parent does not
exit until the pidfile is acquired & basic network sockets are open.

Initialization of the libvirt drivers is still done asynchronously
since this may take a very long time.

* daemon/libvirtd.c: Force parent to stay around until basic config
  file, pidfile & network socket init is completed
2009-11-02 11:41:35 -05:00
a71f79c37e Pull signal setup code out into separate method
* daemon/libvirtd.c: Introduce a daemonSetupSignals() method
  and put all signal handling code there
* daemon/libvirtd.h: Add sigread/sigwrite to qemud_server type
2009-11-02 11:41:35 -05:00
8001eef5d0 Set KMEMSIZE for OpenVZ domains being defined
* src/openvz/openvz_driver.c: add a new openvzDomainSetMemoryInternal()
  function, used to initialize the KMEMSIZE parameter of a container.
2009-11-02 17:39:46 +01:00
4ab7995871 Fix duplicating logging of errors in libvirtd
The libvirt default error handling callback will print all errors
to stderr. The libvirtd default logging callback will do the same.
Set a no-op error handling callback in libvirtd to prevent this
duplication

* daemon/libvirtd.c: Register a no-op error handling function
2009-11-02 11:22:02 -05:00
5f67253813 Fix initialization order bugs
virInitialize must be the first libvirt function called to ensure
threads, error handling & random number generator are all setup.

Move UNIX socket directory permissions change to place of use
2009-11-02 11:21:22 -05:00
0264e1678c Misc cleanup to network socket init
* daemon/libvirtd.c: Change qemudNetworkInit() so that it doesn't try
to free its argument, leaving the caller todo cleanup as is normal
practice. Add missing policykit cleanup to qemudCleanup, and remove
server watch if set. Remove duplicated call to listen() on TCP sockets
2009-11-02 11:15:01 -05:00
46992453b9 Annotate many methods with ATTRIBUTE_RETURN_CHECK & fix problems
Nearly all of the methods in src/util/util.h have error codes that
must be checked by the caller to correct detect & report failure.
Add ATTRIBUTE_RETURN_CHECK to ensure compile time validation of
this

* daemon/libvirtd.c: Add explicit check on return value of virAsprintf
* src/conf/domain_conf.c: Add missing check on virParseMacAddr return
  value status & report error
* src/network/bridge_driver.c: Add missing OOM check on virAsprintf
  and report error
* src/qemu/qemu_conf.c: Add missing check on virParseMacAddr return
  value status & report error
* src/security/security_selinux.c: Remove call to virRandomInitialize
  that's done in libvirt.c already
* src/storage/storage_backend_logical.c: Add check & log on virRun
  return status
* src/util/util.c: Add missing checks on virAsprintf/Run status
* src/util/util.h: Annotate all methods with ATTRIBUTE_RETURN_CHECK
  if they return an error status code
* src/vbox/vbox_tmpl.c: Add missing check on virParseMacAddr
* src/xen/xm_internal.c: Add missing checks on virAsprintf
* tests/qemuargv2xmltest.c: Remove bogus call to virRandomInitialize()
2009-11-02 11:09:03 -05:00
3505790b85 Allow for a driver specific private data blob in virDomainObjPtr
The virDomainObjPtr object stores state about a running domain.
This object is shared across all drivers so it is not appropriate
to include driver specific state here. This patch adds the ability
to request a blob of private data per domain object instance. The
driver must provide a allocator & deallocator for this purpose

THis patch abuses the virCapabilitiesPtr structure for storing the
allocator/deallocator callbacks, since it is already being abused
for other internal things relating to parsing. This should be moved
out into a separate object at some point.

* src/conf/capabilities.h: Add privateDataAllocFunc and
  privateDataFreeFunc fields
* src/conf/domain_conf.c: Invoke the driver allocators / deallocators
  when creating/freeing virDomainObjPtr instances.
* src/conf/domain_conf.h: Pass virCapsPtr into virDomainAssignDef
  to allow access to the driver specific allocator function
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
  src/test/test_driver.c, src/uml/uml_driver.c: Update for
  change in virDomainAssignDef contract
2009-11-02 11:03:10 -05:00
530d4463ba Don't use private struct member names of in6_addr
__in6_u.__u6_addr16 is the private name for this struct member,
s6_addr16 is the public one
* src/util/network.c: dont use the private field, but the public one.
2009-11-02 15:45:05 +01:00
c3cc4f8bad More network utility functions
* src/util/network.[ch] Add functions for address->text and get/set
  port number
* src/libvirt_private.syms: add new entry points
2009-11-02 15:42:47 +01:00
9899e08b8d Fix typo in network.c function comments
* src/util/network.c: fix a few typo
2009-10-30 16:39:57 +01:00
37bc888b28 Add symbols from new network.h module
* src/libvirt_private.syms: keep all symbols from network.h private
2009-10-30 16:36:04 +01:00
24c8fc5dff Set of new network related utilities
* src/util/network.h src/util/network.c: utilities to parse network
  addresses, check netmask and compute ranges
2009-10-30 15:44:53 +01:00
d5fcd4f7a3 Fix configure detection of device mapper
* configure.in: the PKG_CHECK_MODULES() for it would not work on
  Ubuntu and SuSE, so add a direct check fallback
2009-10-30 14:44:50 +01:00
47fec8eac2 Remote code caught EINTR making it ininterruptable
John Levon raised the issue that remoteIOEventLoop() poll call was
reissued after EINTR was caught making it uninterruptible.
* src/remote/remote_driver.c: catch EAGAIN instead as suggested by
  Richard Jones
2009-10-30 12:08:26 +01:00
a3adcce795 Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.

The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.

In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c

* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
  virDomainObjListPtr to use virHashTable. Add a initializer
  method virDomainObjListInit, and rename virDomainObjListFree
  to virDomainObjListDeinit, since its not actually freeing
  the container, only its contents. Also add some convenient
  methods virDomainObjListGetInactiveNames,
  virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
  which can be used to implement the correspondingly named
  public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
  src/qemu/qemu_driver.c, src/test/test_driver.c,
  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
  to deal with hash tables instead of arrays for domains
2009-10-28 20:05:55 +00:00
1acef95a81 libvirt-devel should only require libvirt-client
There's a long known issue where if you install libvirt in a guest,
the default virtual network will conflict with the default virtual
network in the host.

That's one of the reasons we have the libvirt-client RPM - it allows
you to install the client library without having the host side
installed.

Rich Jones points out that if you install libvirt-devel in a guest,
then you get libvirtd installed and the network conflict:

  https://bugzilla.redhat.com/531200

libvirt-devel should only require libvirt-client - e.g. nothing in
the devel package pertains to anything in the libvirt RPM. The Fedora
packaging guidelines say:

  https://fedoraproject.org/wiki/Packaging/Guidelines#Devel_Packages

  Devel packages must require the base package using a fully versioned
  dependency ...

But for all intents and purposes, libvirt-client is our base RPM.

* libvirt.spec.in: make libvirt-devel require libvirt-client
2009-10-28 17:23:34 +00:00
66c6cc7c5e virterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET 2009-10-28 11:30:42 -04:00
33b35313a3 qemu: migrate: Don't require manual URI to specify a port
The xen driver will generate a migration port if only a hostname is passed
in the optional migrate URI, so let's do the same in qemu.
2009-10-28 11:30:41 -04:00
64f920d056 Fix p2p migration without a passed uri. 2009-10-28 11:30:41 -04:00
48a7637d9f qemu: Fix an error message in GetVcpus 2009-10-28 11:30:40 -04:00
e5edc3f03a test: Support virStorageFindPoolSources
The results are hardcoded into the test driver, no option to read from a
testfile is implemented at this time.
2009-10-28 11:30:40 -04:00
d61fff3f4b storage: Add ParseSourceString function for use with FindPoolSources.
This will simplify adding FindPoolSources support to more pool backends in
the future (as well as the test driver).
2009-10-28 11:30:40 -04:00
9bcb174473 storage: Break out function to add pool source to a SourceList.
Similar in theory to *AssignDef type functions, this duplicate functionality
will be used by an future FindPoolSources implementations.
2009-10-28 11:30:39 -04:00
fcbbb289b6 storage: Break out pool source parsing to a separate function.
We need to parse a source XML block for FindPoolSources, so this is a step
in sharing the parsing. The new storage pool XML 2 XML tests cover this area
pretty well to ensure we aren't causing regressions.
2009-10-28 11:30:39 -04:00
0d77396605 Update the documentation for virDomainMigrateToURI
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-28 16:27:04 +01:00
936565c701 Add support for an external TFTP boot server
This patch adds an optional attribute to the <bootp> tag, that
allows to specify a TFTP server address other than the address of
the DHCP server itself.

This can be used to forward the BOOTP settings of the host down to the
guest.  This is something that configurations such as Xen's default
network achieve naturally, but must be done manually for NAT.

* docs/formatnetwork.html.in: Document new attribute.
* docs/schemas/network.rng: Add it to schema.
* src/conf/network_conf.h: Add it to struct.
* src/conf/network_conf.c: Add it to parser and pretty printer.
* src/network/bridge_driver.c: Put it in the dnsmasq command line.
* tests/networkxml2xmlin/netboot-proxy-network.xml
  tests/networkxml2xmlout/netboot-proxy-network.xml
  tests/networkxml2xmltest.c: add new tests
2009-10-28 15:57:49 +01:00
16c1c0833b test: Support virNodeDeviceCreate and virNodeDeviceDestroy 2009-10-27 10:03:51 -04:00
0b74bc622c Fix some typos in comments 2009-10-27 00:02:46 +01:00
74c81b5d93 Fix problems in the Xen inotify driver.
In xenInotifyXendDomainsDirLookup() the wrong UUID variable is used
to search in the config info list.

In xenInotifyEvent() the event is dispatched if it's NULL.

Both were introduced in bc898df2c7.
2009-10-26 23:30:19 +01:00
dfdfc601ac Fix error message in qemudLoadDriverConfig()
* src/qemu/qemu_conf.c: change the error message to refer to
  'cgroup_controllers' instead of 'cgroup_device_acl'
2009-10-26 23:30:19 +01:00
d27098c054 Add a new syntax-check rule for gethostname.
We should always be using virGetHostname in place of
gethostname; thus add in a new syntax-check rule to make
sure no new uses creep in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:34:27 +01:00
4c893ef9be Various syntax-check fixes.
Make a pass over the syntax-check files, tightening up regex's,
un-ignoring certain files, and cleaning things up.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:34:05 +01:00
03b5dc14de Tighten up nonreentrant syntax-check.
We can slightly tighten up the regex's used to detect the use of
nonreentrant functions.  We can also check src/util/virterror.c
by modifying a comment; I think it's worth it to get the additional
coverage.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:33:42 +01:00
b2af10cd49 Replace a gethostname by virGetHostname in libvirtd.c
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:33:20 +01:00
982682b8fd Replace two strcmp() by STREQ() in qemu_driver.c
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:32:52 +01:00
5bd53990c5 Replace gethostname by virGetHostname in xend_internal.c 2009-10-26 10:32:19 +01:00
6940109b9a Remove a completely bogus reference increment in the Xen driver.
xenUnifiedDomainEventRegister() calls out to
virDomainEventCallbackListAdd(), which increments the reference
count on the connection.  That is fine, but then
xenUnifiedDomainEventRegister() increments the usage count again,
leading to a usage count leak.  Remove the increment in the xen
register, and the UnrefConnect in the xen unregister.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:31:42 +01:00
43a9249c95 Add a default log_level to qemudSetLogging to remove a build warning.
(original patch from Charles Duffy)

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:31:16 +01:00
2ff5cffe6e Better error message when libvirtd fails to start.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:30:49 +01:00
4ed2c3773e Fix potential false-positive OOM error reporting.
If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.

Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.

* src/conf/node_device_conf.c: only report an OOM error if there
  really is one
2009-10-22 15:25:45 +02:00
2f4682a9f8 Consolidate virXPathNodeSet()
virXPathNodeSet() could return -1 when doing an evaluation failure
due to xmlXPathEval() from libxml2 behaviour.
* src/util/xml.c: make sure we always return 0 unless the returned
  XPath type is of the wrong type (meaning the query passed didn't
  evaluate to a node set and code must be fixed)
2009-10-22 10:33:52 +02:00
08bed02515 Support QEMU watchdog device.
This adds simple support for configuring a guest with a QEMU/KVM
virtual hardware watchdog device.
2009-10-21 16:37:44 +01:00
b03fe2d0ae Do not log rotate very small logs
Without this, after few weeks without use, each defined domain grows a
tail of empty gzipped logs, instead of keeping just the last log of
interest.

* daemon/libvirtd.logrotate.in: only rotate when the log is over 100 KBytes
2009-10-21 13:56:04 +02:00
09c64d0072 528575 avoid libvirtd crash on LCX domain autostart
https://bugzilla.redhat.com/show_bug.cgi?id=528575
virsh -c lxc:/// autostart vm1
was crashing the daemon

* src/lxc/lxc_conf.h src/lxc/lxc_conf.c: initialize the driver
  autostartDir to avoid a NULL reference and implement autostart for LXC
2009-10-21 13:32:20 +02:00
949dd07b19 Fix virsh.c compilation warning
* tools/virsh.c: call to vshError() containing 'doexit' parameter
  sneaked in after said parameter was removed
2009-10-21 12:59:43 +02:00
309acaa023 Fix SELinux linking issues
* src/Makefile.am: add selinux CFLAGS and linker flags to security driver
2009-10-21 12:11:13 +02:00
e8fc4cbb64 LXC implement missing macaddr assignment feature
Currently MAC address configuration of container veth is just ignored.
This patch implements the missing feature.

* src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
* src/lxc/lxc_driver.c: set macaddr of container veth if specified
2009-10-21 12:04:02 +02:00
89f0c6d089 Fix a make dist error due to wrong EXTRA_DIST paths
* tests/Makefile.am: networkpoolxml2xmlout and networkpoolxml2xmlin are
  really networkxml2xmlout and networkxml2xmlin
2009-10-21 11:16:21 +02:00
9e2fe24518 node device: Break out get_wwns and get_parent_node helpers
These will be used by the test driver, so move them to a shareable space.
2009-10-20 14:17:35 -04:00
d686056f62 node device: Fix locking issue in virNodeDeviceDestroy
Certain error paths won't unlock the node device object.
2009-10-20 14:17:34 -04:00
9710856b33 tests: Centralize VIR_TEST_DEBUG lookup, and document it
Provide a simple interface for other tests to lookup the testDebug variable.
Also remove a redundant error message in interface tests.

If anyone feels inclined to change this env variable to match the existing
LIBVIRT_* format, it should now be easier to do so.
2009-10-20 14:17:34 -04:00
f5ee422c58 tests: Initialize virRandom in for test suite.
Otherwise any virRandom calls will result in a segfault.
2009-10-20 14:17:34 -04:00
cf577653dc Remove bogus const annotations to hash iterator
Most of the hash iterators need to modify either payload of
data args. The const annotation prevents this.

* src/util/hash.h, src/util/hash.c: Remove const-ness from
  virHashForEach/Iterator
* src/xen/xm_internal.c: Remove bogus casts
2009-10-19 16:24:12 +01:00
de2b252df5 fix virDomainMigrateToURI doc
* src/libvirt.c: remove reverences to non existent dconn parameter
  when using that entry point.
2009-10-19 14:53:29 +02:00
41fa653f32 LXC fix virCgroupGetValueStr problem with \n
A cgroup file returns integer value terminated with '\n' and remaining
it has sometimes harmful effects, for example it leads virStrToLong_ull
to fail.
* src/util/cgroup.c: strip out terminating \n when reading a value
2009-10-19 14:29:42 +02:00
4f4a1deccb Remove bashisms from schema tests.
Introduced in commit 39a7be470c.

* tests/*schematest: replace 'source' with '.'
* tests/schematestutils.sh: remove 'function' keyword and add '()'
2009-10-17 01:16:25 +02:00
caf8e91588 tests: Add storage volume XML 2 XML tests. 2009-10-16 10:52:27 -04:00
6d8331fd58 tests: Add network XML to XML tests. 2009-10-16 10:52:26 -04:00
4027461865 schema: Update network schema.
Make things a bit more readable, and properly handle forward mode 'route'.
2009-10-16 10:52:10 -04:00
e1ea1b2af7 tests: Add XML 2 XML tests for storage pools.
Move existing schema data to an input directory. Add extra files for more
thorough XML testing.
2009-10-16 10:21:47 -04:00
39a7be470c tests: Break out duplicate schema verification functionality.
All schema tests have identical functionality, so avoid the duplication.
2009-10-16 10:21:46 -04:00
16a3a4a30a tests: Fix text output for interface XML 2 XML 2009-10-16 10:20:21 -04:00
2210f8a3a8 Don't copy old machines from a domain which has none
If the the qemu and kvm binaries are the same, we don't include machine
types in the kvm domain info.

However, the code which refreshes the machine types info from the
previous capabilities structure first looks at the kvm domain's info,
finds it matches and then copies the empty machine types list over
for the top-level qemu domain.

That doesn't make sense, we shouldn't copy an empty machin types list.

* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
  empty machine types list.
2009-10-15 13:27:57 +01:00
04e0686262 Avoid crash in virBufferEscapeString
* src/util/buf.c: if virBufferEscapeString was called on a buffer that
  had 0 bytes of space, a size of -1 will be passed to snprintf, resulting
  in a segmentation fault, this preallocate some space.
2009-10-15 14:19:11 +02:00
e391595890 Add ocfs2 to list of fs pool types
* src/conf/storage_conf.c src/conf/storage_conf.h: extend the enums
  and values
* docs/schemas/storagepool.rng: add to the list of storage pool type
  formats
2009-10-14 17:03:22 +02:00
c396fb36fa LXC complement PATH environment variable
* src/lxc/lxc_driver.c: without PATH, the controller will definitely
  fail to call ip command
2009-10-14 16:54:29 +02:00
2d8d9b100b Finer grained migration control
Normally, when you migrate a domain from host A to host B,
the domain on host A remains defined but shutoff and the domain
on host B remains running but is a "transient".  Add a new
flag to virDomainMigrate() to allow the original domain to be
undefined on source host A, and a new flag to virDomainMigrate() to
allow the new domain to be persisted on the destination host B.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-14 11:35:51 +02:00
616 changed files with 409512 additions and 275190 deletions

Submodule .gnulib updated: 28db629d4f...146d914507

View File

@ -1,5 +1,6 @@
^src/libvirt\.c$
^src/qemu/qemu_driver\.c$
^src/qemu/qemu_monitor\.c$
^src/util/util\.c$
^src/xen/xend_internal\.c$
^daemon/libvirtd.c$

View File

@ -1,8 +1,5 @@
ChangeLog
docs/devhelp/libvirt-virterror.html
docs/html/libvirt-virterror.html
docs/libvirt-api.xml
docs/libvirt-refs.xml
include/libvirt/virterror.h
daemon/dispatch.c
src/util/virterror.c
^ChangeLog$
^ChangeLog-old$
^include/libvirt/virterror\.h$
^daemon/dispatch\.c$
^src/util/virterror\.c$

View File

@ -1,3 +1,2 @@
gnulib/lib/getaddrinfo.c
gnulib/m4/
src/xend_internal.c
^gnulib/lib/getaddrinfo\.c$
^gnulib/m4/

View File

@ -0,0 +1,2 @@
^src/util/util\.c$
^ChangeLog-old$

View File

@ -1,10 +1,10 @@
^gnulib/
^po/
ChangeLog
^ChangeLog$
^ChangeLog-old$
^Makefile*
^docs/
^tests/
^tools/virsh\.c
^tools/console\.c
^src/util/virterror\.c
^tools/virsh\.c$
^tools/console\.c$
^build-aux/

2
.x-sc_prohibit_readlink Normal file
View File

@ -0,0 +1,2 @@
^src/util/util\.c$
^ChangeLog-old$

View File

@ -1 +1,9 @@
^gnulib/
^ChangeLog-old$
^docs/
^examples/domain-events/events-c/event-test\.c$
^src/internal\.h$
^src/lxc/lxc_container\.c$
^src/node_device/node_device_devkit\.c$
^src/node_device/node_device_hal\.c$
^src/storage/parthelper\.c$

View File

@ -1 +1 @@
src/util/util.c
^src/util/util\.c$

View File

@ -1,5 +1,4 @@
^examples/
^gnulib/lib/dummy\.c$
^gnulib/tests/dummy\.c$
^daemon/remote_protocol\.c$
^ChangeLog$

View File

@ -23,6 +23,7 @@ The primary maintainers and people with commit access rights:
Guido Günther <agx@sigxcpu.org>
John Levon <john.levon@sun.com>
Matthias Bolte <matthias.bolte@googlemail.com>
Jiri Denemark <jdenemar@redhat.com>
Patches have also been contributed by:
@ -80,6 +81,14 @@ Patches have also been contributed by:
Satoru SATOH <satoru.satoh@gmail.com>
Paolo Bonzini <pbonzini@redhat.com>
Miloslav Trmač <mitr@redhat.com>
Jamie Strandboge <jamie@canonical.com>
Gerhard Stenzel <gerhard.stenzel@de.ibm.com>
Matthew Booth <mbooth@redhat.com>
Diego Elio Pettenò <flameeyes@gmail.com>
Adam Litke <agl@us.ibm.com>
Steve Yarmie <steve.yarmie@gmail.com>
Dan Kenigsberg <danken@redhat.com>
Yuji NISHIDA <nishidy@nict.go.jp>
[....send patches to get your name here....]

26
HACKING
View File

@ -15,14 +15,14 @@ should work:
or:
cvs diff -up > libvirt-myfeature.patch
git diff > libvirt-myfeature.patch
(3) Split large changes into a series of smaller patches, self-contained
if possible, with an explanation of each patch and an explanation of how
the sequence of patches fits together.
(4) Make sure your patches apply against libvirt CVS. Developers
only follow CVS and don't care much about released versions.
(4) Make sure your patches apply against libvirt GIT. Developers
only follow GIT and don't care much about released versions.
(5) Run the automated tests on your code before submitting any changes.
In particular, configure with compile warnings set to -Werror:
@ -37,6 +37,17 @@ and run the tests:
The latter test checks for memory leaks.
If you encounter any failing tests, the VIR_TEST_DEBUG environment variable
may provide extra information to debug the failures. Larger values of
VIR_TEST_DEBUG may provide larger amounts of information:
VIR_TEST_DEBUG=1 make check (or)
VIR_TEST_DEBUG=2 make check
Also, individual tests can be run from inside the 'tests/' directory, like:
./qemuxml2xmltest
(6) Update tests and/or documentation, particularly if you are adding
a new feature or changing the output of a program.
@ -211,7 +222,7 @@ one of the following semantically named macros
STREQ(a,b)
STRNEQ(a,b)
- For case sensitive equality:
- For case insensitive equality:
STRCASEEQ(a,b)
STRCASENEQ(a,b)
@ -220,7 +231,7 @@ one of the following semantically named macros
STREQLEN(a,b,n)
STRNEQLEN(a,b,n)
- For case sensitive equality of a substring:
- For case insensitive equality of a substring:
STRCASEEQLEN(a,b,n)
STRCASENEQLEN(a,b,n)
@ -282,10 +293,11 @@ eg typical usage is as follows:
...
virBufferAddLit(&buf, "</domain>\n");
....
...
if (virBufferError(&buf)) {
__virRaiseError(...);
virBufferFreeAndReset(&buf);
virReportOOMError(...);
return NULL;
}

View File

@ -5,7 +5,7 @@ GENHTML = genhtml
SUBDIRS = gnulib/lib include src daemon tools proxy docs gnulib/tests \
python tests po examples/domain-events/events-c examples/hellolibvirt \
examples/dominfo examples/domsuspend examples/python
examples/dominfo examples/domsuspend examples/python examples/apparmor
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
@ -17,12 +17,23 @@ EXTRA_DIST = \
mingw32-libvirt.spec.in \
libvirt.pc libvirt.pc.in \
autobuild.sh \
.x-sc_avoid_ctype_macros \
.x-sc_avoid_if_before_free \
.x-sc_require_config_h_first \
.x-sc_avoid_write \
.x-sc_m4_quote_check \
.x-sc_prohibit_asprintf \
.x-sc_prohibit_gethostby \
.x-sc_prohibit_gethostname \
.x-sc_prohibit_have_config_h \
.x-sc_prohibit_HAVE_MBRTOWC \
.x-sc_prohibit_nonreentrant \
.x-sc_prohibit_strcmp \
.x-sc_prohibit_strcmp_and_strncmp \
.x-sc_prohibit_strncpy \
.x-sc_prohibit_VIR_ERR_NO_MEMORY \
.x-sc_require_config_h \
.x-sc_prohibit_nonreentrant \
.x-sc_require_config_h_first \
.x-sc_trailing_blank \
Makefile.nonreentrant \
autogen.sh \
examples/domain-events/events-python \

View File

@ -49,9 +49,17 @@ test -f src/libvirt.c || {
exit 1
}
if test -z "$*"; then
EXTRA_ARGS=
if test "x$1" = "x--system"; then
shift
EXTRA_ARGS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var"
echo "Running ./configure with $EXTRA_ARGS $@"
else
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
fi
# Ensure that whenever we pull in a gnulib update or otherwise change to a
@ -77,7 +85,7 @@ if test x$OBJ_DIR != x; then
cd "$OBJ_DIR"
fi
$srcdir/configure "$@" && {
$srcdir/configure $EXTRA_ARGS "$@" && {
echo
echo "Now type 'make' to compile libvirt."
}

View File

@ -65,8 +65,10 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
<$gnulib_tool || exit
modules='
areadlink
base64
c-ctype
canonicalize-lgpl
close
connect
getaddrinfo
@ -75,6 +77,7 @@ getpass
gettext
gitlog-to-changelog
gnumakefile
ignore-value
inet_pton
ioctl
maintainer-makefile

16
build-aux/.gitignore vendored
View File

@ -1,13 +1,7 @@
compile
config.guess
config.rpath
config.sub
depcomp
install-sh
ltmain.sh
missing
mkinstalldirs
mktempd
*
/link-warning.h
/mktempd
/arg-nonnull.h
/gitlog-to-changelog
/useless-if-before-free
/vc-list-files
/gitlog-to-changelog

View File

@ -1,28 +0,0 @@
/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
a linker warning on most glibc systems.
We use a linker warning rather than a preprocessor warning, because
#warning cannot be used inside macros. */
#ifndef GL_LINK_WARNING
/* This works on platforms with GNU ld and ELF object format.
Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
Testing __ELF__ guarantees the ELF object format.
Testing __GNUC__ is necessary for the compound expression syntax. */
# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
# define GL_LINK_WARNING(message) \
GL_LINK_WARNING1 (__FILE__, __LINE__, message)
# define GL_LINK_WARNING1(file, line, message) \
GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */
# define GL_LINK_WARNING2(file, line, message) \
GL_LINK_WARNING3 (file ":" #line ": warning: " message)
# define GL_LINK_WARNING3(message) \
({ static const char warning[sizeof (message)] \
__attribute__ ((__unused__, \
__section__ (".gnu.warning"), \
__aligned__ (1))) \
= message "\n"; \
(void)0; \
})
# else
# define GL_LINK_WARNING(message) ((void) 0)
# endif
#endif

View File

@ -1,134 +0,0 @@
#!/bin/sh
# Create a temporary directory, much like mktemp -d does.
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Written by Jim Meyering.
# Usage: mktempd /tmp phoey.XXXXXXXXXX
# First, try to use the mktemp program.
# Failing that, we'll roll our own mktemp-like function:
# - try to get random bytes from /dev/urandom
# - failing that, generate output from a combination of quickly-varying
# sources and gzip. Ignore non-varying gzip header, and extract
# "random" bits from there.
# - given those bits, map to file-name bytes using tr, and try to create
# the desired directory.
# - make only $MAX_TRIES attempts
ME=`basename "$0"`
die() { echo >&2 "$ME: $@"; exit 1; }
MAX_TRIES=4
rand_bytes()
{
n=$1
chars=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
dev_rand=/dev/urandom
if test -r "$dev_rand"; then
# Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194.
dd ibs=$n count=1 if="$dev_rand" | tr -c $chars 01234567$chars$chars$chars
return
fi
cmds='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
data=` (eval "$cmds") 2>&1 | gzip `
n_plus_50=`expr $n + 50`
# Ensure that $data has length at least 50+$n
while :; do
len=`echo "$data"|wc -c`
test $n_plus_50 -le $len && break;
data=` (echo "$data"; eval "$cmds") 2>&1 | gzip `
done
echo "$data" \
| dd bs=1 skip=50 count=$n 2>/dev/null \
| tr -c $chars 01234567$chars$chars$chars
}
mktempd()
{
case $# in
2);;
*) die "Usage: $ME DIR TEMPLATE";;
esac
destdir=$1
template=$2
# Disallow any trailing slash on specified destdir:
# it would subvert the post-mktemp "case"-based destdir test.
case $destdir in
/) ;;
*/) die "invalid destination dir: remove trailing slash(es)";;
esac
case $template in
*XXXX) ;;
*) die "invalid template: $template (must have a suffix of at least 4 X's)";;
esac
fail=0
# First, try to use mktemp.
d=`env -u TMPDIR mktemp -d -t -p "$destdir" "$template" 2>/dev/null` \
|| fail=1
# The resulting name must be in the specified directory.
case $d in "$destdir"*);; *) fail=1;; esac
# It must have created the directory.
test -d "$d" || fail=1
# It must have 0700 permissions. Handle sticky "S" bits.
perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
case $perms in drwx------*) ;; *) fail=1;; esac
test $fail = 0 && {
echo "$d"
return
}
# If we reach this point, we'll have to create a directory manually.
# Get a copy of the template without its suffix of X's.
base_template=`echo "$template"|sed 's/XX*$//'`
# Calculate how many X's we've just removed.
template_length=`echo "$template" | wc -c`
nx=`echo "$base_template" | wc -c`
nx=`expr $template_length - $nx`
err=
i=1
while :; do
X=`rand_bytes $nx`
candidate_dir="$destdir/$base_template$X"
err=`mkdir -m 0700 "$candidate_dir" 2>&1` \
&& { echo "$candidate_dir"; return; }
test $MAX_TRIES -le $i && break;
i=`expr $i + 1`
done
die "$err"
}
mktempd "$@"

23
cfg.mk
View File

@ -1,5 +1,5 @@
# Customize Makefile.maint. -*- makefile -*-
# Copyright (C) 2003-2009 Free Software Foundation, Inc.
# Copyright (C) 2003-2010 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -79,11 +79,9 @@ sc_avoid_write:
# Use STREQ rather than comparing strcmp == 0, or != 0.
# Similarly, use STREQLEN or STRPREFIX rather than strncmp.
sc_prohibit_strcmp_and_strncmp:
@grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *==' \
$$($(VC_LIST_EXCEPT)) \
| grep -vE ':# *define STREQ(LEN)?\(' && \
{ echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
1>&2; exit 1; } || :
@re='strn?cmp *\(' \
msg='use STREQ() in place of the above uses of str[n]cmp' \
$(_prohibit_regexp)
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
sc_prohibit_asprintf:
@ -96,6 +94,16 @@ sc_prohibit_strncpy:
msg='use virStrncpy, not strncpy' \
$(_prohibit_regexp)
sc_prohibit_readlink:
@re='readlink *\(' \
msg='use virFileResolveLink, not readlink' \
$(_prohibit_regexp)
sc_prohibit_gethostname:
@re='gethostname *\(' \
msg='use virGetHostname, not gethostname' \
$(_prohibit_regexp)
sc_prohibit_VIR_ERR_NO_MEMORY:
@re='\<V''IR_ERR_NO_MEMORY\>' \
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
@ -262,3 +270,6 @@ ifeq (0,$(MAKELEVEL))
$(error gnulib update required; run ./autogen.sh first)
endif
endif
# Exempt @...@ uses of these symbols.
_makefile_at_at_check_exceptions = ' && !/(SCHEMA|SYSCONF)DIR/'

View File

@ -1,9 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([libvirt], [0.7.2])
AC_INIT([libvirt], [0.7.6])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_HEADERS([config.h])
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([-Wno-portability])
@ -33,7 +33,13 @@ GNUTLS_REQUIRED="1.0.25"
AVAHI_REQUIRED="0.6.0"
POLKIT_REQUIRED="0.6"
PARTED_REQUIRED="1.8.0"
NETCF_REQUIRED="0.0.1"
NETCF_REQUIRED="0.1.4"
UDEV_REQUIRED=145
PCIACCESS_REQUIRED=0.10.0
XMLRPC_REQUIRED=1.14.0
HAL_REQUIRED=0.5.0
DEVMAPPER_REQUIRED=1.0.0
LIBCURL_REQUIRED="7.18.0"
dnl Checks for C compiler.
AC_PROG_CC
@ -72,12 +78,32 @@ AC_SUBST(VERSION_SCRIPT_FLAGS)
LIBVIRT_COMPILE_WARNINGS([maximum])
AC_MSG_CHECKING([for CPUID instruction])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
[[
#include <stdint.h>
]],
[[
uint32_t eax, ebx, ecx, edx;
asm volatile (
"cpuid"
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "a" (eax));
]]),
[have_cpuid=yes],
[have_cpuid=no])
if test "x$have_cpuid" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_CPUID], 1, [whether CPUID instruction is supported])
fi
AC_MSG_RESULT([$have_cpuid])
dnl Support large files / 64 bit seek offsets.
dnl Use --disable-largefile if you don't want this.
AC_SYS_LARGEFILE
dnl Availability of various common functions (non-fatal if missing).
AC_CHECK_FUNCS([cfmakeraw regexec uname sched_getaffinity getuid getgid posix_fallocate mmap readlink])
AC_CHECK_FUNCS([cfmakeraw regexec uname sched_getaffinity getuid getgid posix_fallocate mmap])
dnl Availability of various not common threadsafe functions
AC_CHECK_FUNCS([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r])
@ -90,7 +116,8 @@ dnl If portablexdr is installed, prefer that.
dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris)
dnl or none (most Unix)
AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[],
[AC_MSG_ERROR([Cannot find a XDR library])])
])
AC_CHECK_LIB([intl],[gettext],[])
@ -178,33 +205,33 @@ fi
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
AC_ARG_WITH([xen],
[ --with-xen add XEN support (on)],[],[with_xen=yes])
AC_HELP_STRING([--with-xen], [add XEN support @<:@default=check@:>@]),[],[with_xen=check])
AC_ARG_WITH([xen-inotify],
[ --with-xen-inotify add XEN inotify support (on)],[],[with_xen_inotify=check])
AC_HELP_STRING([--with-xen-inotify], [add XEN inotify support @<:@default=check@:>@]),[],[with_xen_inotify=check])
AC_ARG_WITH([qemu],
[ --with-qemu add QEMU/KVM support (on)],[],[with_qemu=yes])
AC_HELP_STRING([--with-qemu], [add QEMU/KVM support @<:@default=yes@:>@]),[],[with_qemu=yes])
AC_ARG_WITH([uml],
[ --with-uml add UML support (on)],[],[with_uml=check])
AC_HELP_STRING([--with-uml], [add UML support @<:@default=check@:>@]),[],[with_uml=check])
AC_ARG_WITH([openvz],
[ --with-openvz add OpenVZ support (on)],[],[with_openvz=yes])
AC_HELP_STRING([--with-openvz], [add OpenVZ support @<:@default=yes@:>@]),[],[with_openvz=yes])
AC_ARG_WITH([libssh2],
[ --with-libssh2=[PFX] libssh2 location],[],[with_libssh2=yes])
AC_HELP_STRING([--with-libssh2=@<:@PFX@:>@], [libssh2 location @<:@default=/usr/local/lib@:>@]),[],[with_libssh2=yes])
AC_ARG_WITH([phyp],
[ --with-phyp=[PFX] add PHYP support (on)],[],[with_phyp=check])
AC_HELP_STRING([--with-phyp], [add PHYP support @<:@default=check@:>@]),[],[with_phyp=check])
AC_ARG_WITH([vbox],
[ --with-vbox add VirtualBox support (on)],[],[with_vbox=yes])
AC_HELP_STRING([--with-vbox], [add VirtualBox support @<:@default=yes@:>@]),[],[with_vbox=yes])
AC_ARG_WITH([lxc],
[ --with-lxc add Linux Container support (on)],[],[with_lxc=check])
AC_HELP_STRING([--with-lxc], [add Linux Container support @<:@default=check@:>@]),[],[with_lxc=check])
AC_ARG_WITH([one],
[ --with-one add ONE support (on)],[],[with_one=check])
AC_HELP_STRING([--with-one], [add ONE support @<:@default=check@:>@]),[],[with_one=check])
AC_ARG_WITH([esx],
[ --with-esx add ESX support (on)],[],[with_esx=check])
AC_HELP_STRING([--with-esx], [add ESX support @<:@default=check@:>@]),[],[with_esx=check])
AC_ARG_WITH([test],
[ --with-test add test driver support (on)],[],[with_test=yes])
AC_HELP_STRING([--with-test], [add test driver support @<:@default=yes@:>@]),[],[with_test=yes])
AC_ARG_WITH([remote],
[ --with-remote add remote driver support (on)],[],[with_remote=yes])
AC_HELP_STRING([--with-remote], [add remote driver support @<:@default=yes@:>@]),[],[with_remote=yes])
AC_ARG_WITH([libvirtd],
[ --with-libvirtd add libvirtd support (on)],[],[with_libvirtd=yes])
AC_HELP_STRING([--with-libvirtd], [add libvirtd support @<:@default=yes@:>@]),[],[with_libvirtd=yes])
dnl
dnl specific tests to setup DV devel environments with debug etc ...
@ -218,8 +245,8 @@ AC_SUBST([STATIC_BINARIES])
dnl --enable-debug=(yes|no)
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug=no/yes],
[enable debugging output])],[],[enable_debug=yes])
[AC_HELP_STRING([--enable-debug=@<:@no|yes@:>@],
[enable debugging output @<:@default=yes@:>@])],[],[enable_debug=yes])
AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes")
if test x"$enable_debug" = x"yes"; then
AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
@ -227,7 +254,7 @@ fi
AC_MSG_CHECKING([where to write libvirtd PID file])
AC_ARG_WITH([remote-pid-file], [AC_HELP_STRING([--with-remote-pid-file=[pidfile|none]], [PID file for libvirtd])])
AC_ARG_WITH([remote-pid-file], [AC_HELP_STRING([--with-remote-pid-file=@<:@pidfile|none@:>@], [PID file for libvirtd])])
if test "x$with_remote_pid_file" == "x" ; then
REMOTE_PID_FILE="$localstatedir/run/libvirtd.pid"
elif test "x$with_remote_pid_file" == "xnone" ; then
@ -243,50 +270,32 @@ dnl init script flavor
dnl
AC_MSG_CHECKING([for init script flavor])
AC_ARG_WITH([init-script],
[AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
[Style of init scripts to install (defaults to auto)])])
if test "x$with_init_scripts" = "x" -o "x$with_init_scripts" = "xauto"; then
[AC_HELP_STRING([--with-init-script=@<:@redhat|auto|none@:>@],
[Style of init script to install @<:@default=auto@:>@])])
if test "x$with_init_script" = "x" -o "x$with_init_script" = "xauto"; then
if test -f /etc/redhat-release ; then
with_init_scripts=redhat
with_init_script=redhat
else
with_init_scripts=none
with_init_script=none
fi
fi
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPTS_RED_HAT], test x$with_init_scripts = xredhat)
AC_MSG_RESULT($with_init_scripts)
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test x$with_init_script = xredhat)
AC_MSG_RESULT($with_init_script)
dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
AC_ARG_WITH([rhel5-api],
[AC_HELP_STRING([--with-rhel5-api=[ARG]],
[build for the RHEL-5 API [default=no]])])
[AC_HELP_STRING([--with-rhel5-api=@<:@ARG@:>@],
[build for the RHEL-5 API @<:@default=no@:>@])])
if test x"$with_rhel5_api" = x"yes"; then
AC_DEFINE([WITH_RHEL5_API], [1], [whether building for the RHEL-5 API])
fi
dnl
dnl ensure that Fedora's system-config-firewall knows
dnl about libvirt's iptables rules
dnl
AC_ARG_ENABLE([iptables-lokkit],
[AC_HELP_STRING([--enable-iptables-lokkit=no/yes/check],
[enable registering libvirt's iptables rules with Fedora's lokkit])],
[],[enable_iptables_lokkit=check])
if test x"$enable_iptables_lokkit" != x"no"; then
AC_PATH_PROG([LOKKIT_PATH],[lokkit], [], [/usr/sbin:$PATH])
fi
if test x"$enable_iptables_lokkit" = x"yes" -a x"$LOKKIT_PATH" = x; then
AC_MSG_ERROR([Cannot find lokkit and --enable-iptables-lokkit specified])
fi
if test x"$LOKKIT_PATH" != x; then
AC_DEFINE([ENABLE_IPTABLES_LOKKIT], [], [whether support for Fedora's lokkit is enabled])
AC_DEFINE_UNQUOTED([LOKKIT_PATH], "$LOKKIT_PATH", [path to lokkit binary])
fi
AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [/usr/sbin:$PATH])
AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary])
AC_PATH_PROG([EBTABLES_PATH], [ebtables], /sbin/ebtables, [/usr/sbin:$PATH])
AC_DEFINE_UNQUOTED([EBTABLES_PATH], "$EBTABLES_PATH", [path to ebtables binary])
if test "$with_openvz" = "yes"; then
AC_DEFINE_UNQUOTED([WITH_OPENVZ], 1, [whether OpenVZ driver is enabled])
fi
@ -325,6 +334,8 @@ if test "$with_libvirtd" = "yes" ; then
fi
AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"])
old_LIBS="$LIBS"
old_CFLAGS="$CFLAGS"
XEN_LIBS=""
XEN_CFLAGS=""
dnl search for the Xen store library
@ -334,52 +345,58 @@ if test "$with_xen" != "no" ; then
XEN_LIBS="-L$with_xen/lib64 -L$with_xen/lib"
fi
fail=0
old_LIBS="$LIBS"
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $XEN_CFLAGS"
LIBS="$LIBS $XEN_LIBS"
AC_CHECK_LIB([xenstore], [xs_read], [
with_xen=yes
XEN_LIBS="$XEN_LIBS -lxenstore"
],[
if test "$with_xen" = "check" ; then
with_xen=no
else
with_xen=no
if test "$with_xen" = "yes"; then
fail=1
fi
with_xen=no
])
test $fail = 1 &&
AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore])
AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[
AC_MSG_ERROR([Cannot find standard Xen headers. Is xen-devel installed?])
],
[#include <stdio.h>
#include <stdint.h>
])
dnl Search for the location of <xen/{linux,sys}/privcmd.h>.
AC_CHECK_HEADERS([xen/sys/privcmd.h],,[
AC_CHECK_HEADERS([xen/linux/privcmd.h],,[
AC_MSG_ERROR([Cannot find header file <xen/linux/privcmd.h> or <xen/sys/privcmd.h>. Is xen-devel installed?])
],
[#include <stdio.h>
#include <stdint.h>
#include <xen/xen.h>
])
],
[#include <stdio.h>
#include <stdint.h>
#include <xen/xen.h>
])
LIBS="$old_LIBS"
CFLAGS="$old_CFLAGS"
fi
if test "$with_xen" != "no" ; then
AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[
if test "$with_xen" = "yes"; then
fail=1
fi
with_xen=no
],
[#include <stdio.h>
#include <stdint.h>
])
fi
if test "$with_xen" != "no" ; then
dnl Search for the location of <xen/{linux,sys}/privcmd.h>.
found=
AC_CHECK_HEADERS([xen/sys/privcmd.h xen/linux/privcmd.h], [found=yes; break;], [],
[#include <stdio.h>
#include <stdint.h>
#include <xen/xen.h>
])
if test "x$found" != "xyes"; then
if test "$with_xen" = "yes"; then
fail=1
fi
with_xen=no
fi
fi
LIBS="$old_LIBS"
CFLAGS="$old_CFLAGS"
if test $fail = 1; then
AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore])
fi
if test "$with_xen" = "yes"; then
AC_DEFINE_UNQUOTED([WITH_XEN], 1, [whether Xen driver is enabled])
fi
AM_CONDITIONAL([WITH_XEN], [test "$with_xen" = "yes"])
AC_SUBST([XEN_CFLAGS])
AC_SUBST([XEN_LIBS])
@ -469,8 +486,6 @@ PKG_PROG_PKG_CONFIG
dnl OpenNebula driver Compilation setting
dnl
XMLRPC_REQUIRED=1.14.0
XMLRPC_CFLAGS=
XMLRPC_LIBS=
if test "x$with_one" = "xyes" -o "x$with_one" = "xcheck"; then
@ -502,7 +517,7 @@ LIBXML_CFLAGS=""
LIBXML_LIBS=""
LIBXML_FOUND="no"
AC_ARG_WITH([libxml], [ --with-libxml=[PFX] libxml2 location])
AC_ARG_WITH([libxml], AC_HELP_STRING([--with-libxml=@<:@PFX@:>@], [libxml2 location]))
if test "x$with_libxml" = "xno" ; then
AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED)
AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt])
@ -535,20 +550,20 @@ AC_SUBST([LIBXML_LIBS])
dnl xmlURI structure has query_raw?
old_cflags="$CFLAGS"
old_ldflags="$LDFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $LIBXML_CFLAGS"
LDFLAGS="$LDFLAGS $LIBXML_LIBS"
LIBS="$LIBS $LIBXML_LIBS"
AC_CHECK_MEMBER([struct _xmlURI.query_raw],
[AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [], [Have query_raw field in libxml2 xmlURI structure])],,
[#include <libxml/uri.h>])
CFLAGS="$old_cflags"
LDFLAGS="$old_ldflags"
LIBS="$old_libs"
dnl GnuTLS library
GNUTLS_CFLAGS=
GNUTLS_LIBS=
GNUTLS_FOUND=no
if test -z "$PKG_CONFIG" ; then
if test -x "$PKG_CONFIG" ; then
PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_REQUIRED,
[GNUTLS_FOUND=yes], [GNUTLS_FOUND=no])
fi
@ -561,8 +576,12 @@ if test "$GNUTLS_FOUND" = "no"; then
test $fail = 1 &&
AC_MSG_ERROR([You must install the GnuTLS library in order to compile and run libvirt])
GNUTLS_LIBS=$LIBS
dnl Not all versions of gnutls include -lgcrypt, and so we add
dnl it explicitly for the calls to gcry_control/check_version
GNUTLS_LIBS="$LIBS -lgcrypt"
LIBS="$old_libs"
else
GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
fi
AC_SUBST([GNUTLS_CFLAGS])
@ -572,20 +591,20 @@ dnl Old versions of GnuTLS uses types like 'gnutls_session' instead
dnl of 'gnutls_session_t'. Try to detect this type if defined so
dnl that we can offer backwards compatibility.
old_cflags="$CFLAGS"
old_ldflags="$LDFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
LDFLAGS="$LDFLAGS $GNUTLS_LIBS"
LIBS="$LIBS $GNUTLS_LIBS"
AC_CHECK_TYPE([gnutls_session],
AC_DEFINE([GNUTLS_1_0_COMPAT],[],
[enable GnuTLS 1.0 compatibility macros]),,
[#include <gnutls/gnutls.h>])
CFLAGS="$old_cflags"
LDFLAGS="$old_ldflags"
LIBS="$old_libs"
dnl Cyrus SASL
AC_ARG_WITH([sasl],
[ --with-sasl use cyrus SASL for authentication],
AC_HELP_STRING([--with-sasl], [use cyrus SASL for authentication @<:@default=check@:>@]),
[],
[with_sasl=check])
@ -602,7 +621,7 @@ if test "x$with_sasl" != "xno"; then
CFLAGS="$CFLAGS $SASL_CFLAGS"
LIBS="$LIBS $SASL_LIBS"
AC_CHECK_HEADER([sasl/sasl.h],[],[
if test "x$with_sasl" != "xcheck" ; then
if test "x$with_sasl" = "xcheck" ; then
with_sasl=no
else
fail=1
@ -638,12 +657,62 @@ AC_SUBST([SASL_CFLAGS])
AC_SUBST([SASL_LIBS])
dnl YAJL JSON library http://lloyd.github.com/yajl/
AC_ARG_WITH([yajl],
AC_HELP_STRING([--with-yajl], [use YAJL for JSON parsing/formatting @<:@default=check@:>@]),
[],
[with_yajl=check])
YAJL_CFLAGS=
YAJL_LIBS=
if test "x$with_yajl" != "xno"; then
if test "x$with_yajl" != "xyes" -a "x$with_yajl" != "xcheck"; then
YAJL_CFLAGS="-I$with_yajl/include"
YAJL_LIBS="-L$with_yajl/lib"
fi
fail=0
old_cppflags="$CPPFLAGS"
old_libs="$LIBS"
CPPFLAGS="$CPPFLAGS $YAJL_CFLAGS"
LIBS="$LIBS $YAJL_LIBS"
AC_CHECK_HEADER([yajl/yajl_common.h],[],[
if test "x$with_yajl" = "xcheck" ; then
with_yajl=no
else
fail=1
fi])
if test "x$with_yajl" != "xno" ; then
AC_CHECK_LIB([yajl], [yajl_parse],[
YAJL_LIBS="$YAJL_LIBS -lyajl"
with_yajl=yes
],[
if test "x$with_yajl" = "xcheck" ; then
with_yajl=no
else
fail=1
fi
])
fi
test $fail = 1 &&
AC_MSG_ERROR([You must install the YAJL development package in order to compile libvirt])
CPPFLAGS="$old_cppflags"
LIBS="$old_libs"
if test "x$with_yajl" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_YAJL], 1,
[whether YAJL is available for JSON parsing/formatting])
fi
fi
AM_CONDITIONAL([HAVE_YAJL], [test "x$with_yajl" = "xyes"])
AC_SUBST([YAJL_CFLAGS])
AC_SUBST([YAJL_LIBS])
dnl PolicyKit library
POLKIT_CFLAGS=
POLKIT_LIBS=
PKCHECK_PATH=
AC_ARG_WITH([polkit],
[ --with-polkit use PolicyKit for UNIX socket access checks],
AC_HELP_STRING([--with-polkit], [use PolicyKit for UNIX socket access checks @<:@default=check@:>@]),
[],
[with_polkit=check])
@ -678,12 +747,12 @@ if test "x$with_polkit" = "xyes" -o "x$with_polkit" = "xcheck"; then
[use PolicyKit for UNIX socket access checks])
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
old_LIBS=$LIBS
CFLAGS="$CFLAGS $POLKIT_CFLAGS"
LDFLAGS="$LDFLAGS $POLKIT_LIBS"
LIBS="$LIBS $POLKIT_LIBS"
AC_CHECK_FUNCS([polkit_context_is_caller_authorized])
CFLAGS="$old_CFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
AC_PATH_PROG([POLKIT_AUTH], [polkit-auth])
if test "x$POLKIT_AUTH" != "x"; then
@ -701,7 +770,7 @@ AC_SUBST([POLKIT_LIBS])
dnl Avahi library
AC_ARG_WITH([avahi],
[ --with-avahi use avahi to advertise remote daemon],
AC_HELP_STRING([--with-avahi], [use avahi to advertise remote daemon @<:@default=check@:>@]),
[],
[with_avahi=check])
@ -728,7 +797,7 @@ AC_SUBST([AVAHI_LIBS])
dnl SELinux
AC_ARG_WITH([selinux],
[ --with-selinux use SELinux to manage security],
AC_HELP_STRING([--with-selinux], [use SELinux to manage security @<:@default=check@:>@]),
[],
[with_selinux=check])
@ -763,7 +832,7 @@ AC_SUBST([SELINUX_LIBS])
AC_ARG_WITH([secdriver-selinux],
[ --with-secdriver-selinux use SELinux security driver],
AC_HELP_STRING([--with-secdriver-selinux], [use SELinux security driver @<:@default=check@:>@]),
[],
[with_secdriver_selinux=check])
@ -801,7 +870,7 @@ AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"
dnl AppArmor
AC_ARG_WITH([apparmor],
[ --with-apparmor use AppArmor to manage security],
AC_HELP_STRING([--with-apparmor], [use AppArmor to manage security @<:@default=check@:>@]),
[],
[with_apparmor=check])
@ -840,7 +909,7 @@ AC_SUBST([APPARMOR_LIBS])
AC_ARG_WITH([secdriver-apparmor],
[ --with-secdriver-apparmor use AppArmor security driver],
AC_HELP_STRING([--with-secdriver-apparmor], [use AppArmor security driver @<:@default=check@:>@]),
[],
[with_secdriver_apparmor=check])
@ -879,7 +948,7 @@ AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "n
dnl NUMA lib
AC_ARG_WITH([numactl],
[ --with-numactl use numactl for host topology info],
AC_HELP_STRING([--with-numactl], [use numactl for host topology info @<:@default=check@:>@]),
[],
[with_numactl=check])
@ -974,7 +1043,7 @@ if test "$with_phyp" = "check"; then
if test "$with_phyp" != "no"; then
saved_libs="$LIBS"
LIBS="$LIBS -lssh2"
LIBS="$LIBS -L$libssh2_path -lssh2"
AC_TRY_LINK([#include <libssh2.h>], [
(void) libssh2_session_block_directions(NULL);
], [
@ -1014,7 +1083,7 @@ AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"])
dnl libcap-ng
AC_ARG_WITH([capng],
[ --with-capng use libcap-ng to reduce libvirtd privileges],
AC_HELP_STRING([--with-capng], [use libcap-ng to reduce libvirtd privileges @<:@default=check@:>@]),
[],
[with_capng=check])
@ -1097,7 +1166,7 @@ AC_SUBST([VIRSH_LIBS])
AC_ARG_WITH([network],
[ --with-network with virtual network driver (on)],[],[with_network=yes])
AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes])
if test "$with_libvirtd" = "no" ; then
with_network=no
fi
@ -1115,7 +1184,7 @@ AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
dnl netcf library
AC_ARG_WITH([netcf],
[ --with-netcf libnetcf support to configure physical host network interfaces],
AC_HELP_STRING([--with-netcf], [libnetcf support to configure physical host network interfaces @<:@default=check@:>@]),
[], [with_netcf=check])
NETCF_CFLAGS=
@ -1151,17 +1220,17 @@ AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"])
AC_ARG_WITH([storage-fs],
[ --with-storage-fs with FileSystem backend for the storage driver (on)],[],[with_storage_fs=check])
AC_HELP_STRING([--with-storage-fs], [with FileSystem backend for the storage driver @<:@default=check@:>@]),[],[with_storage_fs=check])
AC_ARG_WITH([storage-lvm],
[ --with-storage-lvm with LVM backend for the storage driver (on)],[],[with_storage_lvm=check])
AC_HELP_STRING([--with-storage-lvm], [with LVM backend for the storage driver @<:@default=check@:>@]),[],[with_storage_lvm=check])
AC_ARG_WITH([storage-iscsi],
[ --with-storage-iscsi with iSCSI backend for the storage driver (on)],[],[with_storage_iscsi=check])
AC_HELP_STRING([--with-storage-iscsi], [with iSCSI backend for the storage driver @<:@default=check@:>@]),[],[with_storage_iscsi=check])
AC_ARG_WITH([storage-scsi],
[ --with-storage-scsi with SCSI backend for the storage driver (on)],[],[with_storage_scsi=check])
AC_HELP_STRING([--with-storage-scsi], [with SCSI backend for the storage driver @<:@default=check@:>@]),[],[with_storage_scsi=check])
AC_ARG_WITH([storage-mpath],
[ --with-storage-mpath with mpath backend for the storage driver (on)],[],[with_storage_mpath=check])
AC_HELP_STRING([--with-storage-mpath], [with mpath backend for the storage driver @<:@default=check@:>@]),[],[with_storage_mpath=check])
AC_ARG_WITH([storage-disk],
[ --with-storage-disk with GPartd Disk backend for the storage driver (on)],[],[with_storage_disk=check])
AC_HELP_STRING([--with-storage-disk], [with GPartd Disk backend for the storage driver @<:@default=check@:>@]),[],[with_storage_disk=check])
with_storage_dir=yes
if test "$with_libvirtd" = "no"; then
@ -1301,14 +1370,24 @@ fi
AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"])
if test "$with_storage_mpath" = "yes"; then
DEVMAPPER_REQUIRED=0.0
DEVMAPPER_CFLAGS=
DEVMAPPER_LIBS=
PKG_CHECK_MODULES(DEVMAPPER, devmapper >= $DEVMAPPER_REQUIRED,
[], [
AC_MSG_ERROR(
[You must install device-mapper-devel >= $DEVMAPPER_REQUIRED to compile libvirt])
])
PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no])
if test "$DEVMAPPER_FOUND" = "no"; then
# devmapper is missing pkg-config files in ubuntu, suse, etc
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
DEVMAPPER_FOUND=yes
AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
DEVMAPPER_LIBS="-ldevmapper"
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
if test "$DEVMAPPER_FOUND" = "no" ; then
AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
fi
fi
AC_SUBST([DEVMAPPER_CFLAGS])
AC_SUBST([DEVMAPPER_LIBS])
@ -1365,7 +1444,6 @@ dnl
LIBCURL_CFLAGS=""
LIBCURL_LIBS=""
LIBCURL_REQUIRED="7.18.0"
LIBCURL_FOUND="no"
if test "$with_esx" = "yes" -o "$with_esx" = "check"; then
@ -1394,79 +1472,79 @@ dnl check for python
dnl
AC_ARG_WITH([python],
[ --with-python Build python bindings (on)],[],[with_python=yes])
AC_HELP_STRING([--with-python], [Build python bindings @<:@default=yes@:>@]),[],[with_python=yes])
if test "$enable_shared:$with_python" = no:yes; then
AC_MSG_WARN([Disabling shared libraries is incompatible with building Python extensions.])
AC_MSG_WARN([Ignoring --with-python.])
with_python=no
fi
PYTHON_VERSION=
PYTHON_INCLUDES=
PYTHON_SITE_PACKAGES=
PYTHON_TESTS=
pythondir=
if test "$with_python" != "no" ; then
if test -x "$with_python/bin/python"
then
echo Found python in $with_python/bin/python
AC_MSG_NOTICE(Found python in $with_python/bin/python)
PYTHON="$with_python/bin/python"
with_python=yes
else
if test -x "$with_python"
then
echo Found python in $with_python
PYTHON="$with_python"
else
if test -x "$PYTHON"
then
echo Found python in environment PYTHON=$PYTHON
with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
else
AC_PATH_PROG([PYTHON], [python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
fi
fi
if test -x "$with_python"
then
AC_MSG_NOTICE(Found python in $with_python)
PYTHON="$with_python"
with_python=yes
else
if test -x "$PYTHON"
then
AC_MSG_NOTICE(Found python in environment PYTHON=$PYTHON)
with_python=yes
fi
fi
fi
if test "$PYTHON" != ""
then
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
echo Found Python version $PYTHON_VERSION
fi
if test "$PYTHON_VERSION" != ""
then
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
-d $with_python/lib/python$PYTHON_VERSION/site-packages
then
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -r /usr/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
echo could not find python$PYTHON_VERSION/Python.h
fi
fi
if test ! -d "$PYTHON_SITE_PACKAGES"
then
PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
fi
fi
fi
if test "$with_python" != "yes"
then
pythondir='$(PYTHON_SITE_PACKAGES)'
if test "$with_python" == "yes" ; then
AM_PATH_PYTHON(,, [:])
if test "$PYTHON" != : ; then
PYTHON_CONFIG="$PYTHON-config"
if test -x "$PYTHON_CONFIG"
then
PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
else
if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
else
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
else
if test -r /usr/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
else
AC_MSG_NOTICE([Could not find python$PYTHON_VERSION/Python.h, disabling bindings])
with_python=no
fi
fi
fi
fi
else
AC_MSG_NOTICE([Could not find python interpreter, disabling bindings])
with_python=no
fi
else
pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
AC_MSG_NOTICE([Could not find python in $with_python, disabling bindings])
with_python=no
fi
else
PYTHON=
fi
AM_CONDITIONAL([WITH_PYTHON], test "$PYTHON_INCLUDES" != "")
AC_SUBST([pythondir])
AM_CONDITIONAL([WITH_PYTHON], [test "$with_python" = "yes"])
AC_SUBST([PYTHON_VERSION])
AC_SUBST([PYTHON_INCLUDES])
AC_SUBST([PYTHON_SITE_PACKAGES])
AC_MSG_CHECKING([whether this host is running a Xen kernel])
RUNNING_XEN=
@ -1491,7 +1569,7 @@ AC_MSG_RESULT($RUNNING_XEND)
AM_CONDITIONAL([ENABLE_XEN_TESTS], [test "$RUNNING_XEN" != "no" -a "$RUNNING_XEND" != "no"])
AC_ARG_ENABLE([test-coverage],
[ --enable-test-coverage turn on code coverage instrumentation],
AC_HELP_STRING([--enable-test-coverage], [turn on code coverage instrumentation @<:@default=no@:>@]),
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-coverage option]) ;;
@ -1508,7 +1586,7 @@ if test "${enable_coverage}" = yes; then
fi
AC_ARG_ENABLE([test-oom],
[ --enable-test-oom memory allocation failure checking],
AC_HELP_STRING([--enable-test-oom], [memory allocation failure checking @<:@default=no@:>@]),
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-oom option]) ;;
@ -1528,7 +1606,7 @@ fi
AC_ARG_ENABLE([test-locking],
[ --enable-test-locking thread locking tests using CIL],
AC_HELP_STRING([--enable-test-locking], [thread locking tests using CIL @<:@default=no@:>@]),
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-locking option]) ;;
@ -1545,7 +1623,7 @@ AM_CONDITIONAL([WITH_CIL],[test "$enable_locking" = "yes"])
dnl Enable building the proxy?
AC_ARG_WITH([xen-proxy],
[ --with-xen-proxy add XEN setuid proxy support (on)],[],[with_xen_proxy=auto])
AC_HELP_STRING([--with-xen-proxy], [add XEN setuid proxy support @<:@default=auto@:>@]),[],[with_xen_proxy=auto])
AC_MSG_CHECKING([if Xen setuid proxy is needed])
if test "$with_xen_proxy" = "auto"; then
@ -1605,7 +1683,7 @@ AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != "no"])
dnl Driver-Modules library
AC_ARG_WITH([driver-modules],
[ --with-driver-modules build drivers as loadable modules],
AC_HELP_STRING([--with-driver-modules], [build drivers as loadable modules @<:@default=no@:>@]),
[],
[with_driver_modules=no])
@ -1640,12 +1718,11 @@ test "$enable_shared" = no && lt_cv_objdir=.
LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.}
AC_SUBST([LV_LIBTOOL_OBJDIR])
dnl HAL or DeviceKit library for host device enumeration
HAL_REQUIRED=0.0
dnl HAL library check for host device enumeration
HAL_CFLAGS=
HAL_LIBS=
AC_ARG_WITH([hal],
[ --with-hal use HAL for host device enumeration],
AC_HELP_STRING([--with-hal], [use HAL for host device enumeration @<:@default=check@:>@]),
[],
[with_hal=check])
@ -1663,79 +1740,73 @@ if test "x$with_hal" = "xyes" -o "x$with_hal" = "xcheck"; then
fi
])
if test "x$with_hal" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_HAL], 1,
[use HAL for host device enumeration])
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
old_LIBS=$LIBS
CFLAGS="$CFLAGS $HAL_CFLAGS"
LDFLAGS="$LDFLAGS $HAL_LIBS"
LIBS="$LIBS $HAL_LIBS"
AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no])
AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
CFLAGS="$old_CFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
fi
if test "x$with_hal" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_HAL], 1,
[use HAL for host device enumeration])
fi
fi
AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"])
AC_SUBST([HAL_CFLAGS])
AC_SUBST([HAL_LIBS])
DEVKIT_REQUIRED=0.0
DEVKIT_CFLAGS=
DEVKIT_LIBS=
AC_ARG_WITH([devkit],
[ --with-devkit use DeviceKit for host device enumeration],
dnl udev/libpciaccess library check for alternate host device enumeration
UDEV_CFLAGS=
UDEV_LIBS=
PCIACCESS_CFLAGS=
PCIACCESS_LIBS=
AC_ARG_WITH([udev],
AC_HELP_STRING([--with-udev], [use libudev for host device enumeration @<:@default=check@:>@]),
[],
[with_devkit=no])
[with_udev=check])
if test "$with_libvirtd" = "no" ; then
with_devkit=no
with_udev=no
fi
dnl Extra check needed while devkit pkg-config info missing glib2 dependency
PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 0.0,,[
if test "x$with_devkit" = "xcheck"; then
with_devkit=no
elif test "x$with_devkit" = "xyes"; then
AC_MSG_ERROR([required package DeviceKit requires package glib-2.0])
fi])
if test "x$with_devkit" = "xyes" -o "x$with_devkit" = "xcheck"; then
PKG_CHECK_MODULES(DEVKIT, devkit-gobject >= $DEVKIT_REQUIRED,
[with_devkit=yes], [
if test "x$with_devkit" = "xcheck" ; then
with_devkit=no
if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then
PKG_CHECK_MODULES(UDEV, libudev >= $UDEV_REQUIRED,
[], [
if test "x$with_udev" = "xcheck" ; then
with_udev=no
else
AC_MSG_ERROR(
[You must install DeviceKit-devel >= $DEVKIT_REQUIRED to compile libvirt])
[You must install libudev-devel >= $UDEV_REQUIRED to compile libvirt])
fi
])
if test "x$with_devkit" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_DEVKIT], 1,
[use DeviceKit for host device enumeration])
dnl Add glib2 flags explicitly while devkit pkg-config info missing glib2 dependency
DEVKIT_CFLAGS="$GLIB2_CFLAGS $DEVKIT_CFLAGS"
DEVKIT_LIBS="$GLIB2_LIBS $DEVKIT_LIBS"
dnl Add more flags apparently required for devkit to work properly
DEVKIT_CFLAGS="$DEVKIT_CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $DEVKIT_CFLAGS"
LDFLAGS="$LDFLAGS $DEVKIT_LIBS"
AC_CHECK_FUNCS([devkit_client_connect],,[with_devkit=no])
CFLAGS="$old_CFLAGS"
LDFLAGS="$old_LDFLAGS"
if test "x$with_udev" != "xno"; then
PKG_CHECK_MODULES(PCIACCESS, pciaccess >= $PCIACCESS_REQUIRED,
[with_udev=yes],
[
if test "x$with_udev" = "xcheck" ; then
with_udev=no
else
AC_MSG_ERROR(
[You must install libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt])
fi
])
fi
if test "x$with_udev" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_UDEV], 1,
[use UDEV for host device enumeration])
fi
fi
AM_CONDITIONAL([HAVE_DEVKIT], [test "x$with_devkit" = "xyes"])
AC_SUBST([DEVKIT_CFLAGS])
AC_SUBST([DEVKIT_LIBS])
AM_CONDITIONAL([HAVE_UDEV], [test "x$with_udev" = "xyes"])
AC_SUBST([UDEV_CFLAGS])
AC_SUBST([UDEV_LIBS])
AC_SUBST([PCIACCESS_CFLAGS])
AC_SUBST([PCIACCESS_LIBS])
with_nodedev=no;
if test "$with_devkit" = "yes" -o "$with_hal" = "yes";
if test "$with_hal" = "yes" -o "$with_udev" = "yes";
then
with_nodedev=yes
AC_DEFINE_UNQUOTED([WITH_NODE_DEVICES], 1, [with node device driver])
@ -1746,17 +1817,16 @@ AM_CONDITIONAL([WITH_LINUX], [test `uname -s` = "Linux"])
AC_ARG_WITH([qemu-user],
[ --with-qemu-user username to run QEMU system instance as],
AC_HELP_STRING([--with-qemu-user], [username to run QEMU system instance as @<:@default=root@:>@]),
[QEMU_USER=${withval}],
[QEMU_USER=root])
AC_ARG_WITH([qemu-group],
[ --with-qemu-group groupname to run QEMU system instance as],
AC_HELP_STRING([--with-qemu-group], [groupname to run QEMU system instance as @<:@default=root@:>@]),
[QEMU_GROUP=${withval}],
[QEMU_GROUP=root])
AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account])
AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
# Only COPYING.LIB is under version control, yet COPYING
# is included as part of the distribution tarball.
# Copy one to the other, but only if this is a srcdir-build.
@ -1780,6 +1850,7 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
tests/xmconfigdata/Makefile \
tests/xencapsdata/Makefile \
tests/confdata/Makefile \
examples/apparmor/Makefile \
examples/domain-events/events-c/Makefile \
examples/domsuspend/Makefile \
examples/dominfo/Makefile \
@ -1851,6 +1922,11 @@ AC_MSG_NOTICE([ sasl: $SASL_CFLAGS $SASL_LIBS])
else
AC_MSG_NOTICE([ sasl: no])
fi
if test "$with_yajl" != "no" ; then
AC_MSG_NOTICE([ yajl: $YAJL_CFLAGS $YAJL_LIBS])
else
AC_MSG_NOTICE([ yajl: no])
fi
if test "$with_avahi" = "yes" ; then
AC_MSG_NOTICE([ avahi: $AVAHI_CFLAGS $AVAHI_LIBS])
else
@ -1895,10 +1971,10 @@ AC_MSG_NOTICE([ hal: $HAL_CFLAGS $HAL_LIBS])
else
AC_MSG_NOTICE([ hal: no])
fi
if test "$with_devkit" = "yes" ; then
AC_MSG_NOTICE([ devkit: $DEVKIT_CFLAGS $DEVKIT_LIBS])
if test "$with_udev" = "yes" ; then
AC_MSG_NOTICE([ udev: $UDEV_CFLAGS $UDEV_LIBS $PCIACCESS_CFLAGS $PCIACCESS_LIBS])
else
AC_MSG_NOTICE([ devkit: no])
AC_MSG_NOTICE([ udev: no])
fi
if test "$with_netcf" = "yes" ; then
AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $NETCF_LIBS])

View File

@ -110,6 +110,10 @@ endif
if WITH_NODE_DEVICES
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
endif
if WITH_SECRETS
libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
endif
libvirtd_LDADD += ../src/libvirt.la
@ -188,7 +192,7 @@ install-logrotate: libvirtd.logrotate
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
if LIBVIRT_INIT_SCRIPTS_RED_HAT
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init: libvirtd.init
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
$(INSTALL_SCRIPT) libvirtd.init \
@ -222,7 +226,7 @@ install-init:
uninstall-init:
libvirtd.init:
endif # DBUS_INIT_SCRIPTS_RED_HAT
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.

View File

@ -1,9 +1,29 @@
Threading: the RULES.
====================
Threading in the libvirtd daemon
================================
If you don't understand this, don't touch the code. Ask for
further advice / explanation on the mailing list first.
To allow efficient processing of RPC requests, the libvirtd daemon
makes use of threads.
- The process leader. This is the initial thread of control
when the daemon starts running. It is responsible for
initializing all the state, and starting the event loop.
Once that's all done, this thread does nothing except
wait for the event loop to quit, thus indicating an orderly
shutdown is required.
- The event loop. This thread runs the event loop, sitting
in poll() on all monitored file handles, and calculating
and dispatching any timers that may be registered. When
this thread quits, the entire daemon will shutdown.
- The workers. These 'n' threads all sit around waiting to
process incoming RPC requests. Since RPC requests may take
a long time to complete, with long idle periods, there will
be quite a few workers running.
The use of threads obviously requires locking to ensure safety when
accessing/changing data structures.
- the top level lock is on 'struct qemud_server'. This must be
held before acquiring any other lock
@ -16,47 +36,17 @@ further advice / explanation on the mailing list first.
this as a caller of virEvent APIs.
The server lock is only needed / used once the daemon has entered
its main loop, which is the qemudRunLoop() . The initial thread
acquires the lock upon entering this method.
The server lock is used in conjunction with a condition variable
to pass jobs from the event loop thread to the workers. The main
event loop thread handles I/O from the client socket, and once a
complete RPC message has been read off the wire (and optionally
decrypted), it will be placed onto the 'dx' job queue for the
associated client object. The job condition will be signalled and
a worker will wakup and process it.
It immediatelty spawns 'n' worker threads, whose main loop is
the qemudWorker() method. The workers will immediately try to
acquire the server lock, and thus block since its held by the
initial thread.
The worker thread must quickly drop its locks on the server and
client to allow the main event loop thread to continue running
with its other work. Critically important, is that now libvirt
API call will ever be made with the server or client locks held.
When the initial thread enters the poll() call, it drops the
server lock. The worker locks now each wakeup, acquire the
server lock and go into a condition wait on the 'job' condition
variable. The workers are now all 'primed' for incoming RPC
calls.
A file descriptor event now occurrs, causing the initial thread
to exit poll(). It invokes the registered callback associated
with the file descriptors on which the event occurrs. The callbacks
are required to immediately acquire the server lock.
If the callback is dealing with a client event, it will then
acquire the client lock, and drop the server lock.
The callback will now handle the I/O event, reading or writing
a RPC message. Once a complete RPC message has been read the
client is marked as being in state QEMUD_MODE_WAIT_DISPATCH,
and the 'job' condition variable is signaled. The callback
now drops the client lock and goes back into the poll() loop
waiting for more I/O events.
Meanwhile one of the worker threads wakes up from its condition
variable sleep, holding the server lock. It now searches for a
client in state QEMUD_MODE_WAIT_DISPATCH. If it doesn't find
one, it goes back to sleep. If it does find one, then it calls
into the remoteDispatchClientRequest() method de-serialize the
incoming message into an XDR object and invoke the helper method
for the associated RPC call.
While the helper method is executing, no locks are held on either
the client or server, but the ref count on the 'struct qemud_client'
object is incremented to ensure its not deleted. The helper can
now safely invoke the necessary libvirt API call.
-- End

View File

@ -413,7 +413,12 @@ static int virEventDispatchTimeouts(void) {
if (eventLoop.timeouts[i].deleted || eventLoop.timeouts[i].frequency < 0)
continue;
if (eventLoop.timeouts[i].expiresAt <= now) {
/* Add 20ms fuzz so we don't pointlessly spin doing
* <10ms sleeps, particularly on kernels with low HZ
* it is fine that a timer expires 20ms earlier than
* requested
*/
if (eventLoop.timeouts[i].expiresAt <= (now+20)) {
virEventTimeoutCallback cb = eventLoop.timeouts[i].cb;
int timer = eventLoop.timeouts[i].timer;
void *opaque = eventLoop.timeouts[i].opaque;

View File

@ -1,7 +1,7 @@
/*
* libvirtd.c: daemon start of day, guest process & i/o management
*
* Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
* Copyright (C) 2006-2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -93,8 +93,10 @@
#ifdef WITH_NODE_DEVICES
#include "node_device/node_device_driver.h"
#endif
#ifdef WITH_SECRETS
#include "secret/secret_driver.h"
#endif
#endif
#ifdef __sun
@ -185,6 +187,30 @@ static int max_client_requests = 5;
static sig_atomic_t sig_errors = 0;
static int sig_lasterrno = 0;
enum {
VIR_DAEMON_ERR_NONE = 0,
VIR_DAEMON_ERR_PIDFILE,
VIR_DAEMON_ERR_RUNDIR,
VIR_DAEMON_ERR_INIT,
VIR_DAEMON_ERR_SIGNAL,
VIR_DAEMON_ERR_PRIVS,
VIR_DAEMON_ERR_NETWORK,
VIR_DAEMON_ERR_CONFIG,
VIR_DAEMON_ERR_LAST
};
VIR_ENUM_DECL(virDaemonErr)
VIR_ENUM_IMPL(virDaemonErr, VIR_DAEMON_ERR_LAST,
"Initialization successful",
"Unable to obtain pidfile",
"Unable to create rundir",
"Unable to initialize libvirt",
"Unable to setup signal handlers",
"Unable to drop privileges",
"Unable to initialize network sockets",
"Unable to load configuration file")
static void sig_handler(int sig, siginfo_t * siginfo,
void* context ATTRIBUTE_UNUSED) {
int origerrno;
@ -335,7 +361,6 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
void *opaque) {
struct qemud_server *server = (struct qemud_server *)opaque;
siginfo_t siginfo;
int ret;
virMutexLock(&server->lock);
@ -347,8 +372,6 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
return;
}
ret = 0;
switch (siginfo.si_signo) {
case SIGHUP:
VIR_INFO0(_("Reloading configuration on SIGHUP"));
@ -360,7 +383,7 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
case SIGQUIT:
case SIGTERM:
VIR_WARN(_("Shutting down on signal %d"), siginfo.si_signo);
server->shutdown = 1;
server->quitEventThread = 1;
break;
default:
@ -368,14 +391,15 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
break;
}
if (ret != 0)
server->shutdown = 1;
virMutexUnlock(&server->lock);
}
static int qemudGoDaemon(void) {
static int daemonForkIntoBackground(void) {
int statuspipe[2];
if (pipe(statuspipe) < 0)
return -1;
int pid = fork();
switch (pid) {
case 0:
@ -384,6 +408,8 @@ static int qemudGoDaemon(void) {
int stdoutfd = -1;
int nextpid;
close(statuspipe[0]);
if ((stdinfd = open("/dev/null", O_RDONLY)) < 0)
goto cleanup;
if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0)
@ -407,7 +433,7 @@ static int qemudGoDaemon(void) {
nextpid = fork();
switch (nextpid) {
case 0:
return 0;
return statuspipe[1];
case -1:
return -1;
default:
@ -428,15 +454,29 @@ static int qemudGoDaemon(void) {
default:
{
int got, status = 0;
/* We wait to make sure the next child forked
successfully */
if ((got = waitpid(pid, &status, 0)) < 0 ||
int got, exitstatus = 0;
int ret;
char status;
close(statuspipe[1]);
/* We wait to make sure the first child forked successfully */
if ((got = waitpid(pid, &exitstatus, 0)) < 0 ||
got != pid ||
status != 0) {
exitstatus != 0) {
return -1;
}
_exit(0);
/* Now block until the second child initializes successfully */
again:
ret = read(statuspipe[0], &status, 1);
if (ret == -1 && errno == EINTR)
goto again;
if (ret == 1 && status != 0) {
fprintf(stderr, "error: %s\n", virDaemonErrTypeToString(status));
}
_exit(ret == 1 && status == 0 ? 0 : 1);
}
}
}
@ -535,16 +575,6 @@ static int qemudListenUnix(struct qemud_server *server,
goto cleanup;
}
if ((sock->watch = virEventAddHandleImpl(sock->fd,
VIR_EVENT_HANDLE_READABLE |
VIR_EVENT_HANDLE_ERROR |
VIR_EVENT_HANDLE_HANGUP,
qemudDispatchServerEvent,
server, NULL)) < 0) {
VIR_ERROR0(_("Failed to add server event callback"));
goto cleanup;
}
sock->next = server->sockets;
server->sockets = sock;
server->nsockets++;
@ -552,9 +582,9 @@ static int qemudListenUnix(struct qemud_server *server,
return 0;
cleanup:
if (sock->fd)
if (sock->fd >= 0)
close(sock->fd);
free(sock);
VIR_FREE(sock);
return -1;
}
@ -570,7 +600,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c
int e = getaddrinfo (node, service, &hints, &ai);
if (e != 0) {
VIR_ERROR(_("getaddrinfo: %s\n"), gai_strerror (e));
VIR_ERROR(_("getaddrinfo: %s"), gai_strerror (e));
return -1;
}
@ -587,19 +617,28 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c
int opt = 1;
setsockopt (fds[*nfds_r], SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt);
#ifdef IPV6_V6ONLY
if (runp->ai_family == PF_INET6) {
int on = 1;
/*
* Normally on Linux an INET6 socket will bind to the INET4
* address too. If getaddrinfo returns results with INET4
* first though, this will result in INET6 binding failing.
* We can trivially cope with multiple server sockets, so
* we force it to only listen on IPv6
*/
setsockopt(fds[*nfds_r], IPPROTO_IPV6,IPV6_V6ONLY,
(void*)&on, sizeof on);
}
#endif
if (bind (fds[*nfds_r], runp->ai_addr, runp->ai_addrlen) == -1) {
if (errno != EADDRINUSE) {
VIR_ERROR(_("bind: %s"), virStrerror (errno, ebuf, sizeof ebuf));
return -1;
}
close (fds[*nfds_r]);
}
else {
if (listen (fds[*nfds_r], SOMAXCONN) == -1) {
VIR_ERROR(_("listen: %s"),
virStrerror (errno, ebuf, sizeof ebuf));
return -1;
}
} else {
++*nfds_r;
}
runp = runp->ai_next;
@ -675,17 +714,6 @@ remoteListenTCP (struct qemud_server *server,
virStrerror (errno, ebuf, sizeof ebuf));
goto cleanup;
}
if ((sock->watch = virEventAddHandleImpl(sock->fd,
VIR_EVENT_HANDLE_READABLE |
VIR_EVENT_HANDLE_ERROR |
VIR_EVENT_HANDLE_HANGUP,
qemudDispatchServerEvent,
server, NULL)) < 0) {
VIR_ERROR0(_("Failed to add server event callback"));
goto cleanup;
}
}
return 0;
@ -706,9 +734,15 @@ static int qemudInitPaths(struct qemud_server *server,
int ret = -1;
char *sock_dir_prefix = NULL;
if (unix_sock_dir)
if (unix_sock_dir) {
sock_dir = unix_sock_dir;
else {
/* Change the group ownership of /var/run/libvirt to unix_sock_gid */
if (server->privileged) {
if (chown(unix_sock_dir, -1, unix_sock_gid) < 0)
VIR_ERROR(_("Failed to change group ownership of %s"),
unix_sock_dir);
}
} else {
sock_dir = sockname;
if (server->privileged) {
dir_prefix = strdup (LOCAL_STATE_DIR);
@ -752,13 +786,16 @@ static int qemudInitPaths(struct qemud_server *server,
goto snprintf_error;
}
if (server->privileged)
server->logDir = strdup (LOCAL_STATE_DIR "/log/libvirt");
else
virAsprintf(&server->logDir, "%s/.libvirt/log", dir_prefix);
if (server->privileged) {
if (!(server->logDir = strdup (LOCAL_STATE_DIR "/log/libvirt")))
virReportOOMError(NULL);
} else {
if (virAsprintf(&server->logDir, "%s/.libvirt/log", dir_prefix) < 0)
virReportOOMError(NULL);
}
if (server->logDir == NULL)
virReportOOMError(NULL);
goto cleanup;
ret = 0;
@ -768,12 +805,18 @@ static int qemudInitPaths(struct qemud_server *server,
_("Resulting path too long for buffer in qemudInitPaths()"));
cleanup:
free (dir_prefix);
free (sock_dir_prefix);
VIR_FREE(dir_prefix);
VIR_FREE(sock_dir_prefix);
return ret;
}
static struct qemud_server *qemudInitialize(int sigread) {
static void virshErrorHandler(void *opaque ATTRIBUTE_UNUSED, virErrorPtr err ATTRIBUTE_UNUSED)
{
/* Don't do anything, since logging infrastructure already
* took care of reporting the error */
}
static struct qemud_server *qemudInitialize(void) {
struct qemud_server *server;
if (VIR_ALLOC(server) < 0) {
@ -781,26 +824,29 @@ static struct qemud_server *qemudInitialize(int sigread) {
return NULL;
}
server->privileged = geteuid() == 0 ? 1 : 0;
server->sigread = server->sigwrite = -1;
if (virMutexInit(&server->lock) < 0) {
VIR_ERROR("%s", _("cannot initialize mutex"));
VIR_FREE(server);
return NULL;
}
if (virCondInit(&server->job) < 0) {
VIR_ERROR("%s", _("cannot initialize condition variable"));
virMutexDestroy(&server->lock);
VIR_FREE(server);
}
server->privileged = geteuid() == 0 ? 1 : 0;
server->sigread = sigread;
if (virEventInit() < 0) {
VIR_ERROR0(_("Failed to initialize event system"));
VIR_FREE(server);
return NULL;
}
virInitialize();
if (virEventInit() < 0) {
VIR_ERROR0(_("Failed to initialize event system"));
virMutexDestroy(&server->lock);
if (virCondDestroy(&server->job) < 0)
{}
VIR_FREE(server);
return NULL;
}
/*
* Note that the order is important: the first ones have a higher
@ -812,7 +858,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
#ifdef WITH_DRIVER_MODULES
/* We don't care if any of these fail, because the whole point
* is to allow users to only install modules they want to use.
* If they try to use a open a connection for a module that
* If they try to open a connection for a module that
* is not loaded they'll get a suitable error at that point
*/
virDriverLoadModule("network");
@ -833,11 +879,12 @@ static struct qemud_server *qemudInitialize(int sigread) {
#ifdef WITH_STORAGE_DIR
storageRegister();
#endif
#if defined(WITH_NODE_DEVICES) && \
(defined(HAVE_HAL) || defined(HAVE_DEVKIT))
#if defined(WITH_NODE_DEVICES)
nodedevRegister();
#endif
#ifdef WITH_SECRETS
secretRegister();
#endif
#ifdef WITH_QEMU
qemuRegister();
#endif
@ -859,13 +906,10 @@ static struct qemud_server *qemudInitialize(int sigread) {
virEventUpdateTimeoutImpl,
virEventRemoveTimeoutImpl);
virStateInitialize(server->privileged);
return server;
}
static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
struct qemud_socket *sock;
static int qemudNetworkInit(struct qemud_server *server) {
char sockname[PATH_MAX];
char roSockname[PATH_MAX];
#if HAVE_SASL
@ -932,20 +976,24 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
#ifdef HAVE_AVAHI
if (server->privileged && mdns_adv) {
struct libvirtd_mdns_group *group;
struct qemud_socket *sock;
int port = 0;
server->mdns = libvirtd_mdns_new();
if (!mdns_name) {
char groupname[64], localhost[HOST_NAME_MAX+1], *tmp;
char groupname[64], *localhost, *tmp;
/* Extract the host part of the potentially FQDN */
gethostname(localhost, HOST_NAME_MAX);
localhost[HOST_NAME_MAX] = '\0';
localhost = virGetHostname(NULL);
if (localhost == NULL)
goto cleanup;
if ((tmp = strchr(localhost, '.')))
*tmp = '\0';
snprintf(groupname, sizeof(groupname)-1, "Virtualization Host %s", localhost);
groupname[sizeof(groupname)-1] = '\0';
group = libvirtd_mdns_add_group(server->mdns, groupname);
VIR_FREE(localhost);
} else {
group = libvirtd_mdns_add_group(server->mdns, mdns_name);
}
@ -973,23 +1021,30 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
}
#endif
return server;
return 0;
cleanup:
if (server) {
sock = server->sockets;
while (sock) {
close(sock->fd);
sock = sock->next;
return -1;
}
static int qemudNetworkEnable(struct qemud_server *server) {
struct qemud_socket *sock;
sock = server->sockets;
while (sock) {
if ((sock->watch = virEventAddHandleImpl(sock->fd,
VIR_EVENT_HANDLE_READABLE |
VIR_EVENT_HANDLE_ERROR |
VIR_EVENT_HANDLE_HANGUP,
qemudDispatchServerEvent,
server, NULL)) < 0) {
VIR_ERROR0(_("Failed to add server event callback"));
return -1;
}
#if HAVE_POLKIT0
if (server->sysbus)
dbus_connection_unref(server->sysbus);
#endif
free(server);
sock = sock->next;
}
return NULL;
return 0;
}
static gnutls_session_t
@ -1371,7 +1426,8 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
if (client &&
client->tlssession) gnutls_deinit (client->tlssession);
close (fd);
VIR_FREE(client->rx);
if (client)
VIR_FREE(client->rx);
VIR_FREE(client);
return -1;
}
@ -1391,7 +1447,7 @@ void qemudDispatchClientFailure(struct qemud_client *client) {
}
/* Deregister event delivery callback */
if(client->conn) {
if (client->conn && client->domain_events_registered) {
DEBUG0("Deregistering to relay remote events");
virConnectDomainEventDeregister(client->conn, remoteRelayDomainEvent);
}
@ -1401,8 +1457,7 @@ void qemudDispatchClientFailure(struct qemud_client *client) {
sasl_dispose(&client->saslconn);
client->saslconn = NULL;
}
free(client->saslUsername);
client->saslUsername = NULL;
VIR_FREE(client->saslUsername);
#endif
if (client->tlssession) {
gnutls_deinit (client->tlssession);
@ -2136,7 +2191,7 @@ static void qemudInactiveTimer(int timerid, void *data) {
virEventUpdateTimeoutImpl(timerid, -1);
} else {
DEBUG0("Timer expired and inactive, shutting down");
server->shutdown = 1;
server->quitEventThread = 1;
}
}
@ -2166,9 +2221,10 @@ static void qemudFreeClient(struct qemud_client *client) {
VIR_FREE(client);
}
static int qemudRunLoop(struct qemud_server *server) {
static void *qemudRunLoop(void *opaque) {
struct qemud_server *server = opaque;
int timerid = -1;
int ret = -1, i;
int i;
int timerActive = 0;
virMutexLock(&server->lock);
@ -2178,7 +2234,7 @@ static int qemudRunLoop(struct qemud_server *server) {
qemudInactiveTimer,
server, NULL)) < 0) {
VIR_ERROR0(_("Failed to register shutdown timeout"));
return -1;
return NULL;
}
if (min_workers > max_workers)
@ -2187,7 +2243,7 @@ static int qemudRunLoop(struct qemud_server *server) {
server->nworkers = max_workers;
if (VIR_ALLOC_N(server->workers, server->nworkers) < 0) {
VIR_ERROR0(_("Failed to allocate workers"));
return -1;
return NULL;
}
for (i = 0 ; i < min_workers ; i++) {
@ -2196,7 +2252,7 @@ static int qemudRunLoop(struct qemud_server *server) {
server->nactiveworkers++;
}
for (;;) {
for (;!server->quitEventThread;) {
/* A shutdown timeout is specified, so check
* if any drivers have active state, if not
* shutdown after timeout seconds
@ -2268,11 +2324,6 @@ static int qemudRunLoop(struct qemud_server *server) {
server->nactiveworkers--;
}
}
if (server->shutdown) {
ret = 0;
break;
}
}
cleanup:
@ -2291,34 +2342,63 @@ cleanup:
VIR_FREE(server->workers);
virMutexUnlock(&server->lock);
return ret;
return NULL;
}
static int qemudStartEventLoop(struct qemud_server *server) {
pthread_attr_t attr;
pthread_attr_init(&attr);
/* We want to join the eventloop, so don't detach it */
/*pthread_attr_setdetachstate(&attr, 1);*/
if (pthread_create(&server->eventThread,
&attr,
qemudRunLoop,
server) != 0)
return -1;
server->hasEventThread = 1;
return 0;
}
static void qemudCleanup(struct qemud_server *server) {
struct qemud_socket *sock;
close(server->sigread);
if (server->sigread != -1)
close(server->sigread);
if (server->sigwrite != -1)
close(server->sigwrite);
sock = server->sockets;
while (sock) {
struct qemud_socket *next = sock->next;
if (sock->watch)
virEventRemoveHandleImpl(sock->watch);
close(sock->fd);
free(sock);
VIR_FREE(sock);
sock = next;
}
free(server->logDir);
VIR_FREE(server->logDir);
#ifdef HAVE_SASL
if (server->saslUsernameWhitelist) {
char **list = server->saslUsernameWhitelist;
while (*list) {
free(*list);
VIR_FREE(*list);
list++;
}
free(server->saslUsernameWhitelist);
VIR_FREE(server->saslUsernameWhitelist);
}
#endif
#if HAVE_POLKIT0
if (server->sysbus)
dbus_connection_unref(server->sysbus);
#endif
virStateCleanup();
if (virCondDestroy(&server->job) < 0) {
@ -2431,7 +2511,7 @@ checkType (virConfValuePtr p, const char *filename,
(var_name) = strdup (p->str); \
if ((var_name) == NULL) { \
char ebuf[1024]; \
VIR_ERROR(_("remoteReadConfigFile: %s\n"), \
VIR_ERROR(_("remoteReadConfigFile: %s"), \
virStrerror(errno, ebuf, sizeof ebuf)); \
goto free_and_fail; \
} \
@ -2474,7 +2554,7 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
*auth = REMOTE_AUTH_POLKIT;
#endif
} else {
VIR_ERROR(_("remoteReadConfigFile: %s: %s: unsupported auth %s\n"),
VIR_ERROR(_("remoteReadConfigFile: %s: %s: unsupported auth %s"),
filename, key, p->str);
return -1;
}
@ -2509,8 +2589,9 @@ remoteReadSaslAllowedUsernameList (virConfPtr conf ATTRIBUTE_UNUSED,
* debugging is asked for then output informations or debug.
*/
static int
qemudSetLogging(virConfPtr conf, const char *filename) {
int log_level;
qemudSetLogging(virConfPtr conf, const char *filename)
{
int log_level = 0;
char *log_filters = NULL;
char *log_outputs = NULL;
int ret = -1;
@ -2531,12 +2612,6 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
* level has been set, we must process variables in the opposite
* order, each one overriding the previous.
*/
/*
* GET_CONF_INT returns 0 when there is no log_level setting in
* the config file. The conditional below eliminates a false
* warning in that case, but also has the side effect of missing
* a warning if the user actually does say log_level=0.
*/
GET_CONF_INT (conf, filename, log_level);
if (log_level != 0)
virLogSetDefaultPriority(log_level);
@ -2672,10 +2747,9 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
goto free_and_fail;
}
unix_sock_gid = grp->gr_gid;
VIR_FREE (buf);
VIR_FREE(buf);
}
free (unix_sock_group);
unix_sock_group = NULL;
VIR_FREE(unix_sock_group);
}
GET_CONF_STR (conf, filename, unix_sock_ro_perms);
@ -2684,8 +2758,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
VIR_ERROR(_("Failed to parse mode '%s'"), unix_sock_ro_perms);
goto free_and_fail;
}
free (unix_sock_ro_perms);
unix_sock_ro_perms = NULL;
VIR_FREE(unix_sock_ro_perms);
}
GET_CONF_STR (conf, filename, unix_sock_rw_perms);
@ -2694,8 +2767,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
VIR_ERROR(_("Failed to parse mode '%s'"), unix_sock_rw_perms);
goto free_and_fail;
}
free (unix_sock_rw_perms);
unix_sock_rw_perms = NULL;
VIR_FREE(unix_sock_rw_perms);
}
GET_CONF_STR (conf, filename, unix_sock_dir);
@ -2730,12 +2802,11 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
free_and_fail:
virConfFree (conf);
free (mdns_name);
mdns_name = NULL;
free (unix_sock_ro_perms);
free (unix_sock_rw_perms);
free (unix_sock_group);
VIR_FREE (buf);
VIR_FREE(mdns_name);
VIR_FREE(unix_sock_ro_perms);
VIR_FREE(unix_sock_rw_perms);
VIR_FREE(unix_sock_group);
VIR_FREE(buf);
/* Don't bother trying to free listen_addr, tcp_port, tls_port, key_file,
cert_file, ca_file, or crl_file, since they are initialized to
@ -2746,9 +2817,8 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
if (tls_allowed_dn_list) {
int i;
for (i = 0; tls_allowed_dn_list[i]; i++)
free (tls_allowed_dn_list[i]);
free (tls_allowed_dn_list);
tls_allowed_dn_list = NULL;
VIR_FREE(tls_allowed_dn_list[i]);
VIR_FREE(tls_allowed_dn_list);
}
return -1;
@ -2769,13 +2839,13 @@ qemudSetupPrivs (void)
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
VIR_ERROR0(_("additional privileges are required\n"));
VIR_ERROR0(_("additional privileges are required"));
return -1;
}
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
VIR_ERROR0(_("failed to set reduced privileges\n"));
VIR_ERROR0(_("failed to set reduced privileges"));
return -1;
}
@ -2785,6 +2855,67 @@ qemudSetupPrivs (void)
#define qemudSetupPrivs() 0
#endif
/*
* Doing anything non-trivial in signal handlers is pretty dangerous,
* since there are very few async-signal safe POSIX funtions. To
* deal with this we setup a very simple signal handler. It simply
* writes the signal number to a pipe. The main event loop then sees
* the signal on the pipe and can safely do the processing from
* event loop context
*/
static int
daemonSetupSignals(struct qemud_server *server)
{
struct sigaction sig_action;
int sigpipe[2];
if (pipe(sigpipe) < 0)
return -1;
if (virSetNonBlock(sigpipe[0]) < 0 ||
virSetNonBlock(sigpipe[1]) < 0 ||
virSetCloseExec(sigpipe[0]) < 0 ||
virSetCloseExec(sigpipe[1]) < 0) {
char ebuf[1024];
VIR_ERROR(_("Failed to create pipe: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
goto error;
}
sig_action.sa_sigaction = sig_handler;
sig_action.sa_flags = SA_SIGINFO;
sigemptyset(&sig_action.sa_mask);
sigaction(SIGHUP, &sig_action, NULL);
sigaction(SIGINT, &sig_action, NULL);
sigaction(SIGQUIT, &sig_action, NULL);
sigaction(SIGTERM, &sig_action, NULL);
sigaction(SIGCHLD, &sig_action, NULL);
sig_action.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sig_action, NULL);
if (virEventAddHandleImpl(sigpipe[0],
VIR_EVENT_HANDLE_READABLE,
qemudDispatchSignalEvent,
server, NULL) < 0) {
VIR_ERROR0(_("Failed to register callback for signal pipe"));
goto error;
}
server->sigread = sigpipe[0];
server->sigwrite = sigpipe[1];
sigwrite = sigpipe[1];
return 0;
error:
close(sigpipe[0]);
close(sigpipe[1]);
return -1;
}
/* Print command-line usage. */
static void
usage (const char *argv0)
@ -2807,7 +2938,7 @@ libvirt management daemon:\n\
\n\
Default paths:\n\
\n\
Configuration file (unless overridden by -c):\n\
Configuration file (unless overridden by -f):\n\
" SYSCONF_DIR "/libvirt/libvirtd.conf\n\
\n\
Sockets (as root):\n\
@ -2838,10 +2969,9 @@ enum {
#define MAX_LISTEN 5
int main(int argc, char **argv) {
struct qemud_server *server = NULL;
struct sigaction sig_action;
int sigpipe[2];
const char *pid_file = NULL;
const char *remote_config_file = NULL;
int statuswrite = -1;
int ret = 1;
struct option opts[] = {
@ -2856,6 +2986,8 @@ int main(int argc, char **argv) {
{0, 0, 0, 0}
};
virInitialize();
while (1) {
int optidx = 0;
int c;
@ -2908,7 +3040,7 @@ int main(int argc, char **argv) {
default:
fprintf (stderr, "libvirtd: internal error: unknown flag: %c\n",
c);
exit (1);
exit (EXIT_FAILURE);
}
}
@ -2923,10 +3055,10 @@ int main(int argc, char **argv) {
if (godaemon) {
char ebuf[1024];
if (qemudGoDaemon() < 0) {
if ((statuswrite = daemonForkIntoBackground()) < 0) {
VIR_ERROR(_("Failed to fork as daemon: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
goto error1;
goto error;
}
}
@ -2938,33 +3070,11 @@ int main(int argc, char **argv) {
/* If we have a pidfile set, claim it now, exiting if already taken */
if (pid_file != NULL &&
qemudWritePidFile (pid_file) < 0)
goto error1;
if (pipe(sigpipe) < 0 ||
virSetNonBlock(sigpipe[0]) < 0 ||
virSetNonBlock(sigpipe[1]) < 0 ||
virSetCloseExec(sigpipe[0]) < 0 ||
virSetCloseExec(sigpipe[1]) < 0) {
char ebuf[1024];
VIR_ERROR(_("Failed to create pipe: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
goto error2;
qemudWritePidFile (pid_file) < 0) {
pid_file = NULL; /* Prevent unlinking of someone else's pid ! */
ret = VIR_DAEMON_ERR_PIDFILE;
goto error;
}
sigwrite = sigpipe[1];
sig_action.sa_sigaction = sig_handler;
sig_action.sa_flags = SA_SIGINFO;
sigemptyset(&sig_action.sa_mask);
sigaction(SIGHUP, &sig_action, NULL);
sigaction(SIGINT, &sig_action, NULL);
sigaction(SIGQUIT, &sig_action, NULL);
sigaction(SIGTERM, &sig_action, NULL);
sigaction(SIGCHLD, &sig_action, NULL);
sig_action.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sig_action, NULL);
/* Ensure the rundir exists (on tmpfs on some systems) */
if (geteuid() == 0) {
@ -2972,8 +3082,11 @@ int main(int argc, char **argv) {
if (mkdir (rundir, 0755)) {
if (errno != EEXIST) {
VIR_ERROR0 (_("unable to create rundir"));
return -1;
char ebuf[1024];
VIR_ERROR(_("unable to create rundir %s: %s"), rundir,
virStrerror(errno, ebuf, sizeof(ebuf)));
ret = VIR_DAEMON_ERR_RUNDIR;
goto error;
}
}
}
@ -2984,51 +3097,105 @@ int main(int argc, char **argv) {
* which is also passed into all libvirt stateful
* drivers
*/
if (qemudSetupPrivs() < 0)
goto error2;
if (qemudSetupPrivs() < 0) {
ret = VIR_DAEMON_ERR_PRIVS;
goto error;
}
if (!(server = qemudInitialize(sigpipe[0]))) {
ret = 2;
goto error2;
if (!(server = qemudInitialize())) {
ret = VIR_DAEMON_ERR_INIT;
goto error;
}
if ((daemonSetupSignals(server)) < 0) {
ret = VIR_DAEMON_ERR_SIGNAL;
goto error;
}
/* Read the config file (if it exists). */
if (remoteReadConfigFile (server, remote_config_file) < 0)
goto error2;
/* Change the group ownership of /var/run/libvirt to unix_sock_gid */
if (unix_sock_dir && server->privileged) {
if (chown(unix_sock_dir, -1, unix_sock_gid) < 0)
VIR_ERROR(_("Failed to change group ownership of %s"),
unix_sock_dir);
if (remoteReadConfigFile (server, remote_config_file) < 0) {
ret = VIR_DAEMON_ERR_CONFIG;
goto error;
}
if (virEventAddHandleImpl(sigpipe[0],
VIR_EVENT_HANDLE_READABLE,
qemudDispatchSignalEvent,
server, NULL) < 0) {
VIR_ERROR0(_("Failed to register callback for signal pipe"));
ret = 3;
goto error2;
/* Disable error func, now logging is setup */
virSetErrorFunc(NULL, virshErrorHandler);
if (qemudNetworkInit(server) < 0) {
ret = VIR_DAEMON_ERR_NETWORK;
goto error;
}
if (!(server = qemudNetworkInit(server))) {
ret = 2;
goto error2;
/* Tell parent of daemon that basic initialization is complete
* In particular we're ready to accept net connections & have
* written the pidfile
*/
if (statuswrite != -1) {
char status = 0;
while (write(statuswrite, &status, 1) == -1 &&
errno == EINTR)
;
close(statuswrite);
statuswrite = -1;
}
qemudRunLoop(server);
/* Start the event loop in a background thread, since
* state initialization needs events to be being processed */
if (qemudStartEventLoop(server) < 0) {
VIR_ERROR0("Event thread startup failed");
goto error;
}
/* Start the stateful HV drivers
* This is delibrately done after telling the parent process
* we're ready, since it can take a long time and this will
* seriously delay OS bootup process */
if (virStateInitialize(server->privileged) < 0) {
VIR_ERROR0("Driver state initialization failed");
goto shutdown;
}
/* Start accepting new clients from network */
virMutexLock(&server->lock);
if (qemudNetworkEnable(server) < 0) {
VIR_ERROR0("Network event loop enablement failed");
goto shutdown;
}
virMutexUnlock(&server->lock);
ret = 0;
error2:
shutdown:
/* In a non-0 shutdown scenario we need to tell event loop
* to quit immediately. Otherwise in normal case we just
* sit in the thread join forever. Sure this means the
* main thread doesn't do anything useful ever, but that's
* not too much of drain on resources
*/
if (ret != 0) {
virMutexLock(&server->lock);
if (server->hasEventThread)
/* This SIGQUIT triggers the shutdown process */
kill(getpid(), SIGQUIT);
virMutexUnlock(&server->lock);
}
pthread_join(server->eventThread, NULL);
error:
if (statuswrite != -1) {
if (ret != 0) {
/* Tell parent of daemon what failed */
char status = ret;
while (write(statuswrite, &status, 1) == -1 &&
errno == EINTR)
;
}
close(statuswrite);
}
if (server)
qemudCleanup(server);
if (pid_file)
unlink (pid_file);
close(sigwrite);
error1:
virLogShutdown();
return ret;
}

View File

@ -175,8 +175,9 @@ struct qemud_client {
int fd;
int watch;
int readonly:1;
int closing:1;
unsigned int readonly :1;
unsigned int closing :1;
unsigned int domain_events_registered :1;
struct sockaddr_storage addr;
socklen_t addrlen;
@ -184,7 +185,7 @@ struct qemud_client {
int type; /* qemud_sock_type */
gnutls_session_t tlssession;
int auth;
int handshake : 1; /* If we're in progress for TLS handshake */
unsigned int handshake :1; /* If we're in progress for TLS handshake */
#if HAVE_SASL
sasl_conn_t *saslconn;
int saslSSF;
@ -243,9 +244,9 @@ struct qemud_socket {
struct qemud_worker {
pthread_t thread;
int hasThread :1;
int processingCall :1;
int quitRequest : 1;
unsigned int hasThread :1;
unsigned int processingCall :1;
unsigned int quitRequest :1;
/* back-pointer to our server */
struct qemud_server *server;
@ -267,8 +268,11 @@ struct qemud_server {
struct qemud_client **clients;
int sigread;
int sigwrite;
char *logDir;
unsigned int shutdown : 1;
pthread_t eventThread;
unsigned int hasEventThread :1;
unsigned int quitEventThread :1;
#ifdef HAVE_AVAHI
struct libvirtd_mdns *mdns;
#endif

View File

@ -40,6 +40,7 @@
SERVICE=libvirtd
PROCESS=libvirtd
PIDFILE=@localstatedir@/run/$SERVICE.pid
LIBVIRTD_CONFIG=
LIBVIRTD_ARGS=
@ -59,7 +60,7 @@ start() {
echo -n $"Starting $SERVICE daemon: "
mkdir -p @localstatedir@/cache/libvirt
rm -rf @localstatedir@/cache/libvirt/*
KRB5_KTNAME=$KRB5_KTNAME daemon --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
@ -68,12 +69,12 @@ start() {
stop() {
echo -n $"Stopping $SERVICE daemon: "
killproc $PROCESS
killproc -p $PIDFILE $PROCESS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f @localstatedir@/lock/subsys/$SERVICE
rm -f @localstatedir@/run/$SERVICE.pid
rm -f $PIDFILE
rm -rf @localstatedir@/cache/libvirt/*
fi
}
@ -86,7 +87,7 @@ restart() {
reload() {
echo -n $"Reloading $SERVICE configuration: "
killproc $PROCESS -HUP
killproc -p $PIDFILE $PROCESS -HUP
RETVAL=$?
echo
return $RETVAL
@ -98,7 +99,7 @@ case "$1" in
$1
;;
status)
status $PROCESS
status -p $PIDFILE $PROCESS
RETVAL=$?
;;
force-reload)

View File

@ -5,4 +5,5 @@
compress
delaycompress
copytruncate
minsize 100k
}

View File

@ -231,7 +231,7 @@ remoteDispatchGetType (struct qemud_server *server ATTRIBUTE_UNUSED,
*/
ret->type = strdup (type);
if (!ret->type) {
remoteDispatchFormatError (rerr, "%s", _("out of memory in strdup"));
remoteDispatchOOMError(rerr);
return -1;
}
@ -258,6 +258,26 @@ remoteDispatchGetVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
return 0;
}
static int
remoteDispatchGetLibVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *rerr,
void *args ATTRIBUTE_UNUSED,
remote_get_lib_version_ret *ret)
{
unsigned long libVer;
if (virConnectGetLibVersion (conn, &libVer) == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
}
ret->lib_ver = libVer;
return 0;
}
static int
remoteDispatchGetHostname (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
@ -565,7 +585,7 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUT
remoteDispatchFormatError (rerr, "%s", _("nparams too large"));
return -1;
}
if (VIR_ALLOC_N(params, nparams)) {
if (VIR_ALLOC_N(params, nparams) < 0) {
remoteDispatchOOMError(rerr);
return -1;
}
@ -687,6 +707,62 @@ remoteDispatchDomainInterfaceStats (struct qemud_server *server ATTRIBUTE_UNUSED
return 0;
}
static int
remoteDispatchDomainMemoryStats (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *rerr,
remote_domain_memory_stats_args *args,
remote_domain_memory_stats_ret *ret)
{
virDomainPtr dom;
struct _virDomainMemoryStat *stats;
unsigned int nr_stats, i;
if (args->maxStats > REMOTE_DOMAIN_MEMORY_STATS_MAX) {
remoteDispatchFormatError (rerr, "%s",
_("maxStats > REMOTE_DOMAIN_MEMORY_STATS_MAX"));
return -1;
}
dom = get_nonnull_domain (conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
return -1;
}
/* Allocate stats array for making dispatch call */
if (VIR_ALLOC_N(stats, args->maxStats) < 0) {
remoteDispatchOOMError(rerr);
return -1;
}
nr_stats = virDomainMemoryStats (dom, stats, args->maxStats, 0);
virDomainFree (dom);
if (nr_stats == -1) {
VIR_FREE(stats);
remoteDispatchConnError(rerr, conn);
return -1;
}
/* Allocate return buffer */
if (VIR_ALLOC_N(ret->stats.stats_val, args->maxStats) < 0) {
VIR_FREE(stats);
remoteDispatchOOMError(rerr);
return -1;
}
/* Copy the stats into the xdr return structure */
for (i = 0; i < nr_stats; i++) {
ret->stats.stats_val[i].tag = stats[i].tag;
ret->stats.stats_val[i].val = stats[i].val;
}
ret->stats.stats_len = nr_stats;
VIR_FREE(stats);
return 0;
}
static int
remoteDispatchDomainBlockPeek (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
@ -721,10 +797,8 @@ remoteDispatchDomainBlockPeek (struct qemud_server *server ATTRIBUTE_UNUSED,
ret->buffer.buffer_len = size;
if (VIR_ALLOC_N (ret->buffer.buffer_val, size) < 0) {
char ebuf[1024];
virDomainFree (dom);
remoteDispatchFormatError (rerr, "%s",
virStrerror(errno, ebuf, sizeof ebuf));
remoteDispatchOOMError(rerr);
return -1;
}
@ -772,10 +846,8 @@ remoteDispatchDomainMemoryPeek (struct qemud_server *server ATTRIBUTE_UNUSED,
ret->buffer.buffer_len = size;
if (VIR_ALLOC_N (ret->buffer.buffer_val, size) < 0) {
char ebuf[1024];
virDomainFree (dom);
remoteDispatchFormatError (rerr, "%s",
virStrerror(errno, ebuf, sizeof ebuf));
remoteDispatchOOMError(rerr);
return -1;
}
@ -3303,7 +3375,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
goto authfail;
}
if (status != 0) {
VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %d\n"),
VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %d"),
action, callerPid, callerUid, status);
goto authfail;
}
@ -3370,7 +3442,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
if (!(pkaction = polkit_action_new())) {
char ebuf[1024];
VIR_ERROR(_("Failed to create polkit action %s\n"),
VIR_ERROR(_("Failed to create polkit action %s"),
virStrerror(errno, ebuf, sizeof ebuf));
polkit_caller_unref(pkcaller);
goto authfail;
@ -3380,7 +3452,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
if (!(pkcontext = polkit_context_new()) ||
!polkit_context_init(pkcontext, &pkerr)) {
char ebuf[1024];
VIR_ERROR(_("Failed to create polkit context %s\n"),
VIR_ERROR(_("Failed to create polkit context %s"),
(pkerr ? polkit_error_get_error_message(pkerr)
: virStrerror(errno, ebuf, sizeof ebuf)));
if (pkerr)
@ -3412,7 +3484,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
polkit_caller_unref(pkcaller);
polkit_action_unref(pkaction);
if (pkresult != POLKIT_RESULT_YES) {
VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %s\n"),
VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %s"),
action, callerPid, callerUid,
polkit_result_to_string_representation(pkresult));
goto authfail;
@ -4102,12 +4174,15 @@ remoteDispatchStorageVolCreateXmlFrom (struct qemud_server *server ATTRIBUTE_UNU
clonevol = get_nonnull_storage_vol (conn, args->clonevol);
if (clonevol == NULL) {
virStoragePoolFree(pool);
remoteDispatchConnError(rerr, conn);
return -1;
}
newvol = virStorageVolCreateXMLFrom (pool, args->xml, clonevol,
args->flags);
virStorageVolFree(clonevol);
virStoragePoolFree(pool);
if (newvol == NULL) {
remoteDispatchConnError(rerr, conn);
return -1;
@ -4414,7 +4489,7 @@ remoteDispatchNodeDeviceDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4445,7 +4520,7 @@ remoteDispatchNodeDeviceGetParent (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4487,7 +4562,7 @@ remoteDispatchNodeDeviceNumOfCaps (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4516,7 +4591,7 @@ remoteDispatchNodeDeviceListCaps (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4559,7 +4634,7 @@ remoteDispatchNodeDeviceDettach (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4586,7 +4661,7 @@ remoteDispatchNodeDeviceReAttach (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4613,7 +4688,7 @@ remoteDispatchNodeDeviceReset (struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4663,7 +4738,7 @@ remoteDispatchNodeDeviceDestroy(struct qemud_server *server ATTRIBUTE_UNUSED,
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
remoteDispatchConnError(rerr, conn);
return -1;
}
@ -4691,12 +4766,17 @@ remoteDispatchDomainEventsRegister (struct qemud_server *server ATTRIBUTE_UNUSED
{
CHECK_CONN(client);
/* Register event delivery callback */
REMOTE_DEBUG("%s","Registering to relay remote events");
virConnectDomainEventRegister(conn, remoteRelayDomainEvent, client, NULL);
if (virConnectDomainEventRegister(conn,
remoteRelayDomainEvent,
client, NULL) < 0) {
remoteDispatchConnError(rerr, conn);
return -1;
}
if(ret)
if (ret)
ret->cb_registered = 1;
client->domain_events_registered = 1;
return 0;
}
@ -4711,12 +4791,15 @@ remoteDispatchDomainEventsDeregister (struct qemud_server *server ATTRIBUTE_UNUS
{
CHECK_CONN(client);
/* Deregister event delivery callback */
REMOTE_DEBUG("%s","Deregistering to relay remote events");
virConnectDomainEventDeregister(conn, remoteRelayDomainEvent);
if (virConnectDomainEventDeregister(conn, remoteRelayDomainEvent) < 0) {
remoteDispatchConnError(rerr, conn);
return -1;
}
if(ret)
if (ret)
ret->cb_registered = 0;
client->domain_events_registered = 0;
return 0;
}
@ -5005,6 +5088,230 @@ remoteDispatchSecretLookupByUsage (struct qemud_server *server ATTRIBUTE_UNUSED,
}
static int remoteDispatchDomainIsActive(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_domain_is_active_args *args,
remote_domain_is_active_ret *ret)
{
virDomainPtr domain;
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->active = virDomainIsActive(domain);
if (ret->active < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchDomainIsPersistent(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_domain_is_persistent_args *args,
remote_domain_is_persistent_ret *ret)
{
virDomainPtr domain;
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->persistent = virDomainIsPersistent(domain);
if (ret->persistent < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchInterfaceIsActive(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_interface_is_active_args *args,
remote_interface_is_active_ret *ret)
{
virInterfacePtr iface;
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->active = virInterfaceIsActive(iface);
if (ret->active < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchNetworkIsActive(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_network_is_active_args *args,
remote_network_is_active_ret *ret)
{
virNetworkPtr network;
network = get_nonnull_network(conn, args->net);
if (network == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->active = virNetworkIsActive(network);
if (ret->active < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchNetworkIsPersistent(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_network_is_persistent_args *args,
remote_network_is_persistent_ret *ret)
{
virNetworkPtr network;
network = get_nonnull_network(conn, args->net);
if (network == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->persistent = virNetworkIsPersistent(network);
if (ret->persistent < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchStoragePoolIsActive(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_storage_pool_is_active_args *args,
remote_storage_pool_is_active_ret *ret)
{
virStoragePoolPtr pool;
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->active = virStoragePoolIsActive(pool);
if (ret->active < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchStoragePoolIsPersistent(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_storage_pool_is_persistent_args *args,
remote_storage_pool_is_persistent_ret *ret)
{
virStoragePoolPtr pool;
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->persistent = virStoragePoolIsPersistent(pool);
if (ret->persistent < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int remoteDispatchIsSecure(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
void *args ATTRIBUTE_UNUSED,
remote_is_secure_ret *ret)
{
ret->secure = virConnectIsSecure(conn);
if (ret->secure < 0) {
remoteDispatchConnError(err, conn);
return -1;
}
return 0;
}
static int
remoteDispatchCpuCompare(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_cpu_compare_args *args,
remote_cpu_compare_ret *ret)
{
int result;
result = virConnectCompareCPU(conn, args->xml, args->flags);
if (result == VIR_CPU_COMPARE_ERROR) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->result = result;
return 0;
}
/*----- Helpers. -----*/
/* get_nonnull_domain and get_nonnull_network turn an on-wire

View File

@ -126,3 +126,12 @@
remote_secret_undefine_args val_remote_secret_undefine_args;
remote_secret_lookup_by_usage_args val_remote_secret_lookup_by_usage_args;
remote_domain_migrate_prepare_tunnel_args val_remote_domain_migrate_prepare_tunnel_args;
remote_domain_is_active_args val_remote_domain_is_active_args;
remote_domain_is_persistent_args val_remote_domain_is_persistent_args;
remote_network_is_active_args val_remote_network_is_active_args;
remote_network_is_persistent_args val_remote_network_is_persistent_args;
remote_storage_pool_is_active_args val_remote_storage_pool_is_active_args;
remote_storage_pool_is_persistent_args val_remote_storage_pool_is_persistent_args;
remote_interface_is_active_args val_remote_interface_is_active_args;
remote_cpu_compare_args val_remote_cpu_compare_args;
remote_domain_memory_stats_args val_remote_domain_memory_stats_args;

View File

@ -50,6 +50,14 @@ static int remoteDispatchClose(
remote_error *err,
void *args,
void *ret);
static int remoteDispatchCpuCompare(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_cpu_compare_args *args,
remote_cpu_compare_ret *ret);
static int remoteDispatchDomainAttachDevice(
struct qemud_server *server,
struct qemud_client *client,
@ -226,6 +234,22 @@ static int remoteDispatchDomainInterfaceStats(
remote_error *err,
remote_domain_interface_stats_args *args,
remote_domain_interface_stats_ret *ret);
static int remoteDispatchDomainIsActive(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_is_active_args *args,
remote_domain_is_active_ret *ret);
static int remoteDispatchDomainIsPersistent(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_is_persistent_args *args,
remote_domain_is_persistent_ret *ret);
static int remoteDispatchDomainLookupById(
struct qemud_server *server,
struct qemud_client *client,
@ -258,6 +282,14 @@ static int remoteDispatchDomainMemoryPeek(
remote_error *err,
remote_domain_memory_peek_args *args,
remote_domain_memory_peek_ret *ret);
static int remoteDispatchDomainMemoryStats(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_memory_stats_args *args,
remote_domain_memory_stats_ret *ret);
static int remoteDispatchDomainMigrateFinish(
struct qemud_server *server,
struct qemud_client *client,
@ -450,6 +482,14 @@ static int remoteDispatchGetHostname(
remote_error *err,
void *args,
remote_get_hostname_ret *ret);
static int remoteDispatchGetLibVersion(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
void *args,
remote_get_lib_version_ret *ret);
static int remoteDispatchGetMaxVcpus(
struct qemud_server *server,
struct qemud_client *client,
@ -514,6 +554,14 @@ static int remoteDispatchInterfaceGetXmlDesc(
remote_error *err,
remote_interface_get_xml_desc_args *args,
remote_interface_get_xml_desc_ret *ret);
static int remoteDispatchInterfaceIsActive(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_interface_is_active_args *args,
remote_interface_is_active_ret *ret);
static int remoteDispatchInterfaceLookupByMacString(
struct qemud_server *server,
struct qemud_client *client,
@ -538,6 +586,14 @@ static int remoteDispatchInterfaceUndefine(
remote_error *err,
remote_interface_undefine_args *args,
void *ret);
static int remoteDispatchIsSecure(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
void *args,
remote_is_secure_ret *ret);
static int remoteDispatchListDefinedDomains(
struct qemud_server *server,
struct qemud_client *client,
@ -666,6 +722,22 @@ static int remoteDispatchNetworkGetBridgeName(
remote_error *err,
remote_network_get_bridge_name_args *args,
remote_network_get_bridge_name_ret *ret);
static int remoteDispatchNetworkIsActive(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_network_is_active_args *args,
remote_network_is_active_ret *ret);
static int remoteDispatchNetworkIsPersistent(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_network_is_persistent_args *args,
remote_network_is_persistent_ret *ret);
static int remoteDispatchNetworkLookupByName(
struct qemud_server *server,
struct qemud_client *client,
@ -1034,6 +1106,22 @@ static int remoteDispatchStoragePoolGetInfo(
remote_error *err,
remote_storage_pool_get_info_args *args,
remote_storage_pool_get_info_ret *ret);
static int remoteDispatchStoragePoolIsActive(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_storage_pool_is_active_args *args,
remote_storage_pool_is_active_ret *ret);
static int remoteDispatchStoragePoolIsPersistent(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_storage_pool_is_persistent_args *args,
remote_storage_pool_is_persistent_ret *ret);
static int remoteDispatchStoragePoolListVolumes(
struct qemud_server *server,
struct qemud_client *client,

View File

@ -106,3 +106,14 @@
remote_secret_get_xml_desc_ret val_remote_secret_get_xml_desc_ret;
remote_secret_get_value_ret val_remote_secret_get_value_ret;
remote_secret_lookup_by_usage_ret val_remote_secret_lookup_by_usage_ret;
remote_is_secure_ret val_remote_is_secure_ret;
remote_domain_is_active_ret val_remote_domain_is_active_ret;
remote_domain_is_persistent_ret val_remote_domain_is_persistent_ret;
remote_network_is_active_ret val_remote_network_is_active_ret;
remote_network_is_persistent_ret val_remote_network_is_persistent_ret;
remote_storage_pool_is_active_ret val_remote_storage_pool_is_active_ret;
remote_storage_pool_is_persistent_ret val_remote_storage_pool_is_persistent_ret;
remote_interface_is_active_ret val_remote_interface_is_active_ret;
remote_get_lib_version_ret val_remote_get_lib_version_ret;
remote_cpu_compare_ret val_remote_cpu_compare_ret;
remote_domain_memory_stats_ret val_remote_domain_memory_stats_ret;

View File

@ -747,3 +747,58 @@
.args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel_args,
.ret_filter = (xdrproc_t) xdr_void,
},
{ /* IsSecure => 149 */
.fn = (dispatch_fn) remoteDispatchIsSecure,
.args_filter = (xdrproc_t) xdr_void,
.ret_filter = (xdrproc_t) xdr_remote_is_secure_ret,
},
{ /* DomainIsActive => 150 */
.fn = (dispatch_fn) remoteDispatchDomainIsActive,
.args_filter = (xdrproc_t) xdr_remote_domain_is_active_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_is_active_ret,
},
{ /* DomainIsPersistent => 151 */
.fn = (dispatch_fn) remoteDispatchDomainIsPersistent,
.args_filter = (xdrproc_t) xdr_remote_domain_is_persistent_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_is_persistent_ret,
},
{ /* NetworkIsActive => 152 */
.fn = (dispatch_fn) remoteDispatchNetworkIsActive,
.args_filter = (xdrproc_t) xdr_remote_network_is_active_args,
.ret_filter = (xdrproc_t) xdr_remote_network_is_active_ret,
},
{ /* NetworkIsPersistent => 153 */
.fn = (dispatch_fn) remoteDispatchNetworkIsPersistent,
.args_filter = (xdrproc_t) xdr_remote_network_is_persistent_args,
.ret_filter = (xdrproc_t) xdr_remote_network_is_persistent_ret,
},
{ /* StoragePoolIsActive => 154 */
.fn = (dispatch_fn) remoteDispatchStoragePoolIsActive,
.args_filter = (xdrproc_t) xdr_remote_storage_pool_is_active_args,
.ret_filter = (xdrproc_t) xdr_remote_storage_pool_is_active_ret,
},
{ /* StoragePoolIsPersistent => 155 */
.fn = (dispatch_fn) remoteDispatchStoragePoolIsPersistent,
.args_filter = (xdrproc_t) xdr_remote_storage_pool_is_persistent_args,
.ret_filter = (xdrproc_t) xdr_remote_storage_pool_is_persistent_ret,
},
{ /* InterfaceIsActive => 156 */
.fn = (dispatch_fn) remoteDispatchInterfaceIsActive,
.args_filter = (xdrproc_t) xdr_remote_interface_is_active_args,
.ret_filter = (xdrproc_t) xdr_remote_interface_is_active_ret,
},
{ /* GetLibVersion => 157 */
.fn = (dispatch_fn) remoteDispatchGetLibVersion,
.args_filter = (xdrproc_t) xdr_void,
.ret_filter = (xdrproc_t) xdr_remote_get_lib_version_ret,
},
{ /* CpuCompare => 158 */
.fn = (dispatch_fn) remoteDispatchCpuCompare,
.args_filter = (xdrproc_t) xdr_remote_cpu_compare_args,
.ret_filter = (xdrproc_t) xdr_remote_cpu_compare_ret,
},
{ /* DomainMemoryStats => 159 */
.fn = (dispatch_fn) remoteDispatchDomainMemoryStats,
.args_filter = (xdrproc_t) xdr_remote_domain_memory_stats_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_memory_stats_ret,
},

View File

@ -4,7 +4,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Generate XHTML-1.0 transitional -->
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
<xsl:output method="xml" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

View File

@ -119,7 +119,7 @@
packages as well as the public headers to compile against libxenstore.</p>
</li>
<li>
<em>I use the CVS version and there is no configure script</em>
<em>I use the GIT version and there is no configure script</em>
<p>The configure script (and other Makefiles) are generated. Use the
autogen.sh script to regenerate the configure script and Makefiles,
like:</p>

View File

@ -106,9 +106,9 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
%.html: %.html.tmp
@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
if $(XMLCATALOG) /etc/xml/catalog "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > /dev/null ; then \
if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
echo "Validating $@" ; \
$(XMLLINT) --nonet --format --valid $< > $@ || : ; \
$(XMLLINT) --nonet --format --valid $< > $@ || (rm $@ && exit 1) ; \
else echo "missing XHTML1 DTD" ; fi ; fi );
@ -117,7 +117,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
echo "Rebuilding the HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi )
-@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
if $(XMLCATALOG) /etc/xml/catalog "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > /dev/null ; then \
if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
echo "Validating the resulting XHTML pages" ; \
$(XMLLINT) --nonet --valid --noout html/*.html ; \
else echo "missing XHTML1 DTD" ; fi ; fi );
@ -143,7 +143,7 @@ rebuild: api all
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/FAQ.html \
-$(INSTALL) -m 0644 $(srcdir)/FAQ.html \
$(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
for h in $(apihtml); do \
@ -152,11 +152,12 @@ install-data-local:
$(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
@INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
$(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
done
uninstall-local:
for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done
rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
done

View File

@ -84,7 +84,7 @@
which is garanteed to be unique for long term usage and across a
set of nodes.</li>
</ul>
<h2><a name="Functions" id="Functions">Functions and naming
conventions</a></h2>
<p> The naming of the functions present in the library is usually
@ -93,7 +93,7 @@
<p> For each first class object you will find apis
for the following actions:</p>
<ul>
<li><b>Lookup</b>:...LookupByName,
<li><b>Lookup</b>:...LookupByName,
<li><b>Enumeration</b>:virConnectList... and virConnectNumOf...:
those are used to enumerate a set of object available to an given
hypervisor connection like:
@ -119,7 +119,7 @@
<li><b>Destruction</b>: ... </li>
</ul>
<p> For more in-depth details of the storage related APIs see
<a href="storage.html">the storage management page</a>,
<a href="storage.html">the storage management page</a>,
<h2><a name="Driver" id="Driver">The libvirt drivers</a></h2>
<p></p>
<p class="image">

View File

@ -145,20 +145,20 @@
<ol class="ordinarylist">
<li>SHOULD log a message with VIR_DEBUG() indicating that it is
being called and its parameters;</li>
being called and its parameters;</li>
<li>MUST call virResetLastError();</li>
<li>SHOULD confirm that the connection is valid with
VIR_IS_CONNECT(conn);</li>
VIR_IS_CONNECT(conn);</li>
<li><strong>SECURITY: If the API requires a connection with write
privileges, MUST confirm that the connection flags do not
indicate that the connection is read-only;</strong></li>
privileges, MUST confirm that the connection flags do not
indicate that the connection is read-only;</strong></li>
<li>SHOULD do basic validation of the parameters that are being
passed in;</li>
passed in;</li>
<li>MUST confirm that the driver for this connection exists and that
it implements this function;</li>
it implements this function;</li>
<li>MUST call the internal API;</li>
<li>SHOULD log a message with VIR_DEBUG() indicating that it is
returning, its return value, and status.</li>
returning, its return value, and status.</li>
<li>MUST return status to the caller.</li>
</ol>
@ -178,7 +178,7 @@
involves making two additions to:
</p>
<p><code>qemud/remote_protocol.x</code></p>
<p><code>src/remote/remote_protocol.x</code></p>
<p>
First, create two new structs for each new function that you're adding
@ -198,7 +198,7 @@
<p>
Once these changes are in place, it's necessary to run 'make rpcgen'
in the qemud directory to create the .c and .h files required by the
in the src directory to create the .c and .h files required by the
remote protocol code. This must be done on a Linux host using the
GLibC rpcgen program. Other rpcgen versions may generate code which
results in bogus compile time warnings
@ -213,7 +213,7 @@
the rpcgen generated .h files. The remote method calls go in:
</p>
<p><code>src/remote_internal.c</code></p>
<p><code>src/remote/remote_internal.c</code></p>
<p>Each remote method invocation does the following:</p>
@ -243,7 +243,7 @@
The server side dispatchers are implemented in:
</p>
<p><code>qemud/remote.c</code></p>
<p><code>daemon/remote.c</code></p>
<p>Again, this step uses the .h files generated by make rpcgen.</p>

View File

@ -26,6 +26,7 @@ included_files = {
ignored_words = {
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
"ATTRIBUTE_SENTINEL": (0, "macro keyword"),
"VIR_DEPRECATED": (0, "macro keyword"),
"WINAPI": (0, "Windows keyword"),
"__declspec": (3, "Windows keyword"),

View File

@ -21,42 +21,42 @@
<dl>
<dt>virsh</dt>
<dd>
An interactive shell, and batch scriptable tool for performing
management tasks on all libvirt managed domains, networks and
storage. This is part of the libvirt core distribution.
An interactive shell, and batch scriptable tool for performing
management tasks on all libvirt managed domains, networks and
storage. This is part of the libvirt core distribution.
</dd>
<dt><a href="http://virt-manager.org/">virt-install</a></dt>
<dd>
Provides a way to provision new virtual machines from a
OS distribution install tree. It supports provisioning from
local CD images, and the network over NFS, HTTP and FTP.
Provides a way to provision new virtual machines from a
OS distribution install tree. It supports provisioning from
local CD images, and the network over NFS, HTTP and FTP.
</dd>
<dt><a href="http://virt-manager.org/">virt-clone</a></dt>
<dd>
Allows the disk image(s) and configuration for an existing
virtual machine to be cloned to form a new virtual machine.
It automates copying of data across to new disk images, and
updates the UUID, Mac address and name in the configuration
Allows the disk image(s) and configuration for an existing
virtual machine to be cloned to form a new virtual machine.
It automates copying of data across to new disk images, and
updates the UUID, Mac address and name in the configuration
</dd>
<dt><a href="http://virt-manager.org/">virt-image</a></dt>
<dd>
Provides a way to deploy virtual appliances. It defines a
simplified portable XML format describing the pre-requisites
of a virtual machine. At time of deployment this is translated
into the domain XML format for execution under any libvirt
hypervisor meeting the pre-requisites.
Provides a way to deploy virtual appliances. It defines a
simplified portable XML format describing the pre-requisites
of a virtual machine. At time of deployment this is translated
into the domain XML format for execution under any libvirt
hypervisor meeting the pre-requisites.
</dd>
<dt><a href="http://et.redhat.com/~rjones/virt-df/">virt-df</a></dt>
<dd>
Examine the utilization of each filesystem in a virtual machine
from the comfort of the host machine. This tool peeks into the
guest disks and determines how much space is used. It can cope
with common Linux filesystems and LVM volumes.
Examine the utilization of each filesystem in a virtual machine
from the comfort of the host machine. This tool peeks into the
guest disks and determines how much space is used. It can cope
with common Linux filesystems and LVM volumes.
</dd>
<dt><a href="http://et.redhat.com/~rjones/virt-top/">virt-top</a></dt>
<dd>
Watch the CPU, memory, network and disk utilization of all
virtual machines running on a host.
Watch the CPU, memory, network and disk utilization of all
virtual machines running on a host.
</dd>
</dl>
@ -65,17 +65,17 @@
<dl>
<dt><a href="http://virt-manager.org/">virt-manager</a></dt>
<dd>
A general purpose desktop management tool, able to manage
virtual machines across both local and remotely accessed
hypervisors. It is targeted at home and small office usage
upto managing 10-20 hosts and their VMs.
A general purpose desktop management tool, able to manage
virtual machines across both local and remotely accessed
hypervisors. It is targeted at home and small office usage
upto managing 10-20 hosts and their VMs.
</dd>
<dt><a href="http://virt-manager.org/">virt-viewer</a></dt>
<dd>
A lightweight tool for accessing the graphical console
associated with a virtual machine. It can securely connect
to remote consoles supporting the VNC protocol. Also provides
an optional mozilla browser plugin.
A lightweight tool for accessing the graphical console
associated with a virtual machine. It can securely connect
to remote consoles supporting the VNC protocol. Also provides
an optional mozilla browser plugin.
</dd>
</dl>
@ -84,18 +84,18 @@
<dl>
<dt><a href="http://ovirt.org/">oVirt</a></dt>
<dd>
oVirt provides the ability to manage large numbers of virtual
machines across an entire data center of hosts. It integrates
with FreeIPA for Kerberos authentication, and in the future,
certificate management.
oVirt provides the ability to manage large numbers of virtual
machines across an entire data center of hosts. It integrates
with FreeIPA for Kerberos authentication, and in the future,
certificate management.
</dd>
<dt><a href="http://community.abiquo.com/display/AbiCloud">AbiCloud</a></dt>
<dd>
AbiCloud is an open source cloud platform manager which allows to
easily deploy a private cloud in your datacenter. One of the key
differences of AbiCloud is the web rich interface for managing the
infrastructure. You can deploy a new service just dragging and
dropping a VM.
AbiCloud is an open source cloud platform manager which allows to
easily deploy a private cloud in your datacenter. One of the key
differences of AbiCloud is the web rich interface for managing the
infrastructure. You can deploy a new service just dragging and
dropping a VM.
</dd>
</dl>
@ -104,10 +104,10 @@
<dl>
<dt><a href="http://et.redhat.com/~rjones/virt-p2v/">virt-p2v</a></dt>
<dd>
A tool for converting a physical machine into a virtual machine. It
is a LiveCD which is booted on the machine to be converted. It collects
a little information from the user and then copies the disks over to
a remote machine and defines the XML for a domain to run the guest.
A tool for converting a physical machine into a virtual machine. It
is a LiveCD which is booted on the machine to be converted. It collects
a little information from the user and then copies the disks over to
a remote machine and defines the XML for a domain to run the guest.
</dd>
</dl>
@ -115,13 +115,13 @@
<dl>
<dt><a href="http://honk.sigxcpu.org/projects/libvirt/#munin">for munin</a></dt>
<dd>
The plugins provided by Guido Günther allow to monitor various things
The plugins provided by Guido Günther allow to monitor various things
like network and block I/O with
<a href="http://munin.projects.linpro.no/">Munin</a>.
</dd>
<dt><a href="http://collectd.org/plugins/libvirt.shtml">for collectd</a></dt>
<dd>
The libvirt-plugin is part of <a href="http://collectd.org/">collectd</a>
The libvirt-plugin is part of <a href="http://collectd.org/">collectd</a>
and gather statistics about virtualized guests on a system. This
way, you can collect CPU, network interface and block device usage
for each guest without installing collectd on the guest systems.
@ -130,8 +130,8 @@
</dd>
<dt><a href="http://et.redhat.com/~rjones/nagios-virt/">nagios-virt</a></dt>
<dd>
Nagios-virt is a configuration tool for adding monitoring of your
virtualised domains to <a href="http://www.nagios.org/">Nagios</a>.
Nagios-virt is a configuration tool for adding monitoring of your
virtualised domains to <a href="http://www.nagios.org/">Nagios</a>.
You can use this tool to either set up a new Nagios installation for
your Xen or QEMU/KVM guests, or to integrate with your existing Nagios
installation.

View File

@ -11,26 +11,26 @@
<ul>
<li><strong>VLAN 1</strong>. This virtual network has connectivity
to <code>LAN 2</code> with traffic forwarded and NATed.
to <code>LAN 2</code> with traffic forwarded and NATed.
</li>
<li><strong>VLAN 2</strong>. This virtual network is completely
isolated from any physical LAN.
isolated from any physical LAN.
</li>
<li><strong>Guest A</strong>. The first network interface is bridged
to the physical <code>LAN 1</code>. The second interface is connected
to a virtual network <code>VLAN 1</code>.
to the physical <code>LAN 1</code>. The second interface is connected
to a virtual network <code>VLAN 1</code>.
</li>
<li><strong>Guest B</strong>. The first network interface is connected
to a virtual network <code>VLAN 1</code>, giving it limited NAT
based connectivity to LAN2. It has a second network interface
connected to <code>VLAN 2</code>. It acts a router allowing limited
traffic between the two VLANs, thus giving <code>Guest C</code>
connectivity to the physical <code>LAN 2</code>.
</li>
to a virtual network <code>VLAN 1</code>, giving it limited NAT
based connectivity to LAN2. It has a second network interface
connected to <code>VLAN 2</code>. It acts a router allowing limited
traffic between the two VLANs, thus giving <code>Guest C</code>
connectivity to the physical <code>LAN 2</code>.
</li>
<li><strong>Guest C</strong>. The only network interface is connected
to a virtual network <code>VLAN 2</code>. It has no direct connectivity
to a physical LAN, relying on <code>Guest B</codE> to route traffic
on its behalf.
to a virtual network <code>VLAN 2</code>. It has no direct connectivity
to a physical LAN, relying on <code>Guest B</codE> to route traffic
on its behalf.
</li>
</ul>

View File

@ -7,16 +7,16 @@
</p>
<ol>
<li>
<strong>Volume</strong> - a single storage volume which can
be assigned to a guest, or used for creating further pools. A
volume is either a block device, a raw file, or a special format
file.
<strong>Volume</strong> - a single storage volume which can
be assigned to a guest, or used for creating further pools. A
volume is either a block device, a raw file, or a special format
file.
</li>
<li>
<strong>Pool</strong> - provides a means for taking a chunk
of storage and carving it up into volumes. A pool can be used to
manage things such as a physical disk, a NFS server, a iSCSI target,
a host adapter, an LVM group.
<strong>Pool</strong> - provides a means for taking a chunk
of storage and carving it up into volumes. A pool can be used to
manage things such as a physical disk, a NFS server, a iSCSI target,
a host adapter, an LVM group.
</li>
</ol>

View File

@ -15,7 +15,7 @@ higher level kind of languages:</p>
<li><strong>OCaml</strong>: Richard Jones supplies <a href="http://libvirt.org/ocaml/">bindings for OCaml</a>.</li>
<li><strong>Ruby</strong>: David Lutterkort provides <a href="http://libvirt.org/ruby/">bindings for Ruby</a>.</li>
<li><strong>Java</strong>: Daniel Veillard maintains <a href="java.html">Java bindings</a>.</li>
<li><strong>C#</strong>: Richard Jones wrote about <a href="https://www.redhat.com/archives/libvir-list/2008-September/msg00283.html">calling libvirt from C# on the mailing list</a>.</li>
<li><strong>C#</strong>: Jarom&iacute;r &#x010C;ervenka maintains <a href="http://svn.i-tux.cz/listing.php?repname=SharpLibVirt">C# bindings here</a>.</li>
</ul>
<p>For information on using libvirt on <strong>Windows</strong>
<a href="windows.html">please see the Windows

View File

@ -16,7 +16,7 @@
<p>
If you are using official libvirt binaries from a Linux distribution
check below for distribution specific bug reporting policies first.
For general libvirt bug reports, from self-built releases, CVS snapshots
For general libvirt bug reports, from self-built releases, GIT snapshots
and any other non-distribution supported builds, enter tickets under
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
component.
@ -30,26 +30,26 @@
<h2>Linux Distribution specific bug reports</h2>
<ul>
<li>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&amp;product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&amp;component=libvirt">New Fedora libvirt ticket</a></li>
</ul>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&amp;product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&amp;component=libvirt">New Fedora libvirt ticket</a></li>
</ul>
</li>
<li>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
<ul>
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&amp;product=Red%20Hat%20Enterprise%20Linux%205">View Red Hat Enterprise Linux libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&amp;component=libvirt">New Red Hat Enterprise Linux libvirt ticket</a></li>
</ul>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
<ul>
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&amp;product=Red%20Hat%20Enterprise%20Linux%205">View Red Hat Enterprise Linux libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&amp;component=libvirt">New Red Hat Enterprise Linux libvirt ticket</a></li>
</ul>
</li>
<li>
If you are using official binaries from another Linux distribution first
follow their own bug reporting guidelines.
If you are using official binaries from another Linux distribution first
follow their own bug reporting guidelines.
</li>
</ul>
@ -64,8 +64,8 @@
</p>
<ul>
<li>The version number of the libvirt build, or date of the CVS
checkout</li>
<li>The version number of the libvirt build, or SHA1 of the GIT
commit</li>
<li>The hardware architecture being used</li>
<li>The name of the hypervisor (Xen, QEMU, KVM)</li>
<li>The XML config of the guest domain if relevant</li>

View File

@ -3,17 +3,46 @@
<body>
<h1>Contacting the development team</h1>
<h2>Mailing list</h2>
<h2>Mailing lists</h2>
<p>
There is a mailing-list <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a> for libvirt,
with an <a href="https://www.redhat.com/archives/libvir-list/">on-line archive</a>.
Please subscribe to this list before posting by visiting the
<a href="https://www.redhat.com/mailman/listinfo/libvir-list">associated Web</a>
page and follow the instructions. Patches with explanations and provided as
attachments are really appreciated and will be discussed on the mailing list.
If possible generate the patches by using <code>cvs diff -up</code> in a CVS
checkout.
There are two mailing-lists:
</p>
<dl>
<dt><a href="https://www.redhat.com/archives/libvir-list/">libvir-list@redhat.com</a></dt>
<dd>This list a place for discussions about the <strong>development</strong> of libvirt. Topics for discussion include
<ul>
<li>New features for libvirt</li>
<li>Bug fixing of libvirt</li>
<li>New hypervisor drivers</li>
<li>Development of language bindings for libvirt API</li>
<li>Testing and documentation of libvirt</li>
</ul>
</dd>
<dt><a href="">libvirt-users@redhat.com</a></dt>
<dd>This list a place for discussions involving libvirt <strong>users</strong>. Topics for discussion include
<ul>
<li>Usage of libvirt / virsh</li>
<li>Administration of libvirtd</li>
<li>Deployment of libvirt with hypervisors</li>
<li>Development of applications on top of / using the libvirt API(s)</li>
<li>Any other topics along these lines</li>
</ul>
</dd>
</dl>
<p>
Both mailing lists require that you subscribe before posting to the list,
otherwise your posting will be delayed for manual approval by mailman.
You can subscribe at the linked webpages above.
</p>
<p>
Patches with explanations and provided as attachments are really appreciated and should
be directed to the development mailing list will be discussed on the mailing list.
If possible generate the patches by using <code>git format-patch</code> in a GIT
clone.
</p>
<h2>IRC discussion</h2>

View File

@ -25,10 +25,10 @@
# make install
</pre>
<h2>Built from CVS / GIT</h2>
<h2>Built from GIT</h2>
<p>
When building from CVS it is necessary to generate the autotools
When building from GIT it is necessary to generate the autotools
support files. This requires having <code>autoconf</code>,
<code>automake</code>, <code>libtool</code> and <code>intltool</code>
installed. The process can be automated with the <code>autogen.sh</code>

View File

@ -24,6 +24,7 @@
<li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li>
<li><strong><a href="drvvbox.html">VirtualBox</a></strong></li>
<li><strong><a href="drvone.html">OpenNebula</a></strong></li>
<li><strong><a href="drvesx.html">VMware ESX</a></strong></li>
</ul>
</body>
</html>

597
docs/drvesx.html.in Normal file
View File

@ -0,0 +1,597 @@
<html><body>
<h1>VMware ESX hypervisor driver</h1>
<ul id="toc"></ul>
<p>
The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.0 and
VMware GSX 2.0, also called VMware Server 2.0, and possibly later
versions.
</p>
<h2><a name="prereq">Deployment pre-requisites</a></h2>
<p>
None. Any out-of-the-box installation of ESX/GSX should work. No
preparations are required on the server side, no libvirtd must be
installed on the ESX server. The driver uses version 2.5 of the remote,
SOAP based
<a href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/">
VMware Virtual Infrastructure API</a> (VI API) to communicate with the
ESX server, like the VMware Virtual Infrastructure Client (VI client)
does. Since version 4.0 this API is called
<a href="http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/">
VMware vSphere API</a>.
</p>
<h2><a name="uri">Connections to the VMware ESX driver</a></h2>
<p>
Some example remote connection URIs for the driver are:
</p>
<pre>
esx://example.com (ESX over HTTPS)
gsx://example.com (GSX over HTTPS)
esx://example.com/?transport=http (ESX over HTTP)
esx://example.com/?no_verify=1 (ESX over HTTPS, but doesn't verify the server's SSL certificate)
</pre>
<h3><a name="uriformat">URI Format</a></h3>
<p>
URIs have this general form ('[...]' marks an optional part).
</p>
<pre>
type://[username@]hostname[:port]/[?extraparameters]
</pre>
<p>
The <code>type://</code> is either <code>esx://</code> or
<code>gsx://</code> and the driver selects the default port depending
on it. For ESX the default HTTPS port is 443, for GSX it is 8333. If
the port parameter is given, it overrides the default port.
</p>
<h4>Extra parameters</h4>
<p>
Extra parameters can be added to a URI as part of the query string
(the part following '?'). The driver understands the extra parameters
shown below.
</p>
<table class="top_table">
<tr>
<th>Name</th>
<th>Values</th>
<th>Meaning</th>
</tr>
<tr>
<td>
<code>transport</code>
</td>
<td>
<code>http</code> or <code>https</code>
</td>
<td>
Overrides the default HTTPS transport. For ESX the default
HTTP port is 80, for GSX it is 8222.
</td>
</tr>
<tr>
<td>
<code>vcenter</code>
</td>
<td>
Hostname of a VMware vCenter or <code>*</code>
</td>
<td>
In order to perform a migration the driver needs to know the
VMware vCenter for the ESX server. If set to <code>*</code>,
the driver connects to the vCenter known to the ESX server.
</td>
</tr>
<tr>
<td>
<code>no_verify</code>
</td>
<td>
<code>0</code> or <code>1</code>
</td>
<td>
If set to 1, this disables libcurl client checks of the server's
SSL certificate. The default value it 0.
</td>
</tr>
<tr>
<td>
<code>auto_answer</code>
</td>
<td>
<code>0</code> or <code>1</code>
</td>
<td>
If set to 1, the driver answers all
<a href="#questions">questions</a> with the default answer.
If set to 0, questions are reported as errors. The default
value it 0.
</td>
</tr>
</table>
<h3><a name="auth">Authentication</a></h3>
<p>
In order to perform any useful operation the driver needs to log into
the ESX server. Therefore, only <code>virConnectOpenAuth</code> can be
used to connect to an ESX server, <code>virConnectOpen</code> and
<code>virConnectOpenReadOnly</code> don't work.
To log into an ESX server or vCenter the driver will request
credentials using the callback passed to the
<code>virConnectOpenAuth</code> function. The driver passes the
hostname as challenge parameter to the callback. This enables the
callback to distinguish between requests for ESX server and vCenter.
</p>
<p>
<strong>Note</strong>: During the ongoing driver development, testing
is done using an unrestricted <code>root</code> account. Problems may
occur if you use a restricted account. Detailed testing with restricted
accounts has not been done yet.
</p>
<h2><a name="questions">Questions blocking tasks</a></h2>
<p>
Some methods of the VI API start tasks, for example
<code>PowerOnVM_Task()</code>. Such tasks may be blocked by questions
if the ESX server detects an issue with the domain that requires user
interaction. The ESX driver cannot prompt the user to answer a
question, libvirt doesn't have an API for something like this.
</p>
<p>
The VI API provides the <code>AnswerVM()</code> method to
programmatically answer a questions. So the driver has two options
how to handle such a situation: either answer the questions with the
default answer or report the question as an error and cancel the
blocked task if possible. The
<a href="#uriformat"><code>auto_answer</code></a> query parameter
controls the answering behavior.
</p>
<h2><a name="xmlspecial">Specialties in the domain XML config</a></h2>
<p>
There are several specialties in the domain XML config for ESX domains.
</p>
<h3><a name="restrictions">Restrictions</h3>
<p>
There are some restrictions for some values of the domain XML config.
The driver will complain if this restrictions are violated.
</p>
<ul>
<li>
Memory size has to be a multiple of 4096
</li>
<li>
Number of virtual CPU has to be 1 or a multiple of 2
</li>
<li>
Valid MAC address prefixes are <code>00:0c:29</code> and
<code>00:50:56</code>. <span class="since">Since 0.7.6</span>
arbitrary <a href="#macaddresses">MAC addresses</a> are supported.
</li>
</ul>
<h3><a name="datastore">Datastore references</h3>
<p>
Storage is managed in datastores. VMware uses a special path format to
reference files in a datastore. Basically, the datastore name is put
into squared braces in front of the path.
</p>
<pre>
[datastore] directory/filename
</pre>
<p>
To define a new domain the driver converts the domain XML into a
VMware VMX file and uploads it to a datastore known to the ESX server.
Because multiple datastores may be known to an ESX server the driver
needs to decide to which datastores the VMX file should be uploaded.
The driver deduces this information from the path of the source of the
first file-based harddisk listed in the domain XML.
</p>
<h3><a name="macaddresses">MAC addresses</h3>
<p>
VMware has registered two MAC address prefixes for domains:
<code>00:0c:29</code> and <code>00:50:56</code>. These prefixes are
split into ranges for different purposes.
</p>
<table class="top_table">
<tr>
<th>Range</th>
<th>Purpose</th>
</tr>
<tr>
<td>
<code>00:0c:29:00:00:00</code> - <code>00:0c:29:ff:ff:ff</code>
</td>
<td>
An ESX server autogenerates MAC addresses from this range if
the VMX file doesn't contain a MAC address when trying to start
a domain.
</td>
</tr>
<tr>
<td>
<code>00:50:56:00:00:00</code> - <code>00:50:56:3f:ff:ff</code>
</td>
<td>
MAC addresses from this range can by manually assigned by the
user in the VI client.
</td>
</tr>
<tr>
<td>
<code>00:50:56:80:00:00</code> - <code>00:50:56:bf:ff:ff</code>
</td>
<td>
A VI client autogenerates MAC addresses from this range for
newly defined domains.
</td>
</tr>
</table>
<p>
The VMX files generated by the ESX driver always contain a MAC address,
because libvirt generates a random one if an interface element in the
domain XML file lacks a MAC address.
<span class="since">Since 0.7.6</span> the ESX driver sets the prefix
for generated MAC addresses to <code>00:0c:29</code>. Before 0.7.6
the <code>00:50:56</code> prefix was used. Sometimes this resulted in
the generation of out-of-range MAC address that were rejected by the
ESX server.
</p>
<p>
Also <span class="since">since 0.7.6</span> every MAC address outside
this ranges can be used. For such MAC addresses the ESX server-side
check is disabled in the VMX file to stop the ESX server from rejecting
out-of-predefined-range MAC addresses.
</p>
<pre>
ethernet0.checkMACAddress = "false"
</pre>
<h3><a name="hardware">Available hardware</h3>
<p>
VMware ESX supports different models of SCSI controllers and network
cards.
</p>
<h4>SCSI controller models</h4>
<dl>
<dt><code>buslogic</code></dt>
<dd>
BusLogic SCSI controller for older guests.
</dd>
<dt><code>lsilogic</code></dt>
<dd>
LSI Logic SCSI controller for recent guests.
</dd>
</dl>
<p>
Here a domain XML snippet:
</p>
<pre>
...
&lt;disk type='file' device='disk'&gt;
&lt;driver name='<strong>lsilogic</strong>'/&gt;
&lt;source file='[local-storage] Fedora11/Fedora11.vmdk'/&gt;
&lt;target dev='sda' bus='scsi'/&gt;
&lt;/disk&gt;
...
</pre>
<h4>Network card models</h4>
<dl>
<dt><code>vlance</code></dt>
<dd>
AMD PCnet32 network card for older guests.
</dd>
<dt><code>vmxnet</code>, <code>vmxnet3</code></dt>
<dd>
Special VMware VMXnet network card, requires VMware tools inside
the guest.
</dd>
<dt><code>e1000</code></dt>
<dd>
Intel E1000 network card for recent guests.
</dd>
</dl>
<p>
Here a domain XML snippet:
</p>
<pre>
...
&lt;interface type='bridge'&gt;
&lt;mac address='00:50:56:25:48:c7'/&gt;
&lt;source bridge='VM Network'/&gt;
&lt;model type='<strong>e1000</strong>'/&gt;
&lt;/interface&gt;
...
</pre>
<h2><a name="importexport">Import and export of domain XML configs</a></h2>
<p>
The ESX driver currently supports a native config format known as
<code>vmware-vmx</code> to handle VMware VMX configs.
</p>
<h3><a name="xmlimport">Converting from VMware VMX config to domain XML config</a></h3>
<p>
The <code>virsh domxml-from-native</code> provides a way to convert an
existing VMware VMX config into a domain XML config that can then be
used by libvirt.
</p>
<pre>
$ cat &gt; demo.vmx &lt;&lt; EOF
#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "4"
floppy0.present = "false"
nvram = "Fedora11.nvram"
deploymentPlatform = "windows"
virtualHW.productCompatibility = "hosted"
tools.upgrade.policy = "useGlobal"
powerType.powerOff = "default"
powerType.powerOn = "default"
powerType.suspend = "default"
powerType.reset = "default"
displayName = "Fedora11"
extendedConfigFile = "Fedora11.vmxf"
scsi0.present = "true"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
memsize = "1024"
scsi0:0.present = "true"
scsi0:0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
ide0:0.present = "true"
ide0:0.clientDevice = "true"
ide0:0.deviceType = "cdrom-raw"
ide0:0.startConnected = "false"
ethernet0.present = "true"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "vpx"
ethernet0.address = "00:50:56:91:48:c7"
chipset.onlineStandby = "false"
guestOSAltName = "Red Hat Enterprise Linux 5 (32-Bit)"
guestOS = "rhel5"
uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
snapshot.action = "keep"
sched.cpu.min = "0"
sched.cpu.units = "mhz"
sched.cpu.shares = "normal"
sched.mem.minsize = "0"
sched.mem.shares = "normal"
toolScripts.afterPowerOn = "true"
toolScripts.afterResume = "true"
toolScripts.beforeSuspend = "true"
toolScripts.beforePowerOff = "true"
scsi0:0.redo = ""
tools.syncTime = "false"
uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4"
sched.cpu.max = "unlimited"
sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11-7de040d8.vswp"
tools.remindInstall = "TRUE"
EOF
$ virsh -c esx://example.com domxml-from-native vmware-vmx demo.vmx
Enter username for example.com [root]:
Enter root password for example.com:
&lt;domain type='vmware'&gt;
&lt;name&gt;Fedora11&lt;/name&gt;
&lt;uuid&gt;50115e16-9bdc-49d7-f171-53c4d7f91710&lt;/uuid&gt;
&lt;memory&gt;1048576&lt;/memory&gt;
&lt;currentMemory&gt;1048576&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='i686'&gt;hvm&lt;/type&gt;
&lt;/os&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;driver name='lsilogic'/&gt;
&lt;source file='[local-storage] Fedora11/Fedora11.vmdk'/&gt;
&lt;target dev='sda' bus='scsi'/&gt;
&lt;/disk&gt;
&lt;interface type='bridge'&gt;
&lt;mac address='00:50:56:91:48:c7'/&gt;
&lt;source bridge='VM Network'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
<h3><a name="xmlexport">Converting from domain XML config to VMware VMX config</a></h3>
<p>
The <code>virsh domxml-to-native</code> provides a way to convert a
domain XML config into a VMware VMX config.
</p>
<pre>
$ cat &gt; demo.xml &lt;&lt; EOF
&lt;domain type='vmware'&gt;
&lt;name&gt;Fedora11&lt;/name&gt;
&lt;uuid&gt;50115e16-9bdc-49d7-f171-53c4d7f91710&lt;/uuid&gt;
&lt;memory&gt;1048576&lt;/memory&gt;
&lt;currentMemory&gt;1048576&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64'&gt;hvm&lt;/type&gt;
&lt;/os&gt;
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;driver name='lsilogic'/&gt;
&lt;source file='[local-storage] Fedora11/Fedora11.vmdk'/&gt;
&lt;target dev='sda' bus='scsi'/&gt;
&lt;/disk&gt;
&lt;interface type='bridge'&gt;
&lt;mac address='00:50:56:25:48:c7'/&gt;
&lt;source bridge='VM Network'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
EOF
$ virsh -c esx://example.com domxml-to-native vmware-vmx demo.xml
Enter username for example.com [root]:
Enter root password for example.com:
config.version = "8"
virtualHW.version = "4"
guestOS = "other-64"
uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
displayName = "Fedora11"
memsize = "1024"
numvcpus = "1"
scsi0.present = "true"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "/vmfs/volumes/local-storage/Fedora11/Fedora11.vmdk"
ethernet0.present = "true"
ethernet0.networkName = "VM Network"
ethernet0.connectionType = "bridged"
ethernet0.addressType = "static"
ethernet0.address = "00:50:56:25:48:C7"
</pre>
<h2><a name="xmlconfig">Example domain XML configs</a></h2>
<h3>Fedora11 on x86_64</h3>
<pre>
&lt;domain type='vmware'&gt;
&lt;name&gt;Fedora11&lt;/name&gt;
&lt;uuid&gt;50115e16-9bdc-49d7-f171-53c4d7f91710&lt;/uuid&gt;
&lt;memory&gt;1048576&lt;/memory&gt;
&lt;currentMemory&gt;1048576&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64'&gt;hvm&lt;/type&gt;
&lt;/os&gt;
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='[local-storage] Fedora11/Fedora11.vmdk'/&gt;
&lt;target dev='sda' bus='scsi'/&gt;
&lt;/disk&gt;
&lt;interface type='bridge'&gt;
&lt;mac address='00:50:56:25:48:c7'/&gt;
&lt;source bridge='VM Network'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
<h2><a name="migration">Migration</a></h2>
<p>
A migration cannot be initiated on an ESX server directly, a VMware
vCenter is necessary for this. The <code>vcenter</code> query
parameter must be set either to the hostname or IP address of the
vCenter managing the ESX server or to <code>*</code>. Setting it
to <code>*</code> causes the driver to connect to the vCenter known to
the ESX server. If the ESX server is not managed by a vCenter an error
is reported.
</p>
<pre>
esx://example.com/?vcenter=example-vcenter.com
</pre>
<p>
Here an example how to migrate the domain <code>Fedora11</code> from
ESX server <code>example-src.com</code> to ESX server
<code>example-dst.com</code> implicitly involving vCenter
<code>example-vcenter.com</code> using <code>virsh</code>.
</p>
<pre>
$ virsh -c esx://example-src.com/?vcenter=* migrate Fedora11 esx://example-dst.com/?vcenter=*
Enter username for example-src.com [root]:
Enter root password for example-src.com:
Enter username for example-vcenter.com [administrator]:
Enter administrator password for example-vcenter.com:
Enter username for example-dst.com [root]:
Enter root password for example-dst.com:
Enter username for example-vcenter.com [administrator]:
Enter administrator password for example-vcenter.com:
</pre>
<h2><a name="scheduler">Scheduler configuration</a></h2>
<p>
The driver exposes the ESX CPU scheduler. The parameters listed below
are available to control the scheduler.
</p>
<dl>
<dt><code>reservation</code></dt>
<dd>
The amount of CPU resource in MHz that is guaranteed to be
available to the domain. Valid values are 0 and greater.
</dd>
<dt><code>limit</code></dt>
<dd>
The CPU utilization of the domain will be
limited to this value in MHz, even if more CPU resources are
available. If the limit is set to -1, the CPU utilization of the
domain is unlimited. If the limit is not set to -1, it must be
greater than or equal to the reservation.
</dd>
<dt><code>shares</code></dt>
<dd>
Shares are used to determine relative CPU
allocation between domains. In general, a domain with more shares
gets proportionally more of the CPU resource. Valid values are 0
and greater. The special values -1, -2 and -3 represent the
predefined shares level <code>low</code>, <code>normal</code> and
<code>high</code>.
</dd>
</dl>
<h2><a name="tools">VMware tools</a></h2>
<p>
Some actions require installed VMware tools. If the VMware tools are
not installed in the guest and one of the actions below is to be
performed the ESX server raises an error and the driver reports it.
</p>
<ul>
<li>
<code>virDomainReboot</code>
</li>
<li>
<code>virDomainShutdown</code>
</li>
</ul>
<h2><a name="links">Links</a></h2>
<ul>
<li>
<a href="http://www.vmware.com/support/developer/vc-sdk/">
VMware vSphere Web Services SDK Documentation
</a>
</li>
<li>
<a href="http://www.vmware.com/pdf/esx3_memory.pdf">
The Role of Memory in VMware ESX Server 3
</a>
</li>
<li>
<a href="http://www.sanbarrow.com/vmx.html">
VMware VMX config parameters
</a>
</li>
</ul>
</body></html>

View File

@ -13,24 +13,24 @@ start it using
<p></p>
<pre>
&lt;domain type='lxc'&gt;
&lt;name&gt;vm1&lt;/name&gt;
&lt;memory&gt;500000&lt;/memory&gt;
&lt;os&gt;
&lt;type&gt;exe&lt;/type&gt;
&lt;init&gt;/bin/sh&lt;/init&gt;
&lt;/os&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
&lt;/interface&gt;
&lt;console type='pty' /&gt;
&lt;/devices&gt;
&lt;name&gt;vm1&lt;/name&gt;
&lt;memory&gt;500000&lt;/memory&gt;
&lt;os&gt;
&lt;type&gt;exe&lt;/type&gt;
&lt;init&gt;/bin/sh&lt;/init&gt;
&lt;/os&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
&lt;/interface&gt;
&lt;console type='pty' /&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
@ -42,28 +42,28 @@ debootstrap, whatever) under /opt/vm-1-root:
<p></p>
<pre>
&lt;domain type='lxc'&gt;
&lt;name&gt;vm1&lt;/name&gt;
&lt;memory&gt;32768&lt;/memory&gt;
&lt;os&gt;
&lt;type&gt;exe&lt;/type&gt;
&lt;init&gt;/init&lt;/init&gt;
&lt;/os&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
&lt;filesystem type='mount'&gt;
&lt;source dir='/opt/vm-1-root'/&gt;
&lt;target dir='/'/&gt;
&lt;/filesystem&gt;
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
&lt;/interface&gt;
&lt;console type='pty' /&gt;
&lt;/devices&gt;
&lt;name&gt;vm1&lt;/name&gt;
&lt;memory&gt;32768&lt;/memory&gt;
&lt;os&gt;
&lt;type&gt;exe&lt;/type&gt;
&lt;init&gt;/init&lt;/init&gt;
&lt;/os&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;clock offset='utc'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;destroy&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
&lt;filesystem type='mount'&gt;
&lt;source dir='/opt/vm-1-root'/&gt;
&lt;target dir='/'/&gt;
&lt;/filesystem&gt;
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
&lt;/interface&gt;
&lt;console type='pty' /&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>

View File

@ -18,82 +18,83 @@ tools and VM description files.</p>
<ul>
<li>
<p style="margin-bottom: 0in">A working OpenNebula installation,
version 1.2 or higher.
</p>
</li>
version 1.2 or higher.
</p>
</li>
</ul>
<h2>
<a name="uris"></a>Connections to OpenNebula driver</h2>
<p>The Uri of the driver protocol is "one". Some example
connection Uris for the driver are:
</p>
<pre> one:/// (local access)
one+unix:/// (local access)
one://example.com/ (remote access)
one+tcp://example.com/ (remote access, SASl/Kerberos)
one+ssh://user@example.com/ (remote access, SSH tunnelled)
</pre>
<pre>
one:/// (local access)
one+unix:/// (local access)
one://example.com/ (remote access)
one+tcp://example.com/ (remote access, SASl/Kerberos)
one+ssh://user@example.com/ (remote access, SSH tunnelled)
</pre>
<h2>
<a name="xmlconfig"></a>Example domain XML config</h2>
<p>There are some limitations on the XML attributes that may be
specified when interfacing OpenNebula. The following xml example
details the attributes and options supported by the OpenNebula
driver:</p>
driver:</p>
<h3>Paravirtualized guest direct kernel boot
<h3>Paravirtualized guest direct kernel boot
</h3>
<pre> &lt;domain type='one'&gt;
&lt;name&gt;vm01&lt;/name&gt;
&lt;memory&gt;32768&lt;/memory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
<pre>
&lt;domain type='one'&gt;
&lt;name&gt;vm01&lt;/name&gt;
&lt;memory&gt;32768&lt;/memory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type&gt;linux&lt;/type&gt;
&lt;kernel&gt;/boot/vmlinuz-2.6.24-17-xen&lt;/kernel&gt;
&lt;initrd&gt;/boot/initrd.img-2.6.24-17-xen&lt;/initrd&gt;
&lt;cmdline&gt;&lt;/cmdline&gt;
&lt;root&gt;sda1&lt;/root&gt;
&lt;/os&gt;
&lt;os&gt;
&lt;type&gt;linux&lt;/type&gt;
&lt;kernel&gt;/boot/vmlinuz-2.6.24-17-xen&lt;/kernel&gt;
&lt;initrd&gt;/boot/initrd.img-2.6.24-17-xen&lt;/initrd&gt;
&lt;cmdline&gt;&lt;/cmdline&gt;
&lt;root&gt;sda1&lt;/root&gt;
&lt;/os&gt;
&lt;devices&gt;
&lt;devices&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/images/sgehosts/01/disk.img'/&gt;
&lt;target dev='sda1'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/images/sgehosts/01/disk.img'/&gt;
&lt;target dev='sda1'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/images/sgehosts/01/swap.img'/&gt;
&lt;target dev='sda2'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/images/sgehosts/01/swap.img'/&gt;
&lt;target dev='sda2'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='cdrom'&gt;
&lt;source file='/images/iso/cdrom.iso'/&gt;
&lt;target dev='hdc'/&gt;
&lt;readonly/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='cdrom'&gt;
&lt;source file='/images/iso/cdrom.iso'/&gt;
&lt;target dev='hdc'/&gt;
&lt;readonly/&gt;
&lt;/disk&gt;
&lt;!--BRIDGE--&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='eth0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;/interface&gt;
&lt;!--BRIDGE--&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='eth0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;/interface&gt;
&lt;!--ONE Network--&gt;
&lt;interface type='network'&gt;
&lt;source network='onenetwork'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
&lt;!--ONE Network--&gt;
&lt;interface type='network'&gt;
&lt;source network='onenetwork'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
<p>
<b>Note:</b> The "&lt;interface type='network'&gt;" will
attach the interface to a previously configured network (named
<tt>onenetwork</tt>) within the <a href="http://opennebula.org/">OpenNebula</a> system, typically with the
<tt>onevnet</tt> CLI command.</p>
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
</p>
<h2>Links</h2>

View File

@ -19,13 +19,13 @@
the libvirt driver are:
</p>
<pre>
openvz:///system (local access)
openvz+unix:///system (local access)
openvz://example.com/system (remote access, TLS/x509)
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
<pre>
openvz:///system (local access)
openvz+unix:///system (local access)
openvz://example.com/system (remote access, TLS/x509)
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
<h2>Notes on bridged networking</h2>
@ -60,10 +60,10 @@
must be created containing
</p>
<pre>
<pre>
#!/bin/bash
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
</pre>
</pre>
<p>
The host OS is now ready to allow bridging of guest containers, which
@ -83,7 +83,7 @@ EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
matches the templates known to OpenVZ tools.
</p>
<pre>
<pre>
&lt;domain type='openvz' id='104'&gt;
&lt;name&gt;104&lt;/name&gt;
&lt;uuid&gt;86c12009-e591-a159-6e9f-91d18b85ef78&lt;/uuid&gt;
@ -104,7 +104,7 @@ EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
&lt;/interface&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
</pre>
</body>
</html>

View File

@ -14,23 +14,23 @@
<ul>
<li>
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
of this can be seen from the capabilities XML output.
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
of this can be seen from the capabilities XML output.
</li>
<li>
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
node. If both are found, then KVM fullyvirtualized, hardware accelerated
guests will be available.
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
node. If both are found, then KVM fullyvirtualized, hardware accelerated
guests will be available.
</li>
<li>
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
node. If both are found, then Xen paravirtualized guests can be run using
the KVM hardware acceleration.
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
node. If both are found, then Xen paravirtualized guests can be run using
the KVM hardware acceleration.
</li>
</ul>
@ -39,20 +39,20 @@
<p>
The libvirt QEMU driver is a multi-instance driver, providing a single
system wide privileged driver (the "system" instance), and per-user
unprivileged drivers (the "session" instance). The of the driver protocol
unprivileged drivers (the "session" instance). The URI driver protocol
is "qemu". Some example conection URIs for the libvirt driver are:
</p>
<pre>
qemu:///session (local access to per-user instance)
qemu+unix:///session (local access to per-user instance)
<pre>
qemu:///session (local access to per-user instance)
qemu+unix:///session (local access to per-user instance)
qemu:///system (local access to system instance)
qemu+unix:///system (local access to system instance)
qemu://example.com/system (remote access, TLS/x509)
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
qemu:///system (local access to system instance)
qemu+unix:///system (local access to system instance)
qemu://example.com/system (remote access, TLS/x509)
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
<h2><a name="security">Driver security architecture</a></h2>
@ -167,7 +167,7 @@
parent directories
</p>
<pre>
chmod o+x /path/to/directory
chmod o+x /path/to/directory
</pre>
<p>
In particular note that if using the "system" instance
@ -383,12 +383,12 @@
The list of shared devices a guest is allowed access to is
</p>
<pre>
/dev/null, /dev/full, /dev/zero,
/dev/random, /dev/urandom,
/dev/ptmx, /dev/kvm, /dev/kqemu,
/dev/rtc, /dev/hpet, /dev/net/tun
</pre>
<pre>
/dev/null, /dev/full, /dev/zero,
/dev/random, /dev/urandom,
/dev/ptmx, /dev/kvm, /dev/kqemu,
/dev/rtc, /dev/hpet, /dev/net/tun
</pre>
<p>
In the event of unanticipated needs arising, this can be customized
@ -397,10 +397,10 @@
should be run as root, prior to starting libvirtd
</p>
<pre>
mkdir /dev/cgroup
mount -t cgroup none /dev/cgroup -o devices
</pre>
<pre>
mkdir /dev/cgroup
mount -t cgroup none /dev/cgroup -o devices
</pre>
<p>
libvirt will then place each virtual machine in a cgroup at
@ -430,6 +430,7 @@ LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
/dev/HostVG/QEMUGuest1 -net none -serial none \
-parallel none -usb
EOF
$ virsh domxml-from-native qemu-argv demo.args
&lt;domain type='qemu'&gt;
&lt;uuid&gt;00000000-0000-0000-0000-000000000000&lt;/uuid&gt;
@ -452,7 +453,7 @@ $ virsh domxml-from-native qemu-argv demo.args
&lt;/disk&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
</pre>
<p>NB, don't include the literral \ in the args, put everything on one line</p>
@ -488,6 +489,7 @@ $ virsh domxml-from-native qemu-argv demo.args
&lt;/devices&gt;
&lt;/domain&gt;
EOF
$ virsh domxml-to-native qemu-argv demo.xml
LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
@ -495,7 +497,7 @@ $ virsh domxml-to-native qemu-argv demo.xml
-monitor pty -no-acpi -boot c -drive \
file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
-serial none -parallel none -usb
</pre>
</pre>
<h2><a name="xmlconfig">Example domain XML config</a></h2>
@ -556,7 +558,7 @@ $ virsh domxml-to-native qemu-argv demo.xml
<h3>Xen paravirtualized guests with hardware acceleration</h3>
</body>
</html>

View File

@ -12,14 +12,14 @@
for the libvirt driver are:
</p>
<pre>
test:///default (local access, default config)
test:///path/to/driver/config.xml (local access, custom config)
test+unix:///default (local access, default config, via daemon)
test://example.com/default (remote access, TLS/x509)
test+tcp://example.com/default (remote access, SASl/Kerberos)
test+ssh://root@example.com/default (remote access, SSH tunnelled)
</pre>
<pre>
test:///default (local access, default config)
test:///path/to/driver/config.xml (local access, custom config)
test+unix:///default (local access, default config, via daemon)
test://example.com/default (remote access, TLS/x509)
test+tcp://example.com/default (remote access, SASl/Kerberos)
test+ssh://root@example.com/default (remote access, SSH tunnelled)
</pre>
</body>
</html>

View File

@ -24,16 +24,16 @@
URIs are
</p>
<pre>
uml:///session (local access to per-user instance)
uml+unix:///session (local access to per-user instance)
<pre>
uml:///session (local access to per-user instance)
uml+unix:///session (local access to per-user instance)
uml:///system (local access to system instance)
uml+unix:///system (local access to system instance)
uml://example.com/system (remote access, TLS/x509)
uml+tcp://example.com/system (remote access, SASl/Kerberos)
uml+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
uml:///system (local access to system instance)
uml+unix:///system (local access to system instance)
uml://example.com/system (remote access, TLS/x509)
uml+tcp://example.com/system (remote access, SASl/Kerberos)
uml+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
<h2>Example XML configuration</h2>
@ -58,7 +58,7 @@
thus accessible with "virsh console" or equivalent tools
</p>
<pre>
<pre>
&lt;domain type='uml'&gt;
&lt;name&gt;demo&lt;/name&gt;
&lt;uuid&gt;b4433fc2-a22e-ffb3-0a3d-9c173b395800&lt;/uuid&gt;
@ -77,6 +77,6 @@
&lt;console type='pty'/&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
</pre>
</body>
</html>

View File

@ -13,107 +13,105 @@
The uri of the driver protocol is "vbox". Some example connection URIs for the driver are:
</p>
<pre>
vbox:///session (local access to per-user instance)
vbox+unix:///session (local access to per-user instance)
vbox+tcp://user@example.com/session (remote access, SASl/Kerberos)
vbox+ssh://user@example.com/session (remote access, SSH tunnelled)
</pre>
<pre>
vbox:///session (local access to per-user instance)
vbox+unix:///session (local access to per-user instance)
vbox+tcp://user@example.com/session (remote access, SASl/Kerberos)
vbox+ssh://user@example.com/session (remote access, SSH tunnelled)
</pre>
<h2><a name="xmlconfig">Example domain XML config</a></h2>
<pre>
&lt;domain type='vbox'&gt;
&lt;name&gt;vbox&lt;/name&gt;
&lt;uuid&gt;4dab22b31d52d8f32516782e98ab3fa0&lt;/uuid&gt;
<pre>
&lt;domain type='vbox'&gt;
&lt;name&gt;vbox&lt;/name&gt;
&lt;uuid&gt;4dab22b31d52d8f32516782e98ab3fa0&lt;/uuid&gt;
&lt;os&gt;
&lt;type&gt;hvm&lt;/type&gt;
&lt;boot dev='cdrom'/&gt;
&lt;boot dev='hd'/&gt;
&lt;boot dev='fd'/&gt;
&lt;boot dev='network'/&gt;
&lt;/os&gt;
&lt;os&gt;
&lt;type&gt;hvm&lt;/type&gt;
&lt;boot dev='cdrom'/&gt;
&lt;boot dev='hd'/&gt;
&lt;boot dev='fd'/&gt;
&lt;boot dev='network'/&gt;
&lt;/os&gt;
&lt;memory&gt;654321&lt;/memory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;memory&gt;654321&lt;/memory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;features&gt;
&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;/features&gt;
&lt;features&gt;
&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;/features&gt;
&lt;devices&gt;
&lt;disk type='file' device='cdrom'&gt;
&lt;source file='/home/user/Downloads/slax-6.0.9.iso'/&gt;
&lt;target dev='hdc'/&gt;
&lt;readonly/&gt;
&lt;/disk&gt;
&lt;devices&gt;
&lt;disk type='file' device='cdrom'&gt;
&lt;source file='/home/user/Downloads/slax-6.0.9.iso'/&gt;
&lt;target dev='hdc'/&gt;
&lt;readonly/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/home/user/tmp/vbox.vdi'/&gt;
&lt;target dev='hdd'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='disk'&gt;
&lt;source file='/home/user/tmp/vbox.vdi'/&gt;
&lt;target dev='hdd'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='floppy'&gt;
&lt;source file='/home/user/tmp/WIN98C.IMG'/&gt;
&lt;target dev='fda'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='floppy'&gt;
&lt;source file='/home/user/tmp/WIN98C.IMG'/&gt;
&lt;target dev='fda'/&gt;
&lt;/disk&gt;
&lt;!--BRIDGE--&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='eth0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;model type='am79c973'/&gt;
&lt;/interface&gt;
&lt;!--BRIDGE--&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='eth0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;model type='am79c973'/&gt;
&lt;/interface&gt;
&lt;!--NAT--&gt;
&lt;interface type='user'&gt;
&lt;mac address='56:16:3e:5d:c7:9e'/&gt;
&lt;model type='82540eM'/&gt;
&lt;/interface&gt;
&lt;!--NAT--&gt;
&lt;interface type='user'&gt;
&lt;mac address='56:16:3e:5d:c7:9e'/&gt;
&lt;model type='82540eM'/&gt;
&lt;/interface&gt;
&lt;sound model='sb16'/&gt;
&lt;sound model='sb16'/&gt;
&lt;parallel type='dev'&gt;
&lt;source path='/dev/pts/1'/&gt;
&lt;target port='0'/&gt;
&lt;/parallel&gt;
&lt;parallel type='dev'&gt;
&lt;source path='/dev/pts/1'/&gt;
&lt;target port='0'/&gt;
&lt;/parallel&gt;
&lt;parallel type='dev'&gt;
&lt;source path='/dev/pts/2'/&gt;
&lt;target port='1'/&gt;
&lt;/parallel&gt;
&lt;parallel type='dev'&gt;
&lt;source path='/dev/pts/2'/&gt;
&lt;target port='1'/&gt;
&lt;/parallel&gt;
&lt;serial type="dev"&gt;
&lt;source path="/dev/ttyS0"/&gt;
&lt;target port="0"/&gt;
&lt;/serial&gt;
&lt;serial type="dev"&gt;
&lt;source path="/dev/ttyS0"/&gt;
&lt;target port="0"/&gt;
&lt;/serial&gt;
&lt;serial type="pipe"&gt;
&lt;source path="/tmp/serial.txt"/&gt;
&lt;target port="1"/&gt;
&lt;/serial&gt;
&lt;serial type="pipe"&gt;
&lt;source path="/tmp/serial.txt"/&gt;
&lt;target port="1"/&gt;
&lt;/serial&gt;
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x1234'/&gt;
&lt;product id='0xbeef'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x1234'/&gt;
&lt;product id='0xbeef'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x4321'/&gt;
&lt;product id='0xfeeb'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x4321'/&gt;
&lt;product id='0xfeeb'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
</body>
</html>

View File

@ -18,31 +18,31 @@
<ul>
<li>
<strong>XenD</strong>: Access to the Xen daemon is a mandatory
requirement for the libvirt Xen driver. It requires that the UNIX
socket interface be enabled in the <code>/etc/xen/xend-config.sxp</code>
configuration file. Specifically the config settings
<code>(xend-unix-server yes)</code>. This path is usually restricted
to only allow the <code>root</code> user access. As an alternative,
the HTTP interface can be used, however, this has significant security
implications.
<strong>XenD</strong>: Access to the Xen daemon is a mandatory
requirement for the libvirt Xen driver. It requires that the UNIX
socket interface be enabled in the <code>/etc/xen/xend-config.sxp</code>
configuration file. Specifically the config settings
<code>(xend-unix-server yes)</code>. This path is usually restricted
to only allow the <code>root</code> user access. As an alternative,
the HTTP interface can be used, however, this has significant security
implications.
</li>
<li>
<strong>XenStoreD</strong>: Access to the Xenstore daemon enables
more efficient codepaths for looking up domain information which
lowers the CPU overhead of management.
<strong>XenStoreD</strong>: Access to the Xenstore daemon enables
more efficient codepaths for looking up domain information which
lowers the CPU overhead of management.
</li>
<li>
<strong>Hypercalls</strong>: The ability to make direct hypercalls
allows the most efficient codepaths in the driver to be used for
monitoring domain status.
<strong>Hypercalls</strong>: The ability to make direct hypercalls
allows the most efficient codepaths in the driver to be used for
monitoring domain status.
</li>
<li>
<strong>XM config</strong>: When using Xen releases prior to 3.0.4,
there is no inactive domain management in XenD. For such releases,
libvirt will automatically process XM configuration files kept in
the <code>/etc/xen</code> directory. It is important not to place
any other non-config files in this directory.
<strong>XM config</strong>: When using Xen releases prior to 3.0.4,
there is no inactive domain management in XenD. For such releases,
libvirt will automatically process XM configuration files kept in
the <code>/etc/xen</code> directory. It is important not to place
any other non-config files in this directory.
</li>
</ul>
@ -54,13 +54,13 @@
the libvirt driver are:
</p>
<pre>
xen:/// (local access, direct)
xen+unix:/// (local access, via daemon)
xen://example.com/ (remote access, TLS/x509)
xen+tcp://example.com/ (remote access, SASl/Kerberos)
xen+ssh://root@example.com/ (remote access, SSH tunnelled)
</pre>
<pre>
xen:/// (local access, direct)
xen+unix:/// (local access, via daemon)
xen://example.com/ (remote access, TLS/x509)
xen+tcp://example.com/ (remote access, SASl/Kerberos)
xen+ssh://root@example.com/ (remote access, SSH tunnelled)
</pre>
<h2><a name="imex">Import and export of libvirt domain XML configs</a></h2>
@ -114,8 +114,7 @@
&lt;input type='mouse' bus='xen'/&gt;
&lt;graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/&gt;
&lt;/devices&gt;
&lt;/domain&gt;
</pre>
&lt;/domain&gt;</pre>
<h3><a name="xmlexport">Converting from domain XML to XM config files</a></h3>
@ -125,7 +124,7 @@
format.
</p>
<pre># virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml
<pre>$ virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml
name = "rhel5pv"
uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
maxmem = 2500
@ -143,8 +142,7 @@ vnc = 1
vncunused = 1
vnclisten = "0.0.0.0"
disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]
</pre>
vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]</pre>
<h2><a name="xmlconfig">Example domain XML config</a></h2>

View File

@ -21,6 +21,11 @@ BIOS you will see</p>
&lt;features&gt;
&lt;vmx/&gt;
&lt;/features&gt;
&lt;model&gt;core2duo&lt;/model&gt;
&lt;topology sockets="1" cores="2" threads="1"/&gt;
&lt;feature name="lahf_lm"/&gt;
&lt;feature name='xtpr'/&gt;
...
&lt;/cpu&gt;
&lt;/host&gt;</span>
@ -48,15 +53,17 @@ BIOS you will see</p>
&lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
&lt;/arch&gt;
&lt;features&gt;
&lt;cpuselection/&gt;
&lt;/features&gt;
&lt;/guest&gt;</span>
...
&lt;/capabilities&gt;</pre>
<p>The first block (in red) indicates the host hardware capabilities, currently
it is limited to the CPU properties but other information may be available,
it shows the CPU architecture, and the features of the chip (the feature
block is similar to what you will find in a Xen fully virtualized domain
description).</p>
it shows the CPU architecture, topology, model name, and additional features
which are not included in the model but the CPU provides them. Features of the
chip are shown within the feature block (the block is similar to what you will
find in a Xen fully virtualized domain description).</p>
<p>The second block (in blue) indicates the paravirtualization support of the
Xen support, you will see the os_type of xen to indicate a paravirtual
kernel, then architecture information and potential features.</p>

View File

@ -37,17 +37,17 @@
<dl>
<dt><code>name</code></dt>
<dd>The content of the <code>name</code> element provides
a short name for the virtual machine. This name should
consist only of alpha-numeric characters and is required
to be unique within the scope of a single host. It is
often used to form the filename for storing the persistent
configuration file. <span class="since">Since 0.0.1</span></dd>
a short name for the virtual machine. This name should
consist only of alpha-numeric characters and is required
to be unique within the scope of a single host. It is
often used to form the filename for storing the persistent
configuration file. <span class="since">Since 0.0.1</span></dd>
<dt><code>uuid</code></dt>
<dd>The content of the <code>uuid</code> element provides
a globally unique identifier for the virtual machine.
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new machine, a random
UUID is generated. <span class="since">Since 0.0.1</span></dd>
a globally unique identifier for the virtual machine.
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new machine, a random
UUID is generated. <span class="since">Since 0.0.1</span></dd>
</dl>
<h3><a name="elementsOS">Operating system booting</a></h3>
@ -78,24 +78,24 @@
<dl>
<dt><code>type</code></dt>
<dd>The content of the <code>type</code> element specifies the
type of operating system to be booted in the virtual machine.
<code>hvm</code> indicates that the OS is one designed to run
on bare metal, so requires full virtualization. <code>linux</code>
(badly named!) refers to an OS that supports the Xen 3 hypervisor
guest ABI. There are also two optional attributes, <code>arch</code>
specifying the CPU architecture to virtualization, and <code>machine</code>
referring to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
provides details on allowed values for these. <span class="since">Since 0.0.1</span></dd>
type of operating system to be booted in the virtual machine.
<code>hvm</code> indicates that the OS is one designed to run
on bare metal, so requires full virtualization. <code>linux</code>
(badly named!) refers to an OS that supports the Xen 3 hypervisor
guest ABI. There are also two optional attributes, <code>arch</code>
specifying the CPU architecture to virtualization, and <code>machine</code>
referring to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
provides details on allowed values for these. <span class="since">Since 0.0.1</span></dd>
<dt><code>loader</code></dt>
<dd>The optional <code>loader</code> tag refers to a firmware blob
used to assist the domain creation process. At this time, it is
only needed by Xen fully virtualized domains. <span class="since">Since 0.1.0</span></dd>
used to assist the domain creation process. At this time, it is
only needed by Xen fully virtualized domains. <span class="since">Since 0.1.0</span></dd>
<dt><code>boot</code></dt>
<dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
"cdrom" or "network" and is used to specify the next boot device
to consider. The <code>boot</code> element can be repeated multiple
times to setup a priority list of boot devices to try in turn.
<span class="since">Since 0.1.3</span>
"cdrom" or "network" and is used to specify the next boot device
to consider. The <code>boot</code> element can be repeated multiple
times to setup a priority list of boot devices to try in turn.
<span class="since">Since 0.1.3</span>
</dd>
</dl>
@ -111,22 +111,22 @@
<pre>
...
&lt;bootloader&gt;/usr/bin/pygrub&lt;/bootloader&gt;
&lt;bootloader_args&gt;--append single&lt;/bootloader_args&gt;
&lt;bootloader&gt;/usr/bin/pygrub&lt;/bootloader&gt;
&lt;bootloader_args&gt;--append single&lt;/bootloader_args&gt;
...</pre>
<dl>
<dt><code>bootloader</code></dt>
<dd>The content of the <code>bootloader</code> element provides
a fully qualified path to the bootloader executable in the
host OS. This bootloader will be run to choose which kernel
to boot. The required output of the bootloader is dependent
on the hypervisor in use. <span class="since">Since 0.1.0</span></dd>
a fully qualified path to the bootloader executable in the
host OS. This bootloader will be run to choose which kernel
to boot. The required output of the bootloader is dependent
on the hypervisor in use. <span class="since">Since 0.1.0</span></dd>
<dt><code>bootloader_args</code></dt>
<dd>The optional <code>bootloader_args</code> element allows
command line arguments to be passed to the bootloader.
<span class="since">Since 0.2.3</span>
</dd>
command line arguments to be passed to the bootloader.
<span class="since">Since 0.2.3</span>
</dd>
</dl>
@ -141,64 +141,157 @@
<pre>
...
&lt;os&gt;
&lt;os&gt;
&lt;type&gt;hvm&lt;/type&gt;
&lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
&lt;kernel&gt;/root/f8-i386-vmlinuz&lt;/kernel&gt;
&lt;initrd&gt;/root/f8-i386-initrd&lt;/initrd&gt;
&lt;cmdline&gt;console=ttyS0 ks=http://example.com/f8-i386/os/&lt;/cmdline&gt;
&lt;/os&gt;
...</pre>
&lt;/os&gt;
...</pre>
<dl>
<dt><code>type</code></dt>
<dd>This element has the same semantics as described earlier in the
<a href="#elementsOSBIOS">BIOS boot section</a></dd>
<a href="#elementsOSBIOS">BIOS boot section</a></dd>
<dt><code>loader</code></dt>
<dd>This element has the same semantics as described earlier in the
<a href="#elementsOSBIOS">BIOS boot section</a></dd>
<a href="#elementsOSBIOS">BIOS boot section</a></dd>
<dt><code>kernel</code></dt>
<dd>The contents of this element specify the fully-qualified path
to the kernel image in the host OS.</dd>
to the kernel image in the host OS.</dd>
<dt><code>initrd</code></dt>
<dd>The contents of this element specify the fully-qualified path
to the (optional) ramdisk image in the host OS.</dd>
to the (optional) ramdisk image in the host OS.</dd>
<dt><code>cmdline</code></dt>
<dd>The contents of this element specify arguments to be passed to
the kernel (or installer) at boottime. This is often used to
specify an alternate primary console (eg serial port), or the
installation media source / kickstart file</dd>
the kernel (or installer) at boottime. This is often used to
specify an alternate primary console (eg serial port), or the
installation media source / kickstart file</dd>
</dl>
<h3><a name="elementsResources">Basic resources</a></h3>
<pre>
...
&lt;memory&gt;524288&lt;/memory&gt;
&lt;currentMemory&gt;524288&lt;/currentMemory&gt;
&lt;memoryBacking&gt;
&lt;hugepages/&gt;
&lt;memory&gt;524288&lt;/memory&gt;
&lt;currentMemory&gt;524288&lt;/currentMemory&gt;
&lt;memoryBacking&gt;
&lt;hugepages/&gt;
&lt;/memoryBacking&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
...</pre>
&lt;vcpu&gt;1&lt;/vcpu&gt;
...</pre>
<dl>
<dt><code>memory</code></dt>
<dd>The maximum allocation of memory for the guest at boot time.
The units for this value are kilobytes (i.e. blocks of 1024 bytes)</dd>
The units for this value are kilobytes (i.e. blocks of 1024 bytes)</dd>
<dt><code>currentMemory</code></dt>
<dd>The actual allocation of memory for the guest. This value
be less than the maximum allocation, to allow for ballooning
up the guests memory on the fly. If this is omitted, it defaults
to the same value as the <code>memory<code> element</dd>
be less than the maximum allocation, to allow for ballooning
up the guests memory on the fly. If this is omitted, it defaults
to the same value as the <code>memory<code> element</dd>
<dt><code>memoryBacking</code></dt>
<dd>The optional <code>memoryBacking</code> element, may have an
<code>hugepages</code> element set within it. This tells the
hypervisor that the guest should have its memory allocated using
hugepages instead of the normal native page size.</dd>
<code>hugepages</code> element set within it. This tells the
hypervisor that the guest should have its memory allocated using
hugepages instead of the normal native page size.</dd>
<dt><code>vcpu</code></dt>
<dd>The content of this element defines the number of virtual
CPUs allocated for the guest OS.</dd>
CPUs allocated for the guest OS.</dd>
</dl>
<h3><a name="elementsCPU">CPU model and topology</a></h3>
<p>
Requirements for CPU model, its features and topology can be specified
using the following collection of elements.
<span class="since">Since 0.7.5</span>
</p>
<pre>
...
&lt;cpu match='exact'&gt;
&lt;model&gt;core2duo&lt;/model&gt;
&lt;topology sockets='1' cores='2' threads='1'/&gt;
&lt;feature policy='disable' name='lahf_lm'/&gt;
&lt;/cpu&gt;
...</pre>
<p>
In case no restrictions need to be put on CPU model and its features, a
simpler <code>cpu</code> element can be used.
<span class="since">Since 0.7.6</span>
</p>
<pre>
...
&lt;cpu&gt;
&lt;topology sockets='1' cores='2' threads='1'/&gt;
&lt;/cpu&gt;
...</pre>
<dl>
<dt><code>cpu</code></dt>
<dd>The <code>cpu</code> element is the main container for describing
guest CPU requirements. Its <code>match</code> attribute specified how
strictly has the virtual CPU provided to the guest match these
requirements. <span class="since">Since 0.7.6</span> the
<code>match</code> attribute can be omitted if <code>topology</code>
is the only element within <code>cpu</code>. Possible values for the
<code>match</code> attribute are:
<dl>
<dt><code>minimum</code></dt>
<dd>The specified CPU model and features describes the minimum
requested CPU.</dd>
<dt><code>exact</code></dt>
<dd>The virtual CPU provided to the guest will exactly match the
specification</dd>
<dt><code>strict</code></dt>
<dd>The guest will not be created unless the host CPU does exactly
match the specification.</dd>
</dl>
</dd>
<dt><code>model</code></dt>
<dd>The content of the <code>model</code> element specifies CPU model
requested by the guest. The list of available CPU models and their
definition can be found in <code>cpu_map.xml</code> file installed
in libvirt's data directory.</dd>
<dt><code>topology</code></dt>
<dd>The <code>topology</code> element specifies requested topology of
virtual CPU provided to the guest. Three non-zero values have to be
given for <code>sockets</code>, <code>cores</code>, and
<code>threads</code>: total number of CPU sockets, number of cores per
socket, and number of threads per core, respectively.</dd>
<dt><code>feature</code></dt>
<dd>The <code>cpu</code> element can contain zero or more
<code>elements</code> used to fine-tune features provided by the
selected CPU model. The list of known feature names can be found in
the same file as CPU models. The meaning of each <code>feature</code>
element depends on its <code>policy</code> attribute, which has to be
set to one of the following values:
<dl>
<dt><code>force</code></dt>
<dd>The virtual CPU will claim the feature is supported regardless
of it being supported by host CPU.</dd>
<dt><code>require</code></dt>
<dd>Guest creation will fail unless the feature is supported by host
CPU.</dd>
<dt><code>optional</code></dt>
<dd>The feature will be supported by virtual CPU if and only if it
is supported by host CPU.</dd>
<dt><code>disable</code></dt>
<dd>The feature will not be supported by virtual CPU.</dd>
<dt><code>forbid</code></dt>
<dd>Guest creation will fail if the feature is supported by host
CPU.</dd>
</dl>
</dd>
</dl>
<h3><a name="elementsLifecycle">Lifecycle control</a></h3>
@ -214,21 +307,21 @@
<pre>
...
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;restart&lt;/on_crash&gt;
...</pre>
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;restart&lt;/on_crash&gt;
...</pre>
<dl>
<dt><code>on_poweroff</code></dt>
<dd>The content of this element specifies the action to take when
the guest requests a poweroff.</dd>
the guest requests a poweroff.</dd>
<dt><code>on_reboot</code></dt>
<dd>The content of this element specifies the action to take when
the guest requests a reboot.</dd>
the guest requests a reboot.</dd>
<dt><code>on_crash</code></dt>
<dd>The content of this element specifies the action to take when
the guest crashes.</dd>
the guest crashes.</dd>
</dl>
<p>
@ -238,16 +331,16 @@
<dl>
<dt><code>destroy</code></dt>
<dd>The domain will be terminated completely and all resources
released</dd>
released</dd>
<dt><code>restart</code></dt>
<dd>The domain will be terminated, and then restarted with
the same configuration</dd>
the same configuration</dd>
<dt><code>preserve</code></dt>
<dd>The domain will be terminated, and its resource preserved
to allow analysis.</dd>
to allow analysis.</dd>
<dt><code>rename-restart</code></dt>
<dd>The domain will be terminated, and then restarted with
a new name</dd>
a new name</dd>
</dl>
<h3><a name="elementsFeatures">Hypervisor features</a></h3>
@ -259,12 +352,12 @@
<pre>
...
&lt;features&gt;
&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;/features&gt;
...</pre>
&lt;features&gt;
&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;
&lt;/features&gt;
...</pre>
<p>
All features are listed within the <code>features</code>
@ -277,10 +370,10 @@
<dl>
<dt><code>pae</code></dt>
<dd>Physical address extension mode allows 32-bit guests
to address more than 4 GB of memory.</dd>
to address more than 4 GB of memory.</dd>
<dt><code>acpi</code></dt>
<dd>ACPI is useful for power management, for example, with
KVM guests it is required for graceful shutdown to work.
KVM guests it is required for graceful shutdown to work.
</dd>
</dl>
@ -296,13 +389,13 @@
<pre>
...
&lt;clock offset="localtime"/&gt;
...</pre>
...</pre>
<dl>
<dt><code>clock</code></dt>
<dd>The <code>sync</code> attribute takes either "utc" or
"localtime" to specify how the guest clock is initialized
in relation to the host OS.
<dd>The <code>offset</code> attribute takes either "utc" or
"localtime" to specify how the guest clock is initialized
in relation to the host OS.
</dd>
</dl>
@ -318,17 +411,17 @@
<pre>
...
&lt;devices&gt;
&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;
&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;
...</pre>
<dl>
<dt><code>emulator</code></dt>
<dd>
The contents of the <code>emulator</code> element specify
the fully qualified path to the device model emulator binary.
The <a href="formatcaps.html">capabilities XML</a> specifies
the recommended default emulator to use for each particular
domain type / architecture combination.
The contents of the <code>emulator</code> element specify
the fully qualified path to the device model emulator binary.
The <a href="formatcaps.html">capabilities XML</a> specifies
the recommended default emulator to use for each particular
domain type / architecture combination.
</dd>
</dl>
@ -342,53 +435,61 @@
<pre>
...
&lt;disk type='file'&gt;
&lt;driver name="tap" type="aio"&gt;
&lt;source file='/var/lib/xen/images/fv0'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;disk type='file'&gt;
&lt;driver name="tap" type="aio" cache="default"&gt;
&lt;source file='/var/lib/xen/images/fv0'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;encryption type='...'&gt;
...
&lt;/encryption&gt;
&lt;/disk&gt;
...</pre>
&lt;shareable/&gt;
&lt;/disk&gt;
...</pre>
<dl>
<dt><code>disk</code></dt>
<dd>The <code>disk</code> element is the main container for describing
disks. The <code>type</code> attribute is either "file" or "block"
and refers to the underlying source for the disk. The optional
<code>device</code> attribute indicates how the disk is to be exposed
to the guest OS. Possible values for this attribute are "floppy", "disk"
and "cdrom", defaulting to "disk".
<span class="since">Since 0.0.3; "device" attribute since 0.1.4</span></dd>
disks. The <code>type</code> attribute is either "file" or "block"
and refers to the underlying source for the disk. The optional
<code>device</code> attribute indicates how the disk is to be exposed
to the guest OS. Possible values for this attribute are "floppy", "disk"
and "cdrom", defaulting to "disk".
<span class="since">Since 0.0.3; "device" attribute since 0.1.4</span></dd>
<dt><code>source</code></dt>
<dd>If the disk <code>type</code> is "file", then the <code>file</code> attribute
specifies the fully-qualified path to the file holding the disk. If the disk
<code>type</code> is "block", then the <code>dev</code> attribute specifies
the path to the host device to serve as the disk. <span class="since">Since 0.0.3</span></dd>
specifies the fully-qualified path to the file holding the disk. If the disk
<code>type</code> is "block", then the <code>dev</code> attribute specifies
the path to the host device to serve as the disk. <span class="since">Since 0.0.3</span></dd>
<dt><code>target</code></dt>
<dd>The <code>target</code> element controls the bus / device under which the
disk is exposed to the guest OS. The <code>dev</code> attribute indicates
the "logical" device name. The actual device name specified is not guaranteed to map to
the device name in the guest OS. Treat it as a device ordering hint.
The optional <code>bus</code> attribute specifies the type of disk device
to emulate; possible values are driver specific, with typical values being
"ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is
inferred from the style of the device name. eg, a device named 'sda'
will typically be exported using a SCSI bus.
<span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
disk is exposed to the guest OS. The <code>dev</code> attribute indicates
the "logical" device name. The actual device name specified is not guaranteed to map to
the device name in the guest OS. Treat it as a device ordering hint.
The optional <code>bus</code> attribute specifies the type of disk device
to emulate; possible values are driver specific, with typical values being
"ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is
inferred from the style of the device name. eg, a device named 'sda'
will typically be exported using a SCSI bus.
<span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
"usb" attribute value since after 0.4.4</span></dd>
<dt><code>driver</code></dt>
<dd>If the hypervisor supports multiple backend drivers, then the optional
<code>driver</code> element allows them to be selected. The <code>name</code>
attribute is the primary backend driver name, while the optional <code>type</code>
attribute provides the sub-type. <span class="since">Since 0.1.8</span>
<code>driver</code> element allows them to be selected. The <code>name</code>
attribute is the primary backend driver name, while the optional <code>type</code>
attribute provides the sub-type. The optional <code>cache</code> attribute
controls the cache mechanism, possible values are "default", "none",
"writethrough" and "writeback". <span class="since">Since 0.1.8</span>
</dd>
<dt><code>encryption</code></dt>
<dd>If present, specifies how the volume is encrypted. See
the <a href="formatstorageencryption.html">Storage Encryption</a> page
for more information.
</dd>
<dt><code>shareable</code></dt>
<dd>If present, this indicates the device is expected to be shared
between domains (assuming the hypervisor and OS support this),
which means that caching should be deactivated for that device.
</dd>
</dl>
<h4><a name="elementsUSB">USB and PCI devices</a></h4>
@ -401,22 +502,22 @@
<pre>
...
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x1234'/&gt;
&lt;product id='0xbeef'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...</pre>
&lt;hostdev mode='subsystem' type='usb'&gt;
&lt;source&gt;
&lt;vendor id='0x1234'/&gt;
&lt;product id='0xbeef'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...</pre>
<p>or:</p>
<pre>
...
&lt;hostdev mode='subsystem' type='pci'&gt;
&lt;source&gt;
&lt;address bus='0x06' slot='0x02' function='0x0'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...</pre>
&lt;hostdev mode='subsystem' type='pci'&gt;
&lt;source&gt;
&lt;address bus='0x06' slot='0x02' function='0x0'/&gt;
&lt;/source&gt;
&lt;/hostdev&gt;
...</pre>
<dl>
<dt><code>hostdev</code></dt>
@ -457,12 +558,12 @@
<pre>
...
&lt;interface type='bridge'&gt;
&lt;source bridge='xenbr0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;script path='vif-bridge'/&gt;
&lt;/interface&gt;
...</pre>
&lt;interface type='bridge'&gt;
&lt;source bridge='xenbr0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;script path='vif-bridge'/&gt;
&lt;/interface&gt;
...</pre>
<h5><a name="elementsNICSVirtual">Virtual network</a></h5>
@ -484,7 +585,8 @@
of the box which does NAT'ing to the default route and has an IP range of
<code>192.168.22.0/255.255.255.0</code>. Each guest will have an
associated tun device created with a name of vnetN, which can also be
overridden with the &lt;target&gt; element.
overridden with the &lt;target&gt; element (see
<a href="#elementsNICSTargetOverride">overriding the target element</a>).
</p>
<pre>
@ -514,10 +616,11 @@
there is a bridge device on the host which has one or more of the hosts
physical NICs enslaved. The guest VM will have an associated tun device
created with a name of vnetN, which can also be overridden with the
&lt;target&gt; element. The tun device will be enslaved to the bridge.
The IP range / network configuration is whatever is used on the LAN. This
provides the guest VM full incoming &amp; outgoing net access just like a
physical machine.
&lt;target&gt; element (see
<a href="#elementsNICSTargetOverride">overriding the target element</a>).
The tun device will be enslaved to the bridge. The IP range / network
configuration is whatever is used on the LAN. This provides the guest VM
full incoming &amp; outgoing net access just like a physical machine.
</p>
<pre>
@ -652,6 +755,25 @@ qemu-kvm -net nic,model=? /dev/null
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio
</p>
<h5><a name="elementsNICSTargetOverride">Overriding the target element</a></h5>
<pre>
...
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
<b>&lt;target dev='vnet1'/&gt;</b>
&lt;/interface&gt;
...</pre>
<p>
If no target is specified, certain hypervisors will automatically
generate a name for the created tun device. This name can be manually
specifed, however the name <i>must not start with either 'vnet' or
'vif'</i>, which are prefixes reserved by libvirt and certain
hypervisors. Manually specified targets using these prefixes will be
ignored.
</p>
<h4><a name="elementsInput">Input devices</a></h4>
<p>
@ -663,16 +785,16 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
&lt;input type='mouse' bus='usb'/&gt;
...</pre>
&lt;input type='mouse' bus='usb'/&gt;
...</pre>
<dl>
<dt><code>input</code></dt>
<dd>The <code>input</code> element has one mandatory attribute, the <code>type</code>
whose value can be either 'mouse' or 'tablet'. The latter provides absolute
cursor movement, while the former uses relative movement. The optional
<code>bus</code> attribute can be used to refine the exact device type.
It takes values "xen" (paravirtualized), "ps2" and "usb".</dd>
whose value can be either 'mouse' or 'tablet'. The latter provides absolute
cursor movement, while the former uses relative movement. The optional
<code>bus</code> attribute can be used to refine the exact device type.
It takes values "xen" (paravirtualized), "ps2" and "usb".</dd>
</dl>
@ -687,11 +809,11 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
&lt;graphics type='sdl' display=':0.0'/&gt;
&lt;graphics type='vnc' port='5904'/&gt;
&lt;graphics type='rdp' autoport='yes' multiUser='yes' /&gt;
&lt;graphics type='desktop' fullscreen='yes'/&gt;
...</pre>
&lt;graphics type='sdl' display=':0.0'/&gt;
&lt;graphics type='vnc' port='5904'/&gt;
&lt;graphics type='rdp' autoport='yes' multiUser='yes' /&gt;
&lt;graphics type='desktop' fullscreen='yes'/&gt;
...</pre>
<dl>
<dt><code>graphics</code></dt>
@ -747,70 +869,176 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
&lt;video type='vga' nvram='8192' heads='1'&gt;
&lt;acceleration accel3d='yes' accel3d='yes' /&gt;
&lt;video&gt;
&lt;model type='vga' vram='8192' heads='1'&gt;
&lt;acceleration accel3d='yes' accel3d='yes'/&gt;
&lt;/model&gt;
&lt;/video&gt;
...
</pre>
...</pre>
<dl>
<dt><code>video</code></dt>
<dd>The <code>video</code> element has a mandatory <code>type</code>
attribute which takes the value "vga", "cirrus", "vmvga", "xen" or "vbox".
You can also provide the amount of video memory using <code>nvram</code>,
the number of screen with <code>heads</code>, and whether acceleration
should be enabled (if supported) using the <code>accel3d</code> and
<code>accel2d</code> attributes in the <code>acceleration</code> element.
<dd>
The <code>video</code> element is the a container for describing
video devices.
</dd>
<dt><code>model</code></dt>
<dd>
The <code>model</code> element has a mandatory <code>type</code>
attribute which takes the value "vga", "cirrus", "vmvga", "xen" or "vbox".
You can also provide the amount of video memory in kilobytes using
<code>vram</code> and the number of screen with <code>heads</code>.
</dd>
<dt><code>acceleration</code></dt>
<dd>
If acceleration should be enabled (if supported) using the
<code>accel3d</code> and <code>accel2d</code> attributes in the
<code>acceleration</code> element.
</dd>
</dl>
<h4><a name="elementsConsole">Consoles, serial &amp; parallel devices</a></h4>
<h4><a name="elementsConsole">Consoles, serial, parallel &amp; channel devices</a></h4>
<p>
A character device provides a way to interact with the virtual machine.
Paravirtualized consoles, serial ports and parallel ports are all
classed as character devices and so represented using the same syntax.
Paravirtualized consoles, serial ports, parallel ports and channels are
all classed as character devices and so represented using the same syntax.
</p>
<pre>
...
&lt;parallel type='pty'&gt;
&lt;source path='/dev/pts/2'/&gt;
&lt;target port='0'/&gt;
&lt;source path='/dev/pts/2'/&gt;
&lt;target port='0'/&gt;
&lt;/parallel&gt;
&lt;serial type='pty'&gt;
&lt;source path='/dev/pts/3'/&gt;
&lt;target port='0'/&gt;
&lt;source path='/dev/pts/3'/&gt;
&lt;target port='0'/&gt;
&lt;/serial&gt;
&lt;console type='pty'&gt;
&lt;source path='/dev/pts/4'/&gt;
&lt;target port='0'/&gt;
&lt;source path='/dev/pts/4'/&gt;
&lt;target port='0'/&gt;
&lt;/console&gt;
&lt;channel type='unix'&gt;
&lt;source mode='bind' path='/tmp/guestfwd'/&gt;
&lt;target type='guestfwd' address='10.0.2.1' port='4600'/&gt;
&lt;/channel&gt;
&lt;/devices&gt;
&lt;/domain&gt;</pre>
<p>
In each of these directives, the top-level element name (parallel, serial,
console, channel) describes how the device is presented to the guest. The
guest interface is configured by the <code>target</code> element.
</p>
<p>
The interface presented to the host is given in the <code>type</code>
attribute of the top-level element. The host interface is
configured by the <code>source</code> element.
</p>
<h5><a name="elementsCharGuestInterface">Guest interface</a></h5>
<p>
A character device presents itself to the guest as one of the following
types.
</p>
<h6><a name="elementCharParallel">Parallel port</a></h6>
<pre>
...
&lt;parallel type='pty'&gt;
&lt;source path='/dev/pts/2'/&gt;
&lt;target port='0'/&gt;
&lt;/parallel&gt;
...</pre>
<p>
<code>target</code> can have a <code>port</code> attribute, which
specifies the port number. Ports are numbered starting from 1. There are
usually 0, 1 or 2 parallel ports.
</p>
<h6><a name="elementCharSerial">Serial port</a></h6>
<pre>
...
&lt;serial type='pty'&gt;
&lt;source path='/dev/pts/3'/&gt;
&lt;target port='0'/&gt;
&lt;/serial&gt;
...</pre>
<p>
<code>target</code> can have a <code>port</code> attribute, which
specifies the port number. Ports are numbered starting from 1. There are
usually 0, 1 or 2 serial ports.
</p>
<h6><a name="elementCharConsole">Console</a></h6>
<p>
This represents the primary console. This can be the paravirtualized
console with Xen guests, or duplicates the primary serial port for fully
virtualized guests without a paravirtualized console.
</p>
<pre>
...
&lt;console type='pty'&gt;
&lt;source path='/dev/pts/4'/&gt;
&lt;target port='0'/&gt;
&lt;/console&gt;
...</pre>
<p>
If the console is presented as a serial port, the <code>target</code>
element has the same attributes as for a serial port. There is usually
only 1 console.
</p>
<h6><a name="elementCharChannel">Channel</a></h6>
<p>
This represents a private communication channel between the host and the
guest.
</p>
<pre>
...
&lt;channel type='unix'&gt;
&lt;source mode='bind' path='/tmp/guestfwd'/&gt;
&lt;target type='guestfwd' address='10.0.2.1' port='4600'/&gt;
&lt;/channel&gt;
...</pre>
<p>
This can be implemented in a variety of ways. The specific type of
channel is given in the <code>type</code> attribute of the
<code>target</code> element. Different channel types have different
<code>target</code> attributes.
</p>
<dl>
<dt><code>parallel</code></dt>
<dd>Represents a parallel port</dd>
<dt><code>serial</code></dt>
<dd>Represents a serial port</dd>
<dt><code>console</code></dt>
<dd>Represents the primary console. This can be the paravirtualized
console with Xen guests, or duplicates the primary serial port
for fully virtualized guests without a paravirtualized console.</dd>
<dt><code>source</code></dt>
<dd>The attributes available for the <code>source</code> element
vary according to the <code>type</code> attribute on the parent
tag. Allowed variations will be described below</dd>
<dt><code>target</code></dt>
<dd>The port number of the character device is specified via the
<code>port</code> attribute, numbered starting from 1. There is
usually only one console device, and 0, 1 or 2 serial devices
or parallel devices.
<dt><code>guestfwd</code></dt>
<dd>TCP traffic sent by the guest to a given IP address and port is
forwarded to the channel device on the host. The <code>target</code>
element must have <code>address</code> and <code>port</code> attributes.
<span class="since">Since 0.7.3</span></dd>
</dl>
<h5><a name="elementsCharSTDIO">Domain logfile</a></h5>
<h5><a name="elementsCharHostInterface">Host interface</a></h5>
<p>
A character device presents itself to the host as one of the following
types.
</p>
<h6><a name="elementsCharSTDIO">Domain logfile</a></h6>
<p>
This disables all input on the character device, and sends output
@ -825,7 +1053,7 @@ qemu-kvm -net nic,model=? /dev/null
...</pre>
<h5><a name="elementsCharFle">Device logfile</a></h5>
<h6><a name="elementsCharFle">Device logfile</a></h6>
<p>
A file is opened and all data sent to the character
@ -840,7 +1068,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharVC">Virtual console</a></h5>
<h6><a name="elementsCharVC">Virtual console</a></h6>
<p>
Connects the character device to the graphical framebuffer in
@ -855,7 +1083,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharNull">Null device</a></h5>
<h6><a name="elementsCharNull">Null device</a></h6>
<p>
Connects the character device to the void. No data is ever
@ -869,7 +1097,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharPTY">Pseudo TTY</a></h5>
<h6><a name="elementsCharPTY">Pseudo TTY</a></h6>
<p>
A Pseudo TTY is allocated using /dev/ptmx. A suitable client
@ -892,7 +1120,7 @@ qemu-kvm -net nic,model=? /dev/null
with existing syntax for &lt;console&gt; tags.
</p>
<h5><a name="elementsCharHost">Host device proxy</a></h5>
<h6><a name="elementsCharHost">Host device proxy</a></h6>
<p>
The character device is passed through to the underlying
@ -910,7 +1138,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharPipe">Named pipe</a></h5>
<h6><a name="elementsCharPipe">Named pipe</a></h6>
<p>
The character device writes output to a named pipe. See pipe(7) for
@ -925,7 +1153,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharTCP">TCP client/server</a></h5>
<h6><a name="elementsCharTCP">TCP client/server</a></h6>
<p>
The character device acts as a TCP client connecting to a
@ -973,7 +1201,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharUDP">UDP network console</a></h5>
<h6><a name="elementsCharUDP">UDP network console</a></h6>
<p>
The character device acts as a UDP netconsole service,
@ -989,7 +1217,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;/serial&gt;
...</pre>
<h5><a name="elementsCharUNIX">UNIX domain socket client/server</a></h5>
<h6><a name="elementsCharUNIX">UNIX domain socket client/server</a></h6>
<p>
The character device acts as a UNIX domain socket server,
@ -1028,6 +1256,81 @@ qemu-kvm -net nic,model=? /dev/null
</dd>
</dl>
<h4><a name="elementsWatchdog">Watchdog device</a></h4>
<p>
A virtual hardware watchdog device can be added to the guest via
the <code>watchdog</code> element.
<span class="since">Since 0.7.3, QEMU and KVM only</span>
</p>
<p>
The watchdog device requires an additional driver and management
daemon in the guest. Just enabling the watchdog in the libvirt
configuration does not do anything useful on its own.
</p>
<p>
Currently libvirt does not support notification when the
watchdog fires. This feature is planned for a future version of
libvirt.
</p>
<pre>
...
&lt;watchdog model='i6300esb'/&gt;
...</pre>
<pre>
...
&lt;watchdog model='i6300esb' action='poweroff'/&gt;
...</pre>
<dl>
<dt><code>model</code></dt>
<dd>
<p>
The required <code>model</code> attribute specifies what real
watchdog device is emulated. Valid values are specific to the
underlying hypervisor.
</p>
<p>
QEMU and KVM support:
</p>
<ul>
<li> 'i6300esb' &mdash; the recommended device,
emulating a PCI Intel 6300ESB </li>
<li> 'ib700' &mdash; emulating an ISA iBase IB700 </li>
</ul>
</dd>
<dt><code>action</code></dt>
<dd>
<p>
The optional <code>action</code> attribute describes what
action to take when the watchdog expires. Valid values are
specific to the underlying hypervisor.
</p>
<p>
QEMU and KVM support:
</p>
<ul>
<li>'reset' &mdash; default, forcefully reset the guest</li>
<li>'shutdown' &mdash; gracefully shutdown the guest
(not recommended) </li>
<li>'poweroff' &mdash; forcefully power off the guest</li>
<li>'pause' &mdash; pause the guest</li>
<li>'none' &mdash; do nothing</li>
</ul>
<p>
Note that the 'shutdown' action requires that the guest
is responsive to ACPI signals. In the sort of situations
where the watchdog has expired, guests are usually unable
to respond to ACPI signals. Therefore using 'shutdown'
is not recommended.
</p>
</dd>
</dl>
<h2><a name="examples">Example configs</a></h2>
<p>

View File

@ -35,17 +35,17 @@
<dl>
<dt><code>name</code></dt>
<dd>The content of the <code>name</code> element provides
a short name for the virtual network. This name should
consist only of alpha-numeric characters and is required
to be unique within the scope of a single host. It is
used to form the filename for storing the persistent
configuration file. <span class="since">Since 0.3.0</span></dd>
a short name for the virtual network. This name should
consist only of alpha-numeric characters and is required
to be unique within the scope of a single host. It is
used to form the filename for storing the persistent
configuration file. <span class="since">Since 0.3.0</span></dd>
<dt><code>uuid</code></dt>
<dd>The content of the <code>uuid</code> element provides
a globally unique identifier for the virtual network.
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new network, a random
UUID is generated. <span class="since">Since 0.3.0</span></dd>
a globally unique identifier for the virtual network.
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new network, a random
UUID is generated. <span class="since">Since 0.3.0</span></dd>
</dl>
<h3><a name="elementsConnect">Connectivity</a></h3>
@ -58,32 +58,32 @@
<pre>
...
&lt;bridge name="virbr0" /&gt;
&lt;forward mode="nat" dev="eth0"/&gt;
...</pre>
&lt;forward mode="nat" dev="eth0"/&gt;
...</pre>
<dl>
<dt><code>bridge</code></dt>
<dd>The <code>name</code> attribute on the <code>bridge</code> element
defines the name of a bridge device which will be used to construct
the virtual network. The virtual machines will be connected to this
bridge device allowing them to talk to each other. The bridge device
may also be connected to the LAN. It is recommended that bridge
device names started with the prefix <code>vir</code>, but the name
<code>virbr0</code> is reserved for the "default" virtual network.
This element should always be provided when defining a new network.
<span class="since">Since 0.3.0</span>
defines the name of a bridge device which will be used to construct
the virtual network. The virtual machines will be connected to this
bridge device allowing them to talk to each other. The bridge device
may also be connected to the LAN. It is recommended that bridge
device names started with the prefix <code>vir</code>, but the name
<code>virbr0</code> is reserved for the "default" virtual network.
This element should always be provided when defining a new network.
<span class="since">Since 0.3.0</span>
</dd>
<dt><code>forward</code></dt>
<dd>Inclusion of the <code>forward</code> element indicates that
the virtual network is to be connected to the physical LAN. If
no attributes are set, NAT forwarding will be used for connectivity.
Firewall rules will allow forwarding to any other network device whether
ethernet, wireless, dialup, or VPN. If the <code>dev</code> attribute
is set, the firewall rules will restrict forwarding to the named
device only. If the <code>mode</code> attribute is set to <code>route</code>
then the traffic will not have NAT applied. This presumes that the
local LAN router has suitable routing table entries to return traffic
to this host. <span class="since">Since 0.3.0; 'mode' attribute since
the virtual network is to be connected to the physical LAN. If
no attributes are set, NAT forwarding will be used for connectivity.
Firewall rules will allow forwarding to any other network device whether
ethernet, wireless, dialup, or VPN. If the <code>dev</code> attribute
is set, the firewall rules will restrict forwarding to the named
device only. If the <code>mode</code> attribute is set to <code>route</code>
then the traffic will not have NAT applied. This presumes that the
local LAN router has suitable routing table entries to return traffic
to this host. <span class="since">Since 0.3.0; 'mode' attribute since
0.4.2</span></dd>
</dl>
@ -96,57 +96,62 @@
<pre>
...
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.100" end="192.168.122.254" /&gt;
&lt;host mac="00:16:3e:77:e2:ed" name="foo.example.com" ip="192.168.122.10" /&gt;
&lt;host mac="00:16:3e:3e:a9:1a" name="bar.example.com" ip="192.168.122.11" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.100" end="192.168.122.254" /&gt;
&lt;host mac="00:16:3e:77:e2:ed" name="foo.example.com" ip="192.168.122.10" /&gt;
&lt;host mac="00:16:3e:3e:a9:1a" name="bar.example.com" ip="192.168.122.11" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<dl>
<dt><code>ip</code></dt>
<dd>The <code>address</code> attribute defines an IPv4 address in
dotted-decimal format, that will be configured on the bridge
device associated with the virtual network. To the guests this
address will be their default route. The <code>netmask</code>
attribute defines the significant bits of the network address,
again specified in dotted-decimal format. <span class="since">Since 0.3.0</span>
dotted-decimal format, that will be configured on the bridge
device associated with the virtual network. To the guests this
address will be their default route. The <code>netmask</code>
attribute defines the significant bits of the network address,
again specified in dotted-decimal format. <span class="since">Since 0.3.0</span>
</dd><dt><code>tftp</code></dt><dd>Immediately within
the <code>ip</code> element there is an optional <code>tftp</code>
element. The presence of this element and of its attribute
<code>root</code> enables TFTP services. The attribute specifies
the path to the root directory served via TFTP.
<span class="since">Since 0.7.1</span>
the <code>ip</code> element there is an optional <code>tftp</code>
element. The presence of this element and of its attribute
<code>root</code> enables TFTP services. The attribute specifies
the path to the root directory served via TFTP.
<span class="since">Since 0.7.1</span>
</dd><dt><code>dhcp</code></dt><dd>Also within the <code>ip</code> element there is an
optional <code>dhcp</code> element. The presence of this element
enables DHCP services on the virtual network. It will further
contain one or more <code>range</code> elements.
<span class="since">Since 0.3.0</span>
optional <code>dhcp</code> element. The presence of this element
enables DHCP services on the virtual network. It will further
contain one or more <code>range</code> elements.
<span class="since">Since 0.3.0</span>
</dd>
<dt><code>range</code></dt>
<dd>The <code>start</code> and <code>end</code> attributes on the
<code>range</code> element specify the boundaries of a pool of
IPv4 addresses to be provided to DHCP clients. These two addresses
must lie within the scope of the network defined on the parent
<code>ip</code> element. <span class="since">Since 0.3.0</span>
<code>range</code> element specify the boundaries of a pool of
IPv4 addresses to be provided to DHCP clients. These two addresses
must lie within the scope of the network defined on the parent
<code>ip</code> element. <span class="since">Since 0.3.0</span>
</dd>
<dt><code>host</code></dt>
<dd>Within the <code>dhcp</code> element there may be zero or more
<code>host</code> elements; these specify hosts which will be given
<code>host</code> elements; these specify hosts which will be given
names and predefined IP addresses by the built-in DHCP server. Any
such element must specify the MAC address of the host to be assigned
a given name (via the <code>mac</code> attribute), the IP to be
a given name (via the <code>mac</code> attribute), the IP to be
assigned to that host (via the <code>ip</code> attribute), and the
name to be given that host by the DHCP server (via the
name to be given that host by the DHCP server (via the
<code>name</code> attribute). <span class="since">Since 0.4.5</span>
</dd><dt><code>bootp</code></dt><dd>The optional <code>bootp</code>
element specifies BOOTP options to be provided by the DHCP server.
Only one attribute is supported, <code>file</code>, giving the file
to be used for the boot image). The BOOTP options currently have to
be the same for all address ranges and statically assigned addresses.<span
class="since">Since 0.7.1.</span>
element specifies BOOTP options to be provided by the DHCP server.
Two attributes are supported: <code>file</code> is mandatory and
gives the file to be used for the boot image; <code>server</code> is
optional and gives the address of the TFTP server from which the boot
image will be fetched. <code>server</code> defaults to the same host
that runs the DHCP server, as is the case when the <code>tftp</code>
element is used. The BOOTP options currently have to be the same
for all address ranges and statically assigned addresses.<span
class="since">Since 0.7.1 (<code>server</code> since 0.7.3).</span>
</dd>
</dl>
<h2><a name="examples">Example configuration</a></h2>
@ -165,14 +170,14 @@
<pre>
&lt;network&gt;
&lt;name&gt;default&lt;/name&gt;
&lt;bridge name="virbr0" /&gt;
&lt;forward mode="nat"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;name&gt;default&lt;/name&gt;
&lt;bridge name="virbr0" /&gt;
&lt;forward mode="nat"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesRoute">Routed network config</a></h3>
@ -188,14 +193,14 @@
<pre>
&lt;network&gt;
&lt;name&gt;local&lt;/name&gt;
&lt;bridge name="virbr1" /&gt;
&lt;forward mode="route" dev="eth1"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;name&gt;local&lt;/name&gt;
&lt;bridge name="virbr1" /&gt;
&lt;forward mode="route" dev="eth1"/&gt;
&lt;ip address="192.168.122.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.122.2" end="192.168.122.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
<h3><a name="examplesPrivate">Isolated network config</a></h3>
@ -210,13 +215,13 @@
<pre>
&lt;network&gt;
&lt;name&gt;private&lt;/name&gt;
&lt;bridge name="virbr2" /&gt;
&lt;ip address="192.168.152.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.152.2" end="192.168.152.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;name&gt;private&lt;/name&gt;
&lt;bridge name="virbr2" /&gt;
&lt;ip address="192.168.152.1" netmask="255.255.255.0"&gt;
&lt;dhcp&gt;
&lt;range start="192.168.152.2" end="192.168.152.254" /&gt;
&lt;/dhcp&gt;
&lt;/ip&gt;
&lt;/network&gt;</pre>
</body>

View File

@ -37,10 +37,10 @@
</dd>
<dt><code>usage</code></dt>
<dd>
Specifies what this secret is used for. A mandatory
<code>type</code> attribute specifies the usage category, currently
only <code>volume</code> is defined. Specific usage categories are
described below.
Specifies what this secret is used for. A mandatory
<code>type</code> attribute specifies the usage category, currently
only <code>volume</code> is defined. Specific usage categories are
described below.
</dd>
</dl>

View File

@ -34,27 +34,27 @@
<dl>
<dt><code>name</code></dt>
<dd>Providing a name for the pool which is unique to the host.
This is mandatory when defining a pool. <span class="since">Since 0.4.1</span></dd>
This is mandatory when defining a pool. <span class="since">Since 0.4.1</span></dd>
<dt><code>uuid</code></dt>
<dd>Providing an identifier for the pool which is globally unique.
This is optional when defining a pool, a UUID will be generated if
omitted. <span class="since">Since 0.4.1</span></dd>
This is optional when defining a pool, a UUID will be generated if
omitted. <span class="since">Since 0.4.1</span></dd>
<dt><code>allocation</code></dt>
<dd>Providing the total storage allocation for the pool. This may
be larger than the sum of the allocation of all volumes due to
metadata overhead. This value is in bytes. This is not applicable
when creating a pool. <span class="since">Since 0.4.1</span></dd>
be larger than the sum of the allocation of all volumes due to
metadata overhead. This value is in bytes. This is not applicable
when creating a pool. <span class="since">Since 0.4.1</span></dd>
<dt><code>capacity</code></dt>
<dd>Providing the total storage capacity for the pool. Due to
underlying device constraints it may not be possible to use the
full capacity for storage volumes. This value is in bytes. This
is not applicable when creating a pool. <span class="since">Since 0.4.1</span></dd>
underlying device constraints it may not be possible to use the
full capacity for storage volumes. This value is in bytes. This
is not applicable when creating a pool. <span class="since">Since 0.4.1</span></dd>
<dt><code>available</code></dt>
<dd>Providing the free space available for allocating new volumes
in the pool. Due to underlying device constraints it may not be
possible to allocate the entire free space to a single volume.
This value is in bytes. This is not applicable when creating a
pool. <span class="since">Since 0.4.1</span></dd>
in the pool. Due to underlying device constraints it may not be
possible to allocate the entire free space to a single volume.
This value is in bytes. This is not applicable when creating a
pool. <span class="since">Since 0.4.1</span></dd>
</dl>
<h3><a name="StoragePoolSource">Source elements</a></h3>
@ -71,38 +71,38 @@
&lt;host name="iscsi.example.com"/&gt;
&lt;device path="demo-target"/&gt;
&lt;/source&gt;
...</pre>
...</pre>
<dl>
<dt><code>device</code></dt>
<dd>Provides the source for pools backed by physical devices.
May be repeated multiple times depending on backend driver. Contains
a single attribute <code>path</code> which is the fully qualified
path to the block device node. <span class="since">Since 0.4.1</span></dd>
May be repeated multiple times depending on backend driver. Contains
a single attribute <code>path</code> which is the fully qualified
path to the block device node. <span class="since">Since 0.4.1</span></dd>
<dt><code>directory</code></dt>
<dd>Provides the source for pools backed by directories. May
only occur once. Contains a single attribute <code>path</code>
which is the fully qualified path to the block device node.
<span class="since">Since 0.4.1</span></dd>
only occur once. Contains a single attribute <code>path</code>
which is the fully qualified path to the block device node.
<span class="since">Since 0.4.1</span></dd>
<dt><code>host</code></dt>
<dd>Provides the source for pools backed by storage from a
remote server. Will be used in combination with a <code>directory</code>
or <code>device</code> element. Contains an attribute <code>name</code>
which is the hostname or IP address of the server. May optionally
contain a <code>port</code> attribute for the protocol specific
port number. <span class="since">Since 0.4.1</span></dd>
remote server. Will be used in combination with a <code>directory</code>
or <code>device</code> element. Contains an attribute <code>name</code>
which is the hostname or IP address of the server. May optionally
contain a <code>port</code> attribute for the protocol specific
port number. <span class="since">Since 0.4.1</span></dd>
<dt><code>name</code></dt>
<dd>Provides the source for pools backed by storage from a
named element (e.g., a logical volume group name).
remote server. Contains a string identifier.
<span class="since">Since 0.4.5</span></dd>
named element (e.g., a logical volume group name).
remote server. Contains a string identifier.
<span class="since">Since 0.4.5</span></dd>
<dt><code>format</code></dt>
<dd>Provides information about the format of the pool. This
contains a single attribute <code>type</code> whose value is
backend specific. This is typically used to indicate filesystem
type, or network filesystem type, or partition table type, or
LVM metadata type. All drivers are required to have a default
value for this, so it is optional. <span class="since">Since 0.4.1</span></dd>
contains a single attribute <code>type</code> whose value is
backend specific. This is typically used to indicate filesystem
type, or network filesystem type, or partition table type, or
LVM metadata type. All drivers are required to have a default
value for this, so it is optional. <span class="since">Since 0.4.1</span></dd>
</dl>
<h3><a name="StoragePoolTarget">Target elements</a></h3>
@ -119,8 +119,8 @@
&lt;target&gt;
&lt;path&gt;/dev/disk/by-path&lt;/path&gt;
&lt;permissions&gt;
&lt;owner&gt;0744&lt;/owner&gt;
&lt;group&gt;0744&lt;/group&gt;
&lt;owner&gt;107&lt;/owner&gt;
&lt;group&gt;107&lt;/group&gt;
&lt;mode&gt;0744&lt;/mode&gt;
&lt;label&gt;virt_image_t&lt;/label&gt;
&lt;/permissions&gt;
@ -133,27 +133,27 @@
<dl>
<dt><code>path</code></dt>
<dd>Provides the location at which the pool will be mapped into
the local filesystem namespace. For a filesystem/directory based
pool it will be the name of the directory in which volumes will
be created. For device based pools it will be the name of the directory in which
devices nodes exist. For the latter <code>/dev/</code> may seem
like the logical choice, however, devices nodes there are not
guaranteed stable across reboots, since they are allocated on
demand. It is preferable to use a stable location such as one
of the <code>/dev/disk/by-{path,id,uuid,label</code> locations.
<span class="since">Since 0.4.1</span>
the local filesystem namespace. For a filesystem/directory based
pool it will be the name of the directory in which volumes will
be created. For device based pools it will be the name of the directory in which
devices nodes exist. For the latter <code>/dev/</code> may seem
like the logical choice, however, devices nodes there are not
guaranteed stable across reboots, since they are allocated on
demand. It is preferable to use a stable location such as one
of the <code>/dev/disk/by-{path,id,uuid,label</code> locations.
<span class="since">Since 0.4.1</span>
</dd>
<dt><code>permissions</code></dt>
<dd>Provides information about the default permissions to use
when creating volumes. This is currently only useful for directory
or filesystem based pools, where the volumes allocated are simple
files. For pools where the volumes are device nodes, the hotplug
scripts determine permissions. It contains 4 child elements. The
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.4.1</span>
when creating volumes. This is currently only useful for directory
or filesystem based pools, where the volumes allocated are simple
files. For pools where the volumes are device nodes, the hotplug
scripts determine permissions. It contains 4 child elements. The
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.4.1</span>
</dd>
<dt><code>encryption</code></dt>
<dd>If present, specifies how the volume is encrypted. See
@ -192,41 +192,41 @@
<pre>
&lt;volume&gt;
&lt;name&gt;sparse.img&lt;/name&gt;
&lt;key&gt;/var/lib/xen/images/sparse.img&lt;/key&gt;
&lt;name&gt;sparse.img&lt;/name&gt;
&lt;key&gt;/var/lib/xen/images/sparse.img&lt;/key&gt;
&lt;allocation&gt;0&lt;/allocation&gt;
&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
...</pre>
<dl>
<dt><code>name</code></dt>
<dd>Providing a name for the volume which is unique to the pool.
This is mandatory when defining a volume. <span class="since">Since 0.4.1</span></dd>
This is mandatory when defining a volume. <span class="since">Since 0.4.1</span></dd>
<dt><code>key</code></dt>
<dd>Providing an identifier for the volume which is globally unique.
This is optional when defining a volume, a key will be generated if
omitted. <span class="since">Since 0.4.1</span></dd>
This is optional when defining a volume, a key will be generated if
omitted. <span class="since">Since 0.4.1</span></dd>
<dt><code>allocation</code></dt>
<dd>Providing the total storage allocation for the volume. This
may be smaller than the logical capacity if the volume is sparsely
allocated. It may also be larger than the logical capacity if the
volume has substantial metadata overhead. This value is in bytes.
If omitted when creating a volume, the volume will be fully
allocated at time of creation. If set to a value smaller than the
capacity, the pool has the <strong>option</strong> of deciding
to sparsely allocate a volume. It does not have to honour requests
for sparse allocation though. <span class="since">Since 0.4.1</span></dd>
may be smaller than the logical capacity if the volume is sparsely
allocated. It may also be larger than the logical capacity if the
volume has substantial metadata overhead. This value is in bytes.
If omitted when creating a volume, the volume will be fully
allocated at time of creation. If set to a value smaller than the
capacity, the pool has the <strong>option</strong> of deciding
to sparsely allocate a volume. It does not have to honour requests
for sparse allocation though. <span class="since">Since 0.4.1</span></dd>
<dt><code>capacity</code></dt>
<dd>Providing the logical capacity for the volume. This value is
in bytes. This is compulsory when creating a volume.
<span class="since">Since 0.4.1</span></dd>
in bytes. This is compulsory when creating a volume.
<span class="since">Since 0.4.1</span></dd>
<dt><code>source</code></dt>
<dd>Provides information about the underlying storage allocation
of the volume. This may not be available for some pool types.
<span class="since">Since 0.4.1</span></dd>
of the volume. This may not be available for some pool types.
<span class="since">Since 0.4.1</span></dd>
<dt><code>target</code></dt>
<dd>Provides information about the representation of the volume
on the local host. <span class="since">Since 0.4.1</span></dd>
on the local host. <span class="since">Since 0.4.1</span></dd>
</dl>
<h3><a name="StorageVolTarget">Target elements</a></h3>
@ -240,42 +240,42 @@
<pre>
...
&lt;target&gt;
&lt;target&gt;
&lt;path&gt;/var/lib/virt/images/sparse.img&lt;/path&gt;
&lt;format type='qcow2'/&gt;
&lt;permissions&gt;
&lt;owner&gt;0744&lt;/owner&gt;
&lt;group&gt;0744&lt;/group&gt;
&lt;owner&gt;107&lt;/owner&gt;
&lt;group&gt;107&lt;/group&gt;
&lt;mode&gt;0744&lt;/mode&gt;
&lt;label&gt;virt_image_t&lt;/label&gt;
&lt;/permissions&gt;
&lt;/target&gt;</pre>
&lt;/target&gt;</pre>
<dl>
<dt><code>path</code></dt>
<dd>Provides the location at which the volume can be accessed on
the local filesystem, as an absolute path. This is a readonly
attribute, so shouldn't be specified when creating a volume.
<span class="since">Since 0.4.1</span></dd>
the local filesystem, as an absolute path. This is a readonly
attribute, so shouldn't be specified when creating a volume.
<span class="since">Since 0.4.1</span></dd>
<dt><code>format</code></dt>
<dd>Provides information about the pool specific volume format.
For disk pools it will provide the partition type. For filesystem
or directory pools it will provide the file format type, eg cow,
qcow, vmdk, raw. If omitted when creating a volume, the pool's
default format will be used. The actual format is specified via
the <code>type</code> attribute. Consult the pool-specific docs for
For disk pools it will provide the partition type. For filesystem
or directory pools it will provide the file format type, eg cow,
qcow, vmdk, raw. If omitted when creating a volume, the pool's
default format will be used. The actual format is specified via
the <code>type</code> attribute. Consult the pool-specific docs for
the list of valid values. <span class="since">Since 0.4.1</span></dd>
<dt><code>permissions</code></dt>
<dd>Provides information about the default permissions to use
when creating volumes. This is currently only useful for directory
or filesystem based pools, where the volumes allocated are simple
files. For pools where the volumes are device nodes, the hotplug
scripts determine permissions. It contains 4 child elements. The
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.4.1</span>
when creating volumes. This is currently only useful for directory
or filesystem based pools, where the volumes allocated are simple
files. For pools where the volumes are device nodes, the hotplug
scripts determine permissions. It contains 4 child elements. The
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.4.1</span>
</dd>
</dl>
@ -294,8 +294,8 @@
&lt;path&gt;/var/lib/virt/images/master.img&lt;/path&gt;
&lt;format&gt;raw&lt;/format&gt;
&lt;permissions&gt;
&lt;owner&gt;0744&lt;/owner&gt;
&lt;group&gt;0744&lt;/group&gt;
&lt;owner&gt;107&lt;/owner&gt;
&lt;group&gt;107&lt;/group&gt;
&lt;mode&gt;0744&lt;/mode&gt;
&lt;label&gt;virt_image_t&lt;/label&gt;
&lt;/permissions&gt;
@ -305,25 +305,25 @@
<dl>
<dt><code>path</code></dt>
<dd>Provides the location at which the backing store can be accessed on
the local filesystem, as an absolute path. If omitted, there is no
the local filesystem, as an absolute path. If omitted, there is no
backing store for this volume.
<span class="since">Since 0.6.0</span></dd>
<span class="since">Since 0.6.0</span></dd>
<dt><code>format</code></dt>
<dd>Provides information about the pool specific backing store format.
For disk pools it will provide the partition type. For filesystem
or directory pools it will provide the file format type, eg cow,
qcow, vmdk, raw. Consult the pool-specific docs for the list of valid
For disk pools it will provide the partition type. For filesystem
or directory pools it will provide the file format type, eg cow,
qcow, vmdk, raw. Consult the pool-specific docs for the list of valid
values. Most file formats require a backing store of the same format,
however, the qcow2 format allows a different backing store format.
<span class="since">Since 0.6.0</span></dd>
<dt><code>permissions</code></dt>
<dd>Provides information about the permissions of the backing file.
It contains 4 child elements. The
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.6.0</span>
<code>mode</code> element contains the octal permission set. The
<code>owner</code> element contains the numeric user ID. The <code>group</code>
element contains the numeric group ID. The <code>label</code> element
contains the MAC (eg SELinux) label string.
<span class="since">Since 0.6.0</span>
</dd>
</dl>
@ -362,18 +362,18 @@
<pre>
&lt;volume&gt;
&lt;name&gt;sparse.img&lt;/name&gt;
&lt;allocation&gt;0&lt;/allocation&gt;
&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
&lt;target&gt;
&lt;name&gt;sparse.img&lt;/name&gt;
&lt;allocation&gt;0&lt;/allocation&gt;
&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
&lt;target&gt;
&lt;path&gt;/var/lib/virt/images/sparse.img&lt;/path&gt;
&lt;permissions&gt;
&lt;owner&gt;0744&lt;/owner&gt;
&lt;group&gt;0744&lt;/group&gt;
&lt;owner&gt;107&lt;/owner&gt;
&lt;group&gt;107&lt;/group&gt;
&lt;mode&gt;0744&lt;/mode&gt;
&lt;label&gt;virt_image_t&lt;/label&gt;
&lt;/permissions&gt;
&lt;/target&gt;
&lt;/target&gt;
&lt;/volume&gt;</pre>
</body>
</html>

View File

@ -5,7 +5,7 @@ body {
color: rgb(0,0,0);
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 80%;
// font-size: 83%;
background: #ffffff;
}
p, ul, ol, dl {

View File

@ -8,50 +8,50 @@
<ol>
<li>Discuss any large changes on the mailing list first. Post patches
early and listen to feedback.</li>
early and listen to feedback.</li>
<li><p>Post patches in unified diff format. A command similar to this
should work:</p>
<pre>
should work:</p>
<pre>
diff -urp libvirt.orig/ libvirt.modified/ &gt; libvirt-myfeature.patch
</pre>
<p>
or:
</p>
<pre>
cvs diff -up > libvirt-myfeature.patch
<p>
or:
</p>
<pre>
git diff > libvirt-myfeature.patch
</pre></li>
<li>Split large changes into a series of smaller patches, self-contained
if possible, with an explanation of each patch and an explanation of how
the sequence of patches fits together.</li>
<li>Make sure your patches apply against libvirt CVS. Developers
only follow CVS and don't care much about released versions.</li>
if possible, with an explanation of each patch and an explanation of how
the sequence of patches fits together.</li>
<li>Make sure your patches apply against libvirt GIT. Developers
only follow GIT and don't care much about released versions.</li>
<li><p>Run the automated tests on your code before submitting any changes.
In particular, configure with compile warnings set to -Werror:</p>
<pre>
In particular, configure with compile warnings set to -Werror:</p>
<pre>
./configure --enable-compile-warnings=error
</pre>
<p>
and run the tests:
</p>
<pre>
<p>
and run the tests:
</p>
<pre>
make check
make syntax-check
make -C tests valgrind
</pre>
<p>
The latter test checks for memory leaks.
</p>
<p>
The latter test checks for memory leaks.
</p>
<li>Update tests and/or documentation, particularly if you are adding
a new feature or changing the output of a program.</li>
a new feature or changing the output of a program.</li>
</ol>
<p>
There is more on this subject, including lots of links to background
reading on the subject, on
<a href="http://et.redhat.com/~rjones/how-to-supply-code-to-open-source-projects/">
Richard Jones' guide to working with open source projects</a>
Richard Jones' guide to working with open source projects</a>
</p>
@ -77,8 +77,8 @@
(setq c-indent-level 4)
(setq c-basic-offset 4))
(add-hook 'c-mode-hook
'(lambda () (if (string-match "/libvirt" (buffer-file-name))
(libvirt-c-mode))))
'(lambda () (if (string-match "/libvirt" (buffer-file-name))
(libvirt-c-mode))))
</pre>
<h2><a name="formatting">Code formatting (especially for new code)</a></h2>
@ -118,30 +118,30 @@
<ul>
<li>If you're using "int" or "long", odds are good that there's a better type.</li>
<li>If a variable is counting something, be sure to declare it with an
unsigned type.</li>
unsigned type.</li>
<li>If it's memory-size-related, use size_t (use ssize_t only if required).</li>
<li>If it's file-size related, use uintmax_t, or maybe off_t.</li>
<li>If it's file-offset related (i.e., signed), use off_t.</li>
<li>If it's just counting small numbers use "unsigned int";
(on all but oddball embedded systems, you can assume that that
type is at least four bytes wide).</li>
(on all but oddball embedded systems, you can assume that that
type is at least four bytes wide).</li>
<li>If a variable has boolean semantics, give it the "bool" type
and use the corresponding "true" and "false" macros. It's ok
to include &lt;stdbool.h&gt;, since libvirt's use of gnulib ensures
that it exists and is usable.</li>
and use the corresponding "true" and "false" macros. It's ok
to include &lt;stdbool.h&gt;, since libvirt's use of gnulib ensures
that it exists and is usable.</li>
<li>In the unusual event that you require a specific width, use a
standard type like int32_t, uint32_t, uint64_t, etc.</li>
standard type like int32_t, uint32_t, uint64_t, etc.</li>
<li>While using "bool" is good for readability, it comes with minor caveats:
<ul>
<li>Don't use "bool" in places where the type size must be constant across
all systems, like public interfaces and on-the-wire protocols. Note
that it would be possible (albeit wasteful) to use "bool" in libvirt's
logical wire protocol, since XDR maps that to its lower-level bool_t
type, which *is* fixed-size.</li>
<li>Don't compare a bool variable against the literal, "true",
since a value with a logical non-false value need not be "1".
I.e., don't write "if (seen == true) ...". Rather, write "if (seen)...".</li>
</ul>
<ul>
<li>Don't use "bool" in places where the type size must be constant across
all systems, like public interfaces and on-the-wire protocols. Note
that it would be possible (albeit wasteful) to use "bool" in libvirt's
logical wire protocol, since XDR maps that to its lower-level bool_t
type, which *is* fixed-size.</li>
<li>Don't compare a bool variable against the literal, "true",
since a value with a logical non-false value need not be "1".
I.e., don't write "if (seen == true) ...". Rather, write "if (seen)...".</li>
</ul>
</li>
</ul>
@ -250,14 +250,14 @@
<ul>
<li><p>For strict equality:</p>
<pre>
<pre>
STREQ(a,b)
STRNEQ(a,b)
</pre>
</li>
<li><p>For case sensitive equality:</p>
<pre>
<li><p>For case insensitive equality:</p>
<pre>
STRCASEEQ(a,b)
STRCASENEQ(a,b)
</pre>
@ -265,15 +265,15 @@
<li><p>For strict equality of a substring:</p>
<pre>
<pre>
STREQLEN(a,b,n)
STRNEQLEN(a,b,n)
</pre>
</li>
<li><p>For case sensitive equality of a substring:</p>
<li><p>For case insensitive equality of a substring:</p>
<pre>
<pre>
STRCASEEQLEN(a,b,n)
STRCASENEQLEN(a,b,n)
</pre>
@ -281,7 +281,7 @@
<li><p>For strict equality of a prefix:</p>
<pre>
<pre>
STRPREFIX(a,b)
</pre>
</li>
@ -306,14 +306,15 @@
...
virBufferAddLit(&amp;buf, "&lt;domain&gt;\n");
virBufferVSprint(&amp;buf, " &lt;memory>%d&lt;/memory&gt;\n", memory);
virBufferVSprint(&amp;buf, " &lt;memory&gt;%d&lt;/memory&gt;\n", memory);
...
virBufferAddLit(&amp;buf, "&lt;/domain&gt;\n");
....
...
if (virBufferError(&amp;buf)) {
__virRaiseError(...);
virBufferFreeAndReset(&amp;buf);
virReportOOMError(...);
return NULL;
}
@ -379,7 +380,7 @@
<pre>
int virAsprintf(char **strp, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
ATTRIBUTE_FORMAT(printf, 2, 3);
</pre>
<p>
@ -416,16 +417,16 @@
</p>
<ul>
<li>if a recently commited patch breaks compilation on a platform
or for a given driver then it's fine to commit a minimal fix
directly without getting the review feedback first</li>
or for a given driver then it's fine to commit a minimal fix
directly without getting the review feedback first</li>
<li>if make check or make syntax-chek breaks, if there is
an obvious fix, it's fine to commit immediately.
The patch should still be sent to the list (or tell what the fix was if
trivial) and 'make check syntax-check' should pass too before commiting
anything</li>
an obvious fix, it's fine to commit immediately.
The patch should still be sent to the list (or tell what the fix was if
trivial) and 'make check syntax-check' should pass too before commiting
anything</li>
<li>
fixes for documentation and code comments can be managed
in the same way, but still make sure they get reviewed if non-trivial.
fixes for documentation and code comments can be managed
in the same way, but still make sure they get reviewed if non-trivial.
</li>
</ul>
</body>

View File

@ -23,6 +23,7 @@ updated on <i>2008-06-05</i>.
<th><a href="remote.html">Remote</a></th>
<th><a href="drvvbox.html">VirtualBox</a></th>
<th><a href="drvone.html">ONE</a></th>
<th><a href="drvesx.html">ESX</a></th>
</tr>
<tr>
<td> virConnectClose </td>
@ -33,6 +34,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectGetCapabilities </td>
@ -43,6 +45,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.1 </td>
</tr>
<tr>
<td> virConnectGetHostname </td>
@ -53,6 +56,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectGetMaxVcpus </td>
@ -62,7 +66,8 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virConnectGetType </td>
@ -73,6 +78,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectGetURI </td>
@ -83,6 +89,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectGetVersion </td>
@ -93,6 +100,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectListDefinedDomains </td>
@ -103,6 +111,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectListDomains </td>
@ -113,6 +122,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectNumOfDefinedDomains </td>
@ -123,6 +133,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectNumOfDomains </td>
@ -133,6 +144,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectOpen </td>
@ -143,6 +155,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> x </td>
</tr>
<tr>
<td> virConnectOpenAuth </td>
@ -153,6 +166,7 @@ updated on <i>2008-06-05</i>.
<td> </td>
<td> </td>
<td> </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virConnectOpenReadOnly </td>
@ -163,6 +177,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainAttachDevice </td>
@ -173,6 +188,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainBlockPeek </td>
@ -183,6 +199,7 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainBlockStats </td>
@ -193,6 +210,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.2 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainCoreDump </td>
@ -203,6 +221,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainCreate </td>
@ -213,6 +232,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainCreateLinux </td>
@ -223,6 +243,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> x </td>
</tr>
<tr>
<td> virDomainDefineXML </td>
@ -233,6 +254,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.2 </td>
</tr>
<tr>
<td> virDomainDestroy </td>
@ -243,6 +265,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainDetachDevice </td>
@ -253,6 +276,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainFree </td>
@ -263,6 +287,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetAutostart </td>
@ -273,11 +298,12 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainGetConnect </td>
<td> 0.3.0 </td>
<td colspan="6"> not a HV function </td>
<td colspan="7"> not a HV function </td>
</tr>
<tr>
<td> virDomainGetID </td>
@ -288,6 +314,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetInfo </td>
@ -298,6 +325,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetMaxMemory </td>
@ -308,6 +336,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetMaxVcpus </td>
@ -318,6 +347,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetName </td>
@ -328,6 +358,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetOSType </td>
@ -338,6 +369,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetSchedulerParameters </td>
@ -348,6 +380,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetSchedulerType </td>
@ -358,6 +391,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetUUID </td>
@ -368,6 +402,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetUUIDString </td>
@ -378,6 +413,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainGetVcpus </td>
@ -388,6 +424,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainInterfaceStats </td>
@ -398,6 +435,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.2 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainGetXMLDesc </td>
@ -408,6 +446,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainLookupByID </td>
@ -418,6 +457,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainLookupByName </td>
@ -428,6 +468,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainLookupByUUID </td>
@ -438,6 +479,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainLookupByUUIDString </td>
@ -448,6 +490,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainMigrate </td>
@ -458,6 +501,7 @@ updated on <i>2008-06-05</i>.
<td> 0.3.2 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainPinVcpu </td>
@ -468,6 +512,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainReboot </td>
@ -478,6 +523,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainRestore </td>
@ -488,7 +534,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainResume </td>
@ -499,6 +545,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainSave </td>
@ -509,6 +556,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainSetAutostart </td>
@ -519,6 +567,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virDomainSetMaxMemory </td>
@ -528,6 +577,8 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainSetMemory </td>
@ -538,6 +589,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainSetSchedulerParameters </td>
@ -548,6 +600,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainSetVcpus </td>
@ -558,6 +611,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainShutdown </td>
@ -568,6 +622,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainSuspend </td>
@ -578,6 +633,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virDomainUndefine </td>
@ -588,17 +644,18 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> &#x2265; 0.6.4 </td>
<td> &#x2265; 0.7.1 </td>
</tr>
<tr>
<td> virGetVersion </td>
<td> All </td>
<td> All </td>
<td colspan="5"> Returns -1 if HV unsupported. </td>
<td colspan="6"> Returns -1 if HV unsupported. </td>
</tr>
<tr>
<td> virInitialize </td>
<td> 0.1.0 </td>
<td colspan="6"> not a HV function </td>
<td colspan="7"> not a HV function </td>
</tr>
<tr>
<td> virDomainMemoryPeek </td>
@ -609,6 +666,7 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
<tr>
<td> virNodeGetInfo </td>
@ -619,6 +677,7 @@ updated on <i>2008-06-05</i>.
<td> &#x2265; 0.3.0 </td>
<td> &#x2265; 0.6.3 </td>
<td> x </td>
<td> &#x2265; 0.7.0 </td>
</tr>
<tr>
<td> virNodeGetFreeMemory </td>
@ -629,6 +688,7 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> x </td>
<td> x </td>
<td> &#x2265; 0.7.2 </td>
</tr>
<tr>
<td> virNodeGetCellsFreeMemory </td>
@ -639,6 +699,7 @@ updated on <i>2008-06-05</i>.
<td> x </td>
<td> x </td>
<td> x </td>
<td> x </td>
</tr>
</table>
<h3>Network functions</h3>

View File

@ -7,26 +7,26 @@
<ul>
<li>
A toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes).
A toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes).
</li>
<li>
Free software available under the
<a href="http://www.opensource.org/licenses/lgpl-license.html">GNU
Lesser General Public License</a>.
Free software available under the
<a href="http://www.opensource.org/licenses/lgpl-license.html">GNU
Lesser General Public License</a>.
</li>
<li>
A long term stable C API
A long term stable C API
</li>
<li>
A set of bindings for common languages
A set of bindings for common languages
</li>
<li>
A <a href="CIM/">CIM provider</a> for the DMTF virtualization schema
A <a href="CIM/">CIM provider</a> for the DMTF virtualization schema
</li>
<li>
A <a href="/qpid/">QMF agent</a> for the AMQP/QPid messaging system
A <a href="/qpid/">QMF agent</a> for the AMQP/QPid messaging system
</li>
</ul>
@ -34,29 +34,32 @@
<ul>
<li>
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
on Linux and Solaris hosts.
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
on Linux and Solaris hosts.
</li>
<li>
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
</li>
<li>
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
</li>
<li>
The <a href="http://lxc.sourceforge.net/">LXC</a> Linux container system
The <a href="http://lxc.sourceforge.net/">LXC</a> Linux container system
</li>
<li>
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
</li>
<li>
The <a href="http://user-mode-linux.sourceforge.net/">User Mode Linux</a> paravirtualized kernel
The <a href="http://user-mode-linux.sourceforge.net/">User Mode Linux</a> paravirtualized kernel
</li>
<li>
The <a href="http://www.virtualbox.org/">VirtualBox</a> hypervisor
The <a href="http://www.virtualbox.org/">VirtualBox</a> hypervisor
</li>
<li>
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
The <a href="http://www.vmware.com/">VMware ESX and GSX</a> hypervisors
</li>
<li>
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
</li>
</ul>

View File

@ -16,7 +16,7 @@
<xsl:import href="page.xsl"/>
<!-- Generate XHTML-1.0 transitional -->
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
<xsl:output method="xml" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
@ -573,7 +573,7 @@
<xsl:document
href="{concat($htmldir, '/index.html')}"
method="xml"
encoding="ISO-8859-1"
encoding="UTF-8"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<xsl:apply-templates select="exsl:node-set($mainpage)" mode="page">
@ -589,7 +589,7 @@
<xsl:document
href="{concat($htmldir, '/libvirt-', @name, '.html')}"
method="xml"
encoding="ISO-8859-1"
encoding="UTF-8"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<xsl:apply-templates select="exsl:node-set($subpage)" mode="page">

View File

@ -1,10 +1,667 @@
<?xml version="1.0"?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1 >Releases</h1>
<p>Here is the list of official releases, however since it is early on in the
development of libvirt, it is preferable when possible to just use the <a href="downloads.html">CVS version or snapshot</a>, contact the mailing list
development of libvirt, it is preferable when possible to just use the <a href="downloads.html">GIT version or snapshot</a>, contact the mailing list
and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
<h3>0.7.6: Feb 3 2010</h3>
<ul>
<li>Features:
Implement support for multi IQN (David Allan),
Implement CPU topology support for QEMU driver (Jiri Denemark),
Use QEmu new device adressing when possible (Daniel P. Berrange),
Implement SCSI controller hotplug/unplug for QEMU (Wolfgang Mauerer)
</li>
<li>Documentation:
Add missing function parameter documentation (Matthias Bolte),
Add docs about new mailing list (Daniel P. Berrange),
Document cpu-compare command in virsh man page (Jiri Denemark),
Document cpu elements in capabilities and domain XML (Jiri Denemark),
docs: Remove outdated information about remote limitations (Matthias Bolte),
documentation improvements (David Jorm),
Minor fixes for API extension doc (Jim Fehlig),
cpu_shares parameter limit documented (David Jorm),
Document the domain XML cache attribute for disk devices (Matthias Bolte),
Replace old CVS references with GIT (Matthias Bolte)
</li>
<li>Portability:
portability to non-glibc: don't use realpath(..., NULL) (Jim Meyering),
Add some missing include files which break build in certain platforms (Daniel P. Berrange),
Remove AppArmor compile warnings (Jamie Strandboge),
Fix compilation of virt-aa-helper.c (Matthias Bolte),
Fix linkage of virt-aa-helper to libgnu.a (Matthias Bolte)
</li>
<li>Bug Fixes:
Fix restore of QEMU guests with PCI device reservation (Daniel P. Berrange),
Another fork() log locking cleanup in file creation (Laine Stump),
Fix log locking problem when using fork() in the library (Cole Robinson),
Fix locking for udev device add/remove (David Allan),
interface_conf.c: don't use a negative value as allocation size (Jim Meyering),
virStoragePoolSourceListNewSource: avoid unconditional leak (Jim Meyering),
xs_internal.c: don't use a negative value as allocation size (Jim Meyering),
Ensure QEMU DAC security driver is activated at all times (Daniel P. Berrange),
udev: Don't let strtoul parse USB busnum and devnum as octal (Matthias Bolte),
json.c: avoid an unconditional leak from most qemuMonitorJSON* functions (Jim Meyering),
Fix PCI host reattach on domain detach. (Chris Lalancette),
Clarify controllers -device string in QEMU driver (Matthew Booth),
util.c (virGetUserEnt): don't use a negative value as allocation size (Jim Meyering),
cpu_x86.c: avoid NULL-deref for invalid arguments (Jim Meyering),
Fix a crash when restarting libvirtd. (Chris Lalancette),
qemuMonitorTextAttachDrive: avoid two leaks (Jim Meyering),
usbGetDevice: don't leak a "usbDevice" buffer on failure path (Jim Meyering),
qemuMonitorTextGetMemoryStats: plug a leak on an error path (Jim Meyering),
usbFindBusByVendor: don't leak a DIR buffer and FD (Jim Meyering),
Fix libvirtd restart for domains with PCI passthrough devices (Chris Lalancette),
qemu: Fix race between device rebind and kvm cleanup (Chris Lalancette),
Fix device assignment with root devices (Chris Lalancette),
Corrected log level of WWN path message (David Allan),
Fix an error when looking for devices in syspath (Daniel Veillard),
Fix off-by-1 in SCSI drive hotplug (Daniel P. Berrange),
Fix leak in hotplug code in QEMU driver (Daniel P. Berrange),
Fix security driver calls in hotplug cleanup paths (Daniel P. Berrange),
Add missing call to re-attach host devices if VM startup fails (Daniel P. Berrange),
Pull initial disk labelling out into libvirtd instead of exec hook (Daniel P. Berrange),
Fix leak of allocated security label (Daniel P. Berrange),
Create storage pool directories with proper uid/gid/mode (Laine Stump),
Create storage volumes directly with desired uid/gid (Laine Stump),
Unset copied environment variables in qemuxml2argvtest (Matthias Bolte),
qemu: Don't allocate zero bytes (Matthias Bolte),
node_device_linux_sysfs.c: avoid opendir/fd leak on error path (Jim Meyering),
domain_conf.c: avoid a leak and the need for "cleanup:" block (Jim Meyering),
Fix QEMU driver custom domain status XML extensions (Daniel P. Berrange),
xen_driver: don't leak a parsed-config buffer (Jim Meyering),
storage_conf: plug a leak on OOM error path (Jim Meyering),
Tests for ACS in PCIe switches (Jiri Denemark),
storage_backend_fs.c: do not ignore probe failure (Jim Meyering),
Avoid free'ing a constant string in chardev lookup code (Daniel P. Berrange),
Fix build of Xen proxy daemon (Daniel P. Berrange),
xen: do not report a write-to-Xen-daemon failure as a read failure (Jim Meyering),
daemon: Don't blindly unregister domain events (Cole Robinson),
node_device: udev: Fix memory leak (Cole Robinson),
Fix migration in xend driver (Jim Fehlig),
Ensure error handling callback functions are called from safe context (Daniel P. Berrange),
qemu: Fix a memory leak in qemudExtractTTYPath (Matthias Bolte),
Fix UUID random generator to use /dev/random (Laine Stump),
let "configure --disable-shared" work once again (Jim Meyering),
Qemu: ask for memory preallocation with large pages (Daniel Veillard),
network/bridge_driver.c: avoid potential NULL-dereference (Jim Meyering),
Don't free an uninitalized pointer in update_driver_name() (Matthias Bolte),
xend_internal: don't let invalid input provoke NULL dereference (Jim Meyering),
Don't update vol details after build (David Allan),
vbox_tmpl.c: don't leak a domain pointer upon failure to create (Jim Meyering),
vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure (Jim Meyering),
qemu_driver.c: avoid NULL dereference upon disk-op failure (Jim Meyering),
openvz_conf.c: don't dereference NULL upon failure (Jim Meyering),
Distribute vmx2xml and xml2vmx test data files (Matthias Bolte)
</li>
<li>Improvements:
Tweak USB hostdevice XML handling (Daniel P. Berrange),
Fix QEMU hotplug device alias assignment (Daniel P. Berrange),
Disable QEMU monitor IO debugging by default (Daniel P. Berrange),
Re-arrange QEMU device alias assignment code (Daniel P. Berrange),
Remove direct storage of hostnet_name &amp; vlan (Daniel P. Berrange),
Remove use of -netdev arg with QEMU (Daniel P. Berrange),
Assign PCI addresses before hotplugging devices (Daniel P. Berrange),
Rewrite way QEMU PCI addresses are allocated (Daniel P. Berrange),
Introduce generic virDomainDeviceInfo iterator function (Daniel P. Berrange),
Make hotplug use new device_add where possible (Daniel P. Berrange),
Introduce internal QEMU monitor APIs for drive + device hotadd (Daniel P. Berrange),
Split out QEMU code for building PCI/USB hostdev arg values (Daniel P. Berrange),
Standard internal API syntax for building QEMU command line arguments (Daniel P. Berrange),
Log flags in virConnectCompareCPU (Jiri Denemark),
Look in /usr/libexec for the qemu-kvm binary. (Chris Lalancette),
Support Xen 4.0 sysctl version 7 (Jim Fehlig),
Add missing sata controller type to domain.rng (Matthew Booth),
udev: Set the state driver name (Matthias Bolte),
udev: Remove event handle on shutdown (Matthias Bolte),
esx: Output error details from libcurl (Matthias Bolte),
qemu: Search binaries in PATH instead of hardcoding /usr/bin (Matthias Bolte),
Implement QMP support for extracting CPU thread ID (Daniel P. Berrange),
Misc fixes to QMP monitor support for QEMU (Daniel P. Berrange),
Fix setup of compatability serial devices from console device (Daniel P. Berrange),
Start modernizing configure (Eric Blake),
Add a rule to check for uses of readlink. (Chris Lalancette),
Add virConnectGetVersion Python API (Taizo ITO),
domMemoryStats / qemu: Fix parsing of unknown stats (Adam Litke),
Allow surrounding whitespace in uuid (Dan Kenigsberg),
Add configuration option to turn off dynamic permissions management (Daniel P. Berrange),
Switch QEMU driver over to use the DAC security driver (Daniel P. Berrange),
Introduce a new DAC security driver for QEMU (Daniel P. Berrange),
Introduce a stacked security driver impl for QEMU (Daniel P. Berrange),
Make security drivers responsible for checking dynamic vs static labelling (Daniel P. Berrange),
New utility functions virFileCreate and virDirCreate (Laine Stump),
Add virRunWithHook util function (Laine Stump),
Update interface.rng and xml test files to match netcf 0.1.5 (Laine Stump),
Support bond interfaces attached to bridges in interface xml. (Laine Stump),
Allow empty bridges in interface xml. (Laine Stump),
Support delay property in interface bridge xml. (Laine Stump),
Use pciDeviceIsAssignable in qemu driver (Jiri Denemark),
Allow for CPU topology specification without model (Jiri Denemark),
Add debug messages for CPU incompatibility (Jiri Denemark),
Take disabled/forced CPU features into account (Jiri Denemark),
Enhance qemuParseCommandLineKeywords (Jiri Denemark),
Convert VirtIO balloon over to -device syntax (Daniel P. Berrange),
uto-assign PCI addresses (Daniel P. Berrange),
Pass -vga none if no video card specified (Daniel P. Berrange),
Add support for explicit -sdl flag to QEMU (Daniel P. Berrange),
Assign device aliases for all devices at startup (Daniel P. Berrange),
Add device info to serial, parallel, channel, input &amp; fs devices (Daniel P. Berrange),
Introduce device aliases (Daniel P. Berrange),
Clear assigned PCI devices at shutdown (Daniel P. Berrange),
Auto-add disk controllers based on defined disks (Daniel P. Berrange),
Remove restriction on duplicated sound devices in parser (Daniel P. Berrange),
Detect PCI addresses at QEMU startup (Daniel P. Berrange),
Properly support SCSI drive hotplug (Daniel P. Berrange),
build: update gnulib submodule to latest (Jim Meyering),
Use closest CPU model when decoding from CPUID (Jiri Denemark),
Change detection of xen so that it's actually automatic rather than forced. (Diego Elio Pettenò),
Standardise ./configure --help options reporting. (Diego Elio Pettenò),
qemu: Use log output for pty assignment if 'info chardev' is unavailable (Matthias Bolte),
esx: Add VNC support (Matthias Bolte),
esx: Make the domain part of the hostname optional (Matthias Bolte),
esx: Add stubs for secondary driver types (Matthias Bolte),
Specify bus/unit instead of index for disks with QEMU (Daniel P. Berrange),
Split code for building QEMU -drive arg in separate method (Daniel P. Berrange),
Convert monitor over to use virDomainDeviceAddress (Daniel P. Berrange),
Add new domain device: "controller" (Wolfgang Mauerer),
Set default disk controller/bus/unit props (Daniel P. Berrange),
Add address info to sound, video and watchdog devices (Daniel P. Berrange),
Extend the virDomainDeviceAddress struture to allow disk controller addresses (Daniel P. Berrange),
Introduce a standardized data structure for device addresses (Daniel P. Berrange),
util: Make sure virExec hook failures are raised (Cole Robinson),
Implement path lookup for USB by vendor:product (Cole Robinson),
events: Report errors on failure (Cole Robinson),
node_device: udev: Enumerate floppy devices (Cole Robinson),
node_device: udev: Use base 16 for product/vendor (Cole Robinson),
libvirt.c: Preserve MigratePerform failure (Cole Robinson),
qemu: migrate: Save MigratePerform error in MigrateFinish. (Cole Robinson),
virterror: Add virSetError (Cole Robinson),
Also look for dmi information in /sys/class (Guido Günther),
proxy_internal.c: mark "request" parameter as nonnull (Jim Meyering),
esx: Dump the raw response in case of an SOAP fault (Matthias Bolte),
esx: Warn if the ESX server is in maintenance mode (Matthias Bolte),
xen hypervisor: xen domctl version 6 (Jim Fehlig),
virsh: Add persistent history using libreadline (Matthias Bolte),
esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses (Matthias Bolte),
esx: Fix deserialization for VI API calls CancelTask and UnregisterVM (Matthias Bolte),
esx: Fix and improve the libcurl debug callback (Matthias Bolte),
esx: Also allow virtualHW version 4 for ESX 4.0 (Matthias Bolte),
qemu: Always enable the virtio balloon driver (Adam Litke),
Disable building of static Python module (Diego Elio Pettenò),
Fix parsing of 'info chardev' line endings (Matthew Booth)
</li>
<li>Cleanups:
xen_hypervisor.c: remove all "domain == NULL" tests, ... (Jim Meyering),
xen_hypervisor.c: avoid NULL deref for NULL domain argument (Jim Meyering),
libvirtd.c: avoid closing a negative socket file descriptor (Jim Meyering),
storage_backend.c: avoid closing a negative file descriptor (Jim Meyering),
avoid a probable EINVAL from lseek (Jim Meyering),
util.c (two more): don't use a negative value as allocation size (Jim Meyering),
avoid format-related warnings (Jim Meyering),
maint: avoid excess parens in STREQ (Eric Blake),
Move models/nmodels mismatch checking one level up (Jiri Denemark),
Fix up a comment in virHashUpdateEntry (Chris Lalancette),
maint: fix spelling error in hacking (Eric Blake),
pci.c: correct an erroneous expression (Jim Meyering),
Remove undefined symbols from libvirt_private.syms (Matthias Bolte),
Don't call disabled timer callbacks in event-test.c (Matthias Bolte),
hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/ (Jim Meyering),
Cleanup of large buffer on stack in virFileMakePath (Laine Stump),
esx: Stop passing around virConnectPtr for error reporting (Matthias Bolte),
Revert "Fix libvirtd restart for domains with PCI passthrough devices" (Chris Lalancette),
Fix two instances of misspelled 'pseudo' (Chris Lalancette),
Use virFileResolveLink instead of readlink in AppArmor (Chris Lalancette),
Fix a compile warning in parthelper.c (Chris Lalancette),
Remove unused PROC_MOUNT_BUF_LEN #define (Chris Lalancette),
fix "make distcheck" failure (Jim Meyering),
avoid format-related warnings (Jim Meyering),
Refactor setup &amp; cleanup of security labels in security driver (Daniel P. Berrange),
Let make fail when XHTML validation fails (Jiri Denemark),
Fix uses of virFileMakePath (Laine Stump),
remove unnecessary closedir call (Jim Meyering),
Make all bitfields unsigned ints to avoid unexpected values in casts (Daniel P. Berrange),
logging: confirm that we want to ignore a write error (Jim Meyering),
Remove superfluous new lines from messages (Jiri Denemark),
vbox_tmpl.c: remove useless array-is-non-NULL comparisons (Jim Meyering),
lxc_driver: remove useless comparison (Jim Meyering),
gnulib added a new syntax-check test: use $(VAR), not @VAR@ (Jim Meyering),
storage_backend.h: include required headers (Jim Meyering),
esx_vi_types.c: include required headers (Jim Meyering),
vbox: include required headers (Jim Meyering),
cpu_x86_data.h: include required header (Jim Meyering),
util.c: include required header, no longer masked by gnulib (Jim Meyering),
Fix validation of news.html (Matthias Bolte),
Remove obsolete comment in QEMU JSON code (Daniel P. Berrange),
Make test suite output less verbose (Daniel P. Berrange),
daemon: Fix various error reporting issues (Cole Robinson),
util: Remove logging handlers in virExec (Cole Robinson),
Commit bootstrap .gitignore additions (Cole Robinson),
qemu: Disable errors in qemudShutdownVMDaemon (Cole Robinson),
avoid another "make distcheck" failure (Jim Meyering),
avoid newly-introduced test failure (Jim Meyering),
don't test "res == NULL" after we've already dereferenced "res" (Jim Meyering),
fix 7 "make check" test failures in non-srcdir build (Jim Meyering),
virsh: Use VIR_FREE instead of free (Matthias Bolte),
esx: Don't warn about an empty URI path (Matthias Bolte),
qemu_driver.c: remove useless, warning-provoking test (Jim Meyering)
</li>
</ul>
<h3>0.7.5: Dec 23 2009</h3>
<ul>
<li>Features:
Add new API virDomainMemoryStats to header and drivers (Adam Litke),
Public API and domain extension for CPU flags (Jiri Denemark),
expose SR IOV physical/virtual function relationships (Dave Allan),
Support for JSON mode monitor [deactivated] (Daniel P. Berrange),
Support for interface model='netfront' (Jiri Denemark),
vbox: Add support for version 3.1 (Pritesh Kothari),
Support QEMU's virtual FAT block device driver (Daniel P. Berrange)
</li>
<li>Documentation:
Document the dommemstat command in the virsh man page (Adam Litke),
esx: Add more links to external documentation (Matthias Bolte),
esx: Extend documentation about 'vcenter' and add some about 'auto_answer' (Matthias Bolte),
Fix and improve domain xml video element description (Matthias Bolte),
Fix owner and group in example volume XML (Matthew Booth),
add missing doc for device &lt;shareable/&gt; option (Daniel Veillard),
add AppArmor test and examples to dist (Jamie Strandboge),
Update location of C# bindings. (Richard Jones),
Fix typo in QEMU driver webpage (Daniel P. Berrange),
Clarify documentation for private symbols (Wolfgang Mauerer),
Fix news.html validation (Dan Kenigsberg)
</li>
<li>Portability:
Define ATTRIBUTE_SENTINEL for GCC &lt; 4.0 too (Matthias Bolte),
Fix compilation with configure --disable-nls (Matthias Bolte),
Fix configure check for SASL (Matthias Bolte),
Fix GnuTLS pkg-config check (Matthias Bolte),
Report an error if no XDR library can be found (Matthias Bolte),
Fix compilation with gcrypt &lt; 1.4.2 (Matthias Bolte),
Don't mix LDFLAGS and LIBS in the configure script (Diego Elio Pettenò),
Don't make it possible to define HAVE_HAL but not enable it in automake (Diego Elio Pettenò),
Fix install location for Python bindings (Matthias Bolte),
Use AM_PATH_PYTHON and python-config to detect Python configuration (Matthias Bolte),
Fix a compilation failure if yajl not avail (Daniel Veillard),
Fix compilation for configure --disable-nls (Matthias Bolte)
</li>
<li>Bug fixes:
cpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad (Matthias Bolte),
Make Xen VT-d PCI attach/detach work (Chris Lalancette),
Fix detection of JSON when restarting libvirtd (Daniel P. Berrange),
Fix reporting of TLS connection errors (Daniel P. Berrange),
Fix typo in qemudDomainAttachHostPciDevice() (Daniel Veillard),
esx: Destroy virtual machine on a vCenter if available (Matthias Bolte),
esx: Undefine virtual machine on a vCenter if available (Matthias Bolte),
Initialize gcrypt threading (Daniel P. Berrange),
Fix bug in storage driver accessing wrong private data (Daniel P. Berrange),
esx_vi.c: do not call through NULL function pointer (Jim Meyering),
esx_util.c: avoid NULL deref for invalid inputs (Jim Meyering),
esx: Don't goto failure for invalid arguments in VMX code (Matthias Bolte),
Fix memory leak in qemudBuildCommandLine (Matthias Bolte),
avoid malfunction when virFileResolveLink is applied to non-POSIX FS (Jim Meyering),
libvirt.c: don't let a NULL "cpumaps" argument provoke a NULL-deref (Jim Meyering),
qemu migration: avoid NULL-deref given an invalid input (Jim Meyering),
qemu_driver.c: don't unlink(NULL) on OOM error path (Jim Meyering),
remote_driver.c: also zero out ->saslDecodedOffset member (Jim Meyering),
qemu_driver.c: avoid double free on error path (Jim Meyering),
libvirtd: avoid a NULL dereference on error path (Jim Meyering),
virsh: avoid double-free (Jim Meyering),
node_device_driver.c: don't write beyond EOB for 4K-byte symlink (Jim Meyering),
Eliminate failure to delete empty storage pools (Laine Stump),
Fix use of virEventAddHandleImpl() (Jiri Denemark),
Fix possible NULL pointer dereference (Paolo Bonzini),
fix various breakages in qemu Dump command (Paolo Bonzini),
Fix reference leak in remoteDispatchStorageVolCreateXmlFrom (Matthias Bolte),
Fix memory leak in virStorageBackendCopyToFD (Matthias Bolte),
retrieve paused/running state at migration start (Paolo Bonzini),
fix migration of paused vms upon failure (Paolo Bonzini),
qemu driver: Fix segfault in libvirt/libvirtd when uri->path is NULL. (Richard Jones),
Fix a wellformedness problem in secret.rng (Diego Elio Pettenò),
Fix virDomainObj ref handling in QEMU driver (Daniel P. Berrange),
Pull code to start CPUs executing out of qemudInitCpuAffinity() (Daniel P. Berrange),
Fix migration cancellation for QEMU (Daniel P. Berrange),
Fix crash when deleting monitor while a command is in progress (Daniel P. Berrange),
udev_device_get_devpath might return NULL (Guido Günther),
Fix some locking issues (Matthias Bolte),
Fix event test timer checks on kernels with HZ=100 (Daniel P. Berrange),
Fix threading problems in python bindings (Daniel P. Berrange),
Supress annoying libcap-ng errors from valgrind (Daniel P. Berrange),
Fix two leaks in test driver (Daniel P. Berrange),
Free cgroup device ACL list on driver shutdown (Daniel P. Berrange),
xen: Fix unconditional freeing in xenDaemonListDefinedDomains() (Matthias Bolte),
Fix default disk type when parsing QEMU argv (Daniel P. Berrange),
remove port filter when network device is detached (Gerhard Stenzel)
</li>
<li>Improvements:
convert missing server entry points into unsupported errors (Daniel Veillard),
fix some error report when on remote access (Olivier Fourdan),
Disable JSON mode monitor until QEMU is more mature (Daniel P. Berrange),
Only probe for CPU models if required (Jiri Denemark),
Add cpu_map.xml to libvirt.spec (Jiri Denemark),
Install cpu_map.xml (Jiri Denemark),
esx: Don't warn about '/' paths (Matthias Bolte),
esx: Extend vCenter query parameter (Matthias Bolte),
esx: Improve domain lookup by UUID (Matthias Bolte),
build: update gnulib submodule to latest (Jim Meyering),
Relax the allowed values for machine type in schema (Daniel Veillard),
Implement --pool option for virsh vol-path (Dave Allan),
nodedev: Add removable storage 'media_label' prop (Cole Robinson),
add --live support to "virsh dump" (Paolo Bonzini),
add --crash support to "virsh dump" (Paolo Bonzini),
Get QEMU pty paths from the monitor (Matthew Booth),
Extract the assigned pty device for QEmu channels (Matthew Booth),
Make QEMU driver use -chardev everywhere if available (Matthew Booth),
add virsh --suspend arg to migrate command (Paolo Bonzini),
reload iptables rules on libvirtd restart (Mark McLoughlin),
reload iptables rules simply by re-adding them (Mark McLoughlin),
Plumb domain description tag in xend backend (Jim Fehlig),
Make QEMU text monitor parsing more robust (Daniel P. Berrange),
Hook up JSON monitor to emit basic lifecycle events (Daniel P. Berrange),
Add QEMU monitor callbacks for basic lifecycle events (Daniel P. Berrange),
Switch over to passing a callback table to QEMU monitor (Daniel P. Berrange),
Introduce callbacks for serializing domain object private data to XML (Daniel P. Berrange),
Switch LXC driver to use a private data blob for virDomainObj state (Daniel P. Berrange),
Switch UML driver to use a private data blob for virDomainObj state (Daniel P. Berrange),
Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it (Daniel P. Berrange),
Introduce a simple API for handling JSON data (Daniel P. Berrange),
Add --system flag to autogen.sh to make it easy to build with right prefix (Daniel P. Berrange),
Export all symbols from xml.h for internal use (Jiri Denemark),
vbox: Use virIndexToDiskName() in vboxGenerateMediumName() (Matthias Bolte),
Tests for interface type/model configuration (Jiri Denemark),
Add virIndexToDiskName and fix mapping gap (Matthias Bolte),
Add another SENTINEL attribute (Paolo Bonzini),
Fix help message (Wolfgang Mauerer),
Alternate CPU affinity impl to cope with NR_CPUS > 1024 (Daniel P. Berrange)
</li>
<li>Cleanups:
The secret driver is stateful, link it directly to libvirtd (Matthias Bolte),
Remove undefined symbols from libvirt_private.syms (Matthias Bolte),
boolean shadows a typedef in rpcndr.h when compiled with MinGW (Matthias Bolte),
Rename DATADIR to PKGDATADIR to fix win32 build (Jiri Denemark),
Move cpu_map.xml to -client RPM (Jiri Denemark),
Fix undefined reference to 'close_used_without_including_unistd_h' (Matthias Bolte),
Fix argument type of virProcessInfoSetAffinity dummy function (Matthias Bolte),
esx: Use occurrence enum to specify expected result of a SOAP call (Matthias Bolte),
esx: Fix occurence typo (Matthias Bolte),
esx: Removed unused inttypes.h include (Matthias Bolte),
esx: Replace libxml1 'xmlChildrenNode' with libxml2 'children' (Matthias Bolte),
esx: Use more suitable error code in esxVI_LookupVirtualMachineByUuid() (Matthias Bolte),
esx: Add automatic question handling (Matthias Bolte),
avoid calling exit with a constant; use EXIT_* instead (Jim Meyering),
maint: remove from VC two gnulib-provided files (Jim Meyering),
xm_internal.c: remove misleading dead code (Jim Meyering),
Cleanup temporary #define after use (Matthew Booth),
Suppress cgroup error message on sucess startup (Ryota Ozaki),
Small change of RNG syntax for domain (Diego Elio Pettenò),
remove iptablesReloadRules() and related code (Mark McLoughlin),
remove all traces of lokkit support (Mark McLoughlin),
Add virBufferFreeAndReset() and replace free() (Matthias Bolte),
Fix the news file non-ascii characters (Daniel Veillard),
Add missing commas to the 0.7.4 news section (Matthias Bolte),
Change generated HTML to UTF-8 encoding (Daniel Veillard),
Avoid an type-punned pointer aliasing pbm (Daniel Veillard),
Move qemuMonitorEscape + migrate status enum into shared monitor code (Daniel P. Berrange),
vbox: Update IIDs from version 3.1-beta2 to 3.1-final (Matthias Bolte),
Fix ReprotError vs ReportError typo in JSON code (Daniel P. Berrange),
Fix inverted conditional test in configure.ac check for yajl (Daniel P. Berrange),
Pull schedular affinity code out into a separate module (Daniel P. Berrange),
Ignore docs/ directory for strcmp() syntax check (Daniel P. Berrange)
</li>
</ul>
<h3>0.7.4: Nov 20 2009</h3>
<ul>
<li>Features:
Implement a node device backend using libudev (David Allan),
New APIs for checking some object properties (Daniel P. Berrange),
Fully asynchronous monitor I/O processing (Daniel P. Berrange),
add MAC address based port filtering to qemu (Gerhard Stenzel),
Support for IPv6 / multiple addresses per interfaces (Laine Stump)
</li>
<li>Documentation:
Document overriding domain interface target (Cole Robinson),
514532 Fix man page, most operation are synchronous (Daniel Veillard),
Fix typo in error message (Matthew Booth),
esx: Add documentation to the website (Matthias Bolte),
AppArmor updates of examples (Jamie Strandboge),
Add documentation for &lt;channel&gt; domain element (Matthew Booth),
Separate character device doc guest and host parts (Matthew Booth),
Add a Python example that lists active ESX domains (Matthias Bolte),
LXC fix wrong or out-of-date function descriptions (Ryota Ozaki),
docs: &lt;clock&gt; property is 'offset', not 'sync' (Cole Robinson),
Update the documentation for virDomainMigrateToURI (Chris Lalancette),
fix virDomainMigrateToURI doc (Dan Kenigsberg)
</li>
<li>Bug fixes:
504262 Check for duplicated UUID in XM Xen defines (Daniel Veillard),
512069 fix domain XML schemas for backward compatibility (Daniel Veillard),
qemu-kvm needs -enable-kvm flag for VT optimization (Steve Yarmie),
fix deprecated iptables command syntax (Steve Yarmie),
Ensure driver lock is released when entering QEMU monitor (Daniel P. Berrange),
only remove masquerade roles for VIR_NETWORK_FORWARD_NAT (Guido Günther),
esx: Fix CPU clock Hz to MHz conversion (Matthias Bolte),
esx: Fix memory leak in esxVI_HostCpuIdInfo_Free() (Matthias Bolte),
esx: Fix MAC address formatting (Matthias Bolte),
Fix compilation of libvirt against xen-unstable (Jim Fehlig),
Fix probing for libpciaccess (Daniel P. Berrange),
Fix incorrect reference counting logic in qemu monitor open (Daniel P. Berrange),
Don't return fatal error in HAL driver init if HAL isn't running (Daniel P. Berrange),
Fix cleanup when state driver init fails (Daniel P. Berrange),
AppArmor handling of accesses to readonly files (Jamie Strandboge),
AppArmor require absolute paths (Jamie Strandboge),
Check that domain is running when starting console (Daniel P. Berrange),
Fix incorrect variable passed to LXC event callback (Daniel P. Berrange),
Fix race condition in HAL driver startup (Daniel P. Berrange),
Remove capng_lock() call when spawning LXC container init process (Daniel P. Berrange),
Fix initscript to check daemon pidfile (Daniel P. Berrange),
Filter out stale domains from xenstore listing (Daniel P. Berrange),
Fix logic in xenUnifiedNumOfDomains to match xenUnifiedListDomains (Jonas Eriksson),
Disable IPv6 socket auto-binding to IPv4 socket (Daniel P. Berrange),
Fix save and restore with non-privileged guests and SELinux (Daniel P. Berrange),
Prevent initializing ebtables if disabled in qemu.conf (Ryota Ozaki),
phyp: too much timeout when polling socket (Eduardo Otubo),
phyp: ssh authentication with public key fixed (Eduardo Otubo),
opennebula: Fix potential memory/mutex leak in state driver startup (Matthias Bolte),
phyp: Break potential infinite loops (Matthias Bolte),
phyp: Fix memory/session leaks and potential invalid frees (Matthias Bolte),
storage: conf: Fix memory leak in encryption parsing (Cole Robinson),
Fix improper error return in virInterfaceDefParseProtoIPvX (Laine Stump),
Fix virInterfaceIpDefPtr leak during virInterfaceIpDefFree (Laine Stump),
give up python interpreter lock before calling cb (Dan Kenigsberg),
ESX: Fix memory leak in list handling functions. (Matthias Bolte),
Fix --with-init-script configure option (Matthew Booth),
Don't let parent of daemon exit until basic initialization is done (Daniel P. Berrange),
Fix configure detection of device mapper (Pritesh Kothari),
Remote code caught EINTR making it ininterruptable (Daniel Veillard),
virterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET (Cole Robinson),
Fix p2p migration without a passed uri. (Cole Robinson),
Fix problems in the Xen inotify driver. (Matthias Bolte),
Remove a completely bogus reference increment in the Xen driver. (Chris Lalancette),
528575 avoid libvirtd crash on LCX domain autostart (Daniel Veillard),
Fix SELinux linking issues (Jim Fehlig),
node device: Fix locking issue in virNodeDeviceDestroy (Cole Robinson),
LXC fix virCgroupGetValueStr problem with \n (Ryota Ozaki),
Avoid crash in virBufferEscapeString (Laine Stump),
LXC complement PATH environment variable (Ryota Ozaki)
</li>
<li>Improvements:
Enable udev instead of hal on F12 / RHEL-6 or later (Daniel P. Berrange),
python: Actually implement list*Interfaces bindings (Cole Robinson),
esx: Handle 'vmxnet3' in esxVMX_FormatEthernet() (Matthias Bolte),
Fix check for existance of cgroups at creation (Daniel P. Berrange),
Fix virt-aa-helper when host and os.type arch differ (Jamie Strandboge),
Add translation of PCI vendor and product IDs (David Allan),
Add scsi_target device type (David Allan),
Add several fields to node device capabilities (David Allan),
Add virConnectGetLibvirtVersion API (Cole Robinson),
Implement finer grained migration control for Xen (Maximilian Wilhelm),
Support for SATA Disks in virDomainDiskBus (pritesh),
LXC implement missing DomainInterfaceStats API (Ryota Ozaki),
disable mac_filter config switch by default (Gerhard Stenzel),
phyp: Reorder keyboard_interactive label in openSSHSession() (Eduardo Otubo),
Implmentation of new APIs to checking state/persistence of objects (Daniel P. Berrange),
Allow timeouts waiting for QEMU job lock (Daniel P. Berrange),
Release driver and domain lock when running monitor commands (Daniel P. Berrange),
Add reference counting on virDomainObjPtr objects (Daniel P. Berrange),
Locking of the qemuMonitorPtr object (Daniel P. Berrange),
Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs (Daniel P. Berrange),
Move encryption lookup back into qemu driver file (Daniel P. Berrange),
Make use of private data structure for monitor state (Daniel P. Berrange),
Add a new timed condition variable wait API (Daniel P. Berrange),
Fix errno handling for pthreads wrappers (Daniel P. Berrange),
524280 pass max lease option to dnsmasq (Daniel Veillard),
Store the range size when adding a DHCP range (Daniel Veillard),
qemu: Allow cpu pinning for all logical CPUs, not just physical (Cole Robinson),
qemu: Use same create/define overwrite logic for migration prepare. (Cole Robinson),
qemu: Break out function to check if we can create/define/restore (Cole Robinson),
Add sentinel attribute for NULL terminated arg lists (Paolo Bonzini),
test: Update inactive guest config on shutdown (Cole Robinson),
test: Add testDomainShutdownState helper (Cole Robinson),
Properly convert port numbers to/from network byte order (Matthew Booth),
phyp add create() and destroy() support (Eduardo Otubo),
Support for &lt;channel&gt; in domain and QEmu backend (Matthew Booth),
Detect availability of QEMU -chardev CLI option (Matthew Booth),
Allow character devices to have different target types (Matthew Booth),
LXC allow container to have ethN interfaces (Ryota Ozaki),
New ebtables module wrapper (Gerhard Stenzel),
test: Implement virDomainPinVcpu (Cole Robinson),
test: Implement virDomainGetVcpus (Cole Robinson),
test: Update vcpu runtime info in SetVcpus (Cole Robinson),
test: Use privateData to track running VM vcpu state (Cole Robinson),
test: Break out wrapper for setting up started domain state. (Cole Robinson),
test: Fixes for SetVcpus (Cole Robinson),
Make monitor type (miimon/arpmon) optional in bond xml (Laine Stump),
Support reporting live interface IP/netmask (Laine Stump),
Make startmode optional in toplevel interface definition (Laine Stump),
Move libvirtd event loop into background thread (Daniel P. Berrange),
Allow NULL mac address in virGetInterface (Laine Stump),
ESX: Don't automatically follow redirects. (Matthias Bolte),
ESX: Change disk selection for datastore detection. (Matthias Bolte),
ESX: Fallback to the preliminary name if the datastore cannot be found. (Matthias Bolte),
Set KMEMSIZE for OpenVZ domains being defined (Yuji NISHIDA),
Allow for a driver specific private data blob in virDomainObjPtr (Daniel P. Berrange),
More network utility functions (Matthew Booth),
Add symbols from new network.h module (Daniel Veillard),
Set of new network related utilities (Daniel Veillard),
Convert virDomainObjListPtr to use a hash of domain objects (Daniel P. Berrange),
qemu: migrate: Don't require manual URI to specify a port (Cole Robinson),
test: Support virStorageFindPoolSources (Cole Robinson),
storage: Add ParseSourceString function for use with FindPoolSources. (Cole Robinson),
Add support for an external TFTP boot server (Paolo Bonzini),
test: Support virNodeDeviceCreate and virNodeDeviceDestroy (Cole Robinson),
Consolidate virXPathNodeSet() (Daniel Veillard),
Support QEMU watchdog device. (Richard Jones),
Do not log rotate very small logs (Dan Kenigsberg),
LXC implement missing macaddr assignment feature (Ryota Ozaki),
tests: Initialize virRandom in for test suite. (Cole Robinson),
tests: Add storage volume XML 2 XML tests. (Cole Robinson),
tests: Add network XML to XML tests. (Cole Robinson),
schema: Update network schema. (Cole Robinson),
tests: Add XML 2 XML tests for storage pools. (Cole Robinson),
tests: Break out duplicate schema verification functionality. (Cole Robinson),
tests: Fix text output for interface XML 2 XML (Cole Robinson),
Add ocfs2 to list of fs pool types (Jim Fehlig),
Finer grained migration control (Chris Lalancette)
</li>
<li>Cleanups:
remove sysfs_path and parent_sysfs_path from XML (Dave Allan),
Removing devicePath member from dev struct (Dave Allan),
report OOM in two places in node_device_driver.c (Dave Allan),
Whitespace cleanup for pre-tags on the website (Matthias Bolte),
Fix type in configure output summary (Daniel P. Berrange),
Remove a compilation warning on uninitialized var (Daniel Veillard),
Change DTD references to use public instead of system identifier (Matthias Bolte),
Remove obsolete devicekit checks (Daniel P. Berrange),
Small guestfwd code cleanup (Matthew Booth),
Small indentation cleanup of domain schema (Matthew Booth),
AppArmor code cleanups (Jamie Strandboge),
Fix formatting of XML for an inactive guest (Daniel P. Berrange),
Remove DevKit node device backend (David Allan),
Exclude numactl on s390[x] (Daniel P. Berrange),
Fix error handling in qemuMonitorOpen (Ryota Ozaki),
Fix warning on make due to missing cast (int) (Ryota Ozaki),
Various fixes following a code review part 2 (Daniel Veillard),
Various fixes following a code review (Daniel Veillard),
Move code for low level QEMU monitor interaction into separate file (Daniel P. Berrange),
Make pciDeviceList struct opaque (Daniel P. Berrange),
Add missing OOM error checks, reports and cleanups (Matthias Bolte),
Removes the ebtablesSaveRules() function (Gerhard Stenzel),
phyp: Use actual error code instead of 0 (Matthias Bolte),
phyp: Don't use VIR_ALLOC if a stack variable is good enough (Matthias Bolte),
phyp: Fix several UUID table related problems (Matthias Bolte),
phyp: Check for exit_status &lt; 0 before parsing the result (Matthias Bolte),
phyp: memcpy/memmove/memset can't fail, so don't check for error (Matthias Bolte),
phyp: Make generic domain listing functions return -1 in case of error (Matthias Bolte),
Fix configure check for libssh2 (Matthias Bolte),
Repair getIPv4Addr after the ntohl conversion (Daniel Veillard),
Cleanup whitespace in docs (Matthew Booth),
Use virBuffer when building QEMU char dev command line (Matthew Booth),
Cleanup virBuffer usage in qemdBuildCommandLine (Matthew Booth),
Fix some cut-and-paste error in migration code (Paolo Bonzini),
Ensure guestfwd address is IPv4 and various cleanups (Matthew Booth),
LXC cleanup deep indentation in lxcDomainSetAutostart (Ryota Ozaki),
LXC messages cleanup and fix lxcError (Ryota Ozaki),
qemu: Remove compiled out localhost migration support (Cole Robinson),
Various error reporting fixes (Cole Robinson),
Improve error reporting for virConnectGetHostname calls (Cole Robinson),
Fix up NLS warnings. (Chris Lalancette),
Remove redundant virFileDeletePID() call (Chris Lalancette),
Fix return value in virStateInitialize impl for LXC (Daniel P. Berrange),
ESX: Unify naming of VI API utility and convenience functions. (Matthias Bolte),
Rename internal APis (Daniel P. Berrange),
Pull signal setup code out into separate method (Daniel P. Berrange),
Fix duplicating logging of errors in libvirtd (Daniel P. Berrange),
Fix initialization order bugs (Daniel P. Berrange),
Misc cleanup to network socket init (Daniel P. Berrange),
Annotate many methods with ATTRIBUTE_RETURN_CHECK &amp; fix problems (Daniel P. Berrange),
Don't use private struct member names of in6_addr (Matthias Bolte),
Fix typo in network.c function comments (Matthew Booth),
libvirt-devel should only require libvirt-client (Mark McLoughlin),
qemu: Fix an error message in GetVcpus (Cole Robinson),
storage: Break out function to add pool source to a SourceList. (Cole Robinson),
storage: Break out pool source parsing to a separate function. (Cole Robinson),
Fix some typos in comments (Dan Kenigsberg),
Fix error message in qemudLoadDriverConfig() (Matthias Bolte),
Add a new syntax-check rule for gethostname. (Chris Lalancette),
Various syntax-check fixes. (Chris Lalancette),
Tighten up nonreentrant syntax-check. (Chris Lalancette),
Replace a gethostname by virGetHostname in libvirtd.c (Chris Lalancette),
Replace two strcmp() by STREQ() in qemu_driver.c (Chris Lalancette),
Replace gethostname by virGetHostname in xend_internal.c (Chris Lalancette),
Add a default log_level to qemudSetLogging to remove a build warning. (Chris Lalancette),
Better error message when libvirtd fails to start. (Chris Lalancette),
Fix potential false-positive OOM error reporting. (Matthias Bolte),
Fix virsh.c compilation warning (Jim Fehlig),
Fix a make dist error due to wrong EXTRA_DIST paths (Daniel Veillard),
node device: Break out get_wwns and get_parent_node helpers (Cole Robinson),
tests: Centralize VIR_TEST_DEBUG lookup, and document it (Cole Robinson),
Remove bogus const annotations to hash iterator (Daniel P. Berrange),
Remove bashisms from schema tests. (Matthias Bolte),
Don't copy old machines from a domain which has none (Mark McLoughlin)
</li>
</ul>
<h3>0.7.3: Nov 20 2009</h3>
<p>Broken release use 0.7.4</p>
<h3>0.7.2: Oct 14 2009</h3>
<ul>
<li>Features:
@ -1157,8 +1814,8 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
<ul>
<li>Bug fixes: QEmu network serialization (Kaitlin Rupert), internal
memory allocation fixes (Chris Lalancette Jim Meyering), virsh
large file config problem (Jim Meyering), xen list APIs when
max is zero, string escape problems in the xm driver </li>
large file config problem (Jim Meyering), xen list APIs when
max is zero, string escape problems in the xm driver </li>
<li>Improvements: add autogen to tarballs, improve iSCSI support
(Chris Lalancette), localization updates </li>
<li>Cleanups: const-ness fixed (Daniel P. Berrange), string helpers
@ -1168,60 +1825,60 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
<ul>
<li>New features: Linux Container start and stop (Dave Leskovec),
Network interface model settings (Daniel Berrange),serial and parallel
device support for QEmu and Xen (Daniel Berrange),
device support for QEmu and Xen (Daniel Berrange),
Sound support for QEmu and Xen (Cole Robinson), vCPU settings for
QEmu (Cole Robinson), support for NUMA and vCPU pinning in QEmu
(Daniel Berrange), new virDomainBlockPeek API (Richard Jones)</li>
QEmu (Cole Robinson), support for NUMA and vCPU pinning in QEmu
(Daniel Berrange), new virDomainBlockPeek API (Richard Jones)</li>
<li>Documentation: coding guidelines (Jim Meyering and Richard Jones),
small man page missing entries and cleanup,
Web site revamp (Daniel Berrange),
typo fixes (Atsushi SAKAI), more docs on network XML format
(Daniel Berrange), libvirt Wiki (Daniel Berrange),
policykit config docs (Cole Robinson), XML domain docs revamp
(Daniel Berrange), docs for remote listen-tls/tcp fixes (Kenneth
Nagin), </li>
Web site revamp (Daniel Berrange),
typo fixes (Atsushi SAKAI), more docs on network XML format
(Daniel Berrange), libvirt Wiki (Daniel Berrange),
policykit config docs (Cole Robinson), XML domain docs revamp
(Daniel Berrange), docs for remote listen-tls/tcp fixes (Kenneth
Nagin), </li>
<li>Bug fixes: save change to config file for Xen (Ryan Scott),
fix /var/run/libvirt/ group ownership (Anton Protopopov),
ancient libparted workaround (Soren Hansen), out of bount
array access (Daniel Berrange), remote check bug (Dave Leskovec),
LXC signal and daemon restart problems (Dave Leskovec), bus selection
logic fix in the daemon config (Daniel Berrange), 2 memory leaks
in the daemon (Jim Meyering), daemon pid file logic bug fix
(Daniel Berrange), python generator fixes (Daniel Berrange),
ivarious leaks and memory problem pointed by valgrind (Daniel
Berrange), iptables forwarding cleanup (Daniel Berrange),
Xen cpuset value checking (Hiroyuki Kaguchi), container process
checks for LXC (Dave Leskovec), let xend check block device syntax
(Hiroyuki Kaguchi), UUIDString for python fixes (Cole Robinson)</li>
ancient libparted workaround (Soren Hansen), out of bount
array access (Daniel Berrange), remote check bug (Dave Leskovec),
LXC signal and daemon restart problems (Dave Leskovec), bus selection
logic fix in the daemon config (Daniel Berrange), 2 memory leaks
in the daemon (Jim Meyering), daemon pid file logic bug fix
(Daniel Berrange), python generator fixes (Daniel Berrange),
ivarious leaks and memory problem pointed by valgrind (Daniel
Berrange), iptables forwarding cleanup (Daniel Berrange),
Xen cpuset value checking (Hiroyuki Kaguchi), container process
checks for LXC (Dave Leskovec), let xend check block device syntax
(Hiroyuki Kaguchi), UUIDString for python fixes (Cole Robinson)</li>
<li>Improvements: fixes for MinGW compilation (Richard Jones),
autostart for running Xen domains (Cole Robinson),
control of listening IP for daemon (Stefan de Konink),
various Xenner related fixes and improvements (Daniel Berrange)
autostart status printed in virsh domainfo (Shigeki Sakamoto),
better error messages for xend driver (Richard Jones)</li>
control of listening IP for daemon (Stefan de Konink),
various Xenner related fixes and improvements (Daniel Berrange)
autostart status printed in virsh domainfo (Shigeki Sakamoto),
better error messages for xend driver (Richard Jones)</li>
<li>Code cleanups: OpenVZ compilation (Richard Jones), conn dom and
net fields deprecation in error structures (Richard Jones),
Xen-ism on UUID (Richard Jones), add missing .pod to dist (Richard
Jones), tab cleanup from sources (Jim Meyering), remove unused field
in virsh control structure (Richard Jones), compilation without
pthread.h (Jim Meyering), cleanup of tests (Daniel Berrange),
syntax-check improvements (Jim Meyering), python cleanup,
remove dependancy on libc is_* character tests (Jim Meyering),
format related cleanups (Jim Meyering), cleanup of the buffer
internal APIs (Daniel Berrange), conversion to the new memory
allocation API (Daniel Berrange), lcov coverage testing
(Daniel Berrange), gnulib updates (Jim Meyering), compatibility
fix with RHEL 5 (Daniel Berrange), SuSE compatibility fix (Jim
Fehlig), const'ification of a number of structures (Jim Meyering),
string comparison macro cleanups (Daniel Berrange), character
range testing cleanups and assorted bug fixes (Jim Meyering),
QEmu test fixes (Daniel Berrange), configure macro cleanup (Daniel
Berrange), refactor QEmu command line building code (Daniel Berrange),
type punning warning in remote code (Richard Jones), refactoring
of internal headers (Richard Jones), generic out of memory
testing and associated bug fixes (Daniel Berrange), don't raise
internal error for unsupported features (Kaitlin Rupert),
missing driver entry points (Daniel Berrange)</li>
Xen-ism on UUID (Richard Jones), add missing .pod to dist (Richard
Jones), tab cleanup from sources (Jim Meyering), remove unused field
in virsh control structure (Richard Jones), compilation without
pthread.h (Jim Meyering), cleanup of tests (Daniel Berrange),
syntax-check improvements (Jim Meyering), python cleanup,
remove dependancy on libc is_* character tests (Jim Meyering),
format related cleanups (Jim Meyering), cleanup of the buffer
internal APIs (Daniel Berrange), conversion to the new memory
allocation API (Daniel Berrange), lcov coverage testing
(Daniel Berrange), gnulib updates (Jim Meyering), compatibility
fix with RHEL 5 (Daniel Berrange), SuSE compatibility fix (Jim
Fehlig), const'ification of a number of structures (Jim Meyering),
string comparison macro cleanups (Daniel Berrange), character
range testing cleanups and assorted bug fixes (Jim Meyering),
QEmu test fixes (Daniel Berrange), configure macro cleanup (Daniel
Berrange), refactor QEmu command line building code (Daniel Berrange),
type punning warning in remote code (Richard Jones), refactoring
of internal headers (Richard Jones), generic out of memory
testing and associated bug fixes (Daniel Berrange), don't raise
internal error for unsupported features (Kaitlin Rupert),
missing driver entry points (Daniel Berrange)</li>
</ul>
<h3>0.4.2: Apr 8 2008</h3>
<ul>

View File

@ -22,28 +22,28 @@
<ul>
<li>
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
</li>
<li>
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
</li>
<li>
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
</li>
<li>
The <a href="http://lxc.sourceforge.net/">LXC</a> Linux container system
The <a href="http://lxc.sourceforge.net/">LXC</a> Linux container system
</li>
<li>
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
</li>
<li>
The <a href="http://virt.kernelnewbies.org/lguest">lGuest</a> paravirtualized hypervisor
The <a href="http://virt.kernelnewbies.org/lguest">lGuest</a> paravirtualized hypervisor
</li>
<li>
The <a href="http://virt.kernelnewbies.org/Linux-VServer">Linux-VServer</a> container system
The <a href="http://virt.kernelnewbies.org/Linux-VServer">Linux-VServer</a> container system
</li>
<li>
The <a href="http://virt.kernelnewbies.org/UML">User Mode Linux</a> paravirtualized hypervisor
The <a href="http://virt.kernelnewbies.org/UML">User Mode Linux</a> paravirtualized hypervisor
</li>
</ul>
@ -51,13 +51,13 @@
<ul>
<li>
<a href="http://virt.kernelnewbies.org/">Kernel Newbies Virtualization guide</a>
<a href="http://virt.kernelnewbies.org/">Kernel Newbies Virtualization guide</a>
</li>
<li>
<a href="http://www-128.ibm.com/developerworks/linux/library/l-linuxvirt/?ca=dgr-lnxw01Virtual-Linux">IBM developerworks virtualization guide</a>
<a href="http://www-128.ibm.com/developerworks/linux/library/l-linuxvirt/?ca=dgr-lnxw01Virtual-Linux">IBM developerworks virtualization guide</a>
</li>
<li>
<a href="http://en.wikipedia.org/wiki/Virtualization">Wikipedia Virtualization</a>
<a href="http://en.wikipedia.org/wiki/Virtualization">Wikipedia Virtualization</a>
</li>
</ul>

View File

@ -811,16 +811,6 @@ should just 'do the right thing(tm)'.
<a name="Remote_limitations" id="Remote_limitations">Limitations</a>
</h3>
<ul>
<li> Remote storage: To be fully useful, particularly for
creating new domains, it should be possible to enumerate
and provision storage on the remote machine. This is currently
in the design phase. </li>
<li> Migration: We expect libvirt will support migration,
and obviously remote support is what makes migration worthwhile.
This is also in the design phase. Issues <a href="https://www.redhat.com/mailman/listinfo/libvir-list" title="libvir-list mailing list">to discuss</a> include
which path the migration data should follow (eg. client to
client direct, or client to server to client) and security.
</li>
<li> Fine-grained authentication: libvirt in general,
but in particular the remote case should support more
fine-grained authentication for operations, rather than

View File

@ -25,6 +25,9 @@
<optional>
<ref name='cpufeatures'/>
</optional>
<optional>
<ref name='cpuspec'/>
</optional>
</element>
<optional>
<ref name='migration'/>
@ -67,6 +70,31 @@
</element>
</define>
<define name='cpuspec'>
<element name='model'>
<text/>
</element>
<element name='topology'>
<attribute name='sockets'>
<ref name='positiveInteger'/>
</attribute>
<attribute name='cores'>
<ref name='positiveInteger'/>
</attribute>
<attribute name='threads'>
<ref name='positiveInteger'/>
</attribute>
</element>
<zeroOrMore>
<element name='feature'>
<attribute name='name'>
<ref name='featureName'/>
</attribute>
<empty/>
</element>
</zeroOrMore>
</define>
<define name='migration'>
<element name='migration_features'>
<optional>
@ -259,6 +287,11 @@
<empty/>
</element>
</optional>
<optional>
<element name='cpuselection'>
<empty/>
</element>
</optional>
</element>
</define>
@ -293,8 +326,14 @@
</define>
<define name='positiveInteger'>
<data type='positiveInteger'>
<param name="pattern">[0-9]+</param>
</data>
</define>
<define name='uint'>
<data type='string'>
<data type='unsignedInt'>
<param name="pattern">[0-9]+</param>
</data>
</define>
@ -305,4 +344,9 @@
</data>
</define>
<define name='featureName'>
<data type='string'>
<param name='pattern'>[a-zA-Z0-9\-_]+</param>
</data>
</define>
</grammar>

View File

@ -27,6 +27,9 @@
<optional>
<ref name="description"/>
</optional>
<optional>
<ref name="cpu"/>
</optional>
<ref name="os"/>
<ref name="clock"/>
<ref name="resources"/>
@ -167,13 +170,11 @@
</optional>
<optional>
<attribute name="machine">
<choice>
<value>xenfv</value>
<value>pc</value>
<value>isapc</value>
</choice>
<data type="string">
<param name="pattern">[a-zA-Z0-9_\.\-]+</param>
</data>
</attribute>
</optional>
</optional>
</group>
</define>
<define name="hvmmips">
@ -275,13 +276,13 @@
</element>
</optional>
<optional>
<element name="memoryBacking">
<optional>
<element name="hugepages">
<empty/>
</element>
</optional>
</element>
<element name="memoryBacking">
<optional>
<element name="hugepages">
<empty/>
</element>
</optional>
</element>
</optional>
<optional>
<element name="vcpu">
@ -384,6 +385,9 @@
<optional>
<ref name="encryption"/>
</optional>
<optional>
<ref name="address"/>
</optional>
</define>
<!--
A disk description can be either of type file or block
@ -434,6 +438,22 @@
<ref name="diskspec"/>
</interleave>
</group>
<group>
<attribute name="type">
<value>dir</value>
</attribute>
<interleave>
<optional>
<element name="source">
<attribute name="dir">
<ref name="absFilePath"/>
</attribute>
<empty/>
</element>
</optional>
<ref name="diskspec"/>
</interleave>
</group>
<ref name="diskspec"/>
</choice>
</element>
@ -501,6 +521,26 @@
</choice>
</attribute>
</define>
<define name="controller">
<element name="controller">
<optional>
<attribute name="type">
<choice>
<value>fdc</value>
<value>ide</value>
<value>scsi</value>
<value>sata</value>
</choice>
</attribute>
</optional>
<attribute name="index">
<ref name="unsignedInt"/>
</attribute>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="filesystem">
<element name="filesystem">
<choice>
@ -561,6 +601,9 @@
</interleave>
</group>
</choice>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="filesystemtgt">
@ -698,6 +741,9 @@
<empty/>
</element>
</optional>
<optional>
<ref name="address"/>
</optional>
</interleave>
</define>
<!--
@ -842,7 +888,7 @@
<define name="video">
<element name="video">
<optional>
<element name="model">
<element name="model">
<attribute name="type">
<choice>
<value>vga</value>
@ -882,7 +928,10 @@
</optional>
</element>
</optional>
</element>
</element>
</optional>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
@ -930,6 +979,27 @@
definition doesn't fully specify the constraints on this node.
-->
<define name="qemucdev">
<ref name="qemucdevSrcType"/>
<optional>
<attribute name="tty">
<ref name="devicePath"/>
</attribute>
</optional>
<interleave>
<ref name="qemucdevSrcDef"/>
<optional>
<element name="target">
<optional>
<attribute name="port"/>
</optional>
</element>
</optional>
<optional>
<ref name="address"/>
</optional>
</interleave>
</define>
<define name="qemucdevSrcType">
<attribute name="type">
<choice>
<value>dev</value>
@ -944,43 +1014,34 @@
<value>pty</value>
</choice>
</attribute>
<interleave>
<optional>
<oneOrMore>
<element name="source">
<optional>
<attribute name="mode"/>
</optional>
<optional>
<attribute name="path"/>
</optional>
<optional>
<attribute name="host"/>
</optional>
<optional>
<attribute name="service"/>
</optional>
<optional>
<attribute name="wiremode"/>
</optional>
</element>
</oneOrMore>
</optional>
<optional>
<element name="protocol">
<optional>
<attribute name="type"/>
</optional>
</element>
</optional>
<optional>
<element name="target">
<optional>
<attribute name="port"/>
</optional>
</element>
</optional>
</interleave>
</define>
<define name="qemucdevSrcDef">
<zeroOrMore>
<element name="source">
<optional>
<attribute name="mode"/>
</optional>
<optional>
<attribute name="path"/>
</optional>
<optional>
<attribute name="host"/>
</optional>
<optional>
<attribute name="service"/>
</optional>
<optional>
<attribute name="wiremode"/>
</optional>
</element>
</zeroOrMore>
<optional>
<element name="protocol">
<optional>
<attribute name="type"/>
</optional>
</element>
</optional>
</define>
<!--
The description for a console
@ -1011,6 +1072,33 @@
<value>ac97</value>
</choice>
</attribute>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="watchdog">
<element name="watchdog">
<attribute name="model">
<choice>
<value>i6300esb</value>
<value>ib700</value>
</choice>
</attribute>
<optional>
<attribute name="action">
<choice>
<value>reset</value>
<value>shutdown</value>
<value>poweroff</value>
<value>pause</value>
<value>none</value>
</choice>
</attribute>
</optional>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="parallel">
@ -1023,6 +1111,27 @@
<ref name="qemucdev"/>
</element>
</define>
<define name="guestfwdTarget">
<element name="target">
<attribute name="type">
<value>guestfwd</value>
</attribute>
<attribute name="address"/>
<attribute name="port"/>
</element>
</define>
<define name="channel">
<element name="channel">
<ref name="qemucdevSrcType"/>
<interleave>
<ref name="qemucdevSrcDef"/>
<ref name="guestfwdTarget"/>
<optional>
<ref name="address"/>
</optional>
</interleave>
</element>
</define>
<define name="input">
<element name="input">
<attribute name="type">
@ -1040,6 +1149,9 @@
</choice>
</attribute>
</optional>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="hostdev">
@ -1067,12 +1179,22 @@
<group>
<element name="source">
<choice>
<ref name="usbproduct"/>
<group>
<ref name="usbproduct"/>
<optional>
<ref name="usbaddress"/>
</optional>
</group>
<ref name="usbaddress"/>
<ref name="pciaddress"/>
<element name="address">
<ref name="pciaddress"/>
</element>
</choice>
</element>
</group>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
<define name="usbproduct">
@ -1098,22 +1220,35 @@
</element>
</define>
<define name="pciaddress">
<element name="address">
<optional>
<attribute name="domain">
<ref name="pciDomain"/>
</attribute>
</optional>
<optional>
<attribute name="domain">
<ref name="pciDomain"/>
</attribute>
</optional>
<attribute name="bus">
<ref name="pciBus"/>
</attribute>
<attribute name="slot">
<ref name="pciSlot"/>
</attribute>
<attribute name="function">
<ref name="pciFunc"/>
</attribute>
</define>
<define name="driveaddress">
<optional>
<attribute name="controller">
<ref name="driveController"/>
</attribute>
</optional>
<optional>
<attribute name="bus">
<ref name="pciBus"/>
<ref name="driveBus"/>
</attribute>
<attribute name="slot">
<ref name="pciSlot"/>
</attribute>
<attribute name="function">
<ref name="pciFunc"/>
</attribute>
</element>
</optional>
<attribute name="unit">
<ref name="driveUnit"/>
</attribute>
</define>
<!--
Devices attached to a domain.
@ -1127,6 +1262,7 @@
<zeroOrMore>
<choice>
<ref name="disk"/>
<ref name="controller"/>
<ref name="filesystem"/>
<ref name="interface"/>
<ref name="input"/>
@ -1137,8 +1273,12 @@
<ref name="console"/>
<ref name="parallel"/>
<ref name="serial"/>
<ref name="channel"/>
</choice>
</zeroOrMore>
<optional>
<ref name="watchdog"/>
</optional>
</interleave>
</element>
</define>
@ -1168,6 +1308,79 @@
</element>
</optional>
</define>
<!--
CPU specification
-->
<define name="cpu">
<element name="cpu">
<optional>
<attribute name="match">
<choice>
<value>minimum</value>
<value>exact</value>
<value>strict</value>
</choice>
</attribute>
</optional>
<interleave>
<optional>
<element name="model">
<text/>
</element>
</optional>
<optional>
<element name="topology">
<attribute name="sockets">
<ref name="positiveInteger"/>
</attribute>
<attribute name="cores">
<ref name="positiveInteger"/>
</attribute>
<attribute name="threads">
<ref name="positiveInteger"/>
</attribute>
</element>
</optional>
<zeroOrMore>
<element name="feature">
<attribute name="policy">
<choice>
<value>force</value>
<value>require</value>
<value>optional</value>
<value>disable</value>
<value>forbid</value>
</choice>
</attribute>
<attribute name="name">
<ref name="featureName"/>
</attribute>
<empty/>
</element>
</zeroOrMore>
</interleave>
</element>
</define>
<define name="address">
<element name="address">
<choice>
<group>
<attribute name="type">
<value>pci</value>
</attribute>
<ref name="pciaddress"/>
</group>
<group>
<attribute name="type">
<value>drive</value>
</attribute>
<ref name="driveaddress"/>
</group>
</choice>
</element>
</define>
<!--
Type library
@ -1181,6 +1394,11 @@
<param name="pattern">[0-9]+</param>
</data>
</define>
<define name='positiveInteger'>
<data type='positiveInteger'>
<param name="pattern">[0-9]+</param>
</data>
</define>
<define name="countCPU">
<data type="unsignedShort">
<param name="pattern">[0-9]+</param>
@ -1288,4 +1506,24 @@
<param name="pattern">(0x)?[0-7]</param>
</data>
</define>
<define name="driveController">
<data type="string">
<param name="pattern">[0-9]{1,2}</param>
</data>
</define>
<define name="driveBus">
<data type="string">
<param name="pattern">[0-9]{1,2}</param>
</data>
</define>
<define name="driveUnit">
<data type="string">
<param name="pattern">[0-9]{1,2}</param>
</data>
</define>
<define name="featureName">
<data type="string">
<param name='pattern'>[a-zA-Z0-9\-_]+</param>
</data>
</define>
</grammar>

View File

@ -1,7 +1,13 @@
<!-- A Relax NG schema for network interfaces -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:v="http://netcf.org/xml/version/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<!-- Versions for this schema are simple integers that are incremented
everytime a changed (but backwards compatible) version
is released. The current version is indicated with the v:serial
attribute on the start element.
-->
<start v:serial="4">
<choice>
<ref name="ethernet-interface"/>
<ref name="bridge-interface"/>
@ -109,12 +115,17 @@
<ref name="on-or-off"/>
</attribute>
</optional>
<oneOrMore>
<!-- Bridge forward delay (see 'brctl setfd') -->
<optional v:since="2">
<attribute name="delay"><ref name="timeval"/></attribute>
</optional>
<zeroOrMore>
<choice>
<ref name="bare-ethernet-interface"/>
<ref name="bare-vlan-interface"/>
<ref v:since="2" name="bare-bond-interface"/>
</choice>
</oneOrMore>
</zeroOrMore>
</element>
</element>
</define>
@ -125,90 +136,105 @@
<!--
Bonds
-->
<define name="bond-interface-common">
<attribute name="type">
<value>bond</value>
</attribute>
<ref name="name-attr"/>
</define>
<define name="bond-element">
<element name="bond">
<optional>
<attribute name="mode">
<choice>
<value>balance-rr</value>
<!-- The primary interface is the first interface child
of the bond element -->
<value>active-backup</value>
<value>balance-xor</value>
<value>broadcast</value>
<value>802.3ad</value>
<value>balance-tlb</value>
<value>balance-alb</value>
</choice>
</attribute>
</optional>
<!-- FIXME: add more attributes
mode == 802.3ad
ad_select
lacp_rate
xmit_hash_policy
mode == active-backup
fail_over_mac
num_grat_arp when mode == active-backup (since 3.3.0)
num_unsol_na when mode == active-backup (ipv6, since 3.4.0)
mode == balance-xor
xmit_hash_policy (since 2.6.3/3.2.2)
-->
<choice>
<element name="miimon">
<!-- miimon frequency in ms -->
<attribute name="freq"><ref name="uint"/></attribute>
<optional>
<attribute name="downdelay"><ref name="uint"/></attribute>
</optional>
<optional>
<attribute name="updelay"><ref name="uint"/></attribute>
</optional>
<optional>
<!-- use_carrier -->
<attribute name="carrier">
<choice>
<!-- use MII/ETHTOOL ioctl -->
<value>ioctl</value>
<!-- use netif_carrier_ok() -->
<value>netif</value>
</choice>
</attribute>
</optional>
</element>
<element name="arpmon">
<attribute name="interval"><ref name="uint"/></attribute>
<attribute name="target"><ref name="ipv4-addr"/></attribute>
<optional>
<attribute name="validate">
<choice>
<value>none</value>
<value>active</value>
<value>backup</value>
<value>all</value>
</choice>
</attribute>
</optional>
</element>
</choice>
<oneOrMore>
<!-- The slave interfaces -->
<ref name="bare-ethernet-interface"/>
</oneOrMore>
</element>
</define>
<define name="bare-bond-interface">
<element name="interface">
<ref name="bond-interface-common"/>
<ref name="bond-element"/>
</element>
</define>
<define name="bond-interface">
<element name="interface">
<attribute name="type">
<value>bond</value>
</attribute>
<ref name="name-attr"/>
<ref name="bond-interface-common"/>
<ref name="startmode"/>
<ref name="mtu"/>
<ref name="interface-addressing"/>
<element name="bond">
<optional>
<attribute name="mode">
<choice>
<value>balance-rr</value>
<!-- The primary interface is the first interface child
of the bond element -->
<value>active-backup</value>
<value>balance-xor</value>
<value>broadcast</value>
<value>802.3ad</value>
<value>balance-tlb</value>
<value>balance-alb</value>
</choice>
</attribute>
</optional>
<!-- FIXME: add more attributes
mode == 802.3ad
ad_select
lacp_rate
xmit_hash_policy
mode == active-backup
fail_over_mac
num_grat_arp when mode == active-backup (since 3.3.0)
num_unsol_na when mode == active-backup (ipv6, since 3.4.0)
mode == balance-xor
xmit_hash_policy (since 2.6.3/3.2.2)
-->
<choice>
<element name="miimon">
<!-- miimon frequency in ms -->
<attribute name="freq"><ref name="uint"/></attribute>
<optional>
<attribute name="downdelay"><ref name="uint"/></attribute>
</optional>
<optional>
<attribute name="updelay"><ref name="uint"/></attribute>
</optional>
<optional>
<!-- use_carrier -->
<attribute name="carrier">
<choice>
<!-- use MII/ETHTOOL ioctl -->
<value>ioctl</value>
<!-- use netif_carrier_ok() -->
<value>netif</value>
</choice>
</attribute>
</optional>
</element>
<element name="arpmon">
<attribute name="interval"><ref name="uint"/></attribute>
<attribute name="target"><ref name="ipv4-addr"/></attribute>
<optional>
<attribute name="validate">
<choice>
<value>none</value>
<value>active</value>
<value>backup</value>
<value>all</value>
</choice>
</attribute>
</optional>
</element>
</choice>
<oneOrMore>
<!-- The slave interfaces -->
<ref name="bare-ethernet-interface"/>
</oneOrMore>
</element>
<ref name="bond-element"/>
</element>
</define>
@ -245,47 +271,87 @@
different protocols
-->
<define name="interface-addressing">
<optional>
<element name="protocol">
<ref name="protocol-ipv4"/>
</element>
</optional>
</define>
<define name="protocol-ipv4">
<attribute name="family">
<value>ipv4</value>
</attribute>
<choice>
<element name="dhcp">
<optional>
<attribute name="peerdns">
<ref name="yes-or-no"/>
</attribute>
</optional>
</element>
<!-- FIXME: This format should be good enough for IPv4 and IPv6, i.e.
ipaddr="192.168.0.5/24"
ipaddr="2001:DB8:ABCD::1/64"
but will cause some backend pain
-->
<group>
<element name="ip">
<attribute name="address"><ref name="ipv4-addr"/></attribute>
<optional>
<attribute name="prefix"><ref name="ipv4-prefix"/></attribute>
</optional>
</element>
<optional>
<element name="route">
<attribute name="gateway"><ref name="ipv4-addr"/></attribute>
</element>
<ref name="protocol-ipv4"/>
</optional>
<optional v:since="3">
<ref name="protocol-ipv6"/>
</optional>
</group>
<group>
<optional v:since="3">
<ref name="protocol-ipv6"/>
</optional>
<optional>
<ref name="protocol-ipv4"/>
</optional>
</group>
</choice>
</define>
<define name="protocol-ipv4">
<element name="protocol">
<attribute name="family">
<value>ipv4</value>
</attribute>
<choice>
<ref name="dhcp-element"/>
<group>
<element name="ip">
<attribute name="address"><ref name="ipv4-addr"/></attribute>
<optional>
<attribute name="prefix"><ref name="ipv4-prefix"/></attribute>
</optional>
</element>
<optional>
<element name="route">
<attribute name="gateway"><ref name="ipv4-addr"/></attribute>
</element>
</optional>
</group>
</choice>
</element>
</define>
<define name="protocol-ipv6">
<element name="protocol">
<attribute name="family">
<value>ipv6</value>
</attribute>
<optional>
<element name="autoconf"><empty/></element>
</optional>
<optional>
<ref name="dhcp-element"/>
</optional>
<zeroOrMore>
<element name="ip">
<attribute name="address"><ref name="ipv6-addr"/></attribute>
<optional>
<attribute name="prefix"><ref name="ipv6-prefix"/></attribute>
</optional>
</element>
</zeroOrMore>
<optional>
<element name="route">
<attribute name="gateway"><ref name="ipv6-addr"/></attribute>
</element>
</optional>
</element>
</define>
<define name="dhcp-element">
<element name="dhcp">
<optional>
<attribute name="peerdns">
<ref name="yes-or-no"/>
</attribute>
</optional>
</element>
</define>
<!-- Jim Fehlig (<jfehlig@novell.com>) suggest the
following additions to DHCP:
@ -342,6 +408,12 @@
</data>
</define>
<define name="timeval">
<data type="double">
<param name="minInclusive">0</param>
</data>
</define>
<define name='device-name'>
<data type='string'>
<param name="pattern">[a-zA-Z0-9_\.\-:/]+</param>
@ -367,13 +439,27 @@
<define name='ipv4-addr'>
<data type='string'>
<param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param>
<param name="pattern">(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))\.){3}((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))</param>
</data>
</define>
<define name='ipv4-prefix'>
<data type='unsignedInt'>
<param name="maxInclusive">32</param>
</data>
</define>
<!-- Based on http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 -->
<define name='ipv6-addr'>
<data type='string'>
<param name="pattern">[1-9]|[12][0-9]|3[0-2]</param>
<!-- To understand this better, take apart the toplevel '|'s -->
<param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(([0-9A-Fa-f]{1,4}:){0,5}:((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|(::([0-9A-Fa-f]{1,4}:){0,5}((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)</param>
</data>
</define>
<define name='ipv6-prefix'>
<data type='unsignedInt'>
<param name="maxInclusive">128</param>
</data>
</define>

View File

@ -2,19 +2,29 @@
<element name="network" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<interleave>
<!-- The name of the network, used to refer to it through the API
and in virsh -->
<element name="name"><text/></element>
<element name="name">
<text/>
</element>
<!-- <uuid> element -->
<optional>
<element name="uuid"><text/></element>
</optional>
<!-- <bridge> element -->
<optional>
<!-- The name of the network to be set up; this will back
the network on the host -->
<element name="bridge">
<optional>
<attribute name="name"><text/></attribute>
<attribute name="name">
<text/>
</attribute>
</optional>
<optional>
<attribute name="stp">
<choice>
@ -23,31 +33,46 @@
</choice>
</attribute>
</optional>
<optional>
<attribute name="delay"><data type="integer"/></attribute>
<attribute name="delay">
<data type="integer"/>
</attribute>
</optional>
</element>
</optional>
<!-- <forward> element -->
<optional>
<!-- The device through which the bridge is connected to the
rest of the network -->
<element name="forward">
<optional><attribute name="dev"><text/></attribute></optional>
<optional>
<attribute name="dev">
<text/>
</attribute>
</optional>
<optional>
<attribute name="mode">
<choice>
<value>nat</value>
<value>routed</value>
<value>route</value>
</choice>
</attribute>
</optional>
</element>
</optional>
<!-- <domain> element -->
<optional>
<element name="domain">
<attribute name="name"><text/></attribute>
</element>
</optional>
<!-- <ip> element -->
<optional>
<!-- The IP element sets up NAT'ing and an optional DHCP server
local to the host. -->
@ -84,6 +109,9 @@
<optional>
<element name="bootp">
<attribute name="file"><text/></attribute>
<optional>
<attribute name="server"><text/></attribute>
</optional>
</element>
</optional>
</element>

View File

@ -314,6 +314,11 @@
<element name='media_size'>
<ref name='uint'/>
</element>
<optional>
<element name='media_label'>
<text/>
</element>
</optional>
</element>
</define>

View File

@ -36,7 +36,7 @@
<optional>
<element name='usage'>
<choice>
<ref name='usagevolume'>
<ref name='usagevolume'/>
<!-- More choices later -->
</choice>
</element>

View File

@ -188,6 +188,15 @@
</element>
</define>
<define name='initiatorinfoiqn'>
<element name='iqn'>
<attribute name='name'>
<text/>
</attribute>
<empty/>
</element>
</define>
<define name='devextents'>
<oneOrMore>
<element name='freeExtent'>
@ -258,6 +267,7 @@
<value>vfat</value>
<value>hfs+</value>
<value>xfs</value>
<value>ocfs2</value>
</choice>
</attribute>
</element>
@ -361,6 +371,9 @@
<element name='source'>
<ref name='sourceinfohost'/>
<ref name='sourceinfodev'/>
<optional>
<ref name='initiatorinfoiqn'/>
</optional>
<optional>
<ref name='sourceinfoauth'/>
</optional>

View File

@ -9,9 +9,9 @@
<xsl:output
method="xml"
encoding="ISO-8859-1"
encoding="UTF-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0//EN"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xsl:variable name="href_base" select="''"/>

View File

@ -134,7 +134,7 @@
</li>
<li>
<a href="drvtest.html">Test</a>
<span>Psuedo-driver simulating APIs in memory for test suites</span>
<span>Pseudo-driver simulating APIs in memory for test suites</span>
</li>
<li>
<a href="drvremote.html">Remote</a>
@ -160,6 +160,10 @@
<a href="drvone.html">OpenNebula</a>
<span>Driver for OpenNebula</span>
</li>
<li>
<a href="drvesx.html">VMware ESX</a>
<span>Driver for VMware ESX</span>
</li>
</ul>
</li>
<li>
@ -202,10 +206,10 @@
<a href="html/libvirt-virterror.html">virterror</a>
<span>error handling interfaces for the libvirt library</span>
</li>
<li>
<a href="hvsupport.html">Driver support</a>
<span>matrix of API support per hypervisor per release</span>
</li>
<li>
<a href="hvsupport.html">Driver support</a>
<span>matrix of API support per hypervisor per release</span>
</li>
</ul>
</li>
<li>
@ -226,10 +230,10 @@
<a href="internals.html">Internals</a>
<span>Working on the internals of libvirt API, driver and daemon code</span>
<ul>
<li>
<a href="hacking.html">Contributor guidelines</a>
<span>General hacking guidelines for contributors</span>
</li>
<li>
<a href="hacking.html">Contributor guidelines</a>
<span>General hacking guidelines for contributors</span>
</li>
<li>
<a href="api_extension.html">API extensions</a>
<span>Adding new public libvirt APIs</span>

View File

@ -45,8 +45,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/var/lib/virt/images&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
@ -101,8 +100,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/var/lib/virt/images&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
@ -172,8 +170,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/var/lib/virt/images&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
@ -215,8 +212,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/dev/HostVG&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
@ -248,8 +244,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/dev&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
@ -338,8 +333,7 @@ libvirt.
&lt;target&gt;
&lt;path&gt;/dev/disk/by-path&lt;/path&gt;
&lt;/target&gt;
&lt;/pool&gt;
</pre>
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>

View File

@ -0,0 +1,5 @@
EXTRA_DIST= \
TEMPLATE \
libvirt-qemu \
usr.lib.libvirt.virt-aa-helper \
usr.sbin.libvirtd

View File

@ -1,4 +1,4 @@
# Last Modified: Wed Jul 8 09:57:41 2009
# Last Modified: Fri Nov 6 16:41:59 2009
#include <abstractions/base>
#include <abstractions/consoles>
@ -24,6 +24,31 @@
#/sys/devices/*/*/usb[0-9]*/** r,
#/dev/bus/usb/*/[0-9]* rw,
# WARNING: this gives the guest direct access to host hardware and specific
# portions of shared memory. This is required for sound using ALSA with kvm,
# but may constitute a security risk. If your environment does not require
# the use of sound in your VMs, feel free to comment out or prepend 'deny' to
# the rules for files in /dev.
/dev/shm/ r,
/dev/shm/pulse-shm* r,
/dev/shm/pulse-shm* rwk,
/dev/snd/* rw,
capability ipc_lock,
# 'kill' is not required for sound and is a security risk. Do not enable
# unless you absolutely need it.
deny capability kill,
/etc/pulse/client.conf r,
@{HOME}/.pulse-cookie rwk,
owner /root/.pulse-cookie rwk,
owner /root/.pulse/ rw,
owner /root/.pulse/* rw,
/usr/share/alsa/** r,
owner /tmp/pulse-*/ rw,
owner /tmp/pulse-*/* rw,
/var/lib/dbus/machine-id r,
# access to firmware's etc
/usr/share/kvm/** r,
/usr/share/qemu/** r,
/usr/share/bochs/** r,
@ -69,3 +94,16 @@
/usr/bin/qemu-sparc32plus rmix,
/usr/bin/qemu-sparc64 rmix,
/usr/bin/qemu-x86_64 rmix,
# for save and resume
/bin/dash rmix,
/bin/dd rmix,
/bin/cat rmix,
# The svirt driver does not relabel the state file
# (https://bugzilla.redhat.com/show_bug.cgi?id=529363) resulting in denied
# messages. Uncommenting these lines can work around this somewhat by
# allowing users to save state files in the specified directory. We use
# 'owner' to make sure we don't overwrite the user's files.
#owner @{HOME}/libvirt-state-files/ r,
#owner @{HOME}/libvirt-state-files/** rw,

View File

@ -23,6 +23,9 @@
capability mknod,
network inet stream,
network inet dgram,
network inet6 stream,
network inet6 dgram,
# Very lenient profile for libvirtd since we want to first focus on confining
# the guests. Guests will have a very restricted profile.
@ -32,6 +35,7 @@
/sbin/* Ux,
/usr/bin/* Ux,
/usr/sbin/* Ux,
/usr/lib/libvirt/* Ux,
# force the use of virt-aa-helper
audit deny /sbin/apparmor_parser rwxl,

View File

@ -14,7 +14,7 @@
__func__, __LINE__)
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__func__, __LINE__, __VA_ARGS__)
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#define STREQ(a,b) (strcmp(a,b) == 0)
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((__unused__))
@ -335,9 +335,10 @@ int main(int argc, char **argv)
sts = poll(&pfd, 1, TIMEOUT_MS);
/* We are assuming timeout of 0 here - so execute every time */
if(t_cb && t_active)
/* if t_timeout < 0 then t_cb must not be called */
if (t_cb && t_active && t_timeout >= 0) {
t_cb(t_timeout,t_opaque);
}
if (sts == 0) {
/* DEBUG0("Poll timeout"); */

View File

@ -1,6 +1,6 @@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la $(COVERAGE_LDFLAGS)
LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la $(COVERAGE_LDFLAGS)
noinst_PROGRAMS=info1

View File

@ -1,6 +1,6 @@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la $(COVERAGE_LDFLAGS)
LDADDS = $(STATIC_BINARIES) $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la $(COVERAGE_LDFLAGS)
noinst_PROGRAMS=suspend

View File

@ -1,3 +1,3 @@
EXTRA_DIST= \
README \
dominfo.py domrestore.py domsave.py domstart.py
dominfo.py domrestore.py domsave.py domstart.py esxlist.py

View File

@ -8,7 +8,26 @@ domstart.py - create a domU from an XML description if the domU isn't
running yet
domsave.py - save all running domU's into a directory
domrestore.py - restore domU's from their saved files in a directory
esxlist.py - list active domains of an VMware ESX host and print some info.
also demonstrates how to use the libvirt.openAuth() method
The XML files in this directory are examples of the XML format that libvirt
expects, and will have to be adapted for your setup. They are only needed
for domstart.py
Some additional notes for the esxlist.py example:
You may see remote errors complaining about missing certificates:
Cannot access CA certificate '/usr/local/etc/pki/CA/cacert.pem': No such file
or directory
This is expected, libvirt tries to find network and storage drivers for ESX,
but those are not implemented yet (November 2009). While searching for this
drivers, libvirt may try to start a local libvirtd instance, but fails because
of the missing certificates. It'll warn about that:
Failed to find the network: Is the daemon running?
This is also expected and can be ignored.

155
examples/python/esxlist.py Executable file
View File

@ -0,0 +1,155 @@
#! /usr/bin/python
# esxlist - list active domains of an ESX host and print some info.
# also demonstrates how to use the libvirt.openAuth() method
import libvirt
import sys
import os
import libxml2
import getpass
def usage():
print "Usage: %s HOSTNAME" % sys.argv[0]
print " List active domains of HOSTNAME and print some info"
# This is the callback method passed to libvirt.openAuth() (see below).
#
# The credentials argument is a list of credentials that libvirt (actually
# the ESX driver) would like to request. An element of this list is itself a
# list containing 5 items (4 inputs, 1 output):
# - the credential type, e.g. libvirt.VIR_CRED_AUTHNAME
# - a prompt to be displayed to the user
# - a challenge, the ESX driver sets this to the hostname to allow automatic
# distinction between requests for ESX and vCenter credentials
# - a default result for the request
# - a place to store the actual result for the request
#
# The user_data argument is the user data item of the auth argument (see below)
# passed to libvirt.openAuth().
def request_credentials(credentials, user_data):
for credential in credentials:
if credential[0] == libvirt.VIR_CRED_AUTHNAME:
# prompt the user to input a authname. display the provided message
credential[4] = raw_input(credential[1] + ": ")
# if the user just hits enter raw_input() returns an empty string.
# in this case return the default result through the last item of
# the list
if len(credential[4]) == 0:
credential[4] = credential[3]
elif credential[0] == libvirt.VIR_CRED_NOECHOPROMPT:
# use the getpass module to prompt the user to input a password.
# display the provided message and return the result through the
# last item of the list
credential[4] = getpass.getpass(credential[1] + ": ")
else:
return -1
return 0
def print_section(title):
print "\n%s" % title
print "=" * 60
def print_entry(key, value):
print "%-10s %-10s" % (key, value)
def print_xml(key, ctx, path):
res = ctx.xpathEval(path)
if res is None or len(res) == 0:
value = "Unknown"
else:
value = res[0].content
print_entry(key, value)
return value
if len(sys.argv) != 2:
usage()
sys.exit(2)
hostname = sys.argv[1]
# Connect to libvirt
uri = "esx://%s/?no_verify=1" % hostname
# The auth argument is a list that contains 3 items:
# - a list of supported credential types
# - a callable that takes 2 arguments
# - user data that will be passed to the callable as second argument
#
# In this example the supported credential types are VIR_CRED_AUTHNAME and
# VIR_CRED_NOECHOPROMPT, the callable is the unbound method request_credentials
# (see above) and the user data is None.
#
# libvirt (actually the ESX driver) will call the callable to request
# credentials in order to log into the ESX host. The callable would also be
# called if the connection URI would reference a vCenter to request credentials
# in order to log into the vCenter
auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_NOECHOPROMPT],
request_credentials, None]
conn = libvirt.openAuth(uri, auth, 0)
if conn is None:
print "Failed to open connection to %s" % hostname
sys.exit(1)
state_names = { libvirt.VIR_DOMAIN_RUNNING : "running",
libvirt.VIR_DOMAIN_BLOCKED : "idle",
libvirt.VIR_DOMAIN_PAUSED : "paused",
libvirt.VIR_DOMAIN_SHUTDOWN : "in shutdown",
libvirt.VIR_DOMAIN_SHUTOFF : "shut off",
libvirt.VIR_DOMAIN_CRASHED : "crashed",
libvirt.VIR_DOMAIN_NOSTATE : "no state" }
for id in conn.listDomainsID():
domain = conn.lookupByID(id)
info = domain.info()
print_section("Domain " + domain.name())
print_entry("ID:", id)
print_entry("UUID:", domain.UUIDString())
print_entry("State:", state_names[info[0]])
print_entry("MaxMem:", info[1])
print_entry("UsedMem:", info[2])
print_entry("VCPUs:", info[3])
# Read some info from the XML desc
print_section("Devices of " + domain.name())
xmldesc = domain.XMLDesc(0)
doc = libxml2.parseDoc(xmldesc)
ctx = doc.xpathNewContext()
devs = ctx.xpathEval("/domain/devices/*")
first = True
for d in devs:
ctx.setContextNode(d)
if not first:
print "------------------------------------------------------------"
else:
first = False
print_entry("Device", d.name)
type = print_xml("Type:", ctx, "@type")
if type == "file":
print_xml("Source:", ctx, "source/@file")
print_xml("Target:", ctx, "target/@dev")
elif type == "block":
print_xml("Source:", ctx, "source/@dev")
print_xml("Target:", ctx, "target/@dev")
elif type == "bridge":
print_xml("Source:", ctx, "source/@bridge")
print_xml("MAC Addr:", ctx, "mac/@address")

View File

@ -333,12 +333,70 @@ struct _virDomainInterfaceStats {
*/
typedef virDomainInterfaceStatsStruct *virDomainInterfaceStatsPtr;
/**
* Memory Statistics Tags:
*/
typedef enum {
/* The total amount of data read from swap space (in kB). */
VIR_DOMAIN_MEMORY_STAT_SWAP_IN = 0,
/* The total amount of memory written out to swap space (in kB). */
VIR_DOMAIN_MEMORY_STAT_SWAP_OUT = 1,
/*
* Page faults occur when a process makes a valid access to virtual memory
* that is not available. When servicing the page fault, if disk IO is
* required, it is considered a major fault. If not, it is a minor fault.
* These are expressed as the number of faults that have occurred.
*/
VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT = 2,
VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT = 3,
/*
* The amount of memory left completely unused by the system. Memory that
* is available but used for reclaimable caches should NOT be reported as
* free. This value is expressed in kB.
*/
VIR_DOMAIN_MEMORY_STAT_UNUSED = 4,
/*
* The total amount of usable memory as seen by the domain. This value
* may be less than the amount of memory assigned to the domain if a
* balloon driver is in use or if the guest OS does not initialize all
* assigned pages. This value is expressed in kB.
*/
VIR_DOMAIN_MEMORY_STAT_AVAILABLE = 5,
/*
* The number of statistics supported by this version of the interface.
* To add new statistics, add them to the enum and increase this value.
*/
VIR_DOMAIN_MEMORY_STAT_NR = 6,
} virDomainMemoryStatTags;
typedef struct _virDomainMemoryStat virDomainMemoryStatStruct;
struct _virDomainMemoryStat {
int tag;
unsigned long long val;
};
typedef virDomainMemoryStatStruct *virDomainMemoryStatPtr;
/* Domain core dump flags. */
typedef enum {
VIR_DUMP_CRASH = (1 << 0), /* crash after dump */
VIR_DUMP_LIVE = (1 << 1), /* live dump */
} virDomainCoreDumpFlags;
/* Domain migration flags. */
typedef enum {
VIR_MIGRATE_LIVE = (1 << 0), /* live migration */
VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host control channel */
VIR_MIGRATE_TUNNELLED = (1 << 2), /* tunnel migration data over libvirtd connection */
VIR_MIGRATE_PERSIST_DEST = (1 << 3), /* persist the VM on the destination */
VIR_MIGRATE_UNDEFINE_SOURCE = (1 << 4), /* undefine the VM on the source */
VIR_MIGRATE_PAUSED = (1 << 5), /* pause on remote side */
} virDomainMigrateFlags;
/* Domain migration. */
@ -487,6 +545,8 @@ int virConnectClose (virConnectPtr conn);
const char * virConnectGetType (virConnectPtr conn);
int virConnectGetVersion (virConnectPtr conn,
unsigned long *hvVer);
int virConnectGetLibVersion (virConnectPtr conn,
unsigned long *libVer);
char * virConnectGetHostname (virConnectPtr conn);
char * virConnectGetURI (virConnectPtr conn);
@ -633,6 +693,10 @@ int virDomainInterfaceStats (virDomainPtr dom,
const char *path,
virDomainInterfaceStatsPtr stats,
size_t size);
int virDomainMemoryStats (virDomainPtr dom,
virDomainMemoryStatPtr stats,
unsigned int nr_stats,
unsigned int flags);
int virDomainBlockPeek (virDomainPtr dom,
const char *path,
unsigned long long offset,
@ -928,6 +992,10 @@ virInterfacePtr virInterfaceLookupByMACString (virConnectPtr conn,
const char* virInterfaceGetName (virInterfacePtr iface);
const char* virInterfaceGetMACString (virInterfacePtr iface);
typedef enum {
VIR_INTERFACE_XML_INACTIVE = 1 /* dump inactive interface information */
} virInterfaceXMLFlags;
char * virInterfaceGetXMLDesc (virInterfacePtr iface,
unsigned int flags);
virInterfacePtr virInterfaceDefineXML (virConnectPtr conn,
@ -1647,6 +1715,47 @@ int virStreamAbort(virStreamPtr st);
int virStreamFree(virStreamPtr st);
int virDomainIsActive(virDomainPtr dom);
int virDomainIsPersistent(virDomainPtr dom);
int virNetworkIsActive(virNetworkPtr net);
int virNetworkIsPersistent(virNetworkPtr net);
int virStoragePoolIsActive(virStoragePoolPtr pool);
int virStoragePoolIsPersistent(virStoragePoolPtr pool);
int virInterfaceIsActive(virInterfacePtr iface);
int virConnectIsEncrypted(virConnectPtr conn);
int virConnectIsSecure(virConnectPtr conn);
/*
* CPU specification API
*/
typedef enum {
VIR_CPU_COMPARE_ERROR = -1,
VIR_CPU_COMPARE_INCOMPATIBLE = 0,
VIR_CPU_COMPARE_IDENTICAL = 1,
VIR_CPU_COMPARE_SUPERSET = 2
} virCPUCompareResult;
/**
* virConnectCompareCPU:
*
* @conn: virConnect connection
* @xmlDesc: XML description of either guest or host cpu with <cpu> root tag
* @flags: comparison flags
*
* Compares given CPU with host cpu.
*
* Returns virCPUCompareResult.
*/
int virConnectCompareCPU(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
#ifdef __cplusplus
}
#endif

View File

@ -68,6 +68,7 @@ typedef enum {
VIR_FROM_ESX, /* Error from ESX driver */
VIR_FROM_PHYP, /* Error from IBM power hypervisor */
VIR_FROM_SECRET, /* Error from secret storage */
VIR_FROM_CPU, /* Error from CPU driver */
} virErrorDomain;
@ -170,6 +171,10 @@ typedef enum {
VIR_WAR_NO_SECRET, /* failed to start secret storage */
VIR_ERR_INVALID_SECRET, /* invalid secret */
VIR_ERR_NO_SECRET, /* secret not found */
VIR_ERR_CONFIG_UNSUPPORTED, /* unsupported configuration construct */
VIR_ERR_OPERATION_TIMEOUT, /* timeout occurred during operation */
VIR_ERR_MIGRATE_PERSIST_FAILED, /* a migration worked, but making the
VM persist on the dest host failed */
} virErrorNumber;
/**

View File

@ -53,12 +53,14 @@
%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}}
%define with_numactl 0%{!?_without_numactl:%{server_drivers}}
%define with_selinux 0%{!?_without_selinux:%{server_drivers}}
%define with_hal 0%{!?_without_hal:%{server_drivers}}
# A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_capng 0%{!?_without_capng:0}
%define with_netcf 0%{!?_without_netcf:0}
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
%define with_yajl 0%{!?_without_yajl:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@ -72,6 +74,10 @@
%define with_xen 0
%endif
# Numactl is not available on s390[x]
%ifarch s390 s390x
%define with_numactl 0
%endif
# RHEL doesn't ship OpenVZ, VBox, UML, OpenNebula, PowerHypervisor or ESX
%if 0%{?rhel}
@ -129,6 +135,18 @@
%define with_netcf 0%{!?_without_netcf:%{server_drivers}}
%endif
# udev is used to manage host devices in Fedora 12 / RHEL-6 or newer
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
%define with_udev 0%{!?_without_udev:%{server_drivers}}
%else
%define with_hal 0%{!?_without_hal:%{server_drivers}}
%endif
# Enable yajl library for JSON mode with QEMU
%if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
%define with_yajl 0%{!?_without_yajl:%{server_drivers}}
%endif
# Force QEMU to run as non-root
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
%define qemu_user qemu
@ -175,6 +193,9 @@ Requires: iptables
%if %{with_hal}
Requires: hal
%endif
%if %{with_udev}
Requires: udev >= 145
%endif
%if %{with_polkit}
%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
Requires: polkit >= 0.93
@ -238,6 +259,13 @@ BuildRequires: gnutls-devel
%if %{with_hal}
BuildRequires: hal-devel
%endif
%if %{with_udev}
BuildRequires: libudev-devel >= 145
BuildRequires: libpciaccess-devel >= 0.10.9
%endif
%if %{with_yajl}
BuildRequires: yajl-devel
%endif
%if %{with_avahi}
BuildRequires: avahi-devel
%endif
@ -308,7 +336,7 @@ BuildRequires: libcap-ng-devel >= 0.5.0
BuildRequires: libssh2-devel
%endif
%if %{with_netcf}
BuildRequires: netcf-devel
BuildRequires: netcf-devel >= 0.1.4
%endif
# Fedora build root suckage
@ -341,7 +369,7 @@ virtualization capabilities of recent versions of Linux (and other OSes).
%package devel
Summary: Libraries, includes, etc. to compile with the libvirt library
Group: Development/Libraries
Requires: libvirt = %{version}-%{release}
Requires: libvirt-client = %{version}-%{release}
Requires: pkgconfig
%if %{with_xen}
Requires: xen-devel
@ -472,6 +500,14 @@ of recent versions of Linux (and other OSes).
%define _without_hal --without-hal
%endif
%if ! %{with_udev}
%define _without_udev --without-udev
%endif
%if ! %{with_yajl}
%define _without_yajl --without-yajl
%endif
%configure %{?_without_xen} \
%{?_without_qemu} \
%{?_without_openvz} \
@ -498,6 +534,8 @@ of recent versions of Linux (and other OSes).
%{?_without_netcf} \
%{?_without_selinux} \
%{?_without_hal} \
%{?_without_udev} \
%{?_without_yajl} \
--with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \
--with-init-script=redhat \
@ -672,9 +710,6 @@ fi
%if %{with_network}
%dir %{_localstatedir}/run/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/filter/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/nat/
%endif
%if %{with_qemu}
@ -739,6 +774,8 @@ fi
%{_datadir}/libvirt/schemas/secret.rng
%{_datadir}/libvirt/schemas/storageencryption.rng
%{_datadir}/libvirt/cpu_map.xml
%if %{with_sasl}
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
%endif
@ -778,6 +815,23 @@ fi
%endif
%changelog
* Wed Feb 3 2010 Daniel Veillard <veillard@redhat.com> - 0.7.6-1
* Wed Dec 23 2009 Daniel Veillard <veillard@redhat.com> - 0.7.5-1
- Add new API virDomainMemoryStats
- Public API and domain extension for CPU flags
- vbox: Add support for version 3.1
- Support QEMU's virtual FAT block device driver
- a lot of fixes
* Fri Nov 20 2009 Daniel Veillard <veillard@redhat.com> - 0.7.3-1
- udev node device backend
- API to check object properties
- better QEmu monitor processing
- MAC address based port filtering for qemu
- support IPv6 and multiple addresses per interfaces
- a lot of fixes
* Tue Sep 15 2009 Daniel Veillard <veillard@redhat.com> - 0.7.1-1
- ESX, VBox driver updates
- mutipath support

View File

@ -2,13 +2,18 @@ daemon/dispatch.c
daemon/libvirtd.c
daemon/remote.c
daemon/stream.c
src/conf/cpu_conf.c
src/conf/domain_conf.c
src/conf/domain_event.c
src/conf/interface_conf.c
src/conf/network_conf.c
src/conf/node_device_conf.c
src/conf/secret_conf.c
src/conf/storage_conf.c
src/conf/storage_encryption_conf.c
src/cpu/cpu.c
src/cpu/cpu_map.c
src/cpu/cpu_x86.c
src/datatypes.c
src/interface/netcf_driver.c
src/libvirt.c
@ -17,16 +22,21 @@ src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
src/network/bridge_driver.c
src/node_device/node_device_driver.c
src/node_device/node_device_hal_linux.c
src/node_device/node_device_linux_sysfs.c
src/node_device/node_device_udev.c
src/nodeinfo.c
src/opennebula/one_conf.c
src/opennebula/one_driver.c
src/openvz/openvz_conf.c
src/openvz/openvz_driver.c
src/phyp/phyp_driver.c
src/qemu/qemu_bridge_filter.c
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c
src/qemu/qemu_security_dac.c
src/remote/remote_driver.c
src/secret/secret_driver.c
src/security/security_driver.c
@ -46,9 +56,11 @@ src/uml/uml_conf.c
src/uml/uml_driver.c
src/util/bridge.c
src/util/conf.c
src/util/iptables.c
src/util/hostusb.c
src/util/json.c
src/util/logging.c
src/util/pci.c
src/util/processinfo.c
src/util/storage_file.c
src/util/util.c
src/util/uuid.c

8155
po/af.po

File diff suppressed because it is too large Load Diff

8155
po/am.po

File diff suppressed because it is too large Load Diff

8155
po/ar.po

File diff suppressed because it is too large Load Diff

9444
po/as.po

File diff suppressed because it is too large Load Diff

8155
po/be.po

File diff suppressed because it is too large Load Diff

8116
po/bg.po

File diff suppressed because it is too large Load Diff

8155
po/bn.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8126
po/bs.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More