]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
13 years agosnapshot: forbid snapshot on autodestroy domain
Eric Blake [Fri, 26 Aug 2011 23:29:18 +0000 (17:29 -0600)]
snapshot: forbid snapshot on autodestroy domain

There is no reason to forbid pausing an autodestroy domain
(not to mention that 'virsh start --paused --autodestroy'
succeeds in creating a paused autodestroy domain).

Meanwhile, qemu was failing to enforce the API documentation that
autodestroy domains cannot be saved.  And while the original
documentation only mentioned save/restore, snapshots are another
form of saving that are close enough in semantics as to make no
sense on one-shot domains.

* src/qemu/qemu_driver.c (qemudDomainSuspend): Drop bogus check.
(qemuDomainSaveInternal, qemuDomainSnapshotCreateXML): Forbid
saves of autodestroy domains.
* src/libvirt.c (virDomainCreateWithFlags, virDomainCreateXML):
Document snapshot interaction.

13 years agoFix error detection in device change
Philipp Hahn [Tue, 30 Aug 2011 14:59:24 +0000 (16:59 +0200)]
Fix error detection in device change

According to qemu-kvm/qerror.c all messages start with a capital
"Device ", but the current code only scans for the lower case "device ".
This results in "virDomainUpdateDeviceFlags()" to not detect locked
CD-ROMs and reporting success even in the case of a failure:
# virsh qemu-monitor-command "$VM" change\ drive-ide0-0-0\ \"/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso\"
Device 'drive-ide0-0-0' is locked
# virsh update-device "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><driver name='qemu' type='raw'/><source file='/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso'/><target dev='hda' bus='ide'/><readonly/><alias name='ide0-0-0'/><address type='drive' controller='0' bus='0' unit='0'/></disk>"
Device updated successfully

Signed-off-by: Philipp Hahn <hahn@univention.de>
13 years agostart: allow discarding managed save
Eric Blake [Sat, 27 Aug 2011 23:07:18 +0000 (17:07 -0600)]
start: allow discarding managed save

There have been several instances of people having problems with
a broken managed save file, and not aware that they could use
'virsh managedsave-remove dom' to fix things.  Making it possible
to do this as part of starting a domain makes the same functionality
easier to find, and one less API call.

* include/libvirt/libvirt.h.in (VIR_DOMAIN_START_FORCE_BOOT): New
flag.
* src/libvirt.c (virDomainCreateWithFlags): Document it.
* src/qemu/qemu_driver.c (qemuDomainObjStart): Alter signature.
(qemuAutostartDomain, qemuDomainStartWithFlags): Update callers.
* tools/virsh.c (cmdStart): Expose it in virsh.
* tools/virsh.pod (start): Document it.

13 years agobuild: simplify use of verify
Eric Blake [Fri, 26 Aug 2011 16:17:48 +0000 (10:17 -0600)]
build: simplify use of verify

Back in 2008 when this line of util.h was written, gnulib's verify
module didn't allow the use of multiple verify() in one file
in combination with our choice of gcc -W options.  But that has
since been fixed in gnulib, and newer gnulib even maps verify()
to the C1x feature of _Static_assert, which gives even nicer
diagnostics with a new enough compiler, so we might as well go
with the simpler verify().

* src/util/util.h (VIR_ENUM_IMPL): Use simpler verify, now that
gnulib module is smarter.

13 years agoqemu: properly label outgoing pipe for tunneled migration
Eric Blake [Mon, 29 Aug 2011 23:31:42 +0000 (17:31 -0600)]
qemu: properly label outgoing pipe for tunneled migration

Commit 3261761 made it possible to use pipes instead of sockets
for outgoing tunneled migration; however, it caused a regression
because the pipe was never given a SELinux label.

* src/qemu/qemu_migration.c (doTunnelMigrate): Label outgoing pipe.

13 years agorpc: fix a typo in debugging log in virNetServerProgramSendStreamData
Guannan Ren [Sun, 28 Aug 2011 05:46:52 +0000 (13:46 +0800)]
rpc: fix a typo in debugging log in virNetServerProgramSendStreamData

The bufferOffset has been initialized to zero in virNetMessageEncodePayloadRaw(),
so, we use bufferLength to represent the length of message which is going to be
sent to client side.

13 years agomaint: fix spelling errors on lose
Eric Blake [Fri, 26 Aug 2011 22:48:24 +0000 (16:48 -0600)]
maint: fix spelling errors on lose

* docs/drvqemu.html.in: Fix typo.
* src/libvirt.c (virDomainCreateXML, virDomainCreateWithFlags):
Likewise.

13 years agoFix generator to cope with call-by-ref long types
Jim Fehlig [Fri, 26 Aug 2011 17:46:41 +0000 (11:46 -0600)]
Fix generator to cope with call-by-ref long types

From: Matthias Bolte <matthias.bolte@googlemail.com>
Tested-by: Jim Fehlig <jfehlig@novell.com>
Matthias provided this patch to fix an issue I encountered in the
generator with APIs containing call-by-ref long type, e.g.

int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
                                unsigned long *bandwidth,
                                unsigned int flags);

13 years agohyperv: Add basic documentation
Matthias Bolte [Wed, 13 Jul 2011 15:13:42 +0000 (17:13 +0200)]
hyperv: Add basic documentation

13 years agohyperv: Add basic driver for Microsoft Hyper-V
Matthias Bolte [Wed, 13 Jul 2011 15:16:47 +0000 (17:16 +0200)]
hyperv: Add basic driver for Microsoft Hyper-V

Domain listing, basic information retrieval and domain life cycle
management is implemented. But currently the domain XML output
lacks the complete devices section.

The driver uses OpenWSMAN to directly communicate with a Hyper-V
server over its WS-Management interface exposed via Microsoft WinRM.

The driver is based on the work of Michael Sievers. This started in
the same master program project group at the University of Paderborn
as the ESX driver.

See Michael's blog for details: http://hyperv4libvirt.wordpress.com/

