]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 years agovirsh: fixed trivial comment and debug message in vshCommandOptVolBy function
Justin Clift [Tue, 8 Jun 2010 14:46:06 +0000 (00:46 +1000)]
virsh: fixed trivial comment and debug message in vshCommandOptVolBy function

14 years agovirsh: remove xen reference in header comment
Justin Clift [Wed, 9 Jun 2010 09:00:30 +0000 (19:00 +1000)]
virsh: remove xen reference in header comment

With libvirt and virsh now being used for much more than Xen, this
patch removes the outdated reference to Xen in the file header.

14 years agoesx: Add proxy query parameter
Matthias Bolte [Thu, 3 Jun 2010 21:09:12 +0000 (23:09 +0200)]
esx: Add proxy query parameter

Allow to specify a proxy to be used by libcurl.

14 years agoesx: Refactor esxUtil_ParseQuery's parameter handling
Matthias Bolte [Thu, 3 Jun 2010 18:04:15 +0000 (20:04 +0200)]
esx: Refactor esxUtil_ParseQuery's parameter handling

Pass a struct containing the parameters instead of passing each
one individually. This make future extensions a bit simpler.

14 years agovirsh: add the volume commands to the virsh man page
Justin Clift [Tue, 8 Jun 2010 15:00:24 +0000 (01:00 +1000)]
virsh: add the volume commands to the virsh man page

This patch also includes the new vol-pool command.

14 years agovirsh: add new vol-pool command
Justin Clift [Tue, 8 Jun 2010 14:06:29 +0000 (00:06 +1000)]
virsh: add new vol-pool command

This patch adds a new "vol-pool" command to virsh, to round out the
identifier conversion functions for volumes in virsh.  Now it is
possible to work with volumes when starting from just a volume key
or volume path.

14 years agovirsh: add --paused option to create
Eric Blake [Tue, 8 Jun 2010 19:43:01 +0000 (13:43 -0600)]
virsh: add --paused option to create

* tools/virsh.c (opts_create): Add --paused option.
(cmdCreate): Pass appropriate flag.
* tools/virsh.pod: Document it.

14 years agoqemu: allow creation of a paused domain
Eric Blake [Tue, 8 Jun 2010 19:02:40 +0000 (13:02 -0600)]
qemu: allow creation of a paused domain

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

Some guests (eg with badly configured grub, or Windows' installation cd)
require quick response from the console user. That's why we have a
"launchPaused" option in vdsm.

To implement it via libvirt, we need to ask libvirt not to call
qemuMonitorStartCPUs() after starting qemu.  Calling virDomainStop
immediately after the domain is up is inherently raceful.

* src/qemu/qemu_driver.c (qemudStartVMDaemon): Add new parameter;
all callers adjusted.
(qemudDomainCreate): Implement support for new flag.

14 years agovirDomainCreateXML: support new flag
Eric Blake [Tue, 25 May 2010 17:13:13 +0000 (11:13 -0600)]
virDomainCreateXML: support new flag

* include/libvirt/libvirt.h.in (virDomainCreateFlags): Add
VIR_DOMAIN_START_PAUSED.
* src/libvirt.c (virDomainCreateXML): Update documentation.
* src/lxc/lxc_driver.c (lxcDomainCreateAndStart): Reject new flag
as unimplemented.
* src/opennebula/one_driver.c (oneDomainCreateAndStart):
Likewise.
* src/openvz/openvz_driver.c (openvzDomainCreateXML): Likewise.
* src/phyp/phyp_driver.c (phypDomainCreateAndStart): Likewise.
* src/qemu/qemu_driver.c (qemudDomainCreate): Likewise.
* src/test/test_driver.c (testDomainCreateXML): Likewise.
* src/uml/uml_driver.c (umlDomainCreate): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Likewise.
* src/xen/xend_internal.c (xenDaemonCreateXML): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDomainCreateXML): Likewise.

14 years agoFix leaks in udev device add/remove v3
David Allan [Sat, 29 May 2010 02:22:05 +0000 (22:22 -0400)]
Fix leaks in udev device add/remove v3

* This patch is a modification of a patch submitted by Nigel Jones.
  It fixes several memory leaks on device addition/removal:

1. Free the virNodeDeviceDefPtr in udevAddOneDevice if the return
   value is non-zero

2. Always release the node device reference after the device has been
   processed.

* Refactored for better readability per the suggestion of clalance

14 years agoAdd multiIQN tests
David Allan [Mon, 7 Jun 2010 20:47:37 +0000 (16:47 -0400)]
Add multiIQN tests

* Fix broken rng schema
* Add test input & output files

14 years agoAdd multiiqn XML dump
David Allan [Mon, 7 Jun 2010 19:06:20 +0000 (15:06 -0400)]
Add multiiqn XML dump

* Use virBufferEscapeString() per Dan B.

14 years agoFix test breakage from virtio serial changes
Daniel P. Berrange [Tue, 8 Jun 2010 15:31:50 +0000 (16:31 +0100)]
Fix test breakage from virtio serial changes

The virtio serial changes broke the test suite because they forgot
to add the new address attribute to the domain XML schema. The
xml2xml test also broke because the XML no longer roundtrips. This
is due to testing of auto-addition of <controller> elements. Split
that test case off into a separate XML file to avoid breakage

* docs/schemas/domain.rng: Allow port number for virtio serial addresses
* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Revert to
  a simple config to avoid breaking xml2xml test
* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.xml,
  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args: Add
  complex test case for auto-controller addition for xml2argv test
* tests/qemuxml2argvtest.c: Add channel-virtio-auto test

14 years agoEnable probing of VPC disk format type
Daniel P. Berrange [Tue, 8 Jun 2010 15:05:36 +0000 (16:05 +0100)]
Enable probing of VPC disk format type

A look at the QEMU source revealed the missing bits of info about
the VPC file format, so we can enable this now

* src/util/storage_file.c: Enable VPC format, providing version
  and disk size offset fields

14 years agoEnsure that PCI device is reattached to host if hotadd fails
Daniel P. Berrange [Fri, 28 May 2010 11:20:24 +0000 (12:20 +0100)]
Ensure that PCI device is reattached to host if hotadd fails

When an attempt to hotplug a PCI device to a guest fails,
the device was left attached to pci-stub. It is neccessary
to reset the device and then attach it to the host driver
again.

* src/qemu/qemu_driver.c: Reattach PCI device to host if
  hotadd fails

14 years agoDon't raise errors in the selinux restore code
Daniel P. Berrange [Fri, 28 May 2010 11:19:13 +0000 (12:19 +0100)]
Don't raise errors in the selinux restore code

The restore code is done in places where errors cannot be
raised, since they will overwrite over pre-existing errors.

* src/security/security_selinux.c: Only warn about failures
  in label restore, don't report errors

14 years agoFix check for errors in device_add command in QEMU text monitor
Daniel P. Berrange [Fri, 28 May 2010 11:18:09 +0000 (12:18 +0100)]
Fix check for errors in device_add command in QEMU text monitor

