Commit Graph

1707 Commits

Author SHA1 Message Date
Chen Hanxiao
906eefb2e9 docs: fix a typo in drvlxc
s/the/The

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-10-06 13:15:31 +02:00
Martin Kletzander
34f514778b minor shmem clean-ups
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-10-04 10:46:22 +02:00
Martin Kletzander
540a84ec89 docs, conf, schema: add support for shmem device
This patch adds parsing/formatting code as well as documentation for
shared memory devices.  This will currently be only accessible in QEMU
using it's ivshmem device, but is designed as generic as possible to
allow future expansion for other hypervisors.

In the devices section in the domain XML users may specify:

- For shmem device using a server:

 <shmem name='shmem0'>
   <server path='/tmp/socket-ivshmem0'/>
   <size unit='M'>32</size>
   <msi vectors='32' ioeventfd='on'/>
 </shmem>

- For ivshmem device not using an ivshmem server:

 <shmem name='shmem1'>
   <size unit='M'>32</size>
 </shmem>

Most of the configuration is made optional so it also allows
specifications like:

 <shmem name='shmem1/>
 <shmem name='shmem2'>
   <server/>
 </shmem>

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-10-03 22:43:08 +02:00
Daniel Veillard
8a24579f3e Release of libvirt-1.2.9
* docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: updated localizations and regenerated
2014-10-01 16:45:32 +08:00
Erik Skultety
1be67cd31b storage: Fix logical pool fmt type
According to our documentation logical pool supports formats 'auto' and
'lvm2'. However, in storage_conf.c we previously defined storage pool
formats: unknown, lvm2. Due to backward compatibility reasons
we must continue refer to pool format type 'unknown' instead of 'auto'.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1123767
2014-09-29 05:59:09 -04:00
Ján Tomko
5b3536ae90 conf: add options for disabling segment offloading
Add options for tuning segment offloading:
<driver>
  <host csum='off' gso='off' tso4='off' tso6='off'
        ecn='off' ufo='off'/>
  <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
which control the respective host_ and guest_ properties
of the virtio-net device.
2014-09-24 16:16:45 +02:00
Chen Hanxiao
0114a1e703 LXC: emphasis uid start of idmap only accept '0' in docs
We don't accept any other values except '0'.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-09-24 11:58:14 +02:00
Peter Krempa
4f3c2e39e5 qemu: hook: Provide hook when restoring a domain save image 2014-09-22 17:11:56 +02:00
Jianwei Hu
a552a86e1a docs: specify vhost-net instead of net-vhost
For the tap backend the default is specified and the same should be
done for the vhost attribute.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-09-22 16:54:26 +02:00
Jianwei Hu
e1dfb6681a schema: properly set tap and vhost backend attributes optional
Each attribute is optional, commit af8b4a2 forgot to mention that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-09-22 16:54:26 +02:00
John Ferlan
58abf1bb36 hostdev: Add "rawio" attribute to _virDomainHostdevSubsysSCSI
Add the 'rawio' attribute to match _virDomainDiskDef and process the
hostdev XML similarly to the disk XML for a lun which supports/requires rawio
2014-09-19 07:47:46 -04:00
Chen Hanxiao
a3bcd86317 LXC: add HOME environment variable docs
commit
3020594ac5
add HOME environment variable.
Add a doc for this.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-09-19 09:41:01 +02:00
Roman Bogorodskiy
05d1dd6b33 docs: update zfs documentation
- docs/formatstorage.html.in: document 'zfs' pool type, add it
   to a list of pool types that could use source physical devices
 - docs/storage.html.in: update a ZFS pool example XML with
   source physical devices, mention that starting from 1.2.9 a
   pool could be created from this devices by libvirt and in earlier
   versions user still has to create a pool manually
 - docs/drvbhyve.html.in: add an example with ZFS pools
2014-09-18 18:08:29 +04:00
Roman Bogorodskiy
b4af40226d storage: zfs: implement pool build and delete
- Provide an implementation for buildPool and deletePool operations
   for the ZFS storage backend.
 - Add VIR_STORAGE_POOL_SOURCE_DEVICE flag to ZFS pool poolOptions
   as now we can specify devices to build pool from
 - storagepool.rng: add an optional 'sourceinfodev' to 'sourcezfs' and
   add an optional 'target' to 'poolzfs' entity
 - Add a couple of tests to storagepoolxml2xmltest