13 years agohyperv: Add OpenWSMAN based client for the Hyper-V WMI API
Matthias Bolte [Wed, 13 Jul 2011 15:05:19 +0000 (17:05 +0200)]
hyperv: Add OpenWSMAN based client for the Hyper-V WMI API

Add a generator script to generate the structs and serialization
information for OpenWSMAN.

openwsman.h collects workarounds for problems in OpenWSMAN <= 2.2.6.
There are also disabled sections that would use ws_serializer_free_mem
but can't because it's broken in OpenWSMAN <= 2.2.6. Patches to fix
this have been posted upstream.

13 years agohyperv: Add driver skeleton
Matthias Bolte [Wed, 13 Jul 2011 14:47:01 +0000 (16:47 +0200)]
hyperv: Add driver skeleton

13 years agohyperv: Add configure check for OpenWSMAN
Matthias Bolte [Wed, 13 Jul 2011 14:05:18 +0000 (16:05 +0200)]
hyperv: Add configure check for OpenWSMAN

13 years agoschedinfo: update man page about virsh schedinfo command
Taku Izumi [Fri, 26 Aug 2011 06:48:27 +0000 (15:48 +0900)]
schedinfo: update man page about virsh schedinfo command

This patch updates the man page about virsh schedinfo command.

 - fix typo: 1844674407370955 -> 18446744073709551
 - describe the value 0 of vcpu_period and vcpu_quota parameters

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
13 years agoFix persistent migration config save
KAMEZAWA Hiroyuki [Fri, 26 Aug 2011 03:08:11 +0000 (12:08 +0900)]
Fix persistent migration config save

When a user migrates a domain by command as

libvirt saves vm's domain XML config in destination host after migration.
But it saves vm->def. Then, the saved XML contains some garbage.

  <domain type='kvm' id='50'>
                     ^^^^^^^^
  ...
   <console type='pty' tty='/dev/pts/5'>
                       ^^^^^^^^^^^^^^^^^

Avoid saving unnecessary things by saving persistent vm definition.

13 years agorpc: Don't close connection if program is unknown
Jiri Denemark [Fri, 26 Aug 2011 15:11:03 +0000 (17:11 +0200)]
rpc: Don't close connection if program is unknown

In case we add a new program in the future (we did that in the past and
we are going to do it again soon) current daemon will behave badly with
new client that wants to use the new program. Before the RPC rewrite we
used to just send an error reply to any request with unknown program.
With the RPC rewrite in 0.9.3 the daemon just closes the connection
through which such request was sent. This patch fixes this regression.

13 years agoremote: Refuse connecting to remote socket
Michal Privoznik [Mon, 22 Aug 2011 13:48:52 +0000 (15:48 +0200)]
remote: Refuse connecting to remote socket

If users wants to connect to remote unix socket, e.g.
'qemu+unix://<remote>/system' currently the <remote> part is ignored,
ending up connecting to localhost. Connecting to remote socket is not
supported and user should have used TLS/TCP/SSH instead.

13 years agovirterror: Fix error message for VIR_ERR_INVALID_ARG
Michal Privoznik [Fri, 26 Aug 2011 09:44:05 +0000 (11:44 +0200)]
virterror: Fix error message for VIR_ERR_INVALID_ARG

When a detail message is presented, nobody expects prefix 'invalid
argument in' but something more general, like 'invalid argument:'.

13 years agoDetect errors from the 'sendkey' command
Daniel P. Berrange [Thu, 25 Aug 2011 16:48:25 +0000 (17:48 +0100)]
Detect errors from the 'sendkey' command

On success, the 'sendkey' command does not return any data, so
any data in the reply should be considered to be an error
message

* src/qemu/qemu_monitor_text.c: Treat non-"" reply data as an
  error message for 'sendkey' command

13 years agoFix keymap used to talk with QEMU
Daniel P. Berrange [Thu, 25 Aug 2011 16:45:49 +0000 (17:45 +0100)]
Fix keymap used to talk with QEMU

The QEMU 'sendkey' command expects keys to be encoded in the same
way as the RFB extended keycode set. Specifically it wants extended
keys to have the high bit of the first byte set, while the Linux
XT KBD driver codeset uses the low bit of the second byte. To deal
with this we introduce a new keymap 'RFB' and use that in the QEMU
driver

* include/libvirt/libvirt.h.in: Add VIR_KEYCODE_SET_RFB
* src/qemu/qemu_driver.c: Use RFB keycode set instead of XT KBD
* src/util/virkeycode-mapgen.py: Auto-generate the RFB keycode
  set from the XT KBD set
* src/util/virkeycode.c: Add RFB keycode entry to table. Add a
  verify check on cardinality of the codeOffset table

13 years agovirsh: Clarify documentation of -d option
Jiri Denemark [Fri, 26 Aug 2011 09:02:10 +0000 (11:02 +0200)]
virsh: Clarify documentation of -d option

The default is 4, not 0.

13 years agoqemu: Correctly label migration TCP socket
Jiri Denemark [Wed, 17 Aug 2011 11:26:09 +0000 (13:26 +0200)]
qemu: Correctly label migration TCP socket

13 years agosecurity: Introduce SetSocketLabel
Jiri Denemark [Fri, 26 Aug 2011 07:39:32 +0000 (09:39 +0200)]
security: Introduce SetSocketLabel

This API labels all sockets created until ClearSocketLabel is called in
a way that a vm can access them (i.e., they are labeled with svirt_t
based label in SELinux).

13 years agosecurity: Rename SetSocketLabel APIs to SetDaemonSocketLabel
Jiri Denemark [Fri, 26 Aug 2011 07:05:57 +0000 (09:05 +0200)]
security: Rename SetSocketLabel APIs to SetDaemonSocketLabel

The APIs are designed to label a socket in a way that the libvirt daemon
itself is able to access it (i.e., in SELinux the label is virtd_t based
as opposed to svirt_* we use for labeling resources that need to be
accessed by a vm). The new name reflects this.