Any output at all from device_add indicates an error in the
command execution. Thus it needs to check for reply != ""

* src/qemu/qemu_monitor_text.c: Fix reply check for errors
  to treat any output as an error

14 years agoPrefer UDEV to HAL drivers if both a compiled
Daniel P. Berrange [Fri, 28 May 2010 10:16:44 +0000 (11:16 +0100)]
Prefer UDEV to HAL drivers if both a compiled

HAL is deprecated and UDEV is the future. Thus if both
options are compiled, we should prefer use of UDEV over
HAL

* src/node_device/node_device_driver.c: Switch init
  order to try UDEV first, then HAL

14 years agoAdd support for setting socket MLS level in SELinux driver
Daniel J Walsh [Thu, 27 May 2010 15:44:47 +0000 (16:44 +0100)]
Add support for setting socket MLS level in SELinux driver

When SELinux is running in MLS mode, libvirtd will have a
different security level to the VMs. For libvirtd to be
able to connect to the monitor console, the client end of
the UNIX domain socket needs a different label. This adds
infrastructure to set the socket label via the security
driver framework

* src/qemu/qemu_driver.c: Call out to socket label APIs in
  security driver
* src/qemu/qemu_security_stacked.c: Wire up socket label
  drivers
* src/security/security_driver.h: Define security driver
  entry points for socket labelling
* src/security/security_selinux.c: Set socket label based on
  VM label

14 years agoNetwork duplicate UUID/name checking
Daniel P. Berrange [Thu, 27 May 2010 15:44:31 +0000 (16:44 +0100)]
Network duplicate UUID/name checking

The network driver is not doing correct checking for
duplicate UUID/name values. This introduces a new method
virNetworkObjIsDuplicate, based on the previously
written virDomainObjIsDuplicate.

* src/conf/network_conf.c, src/conf/network_conf.c,
  src/libvirt_private.syms: Add virNetworkObjIsDuplicate,
* src/network/bridge_driver.c: Call virNetworkObjIsDuplicate
  for checking uniqueness of uuid/names

14 years agoFix error codes for missing storage pools
Daniel P. Berrange [Thu, 27 May 2010 12:30:34 +0000 (13:30 +0100)]
Fix error codes for missing storage pools

The storage pool driver is mistakenly using the error code
VIR_ERR_INVALID_STORAGE_POOL which is for diagnosing invalid
pointers. This patch switches it to use VIR_ERR_NO_STORAGE_POOL
which is the correct code for cases where the storage pool does
not exist

* src/storage/storage_driver.c: Replace VIR_ERR_INVALID_STORAGE_POOL
  with VIR_ERR_NO_STORAGE_POOL

14 years agoStorage pool duplicate UUID/name checking
Daniel P. Berrange [Thu, 27 May 2010 11:41:30 +0000 (12:41 +0100)]
Storage pool duplicate UUID/name checking

The storage pool driver is not doing correct checking for
duplicate UUID/name values. This introduces a new method
virStoragePoolObjIsDuplicate, based on the previously
written virDomainObjIsDuplicate.

* src/conf/storage_conf.c, src/conf/storage_conf.c,
  src/libvirt_private.syms: Add virStoragePoolObjIsDuplicate,
* src/storage/storage_driver.c: Call virStoragePoolObjIsDuplicate
  for checking uniqueness of uuid/names

14 years agoFix auto-adding of virtio serial controllers
Daniel P. Berrange [Thu, 3 Jun 2010 12:49:35 +0000 (13:49 +0100)]
Fix auto-adding of virtio serial controllers

The domain parsing code would auto-add a virtio serial controller
if it saw any virtio serial channel defined. Unfortunately it
always added a controller with index=0, even if the channel address
specified an index != 0. It only added one controller, even if
multiple controllers were referenced by channels. Finally, it let
the ports+vectors parameters initialize to zero instead of -1, which
prevented the controllers accepting any ports.

* src/conf/domain_conf.c: Initialize ports+vectors when adding
  virtio serial controllers. Add all neccessary virtio serial
  controllers, instead of hardcoding controller 0
* qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
  qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Expand to
  test controller auto-add behaviour

14 years agoInclude port number with virtio serial devices
Daniel P. Berrange [Wed, 2 Jun 2010 15:58:39 +0000 (16:58 +0100)]
Include port number with virtio serial devices

To ensure that the device addressing scheme is stable across
hotplug/unplug, all virtio serial channels needs to have an
associated port number in their address. This is then specified
to QEMU using the nr=NNN parameter

* src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
  for port number in vioserial address types.
* src/qemu/qemu_conf.c: Set 'nr=NNN' parameter with virtio
  serial port number
* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Expand
  data set to ensure coverage of port addressing

14 years agoDisable use of 'reason' field in block IO event in QEMU
Daniel P. Berrange [Thu, 3 Jun 2010 14:05:30 +0000 (15:05 +0100)]
Disable use of 'reason' field in block IO event in QEMU

QEMU upstream decided against adding a 'reason' field to
the block IO event in QMP. Disable this code to remove a
annoying warning message. It will be renabled when the
error string reason is re-introduced in QEMU

14 years agoEnsure UNIX domain sockets are removed on daemon shutdown
Daniel P. Berrange [Thu, 3 Jun 2010 13:36:34 +0000 (14:36 +0100)]
Ensure UNIX domain sockets are removed on daemon shutdown

When libvirtd exits it is leaving UNIX domain sockets on
the filesystem. These need to be removed.

The qemudInitPaths() method has signficant code churn to
switch from using a pre-allocated buffer on the stack, to
dynamically allocating on the heap.

* daemon/libvirtd.c, daemon/libvirtd.h: Store a reference
  to the UNIX domain socket path and unlink it on shutdown

14 years agovirsh: fix minor virsh man page typos and formatting problems
Justin Clift [Tue, 8 Jun 2010 00:18:01 +0000 (18:18 -0600)]
virsh: fix minor virsh man page typos and formatting problems

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoFix AppArmor save/restore.Add stdin_path to qemudStartVMDaemon() args.
Jamie Strandboge [Fri, 4 Jun 2010 16:20:29 +0000 (12:20 -0400)]
Fix AppArmor save/restore.Add stdin_path to qemudStartVMDaemon() args.

Refactor to update AppArmor security driver to adjust profile for
save/restore. This addresses the following bugs:

 https://bugzilla.redhat.com/show_bug.cgi?id=529363
 https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/457716

14 years agoAdd stdin_path to qemudStartVMDaemon() args.
Jamie Strandboge [Fri, 4 Jun 2010 16:20:29 +0000 (12:20 -0400)]
Add stdin_path to qemudStartVMDaemon() args.

Adjust args to qemudStartVMDaemon() to also specify path to stdin_fd,
so this can be passed to the AppArmor driver via SetSecurityAllLabel().