2014-09-18 18:08:29 +04:00
Michal Privoznik
f05b6a918e domaincaps: Expose UEFI binary path, if it exists
Check to see if the UEFI binary mentioned in qemu.conf actually
exists, and if so expose it in domcapabilities like

<loader ...>
  <value>/path/to/ovmf</value>
</loader>

We introduce some generic domcaps infrastructure for handling
a dynamic list of string values, it may be of use for future bits.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-09-17 16:29:49 +02:00
Martin Kletzander
def6b35989 docs, conf, schema: add support for shared memory mapping
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-09-17 16:10:26 +02:00
Martin Kletzander
f864aac90b schemas: finish virTristate{Bool,Switch} transition
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-09-17 16:10:26 +02:00
Michal Privoznik
4f76621c0e domaincaps: Expose UEFI capability
As of 542899168c we learned libvirt to use UEFI for domains.
However, management applications may firstly query if libvirt
supports it. And this is where virConnectGetDomainCapabilities()
API comes handy.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-09-17 09:42:33 +02:00
Ján Tomko
af8b4a2e6f conf: add backend element to interfaces
For tuning the network, alternative devices
for creating tap and vhost devices can be specified via:
<backend tap='/dev/net/tun' vhost='/dev/net-vhost'/>
2014-09-16 15:38:34 +02:00
Eric Blake
7e8feed4a7 cputune: allow interleaved xml
I noticed this with the recent iothread pinning code, but the
problem existed longer than that. The XML validation required
users to supply <cputune> children in a strict order, even though
there was no conceptual reason why they can't occur in any order.

docs/ changes best viewed with -w

* docs/schemas/domaincommon.rng (cputune): Add interleave.
* tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml: Swap
up order, copying canonical form...
* tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml:
...here.
* tests/qemuxml2xmltest.c (mymain): Mark the difference.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-09-15 18:59:40 -06:00
John Ferlan
938fb12fad domain_conf: Add iothreadpin to cputune
https://bugzilla.redhat.com/show_bug.cgi?id=1101574

Add an option 'iothreadpin' to the <cpuset> to allow for setting the
CPU affinity for each IOThread.

The iothreadspin will mimic the vcpupin with respect to being able to
assign each iothread to a specific CPU, although iothreads ids start
at 1 while vcpu ids start at 0. This matches the iothread naming scheme.
2014-09-15 13:19:01 -04:00
Erik Skultety
3aa0524104 network: check for invalid forward delay time
When spanning tree protocol is allowed in bridge settings, forward delay
value is set as well (default is 0 if omitted). Until now, there was no
check for delay value validity. Delay makes sense only as a positive
numerical value.

Note: However, even if you provide positive  numerical value, brctl
utility only uses values from range <2,30>, so the number provided can
be modified (kernel most likely) to fall within this range.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1125764
2014-09-15 17:44:37 +02:00
Michal Privoznik
dcf7d0423c formatdomain: Update <loader/> example to match the rest
At the beginning when I was inventing <loader/> attributes and
<nvram/> I've introduced this @readonly attribute to the loader
element. It accepted values 'on' and 'off'. However, later, during the
review process, that has changed to 'yes' and 'no', but the example
XML snippet wasn't updated, so while the description is correct, the
example isn't.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-09-12 14:26:34 +02:00
Michal Privoznik
742b08e30f qemu: Automatically create NVRAM store
When using split UEFI image, it may come handy if libvirt manages per
domain _VARS file automatically. While the _CODE file is RO and can be
shared among multiple domains, you certainly don't want to do that on
the _VARS file. This latter one needs to be per domain. So at the
domain startup process, if it's determined that domain needs _VARS
file it's copied from this master _VARS file. The location of the
master file is configurable in qemu.conf.

Temporary, on per domain basis the location of master NVRAM file can
be overridden by this @template attribute I'm inventing to the
<nvram/> element. All it does is holding path to the master NVRAM file
from which local copy is created. If that's the case, the map in
qemu.conf is not consulted.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2014-09-10 09:38:07 +02:00
Michal Privoznik
68bf13dbef conf: Extend <loader/> and introduce <nvram/>
Up to now, users can configure BIOS via the <loader/> element. With
the upcoming implementation of UEFI this is not enough as BIOS and
UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
is programmable flash (although all writes to code section are
denied). Therefore we need new attribute @type which will
differentiate the two. Then, new attribute @readonly is introduced to
reflect the fact that some images are RO.