13 years agoIgnore unused streams in virStreamAbort
Jiri Denemark [Mon, 15 Aug 2011 09:28:53 +0000 (11:28 +0200)]
Ignore unused streams in virStreamAbort

When virStreamAbort is called on a stream that has not been used yet,
quite confusing error is returned: "this function is not supported by
the connection driver". Let's just ignore such streams as there's
nothing to abort anyway.

13 years agoDo not try to cancel non-existent migration on source
Jiri Denemark [Fri, 12 Aug 2011 18:46:07 +0000 (20:46 +0200)]
Do not try to cancel non-existent migration on source

If migration failed on source daemon, the migration is automatically
canceled by the daemon itself. Thus we don't need to call
virDomainMigrateConfirm3(cancelled=1). Calling it doesn't cause any harm
but the resulting error message printed in logs may confuse people.

13 years agosnapshot: track current snapshot across restarts
Eric Blake [Thu, 25 Aug 2011 21:11:03 +0000 (15:11 -0600)]
snapshot: track current snapshot across restarts

Audit all changes to the qemu vm->current_snapshot, and make them
update the saved xml file for both the previous and the new
snapshot, so that there is always at most one snapshot with
<active>1</active> in the xml, and that snapshot is used as the
current snapshot even across libvirtd restarts.

This patch does not fix the case of virDomainSnapshotDelete(,CHILDREN)
where one of the children is the current snapshot; that will be later.