This updates all calls to qemudStartVMDaemon() as well as setting up
the non-AppArmor security driver *SetSecurityAllLabel() declarations
for the above. This is required for the following
"apparmor-fix-save-restore" patch since AppArmor resolves the passed
file descriptor to the pathname given to open().

14 years agoavoid syntax-check failure
Jim Meyering [Sun, 6 Jun 2010 08:27:28 +0000 (10:27 +0200)]
avoid syntax-check failure

* .mailmap: Map a stray commit-author email address to the canonical one.
Reported by Justin Clift.

14 years agoAdjust block size used by dd to speed QEMU domain save operations.
Laine Stump [Fri, 4 Jun 2010 03:36:00 +0000 (23:36 -0400)]
Adjust block size used by dd to speed QEMU domain save operations.

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

Saving a paused 512MB domain took 3m47s with the old block size of 512
bytes. Changing the block size to 1024*1024 decreased the time to 56
seconds. (Doubling again to 2048*1024 yielded 0 improvement; lowering
to 512k increased the save time to 1m10s, about 20%)

14 years agoFix dereference of potentially freed pointer in qemudDomainSaveFlags
Laine Stump [Fri, 4 Jun 2010 03:25:58 +0000 (23:25 -0400)]
Fix dereference of potentially freed pointer in qemudDomainSaveFlags

The pointer to the xml describing the domain is saved into an object
prior to calling VIR_REALLOC_N() to make the size of the memory it
points to a multiple of QEMU_MONITOR_MIGRATE_TO_FILE_BS. If that
operation needs to allocate new memory, the pointer that was saved is
no longer valid.

To avoid this situation, adjust the size *before* saving the pointer.

(This showed up when experimenting with very large values of
QEMU_MONITOR_MIGRATE_TO_FILE_BS).

14 years agoFixes for commit 211dd1e9
Jim Fehlig [Fri, 4 Jun 2010 16:04:03 +0000 (10:04 -0600)]
Fixes for commit 211dd1e9

Fixes for issues in commit 211dd1e9 noted by by Jim Meyering.

1. Allocate content buffer of size content_length + 1 to ensure
   NUL-termination.
2. Limit content buffer size to 64k
3. Fix whitespace issue

V2:
  - Add comment to clarify allocation of content buffer
  - Add ATTRIBUTE_NONNULL where appropriate
  - User NULLSTR macro

14 years agoautobuild.sh: avoid bashism
Eric Blake [Fri, 4 Jun 2010 03:07:09 +0000 (21:07 -0600)]
autobuild.sh: avoid bashism

* autobuild.sh: Replace 'set -o pipefail' with POSIX alternative.
Reported by Matthias Bolte.

14 years agoAllocate buffer to hold xend response
Jim Fehlig [Thu, 3 Jun 2010 00:07:17 +0000 (18:07 -0600)]
Allocate buffer to hold xend response

There are cases when a response from xend can exceed 4096 bytes, in
which case anything beyond 4096 is ignored. This patch changes the
current fixed-size, stack-allocated buffer to a dynamically allocated
buffer based on Content-Length in HTTP header.

14 years agoUpdate nodedev scsi_host data before use
David Allan [Thu, 3 Jun 2010 03:24:51 +0000 (23:24 -0400)]
Update nodedev scsi_host data before use

* It appears that the udev event for HBA creation arrives before the
  associated sysfs data is fully populated, resulting in bogus data
  for the nodedev entry until the entry is refreshed.  This problem is
  particularly troublesome when creating NPIV vHBAs because it results
  in libvirt failing to find the newly created adapter and waiting for
  the full timeout period before erroneously failing the create
  operation.  This patch forces an update before any attempt to use
  any scsi_host nodedev entry.

14 years agoFix device destroy return value
David Allan [Thu, 3 Jun 2010 01:59:16 +0000 (21:59 -0400)]
Fix device destroy return value

* Set return value in error cases
* Clarify error message when parent device is not vport capable

14 years agophyp: Strict check when listing domains
Eduardo Otubo [Tue, 1 Jun 2010 23:17:49 +0000 (20:17 -0300)]
phyp: Strict check when listing domains

14 years agoadd 802.1Qbh and 802.1Qbg handling
Stefan Berger [Thu, 3 Jun 2010 01:35:22 +0000 (21:35 -0400)]
add 802.1Qbh and 802.1Qbg handling

This patch that adds support for configuring 802.1Qbg and 802.1Qbh
switches. The 802.1Qbh part has been successfully tested with real
hardware. The 802.1Qbg part has only been tested with a (dummy)
server that 'behaves' similarly to how we expect lldpad to 'behave'.

The following changes were made during the development of this patch:

 - Merging Scott's v13-pre1 patch
 - Fixing endptr related bug while using virStrToLong_ui() pointed out
   by Jim Meyering
 - Addressing Jim Meyering's comments to v11
 - requiring mac address to the vpDisassociateProfileId() function to
   pass it further to the 802.1Qbg disassociate part (802.1Qbh untouched)
 - determining pid of lldpad daemon by reading it from /var/run/libvirt.pid
   (hardcode as is hardcode alson in lldpad sources)
 - merging netlink send code for kernel target and user space target
   (lldpad) using one function nlComm() to send the messages
 - adding a select() after the sending and before the reading of the
   netlink response in case lldpad doesn't respond and so we don't hang
 - when reading the port status, in case of 802.1Qbg, no status may be
   received while things are 'in progress' and only at the end a status
   will be there.
 - when reading the port status, use the given instanceId and vf to pick
   the right IFLA_VF_PORT among those nested under IFLA_VF_PORTS.
 - never sending nor parsing IFLA_PORT_SELF type of messages in the
   802.1Qbg case
 - iterating over the elements in a IFLA_VF_PORTS to pick the right
   IFLA_VF_PORT by either IFLA_PORT_PROFILE and given profileId
   (802.1Qbh) or IFLA_PORT_INSTANCE_UUID and given instanceId (802.1Qbg)
   and reading the current status in IFLA_PORT_RESPONSE.
 - recycling a previous patch that adds functionality to interface.c to
   - get the vlan identifier on an interface
   - get the flags of an interface and some convenience function to
     check whether an interface is 'up' or not (not currently used here)
 - adding function to determine the root physical interface of an
   interface. For example if a macvtap is linked to eth0.100, it will
   find eth0. Also adding a function that finds the vlan on the 'way to
   the root physical interface'
 - conveying the root physical interface name and index in case of 802.1Qbg
 - conveying mac address of macvlan device and vlan identifier in
   IFLA_VFINFO_LIST[ IFLA_VF_INFO[ IFLA_VF_MAC(mac), IFLA_VF_VLAN(vlan) ] ]
   to (future) lldpad via netlink
  - To enable build with --without-macvtap rename the
    [dis|]associatePortProfileId functions, prepend 'vp' before their
    name and make them non-static functions.
  - Renaming variable multicast to nltarget_kernel and inverting
    the logic
  - Addressing Jim Meyering's comments; this also touches existing
    code for example for correcting indentation of break statements or
    simplification of switch statements.
  - Renamed occurrencvirVirtualPortProfileDef to virVirtualPortProfileParamses
  - 802.1Qbg part prepared for sending a RTM_SETLINK and getting
    processing status back plus a subsequent RTM_GETLINK to
    get IFLA_PORT_RESPONSE.
    Note: This interface for 802.1Qbg may still change
  - [David Allan] move getPhysfn inside IFLA_VF_PORT_MAX to avoid