Moreover, the OVMF (which is going to be used mostly), works in two
modes:
1) Code and UEFI variable store is mixed in one file.
2) Code and UEFI variable store is separated in two files

The latter has advantage of updating the UEFI code without losing the
configuration. However, in order to represent the latter case we need
yet another XML element: <nvram/>. Currently, it has no additional
attributes, it's just a bare element containing path to the variable
store file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-09-10 09:38:07 +02:00
Ján Tomko
10af1f23f0 docs: fix encryption format attribute in example
The correct attribute name is 'format', not 'type'.

https://bugzilla.redhat.com/show_bug.cgi?id=1139910
2014-09-10 09:25:40 +02:00
Eric Blake
bc7e63d39c maint: tighten curly brace syntax checking
Now that hanging brace offenders have been fixed, we can automate
the check, and document our style.  Done as a separate commit from
code changes, to make it easier to just backport code changes, if
that is ever needed.

* cfg.mk (sc_curly_braces_style): Catch hanging braces.
* docs/hacking.html.in: Document it.
* HACKING: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-09-04 15:38:00 -06:00
Daniel Veillard
2097f7df5f Release of libvirt-1.2.8
* docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: new localizations and regenerate pos
2014-09-02 09:41:09 +02:00
John Ferlan
e2523de554 domain_conf: Add support for iothreads in disk definition
Add a new disk "driver" attribute "iothread" to be parsed as the thread
number for the disk to use. In order to more easily facilitate the usage
and configuration of the iothread, a "zero" for the attribute indicates
iothreads are not supported for the device and a positive value indicates
the specific thread to try and use.
2014-08-28 16:27:54 -04:00
John Ferlan
ee3a9620da domain_conf: Introduce iothreads XML
Introduce XML to allowing adding iothreads to the domain. These can be
used by virtio-blk-pci devices in order to assign a specific thread to
handle the workload for the device.  The iothreads are the official
implementation of the virtio-blk Data Plane that's been in tech preview
for QEMU.
2014-08-28 16:27:53 -04:00
Alex Williamson
d071164272 Add new 'kvm' domain feature and ability to hide KVM signature
QEMU 2.1 added support for the kvm=off option to the -cpu command,
allowing the KVM hypervisor signature to be hidden from the guest.
This enables disabling of some paravirualization features in the
guest as well as allowing certain drivers which test for the
hypervisor to load.  Domain XML syntax is as follows:

<domain type='kvm>
  ...
  <features>
    ...
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  ...

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2014-08-26 10:41:24 +02:00
Martin Kletzander
9e766888c7 docs: fix bootmenu timeout description
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-08-25 18:18:51 +02:00
Martin Kletzander
43b8123d39 docs, conf: add support for bootmenu timeout
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-08-25 14:10:54 +02:00
Erik Skultety
36a0993a15 qemu: min_guarantee: Parameter 'min_guarantee' not supported
The 'min_guarantee' is used by VMware ESX and OpenVZ drivers,
with qemu however, libvirt should report error when starting a domain,
because this element is not used.
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1122455
2014-08-22 16:33:18 +02:00
John Ferlan
f335ed77a6 formatdomain: Reformat vCPU description
Reformat the vCPU description to use list elements rather than one long
run-on paragraph

Signed-off-by: John Ferlan <jferlan@redhat.com>
2014-08-22 10:16:13 -04:00
Michal Privoznik
66eaa887e9 Fix spacing around commas
On some places in the libvirt code we have:

  f(a,z)

instead of

  f(a, z)

This trivial patch fixes couple of such occurrences.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-08-22 15:03:39 +02:00
Michal Privoznik
cf389258ae hvsupport: Adapt to vbox driver rewrite
Since vbox driver rewrite the virDriver structure init moved from
vbox_tmpl.c into vbox_common.c. However, our hvsupport.pl script
doesn't count with that. It still parses vbox_tmp.c and looks for
virDriver structure which is not found there anymore. As a result,
at hvsupport page is seems like vbox driver doesn't support
anything.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-08-20 18:17:07 +02:00
Martin Kletzander
93cf8f9861 cleanup spaces between parentheses and braces
And add a syntax-check for '){$'.  It's not perfect, but better than
nothing.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-08-20 14:50:21 +02:00
Jianwei Hu
0856757279 docs: nwfilter: add missing dscp attribute
Added attribute dscp to below supported protocols table in nwfilter docs.
IPV4 (ip)
TCP/UDP/SCTP (tcp/udp/sctp)
ICMP (icmp)
IGMP,ESP,AH,UDPLITE,'ALL' (igmp,esp,ah,udplite,all)
TCP/UDP/SCTP over IPV6 (tcp-ipv6,udp-ipv6,sctp-ipv6)
ICMPV6 (icmpv6)
IGMP,ESP,AH,UDPLITE,'ALL' over IPv6 (igmp-ipv6,esp-ipv6,ah-ipv6,udplite-ipv6,all-ipv6)