* src/conf/domain_conf.h (_virDomainSnapshotDef): Alter member
type and name.
* src/conf/domain_conf.c (virDomainSnapshotDefParseString)
(virDomainSnapshotDefFormat): Update clients.
* docs/schemas/domainsnapshot.rng: Tighten rng.
* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Reload current
snapshot.
(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
(qemuDomainSnapshotDiscard): Track current snapshot.

13 years agosnapshot: only pass snapshot to qemu command line when reverting
Eric Blake [Thu, 25 Aug 2011 20:44:48 +0000 (14:44 -0600)]
snapshot: only pass snapshot to qemu command line when reverting

Changing the current vm, and writing that change to the file
system, all before a new qemu starts, is risky; it's hard to
roll back if starting the new qemu fails for some reason.
Instead of abusing vm->current_snapshot and making the command
line generator decide whether the current snapshot warrants
using -loadvm, it is better to just directly pass a snapshot all
the way through the call chain if it is to be loaded.

This frees up the last use of snapshot->def->active for qemu's
use, so the next patch can repurpose that field for tracking
which snapshot is current.

* src/qemu/qemu_command.c (qemuBuildCommandLine): Don't use active
field of snapshot.
* src/qemu/qemu_process.c (qemuProcessStart): Add a parameter.
* src/qemu/qemu_process.h (qemuProcessStart): Update prototype.
* src/qemu/qemu_migration.c (qemuMigrationPrepareAny): Update
callers.
* src/qemu/qemu_driver.c (qemudDomainCreate)
(qemuDomainSaveImageStartVM, qemuDomainObjStart)
(qemuDomainRevertToSnapshot): Likewise.
(qemuDomainSnapshotSetCurrentActive)
(qemuDomainSnapshotSetCurrentInactive): Delete unused functions.

13 years agosnapshot: don't leak resources on qemu snapshot failure
Eric Blake [Fri, 12 Aug 2011 20:45:39 +0000 (14:45 -0600)]
snapshot: don't leak resources on qemu snapshot failure

https://bugzilla.redhat.com/show_bug.cgi?id=727709
mentions that if qemu fails to create the snapshot (such as what
happens on Fedora 15 qemu, which has qmp but where savevm is only
in hmp, and where libvirt is old enough to not try the hmp fallback),
then 'virsh snapshot-list dom' will show a garbage snapshot entry,
and the libvirt internal directory for storing snapshot metadata
will have a bogus file.

This fixes the fallout bug of polluting the snapshot-list with
garbage on failure (the root cause of the F15 bug of not having
fallback to hmp has already been fixed in newer libvirt releases).

* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Allocate
memory before making snapshot, and cleanup on failure.  Don't
dereference NULL if transient domain exited during snapshot creation.

13 years agolibvirt: avoid dead store in virDomainMigrateVersion3
Alex Jia [Tue, 16 Aug 2011 09:24:26 +0000 (17:24 +0800)]
libvirt: avoid dead store in virDomainMigrateVersion3

* src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
  clang warning.

Detected by ccc-analyzer:

libvirt.c:4277:5: warning: Value stored to 'ret' is never read
    ret = domain->conn->driver->domainMigrateConfirm3
    ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

13 years agoqemu: avoid dead store in doPeer2PeerMigrate3
Alex Jia [Tue, 16 Aug 2011 09:24:25 +0000 (17:24 +0800)]
qemu: avoid dead store in doPeer2PeerMigrate3

* src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
  clang warning.

Detected by ccc-analyzer:

  CC     libvirt_driver_qemu_la-qemu_migration.lo
qemu/qemu_migration.c:2046:5: warning: Value stored to 'ret' is never read
    ret = qemuMigrationConfirm(driver, sconn, vm,
    ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

13 years agoFix command test wrt gnutls initialize & fix debugging
Daniel P. Berrange [Thu, 25 Aug 2011 11:05:54 +0000 (12:05 +0100)]
Fix command test wrt gnutls initialize & fix debugging

The VIR_TEST_DEBUG and VIR_TEST_VERBOSE env vars did not work
because we replaced 'environ' with 'newenv'. Simply calling
virTestGetDebug/Verbose() before replacing the 'environ' ensures
we have processed the env variables.

The gnutls initialization code opens /dev/urandom and keeps that
FD around for later use. We have code which kills off FDs 3-5
to avoid interfereing with our test case. Move the virInitialize
call before this point, so it kills off the gnutls /dev/urandom
FD which is irrelevant for testing purposes

* tests/commandtest.c: Fix test debugging & make it robust against
  opened FDs

13 years agodaemon: Move TLS initialization to virInitialize
Michal Privoznik [Wed, 24 Aug 2011 14:16:45 +0000 (16:16 +0200)]
daemon: Move TLS initialization to virInitialize

My previous patch 74c75671331d284e1f777f9692b72e9737520bf0
introduced a regression by removing TLS initialization from client.

13 years agoutil: only fchown newly created files in virFileOpenAs
Laine Stump [Wed, 24 Aug 2011 08:50:49 +0000 (04:50 -0400)]
util: only fchown newly created files in virFileOpenAs

virFileOpenAs takes desired uid:gid as arguments, and not only uses
them for a fork/setuid/setgid when retrying failed open operations,
but additionally always forces the opened file to be owned by the
given uid:gid.

One example of the problems this causes is that, when restoring a
domain from a file that is owned by the qemu user, opening the file
chowns it to root. if dynamic_ownership=1 this is coincidentally
expected, but if dynamic_ownership=0, no existing file should ever
have its ownership changed.

This patch adds an extra check before calling fchown() - it only does
it if O_CREAT was passed to virFileOpenAs() in the openflags.

13 years agoqemu: fix off-by-one in pci slot reservation
Shradha Shah [Wed, 24 Aug 2011 15:31:48 +0000 (16:31 +0100)]
qemu: fix off-by-one in pci slot reservation

Signed-off-by: Steve Hodgson <shodgson@solarflare.com>
13 years agomaint: attribute second author of previous patch
Steve Hodgson [Wed, 24 Aug 2011 16:48:20 +0000 (10:48 -0600)]
maint: attribute second author of previous patch

Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agopci: fix pciDeviceListSteal on multiple devices
Shradha Shah [Wed, 24 Aug 2011 15:30:51 +0000 (16:30 +0100)]
pci: fix pciDeviceListSteal on multiple devices

pciDeviceListSteal(pcidevs, dev) removes dev from pcidevs reducing
the length of pcidevs, so moving onto what was the next dev is wrong.

Instead callers should pop entry 0 repeatedly until pcidevs is empty.

Signed-off-by: Steve Hodgson <shodgson@solarflare.com>
Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agolibvirt: log all flags parameters
Eric Blake [Tue, 16 Aug 2011 20:24:12 +0000 (14:24 -0600)]
libvirt: log all flags parameters

I was testing a virsh patch, and wanted to see if I had passed the
flags I thought.  But with LIBVIRT_DEBUG in the environment, I just
saw:

14:24:52.359: 15022: debug : virDomainSnapshotNum:15586 : dom=0xc9c180, (VM: name=rhel_6-64, uuid=48f8e8e7-e14f-0e14-02f0-ce71997bdcab),

including a trailing space.  This fixes the issues.

* src/libvirt.c: Log flag parameters, even if currently unused.
(VIR_DOMAIN_DEBUG_0): Drop trailing comma in log.
(VIR_DOMAIN_DEBUG_1): Split guts into...
(VIR_DOMAIN_DEBUG_2): ...new macro.

13 years agovirsh: add list --managed-save
Eric Blake [Fri, 19 Aug 2011 00:09:14 +0000 (18:09 -0600)]
virsh: add list --managed-save

Knowing whether 'virsh start' will resume a saved image or do
a fresh boot is useful enough to expose via 'virsh list'.

Also, translate the state column.

* tools/virsh.c (cmdList): add --managed-save flag
* tools/virsh.pod (list): Document it.
Based on a suggestion by Miklos Vajna.

13 years agoesx: Use $(PYTHON) instead of the shebang to run the generator
Matthias Bolte [Tue, 23 Aug 2011 21:40:40 +0000 (23:40 +0200)]
esx: Use $(PYTHON) instead of the shebang to run the generator

13 years agoqemu: Report error if qemu monitor command not found for BlockJob
Osier Yang [Wed, 24 Aug 2011 06:39:42 +0000 (14:39 +0800)]
qemu: Report error if qemu monitor command not found for BlockJob

* src/qemu/qemu_monitor_json.c: Handle error "CommandNotFound" and
  report the error.

* src/qemu/qemu_monitor_text.c: If a sub info command is not found,
  it prints the output of "help info", for other commands,
  "unknown command" is printed.

Without this patch, libvirt always report:

  An error occurred, but the cause is unknown

This patch was adapted from a patch by Osier Yang <jyang@redhat.com> to
break out detection of unrecognized text monitor commands into a separate
function.

Signed-off-by: Adam Litke <agl@us.ibm.com>
13 years agoesx: Refactor a repeated string in the generator
Matthias Bolte [Tue, 23 Aug 2011 21:15:21 +0000 (23:15 +0200)]
esx: Refactor a repeated string in the generator

13 years agomaint: fix comment typos
Eric Blake [Tue, 23 Aug 2011 17:02:02 +0000 (11:02 -0600)]
maint: fix comment typos

* src/qemu/qemu_driver.c (qemuDomainSaveInternal): Fix typo.
* src/conf/domain_event.c (virDomainEventDispatchMatchCallback):
Likewise.
* daemon/libvirtd.c (daemonRunStateInit): Likewise.
* src/lxc/lxc_container.c (lxcContainerChildMountSort): Likewise.
* src/util/virterror.c (virCopyError, virRaiseErrorFull): Likewise.
* src/xenxs/xen_sxpr.c (xenParseSxprSound): Likewise.

13 years agovirsh: Substitute goto label out with cleanup
Osier Yang [Tue, 23 Aug 2011 14:22:51 +0000 (22:22 +0800)]
virsh: Substitute goto label out with cleanup

Introduced by 241cbc13a, pushed under urgent rule.

13 years agovirsh: Do not try to free domain if it is NULL
Osier Yang [Tue, 23 Aug 2011 13:42:22 +0000 (21:42 +0800)]
virsh: Do not try to free domain if it is NULL

Without these patch, there will be error like below if domain
is NULL.

error: invalid domain pointer in virDomainFree

Which is useless.

13 years agoxen: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:53:15 +0000 (16:53 +0800)]
xen: Cleanup improper VIR_ERR_NO_SUPPORT use

13 years agotest: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:32:06 +0000 (16:32 +0800)]
test: Cleanup improper VIR_ERR_NO_SUPPORT use