compiler
    warning when latest if_link.h isn't available
  - move from Stefan's 802.1Qb{g|h} XML v8 to v9
  - move hostuuid and vf index calcs to inside doPortProfileOp8021Qbh
  - remove debug fprintfs
  - use virGetHostUUID (thanks Stefan!)
  - fix compile issue when latest if_link.h isn't available
  - change poll timeout to 10s, at 1/8 intervals
     - if polling times out, log msg and return -ETIMEDOUT
  - Add Stefan's code for getPortProfileStatus
  - Poll for up to 2 secs for port-profile status, at 1/8 sec intervals:
     - if status indicates error, abort openMacvtapTap
     - if status indicates success, exit polling
     - if status is "in-progress" after 2 secs of polling, exit
       polling loop silently, without error

My patch finishes out the 802.1Qbh parts, which Stefan had mostly complete.
I've tested using the recent kernel updates for VF_PORT netlink msgs and
enic for Cisco's 10G Ethernet NIC.  I tested many VMs, each with several
direct interfaces, each configured with a port-profile per the XML.  VM-to-VM,
and VM-to-external work as expected.  VM-to-VM on same host (using same NIC)
works same as VM-to-VM where VMs are on diff hosts.  I'm able to change
settings on the port-profile while the VM is running to change the virtual
port behaviour.  For example, adjusting a QoS setting like rate limit.  All
VMs with interfaces using that port-profile immediatly see the effect of the
change to the port-profile.

I don't have a SR-IOV device to test so source dev is a non-SR-IOV device,
but most of the code paths include support for specifing the source dev and
VF index.  We'll need to complete this by discovering the PF given the VF
linkdev.  Once we have the PF, we'll also have the VF index.  All this info-
mation is available from sysfs.

14 years agobitmap: reject zero-size bitmap
Eric Blake [Wed, 2 Jun 2010 15:03:57 +0000 (09:03 -0600)]
bitmap: reject zero-size bitmap

* src/util/bitmap.c (virBitmapAlloc): Tighten sanity check.

14 years agohostusb: Properly handle 'usbX' sysfs files
Cole Robinson [Tue, 1 Jun 2010 18:46:26 +0000 (14:46 -0400)]
hostusb: Properly handle 'usbX' sysfs files

Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=598272

Some files under /sys/bus/usb/devices/ have the format 'usbX', where
X is the USB bus number. Use STRPREFIX to correctly parse the bus numbers.

14 years agoAdd --source-format argument to virsh pool-define-as and pool-create-as
Justin Clift [Sun, 30 May 2010 14:24:51 +0000 (00:24 +1000)]
Add --source-format argument to virsh pool-define-as and pool-create-as

This is the corresponding patch for the virsh man page (virsh.pod).

14 years agoAdd --source-format argument to virsh pool-define-as and pool-create-as
Justin Clift [Sun, 30 May 2010 14:24:45 +0000 (00:24 +1000)]
Add --source-format argument to virsh pool-define-as and pool-create-as

When creating pools from dedicated disks, the existing pool-define-as
and pool-create-as commands are a bit non-optimal.

Ideally, a person would be able to specify all of the required options
directly on the command line instead of having to edit the XML.

At the moment, there is no way to specify the format type (ie gpt) so it
gets included in the XML the pool is constructed with.

Please find attached a simple (tested) patch to add an optional
"--source-format 'type'" to virsh.  This is patched against current git
master and will apply cleanly.