Here is a simple example:
[root@localhost ~]# virsh nwfilter-dumpxml myself
<filter name='myself' chain='root'>
  <uuid>7192ef51-cd50-4f14-ad7b-fa5c69ea19e3</uuid>
  <rule action='accept' direction='in' priority='500'>
    <ip dscp='1'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <tcp dscp='1'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <tcp-ipv6 dscp='2'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <icmp dscp='55'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <icmpv6 dscp='55'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <udp dscp='3'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <udp-ipv6 dscp='4'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <udplite dscp='5'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <udplite-ipv6 dscp='6'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <esp dscp='7'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <esp-ipv6 dscp='8'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <ah dscp='9'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <ah-ipv6 dscp='10'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <sctp dscp='11'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <sctp-ipv6 dscp='55'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <igmp dscp='55'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <all-ipv6 dscp='55'/>
  </rule>
  <rule action='accept' direction='in' priority='500'>
    <all dscp='55'/>
  </rule>
</filter>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2014-08-19 11:54:35 +02:00
Jianwei Hu
2a8fabba18 Maximum vlanid should be 4095 in interface.rng
The correct vlanid range is 0~4095.

After merging this patch, we can not validate a interface xml with vlanid >= 4096.
[root@localhost ~]# cat vlan.xml
<interface type='vlan' name='eno1.4096'>
   <start mode='onboot'/>
   <protocol family='ipv4'>
    <dhcp/>
   </protocol>
   <vlan tag='4096'>
     <interface name='eno1'/>
   </vlan>
</interface>
[root@localhost ~]# virt-xml-validate vlan.xml
vlan.xml:1: element interface: Relax-NG validity error : Invalid sequence in interleave
vlan.xml:6: element vlan: Relax-NG validity error : Element interface failed to validate content
vlan.xml:6: element vlan: Relax-NG validity error : Element vlan failed to validate attributes
vlan.xml fails to validate
[root@localhost ~]#

Here is a ip command help on this.
[root@localhost /]# ip link add link eno1 name eno1.90 type vlan help
Usage: ... vlan [ protocol VLANPROTO ] id VLANID                [ FLAG-LIST ]
                [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]

VLANPROTO: [ 802.1Q / 802.1ad ]
VLANID := 0-4095
FLAG-LIST := [ FLAG-LIST ] FLAG
FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ]
        [ loose_binding { on | off } ]
QOS-MAP := [ QOS-MAP ] QOS-MAPPING
QOS-MAPPING := FROM:TO
2014-08-14 15:04:11 +02:00
Jianwei Hu
49cd6815d6 docs: fix missing forward slash
Should like below:
    <interface type='server'>
      <mac address='52:54:00:22:c9:42'/>
      <source address='192.168.0.1' port='5558'/>
    </interface>
    ...
    <interface type='client'>
      <mac address='52:54:00:8b:c9:51'/>
      <source address='192.168.0.1' port='5558'/>
    </interface>
2014-08-14 12:22:30 +02:00
Roman Bogorodskiy
0257d06ba4 storage: ZFS support
Implement ZFS storage backend driver. Currently supported
only on FreeBSD because of ZFS limitations on Linux.

Features supported:

 - pool-start, pool-stop
 - pool-info
 - vol-list
 - vol-create / vol-delete

Pool definition looks like that:

 <pool type='zfs'>
  <name>myzfspool</name>
  <source>
    <name>actualpoolname</name>
  </source>
 </pool>

The 'actualpoolname' value is a name of the pool on the system,
such as shown by 'zpool list' command. Target makes no sense
here because volumes path is always /dev/zvol/$poolname/$volname.

User has to create a pool on his own, this driver doesn't
support pool creation currently.

A volume could be used with Qemu by adding an entry like this:

    <disk type='volume' device='disk'>
      <driver name='qemu' type='raw'/>
      <source pool='myzfspool' volume='vol5'/>
      <target dev='hdc' bus='ide'/>
    </disk>