13 years agostorage: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:31:03 +0000 (16:31 +0800)]
storage: Cleanup improper VIR_ERR_NO_SUPPORT use

13 years agoremote: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:26:26 +0000 (16:26 +0800)]
remote: Cleanup improper VIR_ERR_NO_SUPPORT use

13 years agoqemu: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:23:10 +0000 (16:23 +0800)]
qemu: Cleanup improper VIR_ERR_NO_SUPPORT use

* src/qemu/qemu_command.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_CONFIG_UNSUPPORTED/

* src/qemu/qemu_driver.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

* src/qemu/qemu_process.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

13 years agonodeinfo: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:20:35 +0000 (16:20 +0800)]
nodeinfo: Cleanup improper VIR_ERR_NO_SUPPORT use

13 years agolxc: Cleanup improper VIR_ERR_NO_SUPPORT use
Osier Yang [Tue, 23 Aug 2011 08:17:10 +0000 (16:17 +0800)]
lxc: Cleanup improper VIR_ERR_NO_SUPPORT use

s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

Special case is changes on lxcDomainInterfaceStats, if it's not
implemented on the platform, prints error like:

    lxcError(VIR_ERR_OPERATION_INVALID, "%s",
             _("interface stats not implemented on this platform"));

As the function is supported by driver actually, error like
VIR_ERR_NO_SUPPORT is confused.

13 years agoconf: Cleanup improper use of VIR_ERR_NO_SUPPORT in node_device_conf
Osier Yang [Tue, 23 Aug 2011 07:04:00 +0000 (15:04 +0800)]
conf: Cleanup improper use of VIR_ERR_NO_SUPPORT in node_device_conf

13 years agoqemu: Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_OPERATION_INVALID
Osier Yang [Tue, 23 Aug 2011 06:59:16 +0000 (14:59 +0800)]
qemu: Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_OPERATION_INVALID

* src/qemu/qemu_monitor_text.c: Error like "this function is not
supported by the connection driver" is confused obviously.

13 years agovirsh: Print error if specified bandwidth is invalid for blockjob
Osier Yang [Tue, 23 Aug 2011 06:55:23 +0000 (14:55 +0800)]
virsh: Print error if specified bandwidth is invalid for blockjob

It's strange that the command fails but without any error if one
specifies as not a number.

13 years agosend-key: fix scan keycode map
KAMEZAWA Hiroyuki [Mon, 22 Aug 2011 10:02:15 +0000 (19:02 +0900)]
send-key: fix scan keycode map

Now, bad key-code in send-key can cause segmentation fault in libvirt.
(example)
 % virsh send-key --codeset win32 12
   error: End of file while reading data: Input/output error

This is caused by overrun at scanning keycode array.

Fix it.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
13 years agobuild: work around older systemtap header
Eric Blake [Fri, 1 Jul 2011 18:33:50 +0000 (12:33 -0600)]
build: work around older systemtap header

Systemtap 1.2 <sys/sdt.h> tried to expand STAP_PROBE3 into an
initialization:
  volatile __typeof__(arg) foo = arg;
but that fails if arg was declared as 'char arg[100]'.
Rather than make all callers to PROBE deal with the stupidity
of <sys/sdt.h>, we instead make PROBE cast away the problem.
Some of this preprocessor abuse copies ideas in src/libvirt.c.

* daemon/libvirtd.h (PROBE): Add casts to all arguments, using...
(VIR_ADD_CASTS, VIR_ADD_CAST, VIR_ADD_CAST2, VIR_ADD_CAST3)
(VIR_ADD_CAST_EXPAND, VIR_ADD_CAST_PASTE, VIR_COUNT_ARGS)
(VIR_ARG5, PROBE_EXPAND): New macros.
Reported by Wen Congyang.

13 years agovirsh: properly interleave shared stdout and stderr
Eric Blake [Fri, 19 Aug 2011 15:20:35 +0000 (09:20 -0600)]
virsh: properly interleave shared stdout and stderr

Without this patch, invoking 'virsh >file 2>&1' results in
error messages appearing before normal output, even if they
occurred later in time than the normal output (since stderr
is unbuffered, but stdout waits until a full buffer).

* tools/virsh.c (print_job_progress, vshError): Flush between
stream transitions.
* tests/undefine: Test it.

13 years agomaint: simplify lots of libxml2 clients
Eric Blake [Thu, 18 Aug 2011 21:37:14 +0000 (15:37 -0600)]
maint: simplify lots of libxml2 clients

Repetitive patterns should be factored.  The sign of a good
factorization is a change that kills 5x more lines than it adds :)

* src/conf/domain_conf.c (virDomainDeviceDefParse)
(virDomainSnapshotDefParseString): Use new convenience macros.
* src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
Likewise.
* src/cpu/cpu.c (cpuCompareXML, cpuBaselineXML): Likewise.
* src/esx/esx_vi.c (esxVI_Context_Execute): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationCookieXMLParseStr):
Likewise.
* src/security/virt-aa-helper.c (caps_mockup): Likewise.
* src/test/test_driver.c (testOpenFromFile): Likewise.
* tests/cputest.c (cpuTestLoadXML, cpuTestLoadMultiXML):
Likewise.
* tools/virsh.c (cmdFreecell, makeCloneXML, cmdVNCDisplay)
(cmdTTYConsole, cmdDetachInterface, cmdDetachDisk)
(cmdSnapshotCreate, cmdSnapshotCreateAs, cmdSnapshotCurrent)
(cmdSnapshotList, cmdSnapshotParent): Likewise.

13 years agoxml: add another convenience function
Eric Blake [Thu, 18 Aug 2011 21:01:36 +0000 (15:01 -0600)]
xml: add another convenience function

Often, we want to use XPath functions on the just-parsed document;
fold this into the parser function for convenience.