Also created a Red Hat BZ ticket for this (#597790) for tracking.

14 years agoTrivial virsh.pod additions --all for "list" command and similar
Justin Clift [Sun, 30 May 2010 03:28:42 +0000 (13:28 +1000)]
Trivial virsh.pod additions --all for "list" command and similar

This is just a trivial patch to virsh.pod (from git master). It adds the
following pieces to the virsh man page:

  + Shows the --inactive and --all optional parameters for the list
    command.

    Closes Bugzilla #575512, reported by Renich Bon Ciric
    https://bugzilla.redhat.com/show_bug.cgi?id=575512

  + Corrects the existing description of the list command, to now say
    that only running domains are listed if no domains are specified.

    The man page up until this point has said all domains are listed if
    no domains are specified, which is incorrect.

  + Adds the "shut off" state to the list of states for the list
    command.

  + Adds a missing =back around line 755, that pod2man was complaining
    was missing.

14 years agobuild: fix VPATH 'make syntax-check'
Eric Blake [Tue, 1 Jun 2010 22:34:25 +0000 (16:34 -0600)]
build: fix VPATH 'make syntax-check'

* cfg.mk (sc_check_author_list): Look in correct location.

14 years agobuild: depend on correct file
Eric Blake [Tue, 1 Jun 2010 20:39:24 +0000 (14:39 -0600)]
build: depend on correct file

Otherwise, VPATH builds fail with:

make[1]: *** No rule to make target `libvirt-guests.init', needed by `all'.

Regression introduced in commit 482e08a9.

* daemon/Makefile.am (%.init): Look in correct place for
config.status.

14 years agoqemu: Add a qemu.conf option for clearing capabilities
Cole Robinson [Thu, 27 May 2010 23:17:55 +0000 (19:17 -0400)]
qemu: Add a qemu.conf option for clearing capabilities

Currently there is no way to opt out of libvirt dropping POSIX
capabilities for qemu. This at least is a useful debugging tool, but
is also wanted by users (and distributors):

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

v2: Clarify qemu.conf comment, warn about security implications

v3: Add .aug changes

14 years agobuild: make cpp indentation conform
Jim Meyering [Sat, 29 May 2010 07:45:21 +0000 (09:45 +0200)]
build: make cpp indentation conform

* src/storage/storage_backend.h (VIR_STORAGE_VOL_OPEN_DEFAULT):
Adjust s/#define/# define/, and align continued lines.

14 years agostorage: Check for invalid storage mode before opening
Cole Robinson [Thu, 20 May 2010 18:25:01 +0000 (14:25 -0400)]
storage: Check for invalid storage mode before opening

If a directory pool contains pipes or sockets, a pool start can fail or hang:

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

We already try to avoid these special files, but only attempt after
opening the path, which is where the problems lie. Unify volume opening
into helper functions, which use the proper open() flags to avoid error,
followed by fstat to validate storage mode.

Previously, virStorageBackendUpdateVolTargetInfoFD attempted to enforce the
storage mode check, but allowed callers to detect this case and silently
continue. In practice, only the FS backend was using this feature, the rest
were treating unknown mode as an error condition. Unfortunately the InfoFD
function wasn't raising an error message here, so error reporting was
busted.

This patch adds 2 functions: virStorageBackendVolOpen, and
virStorageBackendVolOpenModeSkip. The latter retains the original opt out
semantics, the former now throws an explicit error.

This patch maintains the previous volume mode checks: allowing specific
modes for specific pool types requires a bit of surgery, since VolOpen
is called through several different helper functions.

v2: Use ATTRIBUTE_NONNULL. Drop stat check, just open with
    O_NONBLOCK|O_NOCTTY.

v3: Move mode check logic back to VolOpen. Use 2 VolOpen functions with
    different error semantics.

v4: Make second VolOpen function more extensible. Didn't opt to change
    FS backend defaults, this can just be to fix the original bug.

v5: Prefix default flags with VIR_, use ATTRIBUTE_RETURN_CHECK

14 years agomacvtap: cannot support target device name
Stefan Berger [Fri, 28 May 2010 17:00:58 +0000 (13:00 -0400)]
macvtap: cannot support target device name

Since the macvtap device needs active tear-down and the teardown logic
is based on the interface name, it can happen that if for example 1 out
of 3 interfaces was successfully created, that during the failure path
the macvtap's target device name is used to tear down an interface that
is doesn't own (owned by another VM).

So, in this patch, the target interface name is reset so that there is
no target interface name and the interface name is always cleared after
a tear down.

14 years agoImprove nodedev parent/child relationships
David Allan [Thu, 27 May 2010 21:36:54 +0000 (17:36 -0400)]
Improve nodedev parent/child relationships

* If a nodedev has a parent that we don't want to display, we should
  continue walking up the udev device tree to see if any of its
  earlier ancestors are devices that we display.  It makes the tree
  much nicer looking than having a whole lot of devices hanging off
  the root node.

14 years agoFix libvirt-guests init script
Jiri Denemark [Thu, 27 May 2010 12:47:11 +0000 (14:47 +0200)]
Fix libvirt-guests init script

Firstly, the init script has to touch its file under /var/lock/subsys
when started, otherwise the system would think it's not running and
won't stop it during shutdown.

Secondly, for some reason there is a policy to automatically enable
init scripts when they are installed, so let the specfile do this. We
also need to start the init script to ensure it will be stopped during
the first shutdown after installing the package.

Also $LISTFILE should be enclosed by quotes everywhere as suggested by
Eric.

14 years agomaint: new syntax-check rule to ensure that AUTHORS stays in sync
Jim Meyering [Fri, 28 May 2010 09:27:12 +0000 (11:27 +0200)]
maint: new syntax-check rule to ensure that AUTHORS stays in sync

* cfg.mk (sc_check_AUTHOR_list): New rule.
* .mailmap: New file, to tell git log how to map email addresses.

14 years agohooks: fix typo
Paolo Smiraglia [Fri, 28 May 2010 12:54:28 +0000 (06:54 -0600)]
hooks: fix typo

* src/util/hooks.c (virHookLxcOp): Use correct bound.

14 years agobuild: silence cppi warning, clarify vbox headers
Eric Blake [Thu, 27 May 2010 22:35:06 +0000 (16:35 -0600)]
build: silence cppi warning, clarify vbox headers

These files are borrowed from upstream release versions, and should
not need further edits in the context of libvirt (instead, a new
upstream vbox release would entail adding a new header file).  We do
not re-generate these files as part of libvirt, nor do we want to lose
our minor edits (such as cppi cleanups).

* src/vbox/vbox_CAPI_v2_2.h: Clarify file origins.
* src/vbox/vbox_CAPI_v3_0.h: Likewise.
* src/vbox/vbox_CAPI_v3_1.h: Likewise.
* src/vbox/vbox_CAPI_v3_2.h: Likewise.  Reindent with cppi.

14 years agonetwork: bridge: Don't start network if it collides with host routing
Cole Robinson [Thu, 20 May 2010 23:31:16 +0000 (19:31 -0400)]
network: bridge: Don't start network if it collides with host routing

Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=235961

If using the default virtual network, an easy way to lose guest network
connectivity is to install libvirt inside the VM. The autostarted
default network inside the guest collides with host virtual network
routing. This is a long standing issue that has caused users quite a
bit of pain and confusion.

On network startup, parse /proc/net/route and compare the requested
IP+netmask against host routing destinations: if any matches are found,
refuse to start the network.

v2: Drop sscanf, fix a comment typo, comment that function could use
    libnl instead of /proc

v3: Consider route netmask. Compare binary data rather than convert to
    string.

v4: Return to using sscanf, drop inet functions in favor of virSocket,
    parsing safety checks. Don't make parse failures fatal, in case
    expected format changes.

v5: Try and continue if we receive unexpected. Delimit parsed lines to
    prevent scanning past newline

14 years agomaint: update AUTHORS with recent contributors
Eric Blake [Thu, 27 May 2010 21:24:19 +0000 (15:24 -0600)]
maint: update AUTHORS with recent contributors

git shortlog $(git log -1 --format=%H AUTHORS).. | grep -v "^ "

then add missing entries to AUTHORS.

* AUTHORS: Update.

14 years agoxen: Fix chardev listen sexpr formatting
Cole Robinson [Wed, 26 May 2010 02:31:27 +0000 (22:31 -0400)]
xen: Fix chardev listen sexpr formatting

'listen' isn't a valid qemu-dm option, as reported a long time ago here:

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

Matches the near identical logic in qemu_conf.c

v2: When parsing sexpr, only match on ",server", rather than
    full ',server,nowait'.

14 years agoxen: Remove unused function
Cole Robinson [Wed, 26 May 2010 02:27:53 +0000 (22:27 -0400)]
xen: Remove unused function

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agov2 of Cole's wlan support
David Allan [Thu, 27 May 2010 14:44:02 +0000 (10:44 -0400)]
v2 of Cole's wlan support

* Incorporated Jim's feedback (v1 & v2)

* Moved case of DEVTYPE == "wlan" up as it's definitive that we have a network interface.

* Made comment more detailed about the wired case to explain better
  how it differentiates between wired network interfaces and USB
  devices.

14 years agoAdd docs on drive <serial> element
Марк Коренберг [Thu, 27 May 2010 11:44:41 +0000 (12:44 +0100)]
Add docs on drive <serial> element

* docs/formatdomain.html.in: Document <serial> element within
  <disk> and fix typo on <driver/> element

14 years agoesx: Simplify goto usage
Matthias Bolte [Wed, 19 May 2010 20:59:32 +0000 (22:59 +0200)]
esx: Simplify goto usage

Eliminate almost all backward jumps by replacing this common pattern:

int
some_random_function(void)
{
    int result = 0;
    ...

  cleanup:
    <unconditional cleanup code>
    return result;

  failure:
    <cleanup code in case of an error>
    result = -1;
    goto cleanup
}

with this simpler pattern:

int
some_random_function(void)
{
    int result = -1;
    ...
    result = 0;

  cleanup:
    if (result < 0) {
        <cleanup code in case of an error>
    }

    <unconditional cleanup code>
    return result;
}

Add a bool success variable in functions that don't have a int result
that can be used for the new pattern.

Also remove some unnecessary memsets in error paths.

14 years agoSupport for VirtualBox version 3.2
Jean-Baptiste Rouault [Wed, 26 May 2010 11:54:16 +0000 (13:54 +0200)]
Support for VirtualBox version 3.2

14 years agoUse printf instead of echo -e in libvirt.spec.in
Matthias Bolte [Wed, 26 May 2010 21:06:09 +0000 (23:06 +0200)]
Use printf instead of echo -e in libvirt.spec.in

make rpm created dummy tests containing '-e #!/bin/sh' for me.

14 years agoInstall, distribute and package domainsnapshot.rng
Matthias Bolte [Wed, 26 May 2010 21:03:47 +0000 (23:03 +0200)]
Install, distribute and package domainsnapshot.rng

14 years agobuild: support 'make check' in pristine tree
Eric Blake [Wed, 26 May 2010 21:56:04 +0000 (15:56 -0600)]
build: support 'make check' in pristine tree

Otherwise, 'make check' in the python dir tries to reference a file in
docs that is built by 'make' but not by 'make check'.

* docs/Makefile.am (check-local): New rule.
Reported by Matthias Bolte.

14 years agoesx: Expose host UUID in the capabilities XML
Matthias Bolte [Wed, 26 May 2010 11:05:49 +0000 (13:05 +0200)]
esx: Expose host UUID in the capabilities XML

Parse the BIOS UUID. This information may not be available, in that
case no host UUID is exposed in the capabilities XML.

14 years agoFix integer overflow in hotplug methods
Daniel P. Berrange [Wed, 26 May 2010 12:34:45 +0000 (13:34 +0100)]
Fix integer overflow in hotplug methods

The hotplug methods still had the qemuCmdFlags variable declared
as an int, instead of unsigned long long. This caused flag checks
to be incorrect for flags > 31

* src/qemu/qemu_driver.c: Fix integer overflow in hotplug

14 years agoPass pre-opened PCI device sysfs config file to QEMU
Alex Williamson [Wed, 26 May 2010 12:32:38 +0000 (13:32 +0100)]
Pass pre-opened PCI device sysfs config file to QEMU

This allows libvirt to open the PCI device sysfs config file prior
to dropping privileges so qemu can access the full config space.
Without this, a de-privileged qemu can only access the first 64
bytes of config space.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Detect support
  for pci-assign.configfd option. Use this option when formatting
  PCI device string if possible
* src/qemu/qemu_driver.c: Pre-open PCI sysfs config file and pass
  to QEMU

14 years agodaemon: sysconf: Update comment about VNC audio
Cole Robinson [Wed, 26 May 2010 14:51:36 +0000 (10:51 -0400)]
daemon: sysconf: Update comment about VNC audio

14 years agoFix failing virGetHostname.
Chris Lalancette [Thu, 20 May 2010 17:16:30 +0000 (13:16 -0400)]
Fix failing virGetHostname.

We've been running into a lot of situations where
virGetHostname() is returning "localhost", where a plain
gethostname() would have returned the correct thing.  This
is because virGetHostname() is *always* trying to canonicalize
the name returned from gethostname(), even when it doesn't
have to.

This patch changes virGetHostname so that if the value returned
from gethostname() is already FQDN or localhost, it returns
that string directly.  If the value returned from gethostname()
is a shortened hostname, then we try to canonicalize it.  If
that succeeds, we returned the canonicalized hostname.  If
that fails, and/or returns "localhost", then we just return
the original string we got from gethostname() and hope for
the best.

Note that after this patch it is up to clients to check whether
"localhost" is an allowed return value.  The only place
where it's currently not is in qemu migration.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoxen-proxy build broken
Matthias Bolte [Wed, 26 May 2010 10:45:28 +0000 (06:45 -0400)]
xen-proxy build broken

The virVirtualPortProfileFormat just went below the
virVirtualPortProfileParamsParseXML function and got inside the

The attached patch moves virVirtualPortProfileFormat below the #ifndef
PROXY block.

14 years agoesx: Add read-only storage pool access
Matthias Bolte [Tue, 18 May 2010 16:11:59 +0000 (18:11 +0200)]
esx: Add read-only storage pool access

Allows listing existing pools and requesting information about them.

Alter the esxVI_ProductVersion enum in a way that allows to check for
product type by masking.

14 years agobuild: fix HTML errors in nwfilter docs
Eric Blake [Tue, 25 May 2010 23:20:51 +0000 (17:20 -0600)]
build: fix HTML errors in nwfilter docs

A build on Ubuntu reported:

|| Generating formatnwfilter.html.tmp
/dados/develop/libvirt/docs/formatnwfilter.html.in|390| HTML parser error : Unexpected end tag : p
||     </p>
||         ^
/dados/develop/libvirt/docs/formatnwfilter.html.in|705| HTML parser error : Unexpected end tag : code
||          <td>End of range of valid source ports</code></td>
||                                                       ^
/dados/develop/libvirt/docs/formatnwfilter.html.in|710| HTML parser error : Unexpected end tag : code
||          <td>Start of range of valid destination ports</code></td>
||                                                              ^

* docs/formatnwfilter.html.in: Fix invalid HTML constructs.
Reported by Eduardo Otubo.

14 years agobuild: fix compilation without macvtap
Eric Blake [Tue, 25 May 2010 22:44:05 +0000 (16:44 -0600)]
build: fix compilation without macvtap

* src/util/macvtap.c: (associatePortProfileId)
(disassociatePortProfileId): Move inside HAVE_MACVTAP
conditional.
Reported by Eduardo Otubo.

14 years agotests: avoid new failure of the daemon-conf test
Jim Meyering [Tue, 25 May 2010 19:12:01 +0000 (21:12 +0200)]
tests: avoid new failure of the daemon-conf test

* tests/daemon-conf: Accommodate the fact that out template,
daemon/libvirtd.conf now contains an invalid host_uuid.
Convert it to a valid one before the final libvirtd-running
test that must terminate normally.

14 years agolibvirtd: diagnose invalid host UUID
Jim Meyering [Tue, 25 May 2010 19:12:01 +0000 (21:12 +0200)]
libvirtd: diagnose invalid host UUID

* daemon/libvirtd.c (remoteReadConfigFile): Diagnose an invalid
host UUID rather than silently exiting with status 7.

14 years agovepa: parsing for 802.1Qb{g|h} XML
Stefan Berger [Tue, 25 May 2010 21:37:00 +0000 (17:37 -0400)]
vepa: parsing for 802.1Qb{g|h} XML

This patch parses the following two XML descriptions, one for
802.1Qbg and one for 802.1Qbh, and stores the data internally.
The actual triggering of the switch setup protocol has not been
implemented here but the relevant code to do that should go into
the functions associatePortProfileId() and disassociatePortProfileId().

   <interface type='direct'>
      <source dev='eth0.100' mode='vepa'/>
      <model type='virtio'/>
      <virtualport type='802.1Qbg'>
        <parameters managerid='12' typeid='0x123456' typeidversion='1'
         instanceid='fa9b7fff-b0a0-4893-8e0e-beef4ff18f8f'/>
      </virtualport>
      <filterref filter='clean-traffic'/>
    </interface>

    <interface type='direct'>
      <source dev='eth0.100' mode='vepa'/>
      <model type='virtio'/>
      <virtualport type='802.1Qbh'>
        <parameters profileid='my_profile'/>
      </virtualport>
    </interface>

I'd suggest to use this patch as a base for triggering the setup
protocol with the 802.1Qb{g|h} switch.

Several rounds of changes were made to this patch. The
following is a list of these changes.
- Renamed structure virVirtualPortProfileDef to virVirtualPortProfileParams
  as per Daniel Berrange's request
- Addressing Daniel Berrange's comments:
 - removing macvtap.h's dependency on domain_conf.h by
   moving the virVirtualPortProfileDef structure into macvtap.h
   and not passing virtDomainNetDefPtr to any functions in
   macvtap.c
- Addressed most of Chris Wright's comments:
  - indicating error in case virtualport XML node cannot be parsed
    properly
  - parsing hex and decimal numbers using virStrToLong_ui() with
    parameter '0' for base
  - tgifname (target interface name) variable wasn't necessary
    to pass to openMacvtapTap function anymore
- assigning the virtual port data structure to the virDomainNetDef
  only if it was previously parsed
- make sure that the error code returned by openMacvtapTap() is a negative n
  in case the associatePortProfileId() function failed.
- renaming vsi in the XML to virtualport
- replace all occurrences of vsi in the source as well
- removing mode and MAC address parameters from the functions that
  will communicate with the hareware diretctly or indirectly
- moving the associate and disassociate functions to the end of the
  file for subsequent patches to easier make them generally available
  for export
- passing the macvtap interface name rather than the link device since
  this otherwise gives funny side effects when using netlink messages
  where IFLA_IFNAME and IFLA_ADDRESS are specified and the link dev
  all of a sudden gets the MAC address of the macvtap interface.
- Removing rc = -1 error indications in the case of 802.1Qbg|h setup in case
  we wanted to use hook scripts for the setup and so the setup doesn't fail
  here.
- if instance ID UUID is not supplied it will automatically be generated
  - adapted schema to make instance ID UUID optional
  - added test case
- parser and XML generator have been separated into their own
  functions so they can be re-used elsewhere (passthrough case
  for example)
- Adapted XML parser and generator support the above shown type
  (802.1Qbg, 802.1Qbh).
- Adapted schema to above XML
- Adapted test XML to above XML
- Passing through the VM's UUID which seems to be necessary for
  802.1Qbh -- sorry no host UUID
- adding virtual function ID to association function, in case it's
  necessary to use (for SR-IOV)

14 years agovepa+vsi: Introduce dependency on libnl
Stefan Berger [Tue, 25 May 2010 19:31:38 +0000 (15:31 -0400)]
vepa+vsi: Introduce dependency on libnl

This patch introduces a dependency on libnl, which subsequent patches
will then use.

Changes from V1 to V2:
- added diffstats
- following changes in tree

14 years agostorage: Sanitize pool target paths
Cole Robinson [Thu, 20 May 2010 15:41:31 +0000 (11:41 -0400)]
storage: Sanitize pool target paths

Spurious / in a pool target path makes life difficult for apps using the
GetVolByPath, and doing other path based comparisons with pools. This
has caused a few issues for virt-manager users:

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

Add a new util API which removes spurious /, virFileSanitizePath. Sanitize
target paths when parsing pool XML, and for paths passed to GetVolByPath.

v2: Leading // must be preserved, properly sanitize path=/, sanitize
    away /./ -> /

v3: Properly handle starting ./ and ending /.

v4: Drop all '.' handling, just sanitize / for now.

14 years agoExpose a host UUID in the capabilities XML
Daniel P. Berrange [Tue, 25 May 2010 14:33:51 +0000 (15:33 +0100)]
Expose a host UUID in the capabilities XML

Allow for a host UUID in the capabilities XML. Local drivers
will initialize this from the SMBIOS data. If a sanity check
shows SMBIOS uuid is invalid, allow an override from the
libvirtd.conf configuration file

* daemon/libvirtd.c, daemon/libvirtd.conf: Support a host_uuid
  configuration option
* docs/schemas/capability.rng: Add optional host uuid field
* src/conf/capabilities.c, src/conf/capabilities.h: Include
  host UUID in XML
* src/libvirt_private.syms: Export new uuid.h functions
* src/lxc/lxc_conf.c, src/qemu/qemu_driver.c,
  src/uml/uml_conf.c: Set host UUID in capabilities
* src/util/uuid.c, src/util/uuid.h: Support for host UUIDs
* src/node_device/node_device_udev.c: Use the host UUID functions
* tests/confdata/libvirtd.conf, tests/confdata/libvirtd.out: Add
  new host_uuid config option to test

14 years agoFix handling of disk backing stores with cgroups
Daniel P. Berrange [Wed, 28 Apr 2010 15:25:42 +0000 (16:25 +0100)]
Fix handling of disk backing stores with cgroups

The cgroups ACL code was only allowing the primary disk image.
It is possible to chain images together, so we need to search
for backing stores and add them to the ACL too. Since the ACL
only handles block devices, we ignore the EINVAL we get from
plain files. In addition it was missing code to teardown the
cgroup when hot-unplugging a disk

* src/qemu/qemu_driver.c: Allow backing stores in cgroup ACLs
  and add missing teardown code in unplug path

14 years agoFix up basic migration.
Chris Lalancette [Thu, 20 May 2010 19:25:41 +0000 (15:25 -0400)]
Fix up basic migration.

Basic live migration was broken by the commit that added
non-shared block support in two ways:

1)  It added a virCheckFlags() to doNativeMigrate().  Besides
the fact that typical usage of virCheckFlags() is in driver
entry points, and doNativeMigrate() is not an entry point,
it was missing important flags like VIR_MIGRATE_LIVE.  Move
the virCheckFlags to the top-level qemuDomainMigratePrepare2
and friends.

