]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 years agoAdd a detailed message when tap device add fails
Doug Goldstein [Tue, 10 Aug 2010 21:43:37 +0000 (16:43 -0500)]
Add a detailed message when tap device add fails

Added a more detailed error message when adding a tap devices fails and
the kernel is missing tun support.

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
14 years agoFix return value usage
Doug Goldstein [Tue, 10 Aug 2010 21:43:29 +0000 (16:43 -0500)]
Fix return value usage

Fix the error checking to use the return value from brAddTap() instead
of checking the current errno value which might have been changed by
clean up calls inside of brAddTap().

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
14 years agonodeinfo: skip offline CPUs
Eric Blake [Tue, 10 Aug 2010 21:33:37 +0000 (15:33 -0600)]
nodeinfo: skip offline CPUs

https://bugzilla.redhat.com/622515 - When hot-unplugging CPUs,
libvirt failed to start a guest that had been pinned to CPUs that
were still online.

Tested on a dual-core laptop, where I also discovered that, per
http://www.cyberciti.biz/files/linux-kernel/Documentation/cpu-hotplug.txt,
/sys/devices/system/cpu/cpu0/online does not exist on systems where it
cannot be hot-unplugged.

* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Ignore CPUs that are
currently offline.  Detect readdir failure.
(parse_socket): Move guts...
(get_cpu_value): ...to new function, shared with...
(cpu_online): New function.

14 years agoqemu: Hack around asynchronous device_del
Jiri Denemark [Mon, 9 Aug 2010 12:14:34 +0000 (14:14 +0200)]
qemu: Hack around asynchronous device_del

device_del command is not synchronous for PCI devices, it merely asks
the guest to release the device and returns. If the host wants to use
that device before the guest actually releases it, we are in big
trouble. To avoid this, we already added a loop which waits up to 10
seconds until the device is actually released before we do anything else
with that device. But we only added this loop for managed PCI devices
before we try reattach them back to the host.