* src/util/xml.h (virXMLParseHelper): Add argument.
(virXMLParseStrHelper, virXMLParseFileHelper): Delete.
(virXMLParseCtxt, virXMLParseStringCtxt, virXMLParseFileCtxt): New
macros.
* src/libvirt_private.syms (xml.h): Remove deleted functions.
* src/util/xml.c (virXMLParseHelper): Add argument.
(virXMLParseStrHelper, virXMLParseFileHelper): Delete.

13 years agomaint: treat more libxml2 functions as free-like
Eric Blake [Thu, 18 Aug 2011 20:54:43 +0000 (14:54 -0600)]
maint: treat more libxml2 functions as free-like

* cfg.mk (useless_free_options): Add xmlFreeDoc, xmlBufferFree.
* src/esx/esx_vi.c (ESX_VI__TEMPLATE__FREE): Fix offenders.
* tools/virsh.c (cmdFreecell, cmdVNCDisplay, cmdTTYConsole)
(cmdDetachInterface, cmdDetachDisk, cmdSnapshotCreate)
(cmdSnapshotCreateAs, cmdSnapshotList, cmdSnapshotParent):
Likewise.

13 years agotest: rewrite test to match change in behavior
Eric Blake [Fri, 19 Aug 2011 14:57:22 +0000 (08:57 -0600)]
test: rewrite test to match change in behavior

Test failure exposed in commit 7d3390f.

* tests/undefine: Fix to match updated test driver semantics.

13 years agobuild: fix typo in recent test patch
Eric Blake [Fri, 19 Aug 2011 14:14:58 +0000 (08:14 -0600)]
build: fix typo in recent test patch

* src/test/test_driver.c (testDomainUndefineFlags): Use right
variable name.

13 years agoRevert "xen: Allow to undefine a running domain (xm_internal)"
Eric Blake [Fri, 19 Aug 2011 14:19:34 +0000 (08:19 -0600)]
Revert "xen: Allow to undefine a running domain (xm_internal)"

ACK was given too soon.  According to the code, the xm driver is
only used for inactive domains, and has no notion of an active
domain, thus, it cannot support undefine of a running domain.
The real fix for xen needs to be in the unified driver and/or
the xend level.

This reverts commit 49186deda62161599877b0de6f7f4345c50d842a.

13 years agoxen: Allow to undefine a running domain (xm_internal)
Osier Yang [Fri, 19 Aug 2011 13:53:39 +0000 (21:53 +0800)]
xen: Allow to undefine a running domain (xm_internal)

13 years agovmware: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:52:12 +0000 (21:52 +0800)]
vmware: Allow to undefine a running domain

13 years agouml: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:51:42 +0000 (21:51 +0800)]
uml: Allow to undefine a running domain

13 years agotest: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:50:49 +0000 (21:50 +0800)]
test: Allow to undefine a running domain

13 years agoqemu: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:49:37 +0000 (21:49 +0800)]
qemu: Allow to undefine a running domain

13 years agoopenvz: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:48:47 +0000 (21:48 +0800)]
openvz: Allow to undefine a running domain

13 years agolxc: Allow to undefine a running domain
Osier Yang [Fri, 19 Aug 2011 13:47:33 +0000 (21:47 +0800)]
lxc: Allow to undefine a running domain

13 years agolibxl: Allow to undefine a running domain.
Osier Yang [Fri, 19 Aug 2011 13:46:22 +0000 (21:46 +0800)]
libxl: Allow to undefine a running domain.

Undefining a running domain will convert it to trasient, but keep
the domain still running.

13 years agoqemu: Get memory balloon info correctly for text monitor
Osier Yang [Fri, 19 Aug 2011 13:34:59 +0000 (21:34 +0800)]
qemu: Get memory balloon info correctly for text monitor

* src/qemu/qemu_monitor_text.c: BALLOON_PREFIX was defined as
"balloon: actual=", which cause "actual=" is stripped early before
the real parsing. This patch changes BALLOON_PREFIX into "balloon: ",
and modifies related functions, also renames
"qemuMonitorParseExtraBalloonInfo" to "qemuMonitorParseBalloonInfo",
as after the changing, it parses all the info returned by "info balloon".

13 years agobuild: fix compilation on mingw64
Eric Blake [Thu, 18 Aug 2011 00:12:53 +0000 (18:12 -0600)]
build: fix compilation on mingw64

* .gnulib: Update to latest, for getcwd fixes.
* bootstrap: Resync to gnulib.

13 years agostorage: Flush host cache after write
Michal Privoznik [Thu, 18 Aug 2011 12:40:03 +0000 (14:40 +0200)]
storage: Flush host cache after write

Although we are flushing cache after some critical writes (e.g.
volume creation), after some others we do not (e.g. volume cloning).
This patch fix this issue. That is for volume cloning, writing
header of logical volume, and storage wipe.

13 years agodaemon: initialize GnuTLS
Michal Privoznik [Thu, 18 Aug 2011 08:44:08 +0000 (10:44 +0200)]
daemon: initialize GnuTLS

When spice_tls is set but listen_tls is not, we don't initialize
GnuTLS library. So any later gnutls call (e.g. during migration,
where we initialize a certificate) will access uninitialized GnuTLS
internal structs and throws an error.

Although, we might now initialize GnuTLS twice, it is safe according
to the documentation:

    This function can be called many times,
    but will only do something the first time.

This patch creates 2 functions: virNetTLSInit and virNetTLSDeinit
with respect to written above.

13 years agoschedinfo: add missing documentation
Taku Izumi [Fri, 19 Aug 2011 08:53:22 +0000 (16:53 +0800)]
schedinfo: add missing documentation

This patch adds the missing documentation about the scheduler parameter
"vcpu_period" and "vcpu_quota".

13 years agomaint: ignore generated file
Eric Blake [Thu, 18 Aug 2011 23:03:26 +0000 (17:03 -0600)]
maint: ignore generated file

I did 'git add .' while in the middle of 'make syntax-check', and
it picked up a temporary file that should not be committed.