2)  It also added a memory leak in qemuMonitorTextMigrate()
by not freeing the memory used by virBufferContentAndReset().
This is fixed by storing the pointer in a temporary variable
and freeing it at the end.

With this patch in place, normal live migration works again.

v3: Instead of the churn for virCheckFlagsUI and UL, instead
always promote flags to an unsigned long and always use %lx
for the fprintf.
v2: Add back flags check, which required adding virCheckFlagsUI
and virCheckFlagsUL

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoqemu: Allow using regular audio backends with VNC
Cole Robinson [Wed, 19 May 2010 20:41:01 +0000 (16:41 -0400)]
qemu: Allow using regular audio backends with VNC

Currently all host audio backends are disabled if a VM is using VNC, in
favor of the QEMU VNC audio extension. Unfortunately no released VNC
client supports this extension, so users have no way of getting audio
to work if using VNC.

Add a new config option in qemu.conf which allows changing libvirt's
behavior, but keep the default intact.

v2: Fix doc typos, change name to vnc_allow_host_audio

14 years agostorage: mpath: Fix incorrect VIR_ERROR use
Cole Robinson [Mon, 24 May 2010 18:41:14 +0000 (14:41 -0400)]
storage: mpath: Fix incorrect VIR_ERROR use

14 years agoAllow nwfilter functions to be compiled with C++
Chris Lalancette [Mon, 24 May 2010 15:55:55 +0000 (11:55 -0400)]
Allow nwfilter functions to be compiled with C++