However, we need to wait even for non-managed devices. We don't reattach
them automatically, but we still want to prevent the host from using it.
This was revealed thanks to sVirt: when we relabel sysfs files
corresponding to the PCI device before the guest finished releasing the
device, qemu is no longer allowed to access those files and if it wants
(as a result of guest's request) to write anything to them, it just
exits, which kills the guest.

This is not a proper fix and needs some further work both on libvirt and
qemu side in the future.

14 years agomaint: update an email address preference
Eric Blake [Tue, 10 Aug 2010 14:13:22 +0000 (08:13 -0600)]
maint: update an email address preference

* AUTHORS (Soren Hansen): Update address.
* .mailmap: Alias other addresses to new preference.

14 years agobuild-sys: only build the test programs during the check phase.
Diego Elio Pettenò [Tue, 10 Aug 2010 12:38:57 +0000 (14:38 +0200)]
build-sys: only build the test programs during the check phase.

This avoids building the tests when testing libvirt is not the aim.

14 years agoAdd "ubd" to the list of disk prefixes
Soren Hansen [Tue, 10 Aug 2010 11:46:46 +0000 (13:46 +0200)]
Add "ubd" to the list of disk prefixes

virDiskNameToIndex has a list of disk name prefixes that it uses in the
process of finding the disk's index. This list is missing "ubd" which
is the disk prefix used for UML domains.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agoExtend virSocketParseAddr() to allow a NULL result pointer
Daniel Veillard [Tue, 10 Aug 2010 13:00:15 +0000 (15:00 +0200)]
Extend virSocketParseAddr() to allow a NULL result pointer

That way it can be used to verify a numeric address without storing
the details
* src/util/network.c: change virSocketParseAddr to allow a null @addr
  parameter

14 years agobootloader_args is named bootargs in xen-xm
Philipp Hahn [Thu, 5 Aug 2010 15:07:18 +0000 (17:07 +0200)]
bootloader_args is named bootargs in xen-xm

According to <xen-3.4.3/tools/python/xen/xm/create.py:158>
gopts.var('bootargs', val='NAME',
  fn=set_value, default=None,
  use="Arguments to pass to boot loader")
the "bootloader_args" parameter needs to be translated into "bootargs"
when using "virsh domxml-to-native xen-xm".
The reverse direction (domxml-from-native) is already okay.

This patch fixes domxml-to-native and adds two test files to catch this
problem.

Signed-off-by: Philipp Hahn <hahn@univention.de>
14 years agophyp: refactor phypListDomainsGeneric to eliminate buffer overflow
Eduardo Otubo [Thu, 15 Jul 2010 22:37:48 +0000 (19:37 -0300)]
phyp: refactor phypListDomainsGeneric to eliminate buffer overflow

src/phyp/phyp_driver.c:phypListDomainsGeneric was crashing due to a buffer
overflow if any line returned from virRun wasn't <=10 characters.

Since virStrToLong_i recognizes any non-numeric as a terminator (not
just NULL), there actually is no need to copy the number into a
separate string anyway, so this patch eliminates that copy, the fixed
length buffer, and therefore the potential to overflow.

This change also provided the oppurtunity to eliminate the character
counting loop, instead using the return from virStrToLong_i to point
past the end of the number, then simply skip the \n to get to the
next.

14 years agodocs: fix an incorrect keyword in updated hooks page
Justin Clift [Fri, 6 Aug 2010 13:33:05 +0000 (23:33 +1000)]
docs: fix an incorrect keyword in updated hooks page

14 years agobuild-sys: fix build when daemon is disabled by not installing libvirtd.8
Diego Elio Pettenò [Fri, 6 Aug 2010 01:17:37 +0000 (03:17 +0200)]
build-sys: fix build when daemon is disabled by not installing libvirtd.8

Since the rule to build libvirtd.8 is within the WITH_LIBVIRTD conditional,
so declare the man page in there as well. Without this change, build
without daemon will fail.

14 years agodocs: significant expansion of custom hook script information
Justin Clift [Fri, 6 Aug 2010 10:20:07 +0000 (20:20 +1000)]
docs: significant expansion of custom hook script information

14 years agoFix return value usage
Doug Goldstein [Thu, 5 Aug 2010 19:12:52 +0000 (14:12 -0500)]
Fix return value usage

Fix the error checking to use the return value from brAddTap() instead
of checking the current errno value which might have been changed by
clean up calls inside of brAddTap().

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
14 years agoqemu: improve error if tun device is missing
Doug Goldstein [Thu, 5 Aug 2010 23:02:52 +0000 (17:02 -0600)]
qemu: improve error if tun device is missing

Added a more detailed error message when adding a tap devices fails and
the kernel is missing tun support.

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
14 years agobuild: rerun bootstrap if po/Makevars got nuked
Eric Blake [Wed, 4 Aug 2010 20:35:41 +0000 (14:35 -0600)]
build: rerun bootstrap if po/Makevars got nuked

There has been a frequent complaint of:

make[2]: Entering directory `/home/remote/eblake/libvirt/po'
make[2]: *** No rule to make target `/config.status', needed by `Makefile'.  Stop.

It happens after nuking and regenerating the po directory,
which is a common action after running anything like
'make dist' or 'make rpm' that dirties all the .po files.

Teach autogen.sh that it must regenerate po/Makevars to avoid
the missing variable declaration, and teach cfg.mk to recognize
that a nuked po directory is cause to rerun autogen.sh.

* cfg.mk (_update_required): Check for po/Makevars.
* autogen.sh (bootstrap): Run bootstrap if it got lost.
Diagnosed by Justin Clift.

14 years agoDo not use boot=on on IDE device
Daniel Veillard [Wed, 4 Aug 2010 16:31:44 +0000 (18:31 +0200)]
Do not use boot=on on IDE device

the followup on the boot=on problem, basically it's not needed to
specify it when booting out of IDE devices when using KVM
* src/qemu/qemu_conf.c: do not use boot=on for IDE devices
* tests/qemuxml2argvdata/qemuxml2argv*.args: this changes the output
  for 5 of the tests

14 years agoRelease of libvirt-0.8.3
Daniel Veillard [Wed, 4 Aug 2010 13:03:25 +0000 (15:03 +0200)]
Release of libvirt-0.8.3

* configure.ac docs/news.html.in libvirt.spec.in: updates
* po/*.po*: update and regenerated

14 years agoqemu: Fix PCI address allocation
Jiri Denemark [Wed, 4 Aug 2010 12:46:06 +0000 (14:46 +0200)]
qemu: Fix PCI address allocation

Patch version revamped by Eric Blake <eblake@redhat.com> of Jiri
Denemark <jdenemar@redhat.com> original patch

When attaching a PCI device which doesn't explicitly set its PCI
address, libvirt allocates the address automatically. The problem is
that when checking which PCI address is unused, we only check for those
with slot number higher than the highest slot number ever used.

Thus attaching/detaching such device several times in a row (31 is the
theoretical limit, less then 30 tries are enough in practise) makes any
further device attachment fail. Furthermore, attaching a device with
predefined PCI address to 0:0:31 immediately forbids attachment of any
PCI device without explicit address.

This patch changes the logic so that we always check all PCI addresses
before we say there is no PCI address available.

Modifications from v1: revert back to remembering the last slot
reserved, but allow wraparound to not be limited by the end.
In this way, slots are still assigned in the same order as
before the patch, rather than filling in the gaps closest to
0 and risking making windows guests mad.

* src/qemu/qemu_conf.c: fix pci reservation code to do a round-robbin
  check of all available PCI splot availability before failing.

14 years agoOpenVZ: implement suspend/resume driver APIs
Jean-Baptiste Rouault [Wed, 4 Aug 2010 12:00:07 +0000 (14:00 +0200)]
OpenVZ: implement suspend/resume driver APIs

* src/openvz/openvz_driver.c: implements openvzDomainSuspend and
  openvzDomainResume

14 years agoDon't leak delay string when freeing virInterfaceBridgeDefs
Laine Stump [Tue, 3 Aug 2010 14:31:59 +0000 (10:31 -0400)]
Don't leak delay string when freeing virInterfaceBridgeDefs

14 years agoFix build error in virsh.c
Laine Stump [Tue, 3 Aug 2010 14:35:01 +0000 (10:35 -0400)]
Fix build error in virsh.c

Another gettext string with no format args sent to printf as a format string.

14 years agoesx: Set storage pool target path to host.mountInfo.path
Matthias Bolte [Sun, 1 Aug 2010 20:11:38 +0000 (22:11 +0200)]
esx: Set storage pool target path to host.mountInfo.path

Now all storage pool types expose the target path.

14 years agoesx: Make storage pool lookup by name and UUID more robust
Matthias Bolte [Sun, 1 Aug 2010 17:53:00 +0000 (19:53 +0200)]
esx: Make storage pool lookup by name and UUID more robust

Don't rely on summary.url anymore, because its value is different
between an esx:// and vpx:// connection. Use host.mountInfo.path
instead.

Don't fallback to lookup by UUID (actually lookup by absolute path)
in esxVI_LookupDatastoreByName when lookup by name fails. Add a
seperate function for this: esxVI_LookupDatastoreByAbsolutePath

14 years agoesx: Restrict vpx:// to handle a single host in a vCenter
Matthias Bolte [Sat, 31 Jul 2010 21:57:42 +0000 (23:57 +0200)]
esx: Restrict vpx:// to handle a single host in a vCenter

Now a vpx:// connection has an explicitly specified host. This
allows to enabled several functions for a vpx:// connection
again, like host UUID, hostname, general node info, max vCPU
count, free memory, migration and defining new domains.

Lookup datacenter, compute resource, resource pool and host
system once and cache them. This simplifies the rest of the
code and reduces overall HTTP(S) traffic a bit.

esx:// and vpx:// can be mixed freely for a migration.

Ensure that migration source and destination refer to the
same vCenter. Also directly encode the resource pool and
host system object IDs into the migration URI in the prepare
function. Then directly build managed object references in
the perform function instead of re-looking up already known
information.

14 years agoesx: Map some managed object types
Matthias Bolte [Sat, 31 Jul 2010 20:27:32 +0000 (22:27 +0200)]
esx: Map some managed object types

Datacenter, ComputeResource and HostSystem will be used for
simplified handling and caching.

14 years agoesx: Parse the path of the URI
Matthias Bolte [Fri, 30 Jul 2010 20:08:35 +0000 (22:08 +0200)]
esx: Parse the path of the URI

The path will be used to specify the datacenter, compute resource
and host system to be used with a vpx:// connection.

14 years agoqemu: don't lose error on setting monitor capabilities
Eric Blake [Fri, 30 Jul 2010 15:47:28 +0000 (09:47 -0600)]
qemu: don't lose error on setting monitor capabilities

Spotted by clang.  Regression introduced in commit e72cc3c11d.

* src/qemu/qemu_driver.c (qemuConnectMonitor): Don't lose error status.

14 years agobuild: avoid compiler warning, for real this time
Eric Blake [Mon, 2 Aug 2010 20:00:54 +0000 (14:00 -0600)]
build: avoid compiler warning, for real this time

* tools/virsh.c (vshParseArgv): Drop spurious argument to printf.

14 years agoFix virsh error message when -d arg is not numeric
Eric Blake [Mon, 2 Aug 2010 20:03:13 +0000 (22:03 +0200)]
Fix virsh error message when -d arg is not numeric

14 years agoAdd Aurelien to AUTHORS
Daniel Veillard [Mon, 2 Aug 2010 19:55:33 +0000 (21:55 +0200)]
Add Aurelien to AUTHORS

14 years agoFix a couple of typo in iSCSI backend
Aurelien ROUGEMONT [Mon, 2 Aug 2010 19:52:02 +0000 (21:52 +0200)]
Fix a couple of typo in iSCSI backend

- a pure typo error and a wrong command referenced in an error message.

14 years agoMake virsh -d check its input
Daniel Veillard [Mon, 2 Aug 2010 19:20:26 +0000 (21:20 +0200)]
Make virsh -d check its input

it was using atoi direct without checking leading to confusion
in case of flag error for example with -c

* tools/virsh.c: vshParseArgv() use virStrToLong_i and remove the
  unchecked atoi used to parse teh parameter

14 years agoAdd iptables rule to fixup DHCP response checksum.
Laine Stump [Tue, 13 Jul 2010 02:59:58 +0000 (22:59 -0400)]
Add iptables rule to fixup DHCP response checksum.

This patch attempts to take advantage of a newly added netfilter
module to correct for a problem with some guest DHCP client
implementations when used in conjunction with a DHCP server run on the
host systems with packet checksum offloading enabled.

The problem is that, when the guest uses a RAW socket to read the DHCP
response packets, the checksum hasn't yet been fixed by the IP stack,
so it is incorrect.

The fix implemented here is to add a rule to the POSTROUTING chain of
the mangle table in iptables that fixes up the checksum for packets on
the virtual network's bridge that are destined for the bootpc port (ie
"dhcpc", ie port 68) port on the guest.

Only very new versions of iptables will have this support (it will be
in the next upstream release), so a failure to add this rule only
results in a warning message. The iptables patch is here:

  http://patchwork.ozlabs.org/patch/58525/

A corresponding kernel module patch is also required (the backend of
the iptables patch) and that will be in the next release of the
kernel.

14 years agoFix the ACS checking in the PCI code.
Chris Lalancette [Wed, 28 Jul 2010 20:53:00 +0000 (16:53 -0400)]
Fix the ACS checking in the PCI code.

When trying to assign a PCI device to a guest, we have
to check that all bridges upstream of that device support
ACS.  That means that we have to find the parent bridge of
the current device, check for ACS, then find the parent bridge
of that device, check for ACS, etc.  As it currently stands,
the code to do this iterates through all PCI devices on the
system, looking for a device that has a range of busses that
included the current device's bus.

That check is not restrictive enough, though.  Depending on
how we iterated through the list of PCI devices, we could first
find the *topmost* bridge in the system; since it necessarily had
a range of busses including the current device's bus, we
would only ever check the topmost bridge, and not check
any of the intermediate bridges.

Note that this also caused a fairly serious bug in the
secondary bus reset code, where we could erroneously
find and reset the topmost bus instead of the inner bus.

This patch changes pciGetParentDevice() so that it first
checks if a bridge device's secondary bus exactly matches
the bus of the device we are looking for.  If it does, we've
found the correct parent bridge and we are done.  If it does not,
then we check to see if this bridge device's busses *include* the
bus of the device we care about.  If so, we mark this bridge device
as best, and go on.  If we later find another bridge device whose
busses include this device, but is more restrictive, then we
free up the previous best and mark the new one as best.  This
algorithm ensures that in the normal case we find the direct
parent, but in the case that the parent bridge secondary bus
is not exactly the same as the device, we still find the
correct bridge.

This patch was tested by me on a 4-port NIC with a
bridge without ACS (where assignment failed), a 4-port
NIC with a bridge with ACS (where assignment succeeded),
and a 2-port NIC with no bridges (where assignment
succeeded).

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoFree up memballoon def.
Chris Lalancette [Fri, 30 Jul 2010 15:40:59 +0000 (11:40 -0400)]
Free up memballoon def.

Forgetting to do this was causing a memory leak.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoDon't put a semicolon on the end of a VIR_ENUM_IMPL.
Chris Lalancette [Fri, 30 Jul 2010 15:40:42 +0000 (11:40 -0400)]
Don't put a semicolon on the end of a VIR_ENUM_IMPL.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoFix a bogus warning when parsing <hostdev>
Chris Lalancette [Fri, 30 Jul 2010 15:28:55 +0000 (11:28 -0400)]
Fix a bogus warning when parsing <hostdev>

When parsing hostdev, the following message would be emitted:

10:17:19.052: error : virDomainHostdevDefParseXML:3748 : internal error unknown node alias

However, alias is appropriately parsed in
virDomainDeviceInfoParseXML anyway.  Disable the error message
in the initial XML parsing loop.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoRemove duplicate </p> from downloads.html.in
Matthias Bolte [Sat, 31 Jul 2010 23:54:40 +0000 (01:54 +0200)]
Remove duplicate </p> from downloads.html.in

14 years agoUpdate ID after stopping a domain
Matthias Bolte [Fri, 30 Jul 2010 17:50:12 +0000 (19:50 +0200)]
Update ID after stopping a domain

14 years agoopenvzDomainCreateWithFlags: set domain id to the correct value
Jean-Baptiste Rouault [Fri, 30 Jul 2010 08:36:06 +0000 (10:36 +0200)]
openvzDomainCreateWithFlags: set domain id to the correct value

When an openvz domain is defined with virDomainDefineXML,
domain id is set to -1. A call to virDomainGetInfo after
starting the domain would then fail because this invalid
id is passed to openvzGetProcessInfo.

14 years agostorage: kill dead stores
Eric Blake [Fri, 30 Jul 2010 16:24:17 +0000 (10:24 -0600)]
storage: kill dead stores

Found by clang.  Clang complained that virStorageBackendProbeTarget
could dereference NULL if backingStoreFormat was NULL, but since all
callers passed a valid pointer, I added attributes instead of null
checks.

* src/storage/storage_backend.c
(virStorageBackendQEMUImgBackingFormat): Kill dead store.
* src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
Likewise.  Skip null checks, by adding attributes.

14 years agoqemu: kill some dead stores
Eric Blake [Fri, 30 Jul 2010 17:33:26 +0000 (11:33 -0600)]
qemu: kill some dead stores

Spotted by clang.

* src/qemu/qemu_monitor.c (qemuMonitorClose): Kill dead store.
* src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Likewise.

14 years agonetwork: kill dead store
Eric Blake [Fri, 30 Jul 2010 15:59:17 +0000 (09:59 -0600)]
network: kill dead store

* src/network/bridge_driver.c (networkDefine): Kill dead store.

14 years agoxenapi: Update ID after starting a domain
Matthias Bolte [Fri, 30 Jul 2010 15:13:38 +0000 (17:13 +0200)]
xenapi: Update ID after starting a domain

14 years agoesx: Update ID after starting a domain
Matthias Bolte [Fri, 30 Jul 2010 15:06:20 +0000 (17:06 +0200)]
esx: Update ID after starting a domain

14 years agoFix DMI uuid parsing.
Chris Lalancette [Fri, 30 Jul 2010 14:19:51 +0000 (10:19 -0400)]
Fix DMI uuid parsing.

valgrind was complaining that virUUIDParse was depending on
an uninitialized value.  Indeed it was; virSetHostUUIDStr()
didn't initialize the dmiuuid buffer to 0's, meaning that
anything after the string read from /sys was uninitialized.
Clear out the dmiuuid buffer before use, and make sure to
always leave a \0 at the end.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoDo not activate boot=on on devices when not using KVM
Daniel Veillard [Fri, 30 Jul 2010 14:38:48 +0000 (16:38 +0200)]
Do not activate boot=on on devices when not using KVM

  Basically the 'boot=on' boot selection device is something present in
KVM but not in upstream QEmu, as a result if we boot a QEmu domain
without KVM acceleration we must disable boot=on ... even if the front
end kvm binary expose that capability in the help page.

* src/qemu/qemu_conf.c: in qemudBuildCommandLine if -no-kvm
  is passed, then deactivate QEMUD_CMD_FLAG_DRIVE_BOOT

14 years agoFix a memory leak in the qemudBuildCommandLine.
Chris Lalancette [Fri, 30 Jul 2010 13:39:48 +0000 (09:39 -0400)]
Fix a memory leak in the qemudBuildCommandLine.

ADD_ARG_LIT should only be used for literal arguments,
since it duplicates the memory.  Since virBufferContentAndReset
is already allocating memory, we should only use ADD_ARG.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoesx: Fix freeing of heterogeneous lists
Matthias Bolte [Wed, 28 Jul 2010 13:42:10 +0000 (15:42 +0200)]
esx: Fix freeing of heterogeneous lists

Always call the free function of the base type. The base type
function then dynamically dispatches the call to the free function
for the actual type.

14 years agoesx: Switch from name to number checks in the subdrivers
Matthias Bolte [Sun, 25 Jul 2010 17:04:22 +0000 (19:04 +0200)]
esx: Switch from name to number checks in the subdrivers

14 years agoesx: Improve blocked task detection and fix race condition
Matthias Bolte [Sun, 25 Jul 2010 15:45:19 +0000 (17:45 +0200)]
esx: Improve blocked task detection and fix race condition

esxVI_WaitForTaskCompletion can take a UUID to lookup the
corresponding domain and check if the current task for it
is blocked by a question. It calls another function to do
this: esxVI_LookupAndHandleVirtualMachineQuestion looks up
the VirtualMachine and checks for a question. If there is
a question it calls esxVI_HandleVirtualMachineQuestion to
handle it.

If there was no question or it has been answered the call
to esxVI_LookupAndHandleVirtualMachineQuestion returns 0.
If any error occurred during the lookup and answering
process -1 is returned. The problem with this is, that -1
is also returned when there was no error but the question
could not be answered. So esxVI_WaitForTaskCompletion cannot
distinguish between this two situations and reports that a
question is blocking the task even when there was actually
another problem.

This inherent problem didn't surface until vSphere 4.1 when
you try to define a new domain. The driver tries to lookup
the domain that is just in the process of being registered.
There seems to be some kind of race condition and the driver
manages to issue a lookup command before the ESX server was
able to register the domain. This used to work before.

Due to the return value problem described above the driver
reported a false error message in that case.

To solve this esxVI_WaitForTaskCompletion now takes an
additional occurrence parameter that describes whether or
not to expect the domain to be existent. Also add a new
parameter to esxVI_LookupAndHandleVirtualMachineQuestion
that allows to distinguish if the call returned -1 because
of an actual error or because the question could not be
answered.

14 years agoesx: silence spurious compiler warning
Eric Blake [Wed, 28 Jul 2010 23:28:44 +0000 (17:28 -0600)]
esx: silence spurious compiler warning

* src/esx/esx_vi_types.c (_DESERIALIZE_NUMBER)
(ESX_VI__TEMPLATE__DESERIALIZE_NUMBER): Add range check to shut up
gcc 4.5.0 regarding long long.

14 years agobuild: distribute libvirt_qemu.syms
Eric Blake [Thu, 29 Jul 2010 20:19:40 +0000 (14:19 -0600)]
build: distribute libvirt_qemu.syms

* src/Makefile.am (EXTRA_DIST): Ensure 'make distcheck' and
'rpmbuild' can reproduce a build.
* daemon/Makefile.am (DAEMON_SOURCES): Likewise.

14 years agobuild: restore operation of bit-rotted 'make cov'
Eric Blake [Wed, 9 Jun 2010 18:35:49 +0000 (12:35 -0600)]
build: restore operation of bit-rotted 'make cov'

'./autobuild.sh' with lcov installed discovered that our
coverage support has been bit-rotting for a while.  This
restores it back to a successful state, although I have
not yet spent any time looking through the resulting files to
look for low-hanging fruit in the unit test coverage front.

* configure.ac: Clear COMPILER_FLAGS at right place.
* Makefile.am (cov): Newer genhtml no longer likes plain -s.
* m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST
COMPILER_FLAGS; it is a shell variable for use in configure only.
* src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make
it easier to provide global flag additions.  Use throughout, to
uniformly apply coverage flags.
* .gitignore: Globally ignore gcov output.
* daemon/.gitignore: Simplify.
* src/.gitignore: Likewise.
* tests/.gitignore: Likewise.

14 years agoxen: fix logic bug
Eric Blake [Wed, 28 Jul 2010 23:12:16 +0000 (17:12 -0600)]
xen: fix logic bug

The recent switch to enable -Wlogical-op paid off again.
gcc 4.5.0 (rawhide) is smarter than 4.4.4 (Fedora 13).

* src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
(xenDaemonUpdateDeviceFlags, xenDaemonDetachDeviceFlags): Use
correct operator.

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agobuild: fix 'make syntax-check' failure
Eric Blake [Thu, 29 Jul 2010 19:27:58 +0000 (13:27 -0600)]
build: fix 'make syntax-check' failure

src/lxc/veth.c:150:        VIR_DEBUG(_("Failed to delete '%s' (%d)"),
src/lxc/veth.c:188:            VIR_DEBUG(_("Failed to disable '%s' (%d)"),
maint.mk: do not mark these strings for translation

* src/lxc/veth.c (vethDelete, vethInterfaceUpOrDown): Don't
translate VIR_DEBUG.

14 years agolxc: Fix return values of veth.c functions
Ryota Ozaki [Fri, 23 Jul 2010 17:25:56 +0000 (02:25 +0900)]
lxc: Fix return values of veth.c functions

Previously, the functions in src/lxc/veth.c could sometimes return
positive values on failure rather than -1. This made accurate error
reporting difficult, and led to one failure to catch an error in a
calling function.

This patch makes all the functions in veth.c consistently return 0 on
success, and -1 on failure. It also fixes up the callers to the veth.c
functions where necessary.

Note that this patch may be related to the bug:

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

It will not fix the bug, but should unveil what happens.

* po/POTFILES.in - add veth.c, which previously had no translatable strings
* src/lxc/lxc_controller.c
* src/lxc/lxc_container.c
* src/lxc/lxc_driver.c    - fixup callers to veth.c, and remove error logs,
                            as they are now done in veth.c
* src/lxc/veth.c - make all functions consistently return -1 on error.
* src/lxc/veth.h - use ATTRIBUTE_NONNULL to protect against NULL args.

14 years agoEliminate memory leak in xenUnifiedDomainInfoListFree
Laine Stump [Thu, 29 Jul 2010 13:41:33 +0000 (09:41 -0400)]
Eliminate memory leak in xenUnifiedDomainInfoListFree

This fixes a leak described in

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

xenUnifiedDomainInfoList has a pointer to a list of pointers to
xenUnifiedDomain. We were freeing up all the domains, but neglecting
to free the list.

This was found by Paolo Bonzini <pbonzini@redhat.com>.

14 years agolxc: Fix 'autostart' doesn't take effect actually
Ryota Ozaki [Thu, 29 Jul 2010 14:21:17 +0000 (23:21 +0900)]
lxc: Fix 'autostart' doesn't take effect actually

lxcStartup forgot to call lxcAutostartConfigs. Fix it.

This patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=589863 .

14 years agoFix --with-xen-proxy related compile error
Matthias Bolte [Thu, 29 Jul 2010 14:03:48 +0000 (16:03 +0200)]
Fix --with-xen-proxy related compile error

Move virDomainChrTargetTypeToString out of the #ifndef PROXY
block, because it's used outside of it.

14 years agoFix a potential race in pciInitDevice.
Chris Lalancette [Wed, 28 Jul 2010 18:07:08 +0000 (14:07 -0400)]
Fix a potential race in pciInitDevice.

If detecting the FLR flag of a pci device fails, then we
could run into the situation of trying to close a file
descriptor twice, once in pciInitDevice() and once in pciFreeDevice().
Fix that by removing the pciCloseConfig() in pciInitDevice() and
just letting pciFreeDevice() handle it.

Thanks to Chris Wright for pointing out this problem.

While we are at it, fix an error check.  While it would actually
work as-is (since success returns 0), it's still more clear to
check for < 0 (as the rest of the code does).

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoqemu: virtio console support
Cole Robinson [Wed, 14 Jul 2010 17:02:04 +0000 (13:02 -0400)]
qemu: virtio console support

Enable specifying a virtio console device with:

<console type='pty'>
  <target type='virtio'/>
</console>

14 years agodomain conf: Track <console> target type
Cole Robinson [Thu, 22 Jul 2010 17:56:21 +0000 (13:56 -0400)]
domain conf: Track <console> target type

All <console> devices now export a <target> type attribute. QEMU defaults
to 'serial', UML defaults to 'uml, xen can be either 'serial' or 'xen'
depending on fullvirt. Understandably there is lots of test fallout.

This will be used to differentiate between a serial vs. virtio console for
QEMU.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agodomain conf: char: Add an explicit targetType field
Cole Robinson [Tue, 13 Jul 2010 20:06:38 +0000 (16:06 -0400)]
domain conf: char: Add an explicit targetType field

targetType only tracks the actual <target> format we are parsing. Currently
we only fill abide this value for channel devices.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agodomain conf: Rename character prop targetType -> deviceType
Cole Robinson [Tue, 13 Jul 2010 19:05:34 +0000 (15:05 -0400)]
domain conf: Rename character prop targetType -> deviceType

There is actually a difference between the character device type (serial,
parallel, channel, ...) and the target type (virtio, guestfwd). Currently
they are awkwardly conflated.

Start to pull them apart by renaming targetType -> deviceType. This is
an entirely mechanical change.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agodocs: domain: Document virtio <channel>
Cole Robinson [Wed, 14 Jul 2010 19:07:59 +0000 (15:07 -0400)]
docs: domain: Document virtio <channel>

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agotests: Test qemuxml2xml when expected xml changes
Cole Robinson [Sat, 24 Jul 2010 22:18:18 +0000 (18:18 -0400)]
tests: Test qemuxml2xml when expected xml changes

Add tests for auto memballon, implicit IDE, SCSI, virtio channel
controllers, and console/serial back compat.

Additionally, an explicit qemuxml2argvtest for scsi disks is added.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 years agofix handling of PORT_PROFILE_RESPONSE_INPROGRESS netlink message
Gerhard Stenzel [Wed, 28 Jul 2010 14:17:21 +0000 (16:17 +0200)]
fix handling of PORT_PROFILE_RESPONSE_INPROGRESS netlink message

During function test of the 802.1Qbg implementation in lldpad we came
across a small problem in the handling of the netlink message
corresponding to PORT_PROFILE_RESPONSE_INPROGRESS. This should not
result in returning the default rc=1.

- src/util/macvtap.c: fix getPortProfileStatus() to return 0 in that
  case and also fix an indentation problem

14 years agomaint: fix comment typos
Eric Blake [Wed, 28 Jul 2010 14:05:55 +0000 (08:05 -0600)]
maint: fix comment typos

* src/network/bridge_driver.c
(networkAddMasqueradingIptablesRules): Fix spelling and grammar.

14 years agoFix up confusing indentation in qemudDomainAttachHostPciDevice.
Chris Lalancette [Tue, 27 Jul 2010 16:58:48 +0000 (12:58 -0400)]
Fix up confusing indentation in qemudDomainAttachHostPciDevice.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agomaint: turn on gcc logical-op checking
Eric Blake [Fri, 23 Jul 2010 20:28:31 +0000 (14:28 -0600)]
maint: turn on gcc logical-op checking

This would have detected the bug in commit 38ad33931 (Aug 09), which
we missed until commit f828ca35 (Jul 10); over 11 months later.

However, on Fedora 13, it also triggers LOTS of warnings from
the libcurl-devel header for two files:

esx/esx_vi.c: In function 'esxVI_CURL_Perform':
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
...
xenapi/xenapi_driver.c: In function 'call_func':
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
...

libcurl allows to disable the type-checking code that triggers those
warnings, along with the reduction in type-safety of calls to some
libcurl functions. I figure this is worth the improved compiler
checking throughout the rest of libvirt.

* acinclude.m4 (--enable-compile-warnings=error): Add -Wlogical-op.
* configure.ac: Add -DCURL_DISABLE_TYPECHECK to LIBCURL_CFLAGS to
avoid compilation warning.

Suggested by Daniel P. Berrange.
Tweaked by Matthias Bolte.

14 years agolibvirt-guests: add reload, condrestart
Eric Blake [Tue, 27 Jul 2010 18:21:31 +0000 (12:21 -0600)]
libvirt-guests: add reload, condrestart

Optional per LSB, but required by Fedora:
https://fedoraproject.org/wiki/Packaging/SysVInitScript

* daemon/libvirt-guests.init.in (main): Add more required
commands.

14 years agolibvirt-guests: enhance status
Eric Blake [Tue, 27 Jul 2010 19:50:35 +0000 (13:50 -0600)]
libvirt-guests: enhance status

LSB and https://fedoraproject.org/wiki/Packaging/SysVInitScript
require status to output something useful, rather than just use
the exit code.

* daemon/libvirt-guests.init.in (rh_status): Break into new routine,
and provide output.
(usage): Document status.

14 years agolibvirt-guests: detect invalid arguments
Eric Blake [Tue, 27 Jul 2010 18:05:27 +0000 (12:05 -0600)]
libvirt-guests: detect invalid arguments

Reject extra arguments.
Return the correct status for unknown arguments, as mandated by
https://fedoraproject.org/wiki/Packaging/SysVInitScript
Add --help, as a permitted extension.

* daemon/libvirt-guests.init.in (usage): New function.  Use it in
more places, and return correct value.

14 years agoInvert logic for checking for QEMU disk cache options
Daniel P. Berrange [Tue, 27 Jul 2010 10:21:10 +0000 (11:21 +0100)]
Invert logic for checking for QEMU disk cache options

QEMU has had two different syntax for disk cache options

 Old: on|off
 New: writeback|writethrough|none

QEMU recently added another 'unsafe' option which broke the
libvirt check. We can avoid this & future breakage, if we
do a negative check for the old syntax, instead of a positive
check for the new syntax

* src/qemu/qemu_conf.c: Invert cache option check

14 years agoqemu: Allow setting boot menu on/off
Cole Robinson [Mon, 26 Jul 2010 14:28:58 +0000 (10:28 -0400)]
qemu: Allow setting boot menu on/off

Add a new element to the <os> block:

  <bootmenu enable="yes|no"/>

Which maps to -boot,menu=on|off on the QEMU command line.

I decided to use an explicit 'enable' attribute rather than just make the
bootmenu element boolean. This allows us to treat lack of a bootmenu element
as 'use hypervisor default'.

14 years agodocs: Link wiki FAQ to main page
Cole Robinson [Mon, 26 Jul 2010 14:32:42 +0000 (10:32 -0400)]
docs: Link wiki FAQ to main page

Since DV recommended keeping the build instructions distributed with the
source, move them from the old FAQ to the downloads page.

14 years agoqemu: Error on unsupported graphics config
Cole Robinson [Mon, 26 Jul 2010 14:30:01 +0000 (10:30 -0400)]
qemu: Error on unsupported graphics config

Throw an explicit error if multiple graphics devices are specified, or
an unsupported type is specified (rdp).

14 years agolibvirt-guests: Don't throw errors if libvirtd is not installed
Jiri Denemark [Tue, 27 Jul 2010 12:21:51 +0000 (14:21 +0200)]
libvirt-guests: Don't throw errors if libvirtd is not installed

When only client parts of libvirt are installed (i.e., no libvirtd
daemon), libvirt-guests init script in its default configuration would
throw seriously looking errors during host shutdown:

Running guests on default URI: error: unable to connect to
'/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No
such file or directory
error: failed to connect to the hypervisor

This patch changes the script to print rather harmless message in that
situation:

Running guests on default URI: libvirtd not installed; skipping this
URI.

14 years agoForce FLR on for buggy SR-IOV devices.
Chris Lalancette [Fri, 23 Jul 2010 19:03:29 +0000 (15:03 -0400)]
Force FLR on for buggy SR-IOV devices.

Some buggy PCI devices actually support FLR, but
forget to advertise that fact in their PCI config space.
However, Virtual Functions on SR-IOV devices are
*required* to support FLR by the spec, so force has_flr
on if this is a virtual function.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agobuild: fix VPATH builds
Eric Blake [Mon, 26 Jul 2010 16:38:30 +0000 (10:38 -0600)]
build: fix VPATH builds

After the recent libvirt-qemu library addition, VPATH builds fail with:

  CC     libvirt_qemu_la-libvirt-qemu.lo
In file included from ../../src/libvirt-qemu.c:29:
../../include/libvirt/libvirt-qemu.h:17:22: error: libvirt.h: No such file or directory
...
  CCLD   libvirt-qmeu.la
/usr/bin/ld: cannot open linker script file libvirt_qemu.syms: No such file or directory

This fixes both issues (there are still some documentation VPATH issues,
but those don't show up with 'make check').

* configure.ac (LIBVIRT_QEMU_SYMBOL_FILE): While libvirt.syms is
generated and lives in $(builddir), libvirt_qemu.syms is static
and lives in $(srcdir).
* include/libvirt/libvirt-qemu.h (includes): Pull in libvirt.h via
the public location, since this is a public header.

14 years agopciResetDevice: use inactive devices to determine safe reset
Chris Wright [Mon, 26 Jul 2010 16:43:04 +0000 (18:43 +0200)]
pciResetDevice: use inactive devices to determine safe reset

When doing a PCI secondary bus reset, we must be sure that there are no
active devices on the same bus segment.  The active device tracking is
designed to only track host devices that are active in use by guests.
This ignores host devices that are actively in use by the host.  So the
current logic will reset host devices.

Switch this logic around and allow sbus reset when we are assigning all
devices behind a bridge to the same guest at guest startup or as a result
of a single attach-device command.

* src/util/pci.h: change signature of pciResetDevice to add an
  inactive devices list
* src/qemu/qemu_driver.c src/xen/xen_driver.c: use (or not) the new
  functionality of pciResetDevice() depending on the place of use
* src/util/pci.c: implement the interface and logic changes

14 years agoqemudDomainAttachHostPciDevice refactor to use new helpers
Chris Wright [Mon, 26 Jul 2010 16:34:24 +0000 (18:34 +0200)]
qemudDomainAttachHostPciDevice refactor to use new helpers

- src/qemu/qemu_driver.c: Eliminate code duplication by using the new
  helpers qemuPrepareHostdevPCIDevices and qemuDomainReAttachHostdevDevices.
  This reduces the number of open coded calls to pciResetDevice.

14 years agoAdd helpers qemuPrepareHostdevPCIDevice and qemuDomainReAttachHostdevDevices
Chris Wright [Mon, 26 Jul 2010 16:23:17 +0000 (18:23 +0200)]
Add helpers qemuPrepareHostdevPCIDevice and qemuDomainReAttachHostdevDevices

- src/qemu/qemu_driver.c: These new helpers take hostdev list and count
  directly rather than getting them indirectly from domain definition.
  This will allow reuse for the attach-device case.

14 years agoqemuGetPciHostDeviceList take hostdev list directly
Chris Wright [Mon, 26 Jul 2010 16:17:20 +0000 (18:17 +0200)]
qemuGetPciHostDeviceList take hostdev list directly

- src/qemu/qemu_driver.c: Update qemuGetPciHostDeviceList to take a
  hostdev list and count directly, rather than getting this indirectly
  from domain definition. This will allow reuse for the attach-device case.

14 years agoesx: Support vSphere 4.1
Matthias Bolte [Wed, 21 Jul 2010 23:19:04 +0000 (01:19 +0200)]
esx: Support vSphere 4.1

Also accept version > 4.1, but output a warning.

14 years agoesx: Add vpx:// scheme to allow direct connection to a vCenter
Matthias Bolte [Sun, 18 Jul 2010 15:27:05 +0000 (17:27 +0200)]
esx: Add vpx:// scheme to allow direct connection to a vCenter

Add a pointer to the primary context of a connection and use it in all
driver functions that don't dependent on the context type. This includes
almost all functions that deal with a virDomianPtr. Therefore, using
a vpx:// connection allows you to perform all the usual domain related
actions like start, destroy, suspend, resume, dumpxml etc.

Some functions that require an explicitly specified ESX server don't work
yet. This includes the host UUID, the hostname, the general node info, the
max vCPU count and the free memory. Also not working yet are migration and
defining new domains.

14 years agoesx: Don't ignore the vcenter query parameter
Matthias Bolte [Tue, 13 Jul 2010 20:44:07 +0000 (22:44 +0200)]
esx: Don't ignore the vcenter query parameter

Since 070f61002f47b602c15d1e4950a122ac9edefe1b the vcenter query
parameter has been ignored, because the refactoring to use
esxUtil_ParseQuery was incomplete. This effectively broke migration,
because the vcenter query parameter is essential for a migration.

14 years agoesx: Add autodetection for the SCSI controller model
Matthias Bolte [Tue, 6 Jul 2010 17:02:48 +0000 (19:02 +0200)]
esx: Add autodetection for the SCSI controller model

This works for file-backed SCSI disk device with a datastore
related source path.

14 years agoesx: Allow 'vmpvscsi' as SCSI controller model
Matthias Bolte [Thu, 24 Jun 2010 14:58:54 +0000 (16:58 +0200)]
esx: Allow 'vmpvscsi' as SCSI controller model

14 years agosecaatest: Fix compilation
Matthias Bolte [Fri, 23 Jul 2010 16:49:48 +0000 (18:49 +0200)]
secaatest: Fix compilation

Since 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 virSecurityDriverStartup
takes and additional parameter to control disk format probing.

Pass false as third parameter.

14 years agovirt-aa-helper-test: Fix failure due to the new disk format probing option
Matthias Bolte [Fri, 23 Jul 2010 16:43:37 +0000 (18:43 +0200)]
virt-aa-helper-test: Fix failure due to the new disk format probing option

Commit 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 added the disk format
probing option. This makes virt-aa-helper-test fail because the domain
config didn't specifiy the disk format and it didn't pass '-p 1' to
virt-aa-helper to allow disk format probing.

Specify the disk format in the domain config. Pass the '-p 1' option
to virt-aa-helper for the test case with two disks. This way this test
also covers this new option.

14 years agovirt-aa-helper: Make getopt accept the p option
Matthias Bolte [Fri, 23 Jul 2010 16:41:42 +0000 (18:41 +0200)]
virt-aa-helper: Make getopt accept the p option

Commit 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 added the
p option to control disk format probing, but it wasn't added
to the getopt_long optstring parameter.

Add the p option to the getopt_long optstring parameter.

14 years agovirt-aa-helper: Fix return value of add_file_path
Matthias Bolte [Fri, 23 Jul 2010 16:27:43 +0000 (18:27 +0200)]
virt-aa-helper: Fix return value of add_file_path

Commit a8853344994a7c6aaca882a5e949ab5536821ab5 added this
function and wrapped vah_add_file in it. vah_add_file may
return -1, 0, 1. It returns 1 in case the call to valid_path
detects a restricted file. The original code treated a return
value != 0 as error. The refactored code treats a return
value < 0 as error. This triggers segfault in virt-aa-helper
and breaks virt-aa-helper-test for the restricted file tests.

Make sure that add_file_path returns -1 on error.

14 years agovirt-aa-helper: Ignore open errors again
Matthias Bolte [Fri, 23 Jul 2010 16:09:46 +0000 (18:09 +0200)]
virt-aa-helper: Ignore open errors again

virt-aa-helper used to ignore errors when opening files.
Commit a8853344994a7c6aaca882a5e949ab5536821ab5 refactored
the related code and changed this behavior. virt-aa-helper
didn't ignore open errors anymore and virt-aa-helper-test
fails.

Make sure that virt-aa-helper ignores open errors again.

14 years agoqemu-api: avoid build failure
Eric Blake [Fri, 23 Jul 2010 23:01:10 +0000 (17:01 -0600)]
qemu-api: avoid build failure

* src/remote_protocol-structs: Tweak to match intentional type
change (with no ABI change) in remote protocol.

14 years agoAdd tests for the new Qemu namespace XML.
Chris Lalancette [Tue, 20 Apr 2010 21:22:49 +0000 (17:22 -0400)]
Add tests for the new Qemu namespace XML.

Thanks to DV for knocking together the Relax-NG changes
quickly for me.

Changes since v1:
 - Change the domain.rng to correspond to the new schema
 - Don't allocate caps->ns in testQemuCapsInit since it is a static table

Changes since v2:
 - Change domain.rng to add restrictions on allowed environment names

Changes since v3:
 - Remove a bogus comment in the tests

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoQemu remote protocol.
Chris Lalancette [Sat, 17 Apr 2010 02:09:25 +0000 (22:09 -0400)]
Qemu remote protocol.

Since we are adding a new "per-hypervisor" protocol, we
make it so that the qemu remote protocol uses a new
PROTOCOL and PROGRAM number.  This allows us to easily
distinguish it from the normal REMOTE protocol.

This necessitates changing the proc in remote_message_header
from a "remote_procedure" to an "unsigned", which should
be the same size (and thus preserve the on-wire protocol).

Changes since v1:
 - Fixed up a couple of script problems in remote_generate_stubs.pl
 - Switch an int flag to a bool in dispatch.c

Changes since v2:
 - None

Changes since v3:
 - Change unsigned proc to signed proc, to conform to spec

Signed-off-by: Chris Lalancette <clalance@redhat.com>
14 years agoQemu arbitrary monitor commands.
Chris Lalancette [Sat, 17 Apr 2010 02:12:45 +0000 (22:12 -0400)]
Qemu arbitrary monitor commands.

Implement the qemu driver's virDomainQemuMonitorCommand
and hook it into the API entry point.

Changes since v1:
 - Rename the (external) qemuMonitorCommand to qemuDomainMonitorCommand
 - Add virCheckFlags to qemuDomainMonitorCommand

Changes since v2:
 - Drop ATTRIBUTE_UNUSED from the flags

Changes since v3:
 - Add a flag to priv so we only print out monitor command warning once.  Note
   that this has not been plumbed into qemuDomainObjPrivateXMLFormat or
   qemuDomainObjPrivateXMLParse, which means that if you run a monitor command,
   restart libvirtd, and then run another monitor command, you may get an
   an erroneous VIR_INFO.  It's a pretty minor matter, and I didn't think it
   warranted the additional code.
 - Add BeginJob/EndJob calls around EnterMonitor/ExitMonitor

Signed-off-by: Chris Lalancette <clalance@redhat.com>