* .gitignore: Ignore sc_* from syntax check.

13 years agobuild: fix virnetsocket on mingw
Eric Blake [Wed, 17 Aug 2011 17:52:38 +0000 (11:52 -0600)]
build: fix virnetsocket on mingw

Regression introduced in commit 5d30db0.

* src/rpc/virnetsocket.c (virNetSocketNewListenUNIX) [WIN32]: Use
correct signature.

13 years agobuild: fix virpidfile on mingw
Eric Blake [Wed, 17 Aug 2011 17:46:35 +0000 (11:46 -0600)]
build: fix virpidfile on mingw

Regression introduced in commit b7e5ca4.

Mingw lacks kill(), but we were only using it for a sanity check;
so we can go with one less check.

Also, on OOM error, this function should outright fail rather than
claim that the pid file was successfully read.

* src/util/virpidfile.c (virPidFileReadPathIfAlive): Skip kill
call where unsupported, and report error on OOM.

13 years agoEnsure async packets never get marked for sync replies
Daniel P. Berrange [Tue, 16 Aug 2011 23:22:44 +0000 (16:22 -0700)]
Ensure async packets never get marked for sync replies

If a client had initiated a stream abort, it will have a call
waiting for a reply in the queue. If more data continues to
arrive on the stream, the abort command could mistakenly get
signalled as complete. Remove the code from async data processing
that looked for waiting calls. Add a sanity check to ensure no
async call can ever be marked as needing a reply

* src/rpc/virnetclient.c: Ensure async data packets can't
  trigger a reply

13 years agoDon't attempt to read from a stream if it is closed
Daniel P. Berrange [Tue, 16 Aug 2011 23:20:58 +0000 (16:20 -0700)]
Don't attempt to read from a stream if it is closed

The I/O event callback processes incoming packets first, and then
does outgoing packets. If the incoming packet caused the stream to
close, then the attempt to process outgoing data resulted in an
error. This caused libvirt to then send an error back to the client,
but the stream had already been stopped. This confused the client
since it sees 2 error events.

* daemon/stream.c: Don't attempt read if stream is closed

13 years agoqemu: disk migration verbose progress
Tom Vijlbrief [Wed, 17 Aug 2011 06:30:02 +0000 (08:30 +0200)]
qemu: disk migration verbose progress

A virsh command like:

migrate --live --copy-storage-all Guest qemu+ssh://user@host/system
--persistent --verbose

shows

Migration: [  0 %]

during the storage copy and does not start counting
until the ram transfer starts

Fix this by scraping optional disk transfer status, and adding it
into the progress meter.

13 years agovirsh: concatenate qemu-monitor-command arguments
Eric Blake [Fri, 5 Aug 2011 23:48:13 +0000 (17:48 -0600)]
virsh: concatenate qemu-monitor-command arguments

Call me lazy, but:

virsh qemu-monitor-command dom --hmp info status

is nicer than:

virsh qemu-monitor-command dom --hmp 'info status'

* tools/virsh.c (cmdQemuMonitorCommand): Allow multiple arguments,
for convenience.

13 years agoqemu: Init reattaching related members of pciDevice before reattach
Osier Yang [Wed, 17 Aug 2011 12:58:33 +0000 (20:58 +0800)]
qemu: Init reattaching related members of pciDevice before reattach

Otherwise the device will still be bound to pci-stub driver even
it's set as "managed=yes" when do detaching. Of course, it won't
triger any driver reprobing too.

13 years agovirsh: tweak misleading wording
Eric Blake [Tue, 16 Aug 2011 22:54:14 +0000 (16:54 -0600)]
virsh: tweak misleading wording

Fixes confusing docs introduced in commit 98369d3.

* tools/virsh.c (cmdSnapshotParent): Operates on named snapshot,
not current.

13 years agoTweak debugging message in RPC client code
Daniel P. Berrange [Tue, 16 Aug 2011 16:48:03 +0000 (09:48 -0700)]
Tweak debugging message in RPC client code

Make it clearer that a log message is for an outgoing message

13 years agoFix race condition in abort of stream
Daniel P. Berrange [Tue, 16 Aug 2011 16:44:28 +0000 (09:44 -0700)]
Fix race condition in abort of stream

If a stream gets a server initiated abort, the client may still
send an abort request before it receives the server side abort.
This causes the server to send back another abort for the
stream. Since the protocol defines that abort is the last thing
to be sent, the client gets confused by this second abort from
the server. If the stream is already shutdown, just drop any
client requested abort, rather than sending back another message.
This fixes the regression from previous versions.

Tested as follows

In one virsh session

  virsh # start foo
  virsh # console foo

In other virsh session

  virsh # destroy foo

The first virsh session should be able to continue issuing
commands without error. Prior to this patch it saw

  virsh # list
  error: Failed to list active domains
  error: An error occurred, but the cause is unknown

  virsh # list
  error: Failed to list active domains
  error: no call waiting for reply with prog 536903814 vers 1 serial 9

* src/rpc/virnetserverprogram.c: Drop abort requests
  for streams which no longer exist

13 years agoEnsure client streams are closed when marking a client for close
Daniel P. Berrange [Sun, 14 Aug 2011 22:44:45 +0000 (15:44 -0700)]
Ensure client streams are closed when marking a client for close

Every active stream results in a reference being held on the
virNetServerClientPtr object. This meant that if a client quit
with any streams active, although all I/O was stopped the
virNetServerClientPtr object would leak. This causes libvirtd
to leak any file handles associated with open streams when a
client quit

To fix this, when we call virNetServerClientClose there is a
callback invoked which lets the daemon release the streams
and thus the extra references

* daemon/remote.c: Add a hook to close all streams
* daemon/stream.c, daemon/stream.h: Add API for releasing
  all streams
* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
  Allow registration of a hook to trigger when closing client

13 years agoEnsure stream is aborted when exiting console
Daniel P. Berrange [Tue, 1 Mar 2011 14:59:45 +0000 (14:59 +0000)]
Ensure stream is aborted when exiting console