Unfortunately the NWFilter functions were outside of the
"extern C { ... }" declaration in include/libvirt/libvirt.h.in,
which means that they couldn't be properly used with C++.  Move
them inside of the braces, which should fix the problem.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agonwfilter: documentation
Stefan Berger [Tue, 25 May 2010 11:09:31 +0000 (07:09 -0400)]
nwfilter: documentation

This patch adds documentation of the nwfilter subsystem of libvirt to
the existing (web) docs.

14 years agomaint: update AUTHORS with recent contributors
Eric Blake [Mon, 24 May 2010 22:29:06 +0000 (16:29 -0600)]
maint: update AUTHORS with recent contributors

git shortlog $(git log -1 --format=%H AUTHORS).. | grep -v "^ "

then add missing entries to AUTHORS.

* AUTHORS: Update.

14 years agoqemu: Release bus address on PCI host device remove
Alex Williamson [Mon, 24 May 2010 17:33:48 +0000 (13:33 -0400)]
qemu: Release bus address on PCI host device remove

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
14 years agoqemu: avoid corrupting guest info struct on host device PCI hot add
Alex Williamson [Mon, 24 May 2010 17:33:27 +0000 (13:33 -0400)]
qemu: avoid corrupting guest info struct on host device PCI hot add

The device path doesn't make use of guestAddr, so the memcpy corrupts
the guest info struct.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
14 years agoQuery block allocation extent from QEMU monitor
Daniel P. Berrange [Fri, 14 May 2010 13:10:01 +0000 (09:10 -0400)]
Query block allocation extent from QEMU monitor