2014-08-12 19:40:20 +04:00
Eric Blake
51cb34b31d docs: use correct hints per bus type in <disk> examples
Commit 4cf53158 tried to set up unique labels per disk in the
example, but ended up choosing strings that don't correspond
to the usual choice of bus types.  Tweak the strings once again.

* docs/formatdomain.html.in: Use preferred names.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-11 15:44:58 -06:00
Peter Krempa
e260a0e60a conf: Add USB sound card support and implement it for qemu 2014-08-08 14:34:20 +02:00
John Ferlan
54ac483e68 hostdev: Add iSCSI hostdev XML
Introduce a new structure to handle an iSCSI host device based on the
existing virDomainHostdevSubsysSCSI by adding a "protocol='iscsi'" to
the <source/> element. The existing scsi_host subsystem RNG was modified
to read an optional "protocol='adapter'", although it won't be written
out nor is it documented as an option (by choice).

The new hostdev structure mimics the existing <disk/> element for an
iSCSI device (network) device. New XML is:

  <hostdev mode='subsystem' type='scsi' managed='yes'>
    <source protocol='iscsi' name='iqn.1992-01.com.example'>
      <host name='example.org' port='3260'/>
      <auth username='myname'>
        <secret type='iscsi' usage='mycluster_myname'/>
      </auth>
    </source>
    <address type='drive' controller='0' bus='0' target='2' unit='5'/>
  </hostdev>

The controller element will mimic the existing scsi_host code insomuch
as when 'lsi' and 'virtio-scsi' are used.
2014-08-07 15:07:56 -04:00
Eric Blake
4cf531589a docs: use unique dev names in <disk> examples
Jiri Moskovcak reported on IRC that the documentation on valid
<disk> was confusing because it didn't have unique dev='...'
entries.

* docs/formatdomain.html.in: Use unique names.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-07 11:12:00 -06:00
Jianwei Hu
55f34fe3bd Fix vlanid attribute name in nwfilter docs
'vlanid' is the attribute name in our XML,
'vlan-id' is the ebtables attribute:

[root@localhost ~]# virsh nwfilter-dumpxml myself
<filter name='myself' chain='root'>
  <uuid>7192ef51-cd50-4f14-ad7b-fa5c69ea19e3</uuid>
  <rule action='accept' direction='in' priority='500'>
    <vlan dstmacaddr='00:11:22:33:44:55' vlanid='44'/>
  </rule>
</filter>

[root@localhost ~]# ebtables -t nat -L
Bridge table: nat

...
-p 802_1Q -d 0:11:22:33:44:55 --vlan-id 44 -j ACCEPT

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2014-08-05 09:59:17 +02:00
Daniel Veillard
21b59b651c Release of libvirt-1.2.7
* docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: update localizations and regenerate
2014-08-03 08:55:15 -04:00
Roman Bogorodskiy
221b1828f9 docs: bhyve: document recent changes
- mention that one disk and one network limitation
   is no longer current for 1.2.6 and newer
 - add 'cdrom' device to the sample domain XML
2014-07-30 17:45:28 +04:00
Eric Blake
232a31bea3 blockcommit: track job type in xml
A future patch is going to wire up qemu active block commit jobs;
but as they have similar events and are canceled/pivoted in the
same way as block copy jobs, it is easiest to track all bookkeeping
for the commit job by reusing the <mirror> element.  This patch
adds domain XML to track which job was responsible for creating a
mirroring situation, and adds a job='copy' attribute to all
existing uses of <mirror>.  Along the way, it also massages the
qemu monitor backend to read the new field in order to generate
the correct type of libvirt job (even though it requires a
future patch to actually cause a qemu event that can be reported
as an active commit).  It also prepares to update persistent XML
to match changes made to live XML when a copy completes.

* docs/schemas/domaincommon.rng: Enhance schema.
* docs/formatdomain.html.in: Document it.
* src/conf/domain_conf.h (_virDomainDiskDef): Add a field.
* src/conf/domain_conf.c (virDomainBlockJobType): String conversion.
(virDomainDiskDefParseXML): Parse job type.
(virDomainDiskDefFormat): Output job type.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Distinguish
active from regular commit.
* src/qemu/qemu_driver.c (qemuDomainBlockCopy): Set job type.
(qemuDomainBlockPivot, qemuDomainBlockJobImpl): Clean up job type
on completion.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
Update tests.
* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml: New
file.
* tests/qemuxml2xmltest.c (mymain): Drive new test.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-07-30 06:32:38 -06:00