After running 'virsh console' in interactive mode, there was a
missing call to virStreamAbort, which meant the server kept the
stream resources open

* tools/console.c: Abort stream when exiting

13 years agomaint: fix some compilation issues on non-linux platforms (part 2)
Stefan Berger [Tue, 16 Aug 2011 19:36:22 +0000 (15:36 -0400)]
maint: fix some compilation issues on non-linux platforms (part 2)

Get rid of the #if __linux__ check in virPidFileReadPathIfAlive that
was preventing a check of a symbolic link in /proc/<pid>/exe on
non-linux platforms against an expected executable. Replace
this with a run-time check testing whether the /proc/<pid>/exe is a
symbolic link and if so call the function doing the comparison
against the expected file the link is supposed to point to.

13 years agomaint: fix some compilation issues on non-linux platforms
Stefan Berger [Tue, 16 Aug 2011 17:54:15 +0000 (13:54 -0400)]
maint: fix some compilation issues on non-linux platforms

This patch fixes *some* compilation issues on non-Linux platforms (cygwin).

13 years agodaemon: Add early libvirtd start verbose errors.
Peter Krempa [Fri, 12 Aug 2011 11:41:29 +0000 (13:41 +0200)]
daemon: Add early libvirtd start verbose errors.

Early errors during start of libvirtd didn't have
an error reporting mechanism and caused libvirtd
to exit silently (only the return value indicated
an error).

Libvirt logging is initialized very early using
enviroment variables and the internal error reporting
API is used to report early errors.

 v2 changes:
 - print errors unconditionaly before logging starts
 - fix message to US spelling
 v2.5 changes:
 - initialize logging from enviroment
 - log all early errors using VIR_ERROR
 v3 changes:
 - move virSetLogFromEnv() after virInitialize()

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

13 years agomaint: add missing symbols
Stefan Berger [Tue, 16 Aug 2011 16:38:02 +0000 (12:38 -0400)]
maint: add missing symbols

Add missing symbols to libvirt_private.syms.

13 years agomacvtap: Fix getPhysfn to get the PF of a direct attach network interface
Roopa Prabhu [Tue, 16 Aug 2011 04:28:58 +0000 (21:28 -0700)]
macvtap: Fix getPhysfn to get the PF of a direct attach network interface

This patch renames getPhysfn to getPhysfnDev and adds code to get the
Physical function and Virtual Function index of the direct attach linkdev (if
the direct attach interface is a SRIOV VF). The idea is to send the port
profile message to a PF if the direct attach interface is a SRIOV VF.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
13 years agointerface: Add functions to get sriov PF/VF relationship of a net interface
Roopa Prabhu [Tue, 16 Aug 2011 04:28:53 +0000 (21:28 -0700)]
interface: Add functions to get sriov PF/VF relationship of a net interface

This patch adds the following functions to get PF/VF relationship of an SRIOV
network interface:
ifaceIsVirtualFunction: Function to check if a network interface is a SRIOV VF
ifaceGetVirtualFunctionIndex: Function to get VF index if a network interface is a SRIOV VF
ifaceGetPhysicalFunction: Function to get the PF net interface name of a SRIOV VF net interface

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
13 years agopci: Add helper functions for sriov devices
Roopa Prabhu [Tue, 16 Aug 2011 04:28:48 +0000 (21:28 -0700)]
pci: Add helper functions for sriov devices

This patch adds the following helper functions:
pciDeviceIsVirtualFunction: Function to check if a pci device is a sriov VF
pciGetVirtualFunctionIndex: Function to get the VF index of a sriov VF
pciDeviceNetName: Function to get the network device name of a pci device
pciConfigAddressCompare: Function to compare pci config addresses

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
13 years agopci: Move some pci sriov helper code out of node device driver to util/pci
Roopa Prabhu [Tue, 16 Aug 2011 04:28:43 +0000 (21:28 -0700)]
pci: Move some pci sriov helper code out of node device driver to util/pci

This patch moves some of the sriov related pci code from node_device driver
to src/util/pci.[ch]. Some functions had to go thru name and argument list
change to accommodate the move.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
13 years agomaint: ignore generated file
Eric Blake [Mon, 15 Aug 2011 20:42:43 +0000 (14:42 -0600)]
maint: ignore generated file

* .gitignore: Ignore qemu-sanlock.conf.

13 years agoqemu: support event_idx parameter for virtio disk and net devices
Laine Stump [Sat, 13 Aug 2011 06:32:45 +0000 (02:32 -0400)]
qemu: support event_idx parameter for virtio disk and net devices

In some versions of qemu, both virtio-blk-pci and virtio-net-pci
devices can have an event_idx setting that determines some details of
event processing. When it is enabled, it "reduces the number of
interrupts and exits for the guest". qemu will automatically enable
this feature when it is available, but there may be cases where this
new feature could actually make performance worse (NB: no such case
has been found so far).

As a safety switch in case such a situation is encountered in the
field, this patch adds a new attribute "event_idx" to the <driver>
element of both disk and interface devices. event_idx can be set to
"on" (to force event_idx on in case qemu has it disabled by default)
or "off" (for force event_idx off). In the case that event_idx support
isn't present in qemu, the attribute is ignored (this on the advice of
the qemu developer).

docs/formatdomain.html.in: document the new flag (marking it as
   "don't mess with this!"
docs/schemas/domain.rng: add event_idx in appropriate places
src/conf/domain_conf.[ch]: add event_idx to parser and formatter
src/libvirt_private.syms: export
   virDomainVirtioEventIdx(From|To)String
src/qemu/qemu_capabilities.[ch]: detect and report event_idx in
   disk/net
src/qemu/qemu_command.c: add event_idx parameter to qemu commandline
    when appropriate.
tests/qemuxml2argvdata/qemuxml2argv-event_idx.args,
tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml,
tests/qemuxml2argvtest.c,
tests/qemuxml2xmltest.c: test cases for event_idx.