The virDomainGetBlockInfo API allows query physical block
extent and allocated block extent. These are normally the
same value unless storing a special format like qcow2
inside a block device. In this scenario we can query QEMU
to get the actual allocated extent.

Since last time:

 - Return fatal error in text monitor
 - Only invoke monitor command for block devices
 - Fix error handling JSON code

* src/qemu/qemu_driver.c: Fill in block aloction extent when VM
  is running
* 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 to query the highest block extent via info blockstats

14 years agolxcSetSchedulerParameters: reverse order of tests; diagnose a failure
Jim Meyering [Tue, 11 May 2010 13:51:46 +0000 (15:51 +0200)]
lxcSetSchedulerParameters: reverse order of tests; diagnose a failure

* src/lxc/lxc_driver.c (lxcSetSchedulerParameters): Ensure that
"->field" is "cpu_shares" before possibly giving a diagnostic about
a type for a "cpu_shares" value.
Also, virCgroupSetCpuShares could fail without evoking a diagnostic.
Add one.

14 years agoDon't overwrite virDomainAssignDef errors.
Chris Lalancette [Tue, 11 May 2010 20:44:09 +0000 (16:44 -0400)]
Don't overwrite virDomainAssignDef errors.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agostorage: Combine some duplicate code
Cole Robinson [Thu, 20 May 2010 17:29:24 +0000 (13:29 -0400)]
storage: Combine some duplicate code

Volume detection in the scsi backend was duplicating code already
present in storage_backend.c. Let's drop the duplicate code.

Also, change the shared function name to be less generic, and remove
some error squashing in the other call site.

14 years agostorage: mpath: Clean up some error handling
Cole Robinson [Thu, 20 May 2010 18:16:54 +0000 (14:16 -0400)]
storage: mpath: Clean up some error handling

We were squashing error messages in a few cases. Recode to follow common
ret = -1 convention.

v2: Handle more error squashing issues further up in MakeNewVol and
    CreateVols. Use ret = -1 convention in MakeVols.

14 years agoRemove dead code after refactoring qemudDomainStart
Jiri Denemark [Fri, 21 May 2010 09:32:03 +0000 (11:32 +0200)]
Remove dead code after refactoring qemudDomainStart

The event is already generated and sent by qemudDomainObjStart, no need
to do anything about here.

14 years agolibvirtd: start each diagnostic with "argv0: "
Jim Meyering [Thu, 20 May 2010 19:40:54 +0000 (21:40 +0200)]
libvirtd: start each diagnostic with "argv0: "

Some diagnostics had a hard-coded "libvirtd: " prefix, some used
"error: " and some used "argv[0]: ".  Always use "argv[0]: ".
* daemon/libvirtd.c (argv0): New global.
(main): Set it.
(version, usage): Remove argv0 parameter.  Use global; update callers.
(daemonForkIntoBackground): Use argv0:, not error:.
(qemudWritePidFile): Start each diagnostic with argv0:.
Suggested by Eric Blake.

14 years agolibvirtd: mark strings for translation, including --help output
Jim Meyering [Thu, 20 May 2010 08:01:32 +0000 (10:01 +0200)]
libvirtd: mark strings for translation, including --help output

* daemon/libvirtd.c (daemonForkIntoBackground, main): Mark strings
for translation.
(usage): Rework --help so that it is translatable, replacing
each embedded, configuration-dependent, macro with an `%s'.

libvirtd: don't ignore virInitialize failure
* daemon/libvirtd.c (main): Diagnose virInitialize failure
and exit nonzero.

14 years agobuild: fix cppi warnings
Eric Blake [Fri, 21 May 2010 22:02:18 +0000 (16:02 -0600)]
build: fix cppi warnings

* src/util/bitmap.h (includes): Placate cppi.

14 years agobuild: force init scripts to rebuild on changed --prefix
Eric Blake [Fri, 21 May 2010 21:18:24 +0000 (15:18 -0600)]
build: force init scripts to rebuild on changed --prefix

Otherwise, './configure --prefix=/foo && make &&
 ./configure --prefix=/bar && make' leaves the wrong files
in libvirtd.init (/foo instead of /bar).

* daemon/Makefile.am (libvirtd.init): Add dependency on
config.status.  Reported by Cole Robinson.