]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agolibvirt.spec: Build & run tests in parallel
Michal Privoznik [Thu, 3 Nov 2016 12:34:53 +0000 (20:34 +0800)]
libvirt.spec: Build & run tests in parallel

So far, the main code is built in parallel, which makes it pretty
fast. But with a lots of tests we have now I've noticed this part
takes too much time to build. The problem was that tests were
build and run in a single job.

Also, 'make' in the first hunk is useless. The test suite is not
built due to 'make all' because there's no .git in the sources
unpacked from a tar.xz archive. It's 'make check' which triggers
tests build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoloopback is not always just lo
Pavel Timofeev [Tue, 1 Nov 2016 15:15:59 +0000 (18:15 +0300)]
loopback is not always just lo

 On BSD family OSes (Free/Net/Open/DragonFlyBSD, Mac OS) and
 Solaris loopback interface is called 'lo0' instead of just 'lo'.

8 years agoqemu: Add support for hot/cold-(un)plug of shmem devices
Martin Kletzander [Mon, 12 Sep 2016 13:40:48 +0000 (15:40 +0200)]
qemu: Add support for hot/cold-(un)plug of shmem devices

This is needed in order to migrate a domain with shmem devices as that
is not allowed to migrate.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Support newer ivshmem device variants
Martin Kletzander [Wed, 10 Aug 2016 09:15:22 +0000 (11:15 +0200)]
qemu: Support newer ivshmem device variants

QEMU added support for ivshmem-plain and ivshmem-doorbell.  Those are
reworked varians of legacy ivshmem that are compatible from the guest
POV, but not from host's POV and have sane specification and handling.

Details about the newer device type can be found in qemu's commit
5400c02b90bb:

  http://git.qemu.org/?p=qemu.git;a=commit;h=5400c02b90bb

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Save various defaults for shmem
Martin Kletzander [Wed, 3 Aug 2016 15:34:51 +0000 (17:34 +0200)]
qemu: Save various defaults for shmem

We're keeping some things at default and that's not something we want to
do intentionally.  Let's save some sensible defaults upfront in order to
avoid having problems later.  The details for the defaults (of the newer
implementation) can be found in qemu's commit 5400c02b90bb:

  http://git.qemu.org/?p=qemu.git;a=commit;h=5400c02b90bb

Since we are merely saving the defaults it will not change the guest ABI
and thanks to the fact that we're doing it in the PostParse callback it
will not break the ABI stability checks.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Add capabilities for ivshmem-{plain,doorbell}
Martin Kletzander [Tue, 2 Aug 2016 06:48:45 +0000 (08:48 +0200)]
qemu: Add capabilities for ivshmem-{plain,doorbell}

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoconf, qemu: Add newer shmem models
Martin Kletzander [Fri, 19 Aug 2016 12:58:35 +0000 (14:58 +0200)]
conf, qemu: Add newer shmem models

The old ivshmem is deprecated in QEMU, so let's use the better
ivshmem-{plain,doorbell} variants instead.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoconf, qemu: Add support for shmem model
Martin Kletzander [Fri, 19 Aug 2016 12:57:07 +0000 (14:57 +0200)]
conf, qemu: Add support for shmem model

Just the default one now, new ones will be added in following commits.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Reset post-copy capability after migration
Jiri Denemark [Wed, 2 Nov 2016 13:20:42 +0000 (14:20 +0100)]
qemu: Reset post-copy capability after migration

Unlike other migration capabilities, post-copy is also set on the
destination host which means it doesn't disappear once domain is
migrated. As a result of that other functionality which internally uses
migration to a file (virDomainManagedSave, virDomainSave,
virDomainCoreDump) may fail after migration because the post-copy
capability is still set.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agom4/virt-gnutls: remove code for gnutls < 2.2.0
Pavel Hrdina [Fri, 21 Oct 2016 21:17:08 +0000 (23:17 +0200)]
m4/virt-gnutls: remove code for gnutls < 2.2.0

Commit d8a8af3492 changed the minimal required version of gnutls
so it's safe to remove the code for older versions.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoconfigure: move gnutls check into virt-gnutls.m4
Pavel Hrdina [Fri, 21 Oct 2016 21:09:53 +0000 (23:09 +0200)]
configure: move gnutls check into virt-gnutls.m4

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoPost-release version bump to 2.5.0
Jiri Denemark [Wed, 2 Nov 2016 09:10:02 +0000 (10:10 +0100)]
Post-release version bump to 2.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoRelease of libvirt-2.4.0
Daniel Veillard [Tue, 1 Nov 2016 20:47:10 +0000 (21:47 +0100)]
Release of libvirt-2.4.0

* docs/news.html.in: update for the release
* po/*.po*: regenerated

8 years agodocs: remove obsolete library.xen file
Daniel P. Berrange [Mon, 31 Oct 2016 13:39:34 +0000 (13:39 +0000)]
docs: remove obsolete library.xen file

The library.xen file contains a braindump of thoughts dating
from the very first days of libvirt, when it was briefly
called libxen. This is not useful and potentially misleading
or confusing for people.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovsh: Pass correct values for command line completion
John Ferlan [Fri, 28 Oct 2016 20:59:58 +0000 (16:59 -0400)]
vsh: Pass correct values for command line completion

Commit id 'dcfdf341' passes 'opts_need_arg' and 'opts_seen' to
vshCmddefGetData, but that seems to be incorrect as those values
are not initialized properly (something at least one compiler found).
Instead the static 'const_opts_need_arg' and 'const_opts_seen' values
should be passed.

By passing unitialized values leads to not finding possible options
for simpler commands (domfsfreeze for example), where if you're in
a virsh shell using command line completion - you'll get a list of
files in your current directory instead of two options --domain and
--mountpoint (as would happen with this patch applied.

8 years agovsh: Using VSH_REQUIRE_OPTION rather than virReportError
Kothapally Madhu Pavan [Tue, 18 Oct 2016 17:33:11 +0000 (13:33 -0400)]
vsh: Using VSH_REQUIRE_OPTION rather than virReportError

Correcting the error reporting method by using VSH_REQUIRE_OPTION
instead of virReportError

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
8 years agonetwork: fix endless loop when starting network with multiple IPs and no dhcp
Laine Stump [Fri, 28 Oct 2016 15:43:56 +0000 (11:43 -0400)]
network: fix endless loop when starting network with multiple IPs and no dhcp

commit 9065cfaa added the ability to disable DNS services for a
libvirt virtual network. If neither DNS nor DHCP is needed for a
network, then we don't need to start dnsmasq, so code was added to
check for this.

Unfortunately, it was written with a great lack of attention to detail
(I can say that, because I was the author), and the loop that checked
if DHCP is needed for the network would never end if the network had
multiple IP addresses and the first <ip> had no <dhcp> subelement
(which would have contained a <range> or <host> subelement, thus
requiring DHCP services).

This patch rewrites the check to be more compact and (more
importantly) finite.

This bug was present in release 2.2.0 and 2.3.0, so will need to be
backported to any relevant maintainence branches.

Reported here:
  https://www.redhat.com/archives/libvirt-users/2016-October/msg00032.html
  https://www.redhat.com/archives/libvirt-users/2016-October/msg00045.html

8 years agoqemu_driver: unlink new domain cfg file when rollback
Chen Hanxiao [Fri, 28 Oct 2016 00:45:41 +0000 (08:45 +0800)]
qemu_driver: unlink new domain cfg file when rollback

If we failed to unlink old dom cfg file, we goto rollback.
But inside rollback, we fogot to unlink the new dom cfg file.
This patch fixes this issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Minimalize global driver accesses
Michal Privoznik [Wed, 26 Oct 2016 10:56:01 +0000 (12:56 +0200)]
qemu: Minimalize global driver accesses

Whilst working on another issue, I've noticed that in some
functions we have a local @driver variable among with access to
global @qemu_driver variable. This makes no sense.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Fix crash during qemuStateCleanup
Nikolay Shirokovskiy [Tue, 4 Oct 2016 14:27:45 +0000 (17:27 +0300)]
qemu: Fix crash during qemuStateCleanup

Rather than waiting until we've free'd up all the resources, cause the
'workerPool' thread pool to flush as soon as possible during stateCleanup.
Otherwise, it's possible something waiting to run will SEGV such as is the
case during race conditions of simultaneous exiting libvirtd and qemu process.
Resolves the following crash:

[1] crash backtrace: (bt is shortened a bit):

0  0x00007ffff7282f2b in virClassIsDerivedFrom
   (klass=0xdeadbeef, parent=0x55555581d650) at util/virobject.c:169
1  0x00007ffff72835fd in virObjectIsClass
   (anyobj=0x7fffd024f580, klass=0x55555581d650) at util/virobject.c:365
2  0x00007ffff7283498 in virObjectLock
   (anyobj=0x7fffd024f580) at util/virobject.c:317
3  0x00007ffff722f0a3 in virCloseCallbacksUnset
   (closeCallbacks=0x7fffd024f580, vm=0x7fffd0194db0,
    cb=0x7fffdf1af765 <qemuProcessAutoDestroy>)
   at util/virclosecallbacks.c:164
4  0x00007fffdf1afa7b in qemuProcessAutoDestroyRemove
   (driver=0x7fffd00f3a60, vm=0x7fffd0194db0) at qemu/qemu_process.c:6365
5  0x00007fffdf1adff1 in qemuProcessStop
   (driver=0x7fffd00f3a60, vm=0x7fffd0194db0, reason=VIR_DOMAIN_SHUTOFF_CRASHED,
    asyncJob=QEMU_ASYNC_JOB_NONE, flags=0)
   at qemu/qemu_process.c:5877
6  0x00007fffdf1f711c in processMonitorEOFEvent
   (driver=0x7fffd00f3a60, vm=0x7fffd0194db0) at qemu/qemu_driver.c:4545
7  0x00007fffdf1f7313 in qemuProcessEventHandler
   (data=0x555555832710, opaque=0x7fffd00f3a60) at qemu/qemu_driver.c:4589
8  0x00007ffff72a84c4 in virThreadPoolWorker
   (opaque=0x555555805da0) at util/virthreadpool.c:167

Thread 1 (Thread 0x7ffff7fb1880 (LWP 494472)):
1  0x00007ffff72a7898 in virCondWait
   (c=0x7fffd01c21f8, m=0x7fffd01c21a0) at util/virthread.c:154
2  0x00007ffff72a8a22 in virThreadPoolFree
   (pool=0x7fffd01c2160) at util/virthreadpool.c:290
3  0x00007fffdf1edd44 in qemuStateCleanup ()
   at qemu/qemu_driver.c:1102
4  0x00007ffff736570a in virStateCleanup ()
   at libvirt.c:807
5  0x000055555556f991 in main (argc=1, argv=0x7fffffffe458) at libvirtd.c:1660

8 years agodaemon: Fix crash during daemon cleanup
Nikolay Shirokovskiy [Tue, 4 Oct 2016 14:27:44 +0000 (17:27 +0300)]
daemon: Fix crash during daemon cleanup

Do not dereference the 'dmn' until after the virStateCleanup is completed.

During initialization, virStateInitialize requires/uses the "dmn" as the
argument to/for the daemonInhibitCallback functions. Thus, cleanup cannot
dereference 'dmn' until after calling the virStateCleanup which calls the
the daemonInhibitCallback using 'dmn'; otherwise, the following crash occurs:

backtrace (shortened a bit)

1  0x00007fd3a791b2e6 in virCondWait (c=<optimized out>, m=<optimized out>)
   at util/virthread.c:154
2  0x00007fd3a791bcb0 in virThreadPoolFree (pool=0x7fd38024ee00)
   at util/virthreadpool.c:266
3  0x00007fd38edaa00e in qemuStateCleanup () at qemu/qemu_driver.c:1116
4  0x00007fd3a79abfeb in virStateCleanup () at libvirt.c:808
5  0x00007fd3a85f2c9e in main (argc=<optimized out>, argv=<optimized out>)
    at libvirtd.c:1660

Thread 1 (Thread 0x7fd38722d700 (LWP 32256)):
0  0x00007fd3a7900910 in virClassIsDerivedFrom
   (klass=0xdfd36058d4853, parent=0x7fd3a8f394d0) at util/virobject.c:169
1  0x00007fd3a7900c4e in virObjectIsClass
   (anyobj=anyobj@entry=0x7fd3a8f2f850, klass=<optimized out>)
   at util/virobject.c:365
2  0x00007fd3a7900c74 in virObjectLock (anyobj=0x7fd3a8f2f850)
   at util/virobject.c:317
3  0x00007fd3a7a24d5d in virNetDaemonRemoveShutdownInhibition
   (dmn=0x7fd3a8f2f850) at rpc/virnetdaemon.c:547
4  0x00007fd38ed722cf in qemuProcessStop
   (driver=driver@entry=0x7fd380103810, vm=vm@entry=0x7fd38025b6d0,
    reason=reason@entry=VIR_DOMAIN_SHUTOFF_SHUTDOWN,
    asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_NONE, flags=flags@entry=0)
   at qemu/qemu_process.c:5786
5  0x00007fd38edd9428 in processMonitorEOFEvent
   (vm=0x7fd38025b6d0, driver=0x7fd380103810) at qemu/qemu_driver.c:4588
6  qemuProcessEventHandler (data=<optimized out>, opaque=0x7fd380103810)
   at qemu/qemu_driver.c:4632
7  0x00007fd3a791bb55 in virThreadPoolWorker
   (opaque=opaque@entry=0x7fd3a8f1e4c0) at util/virthreadpool.c:145

8 years agovz: remove Bridged network name and rename Routed
Maxim Nestratov [Mon, 5 Sep 2016 16:39:32 +0000 (19:39 +0300)]
vz: remove Bridged network name and rename Routed

It's funny, but Routed network name was incorrect. We should use
host-routed instead.

8 years agovz: support type=bridge network interface type correctly
Maxim Nestratov [Mon, 5 Sep 2016 16:39:31 +0000 (19:39 +0300)]
vz: support type=bridge network interface type correctly

Recently, libprlsdk got a separate flag PNA_BRIDGE corresponding to
type=bridge libvirt network interfaces. Let's use it and get rid of
all workarounds previously added to  support it.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agoqemu: Forbid pinning vCPUs for TCG domain
Chen Hanxiao [Sat, 22 Oct 2016 09:49:38 +0000 (17:49 +0800)]
qemu: Forbid pinning vCPUs for TCG domain

We don't support cpu pinning for TCG domains because QEMU runs them in
one thread only.  But vcpupin command was able to set them, which
resulted in a failed startup, so make sure that doesn't happen.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agoRecreate the USB address cache at reconnect
Ján Tomko [Fri, 21 Oct 2016 11:09:04 +0000 (13:09 +0200)]
Recreate the USB address cache at reconnect

When starting a new domain, we allocate the USB addresses and keep
an address cache in the domain object's private data.

However this data is lost on libvirtd restart.

Also generate the address cache if all the addresses have been
specified, so that devices hotplugged after libvirtd restart
also get theirs assigned.

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

8 years agoDo not try to release virtio serial addresses
Ján Tomko [Fri, 21 Oct 2016 12:18:54 +0000 (14:18 +0200)]
Do not try to release virtio serial addresses

Return 0 instead of 1, so that qemuDomainAttachChrDevice does not
assume the address neeeds to be released on error.

No functional change, since qemuDomainReleaseDeviceAddress has been a noop
for virtio serial addresses since the address cache was removed
in commit 19a148b.

8 years agoFix crash on usb-serial hotplug
Ján Tomko [Fri, 21 Oct 2016 12:23:54 +0000 (14:23 +0200)]
Fix crash on usb-serial hotplug

For domains with no USB address cache, we should not attempt
to generate a USB address.

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

8 years agoReturn directly from qemuDomainAttachChrDeviceAssignAddr
Ján Tomko [Fri, 21 Oct 2016 12:17:31 +0000 (14:17 +0200)]
Return directly from qemuDomainAttachChrDeviceAssignAddr

This function should never need a cleanup section.

8 years agoIntroduce virDomainVirtioSerialAddrAutoAssign again
Ján Tomko [Fri, 21 Oct 2016 11:09:36 +0000 (13:09 +0200)]
Introduce virDomainVirtioSerialAddrAutoAssign again

This time do not require an address cache as a parameter.

Simplify qemuDomainAttachChrDeviceAssignAddr to not generate
the virtio serial address cache for devices of other types.

Partially reverts commit 925fa4b.

8 years agoAdd 'FromCache' to virDomainVirtioSerialAddrAutoAssign
Ján Tomko [Fri, 21 Oct 2016 10:58:54 +0000 (12:58 +0200)]
Add 'FromCache' to  virDomainVirtioSerialAddrAutoAssign

Commit 19a148b dropped the cache from QEMU's private domain object.
Assume the callers do not have the cache by default and use
a longer name for the internal ones that do.

This makes the shorter 'virDomainVirtioSerialAddrAutoAssign'
name availabe for a function that will not require the cache.

8 years agovirsh: Fix on_shutdown to on_poweroff
Martin Kletzander [Thu, 27 Oct 2016 06:33:45 +0000 (08:33 +0200)]
virsh: Fix on_shutdown to on_poweroff

The 'on_shutdown' was the name in Xen, there was never such option in
libvirt's domain XML.

Reported-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu, lxc: Raise error message when resuming running domain
Sławek Kapłoński [Sat, 22 Oct 2016 10:30:01 +0000 (12:30 +0200)]
qemu, lxc: Raise error message when resuming running domain

When user tries to resume already running domain (Qemu or LXC)
VIR_ERR_OPERATION_INVALID error should be raised with message that
domain is already running.

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

8 years agowireshark: Rename plugindir to ws_plugindir
Andrea Bolognani [Wed, 26 Oct 2016 12:00:16 +0000 (14:00 +0200)]
wireshark: Rename plugindir to ws_plugindir

Since we're using autoconf to substitute the right value in
Makefile.am now, we can use a less generic name without running
into circular dependencies.

8 years agowireshark: Inject $(prefix) at the right time
Andrea Bolognani [Wed, 26 Oct 2016 11:56:52 +0000 (13:56 +0200)]
wireshark: Inject $(prefix) at the right time

Adding $(prefix) in Makefile.am, as we were doing, means that
it would be prepended even when using --with-ws-plugindir,
which is something we don't want to happen.

Instead, we add it beforehand but take care that it doesn't
get expanded until make is called.

8 years agowireshark: Strip prefix correctly
Andrea Bolognani [Wed, 26 Oct 2016 11:52:08 +0000 (13:52 +0200)]
wireshark: Strip prefix correctly

Even when we're building $plugindir ourselves because we can't
retrieve it using pkg-config, we still want to strip the prefix,
except in that case it would be the same prefix we're using for
building libvirt.

The fact that $plugindir is missing also doesn't tell us
anything about $ws_prefix, so we have to handle the two variables
separately.

8 years agowireshark: Hoist $ws_prefix declaration
Andrea Bolognani [Wed, 26 Oct 2016 12:19:12 +0000 (14:19 +0200)]
wireshark: Hoist $ws_prefix declaration

Keep all variable declarations close together.

8 years agowireshark: Introduce $ws_modversion
Andrea Bolognani [Wed, 26 Oct 2016 11:43:16 +0000 (13:43 +0200)]
wireshark: Introduce $ws_modversion

Use a separate variable instead of setting it inline for
slightly cleaner code.

8 years agoqemu: Add support for using AES secret for SCSI hotplug
Gema Gomez [Sun, 9 Oct 2016 15:51:09 +0000 (16:51 +0100)]
qemu: Add support for using AES secret for SCSI hotplug

Support for virtio disks was added in commit id 'fceeeda', but not for
SCSI drives. Add the secret for the server when hotplugging a SCSI drive.
No need to make any adjustments for unplug since that's handled during
the qemuDomainDetachDiskDevice call to qemuDomainRemoveDiskDevice in
the qemuDomainDetachDeviceDiskLive switch.

Added a test to/for the command line processing to show the command line
options when adding a SCSI drive for the guest.

8 years agoqemu: Add secret object hotplug for TCP chardev TLS
John Ferlan [Fri, 17 Jun 2016 13:44:30 +0000 (09:44 -0400)]
qemu: Add secret object hotplug for TCP chardev TLS

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

Complete the implementation of support for TLS encryption on
chardev TCP transports by adding the hotplug ability of a secret
to generate the passwordid for the TLS object for chrdev, RNG,
and redirdev.

Fix up the order of object removal on failure to be the inverse
of the attempted attach (for redirdev, chr, rng) - for each the
tls object was being removed before the chardev backend.

Likewise, add the ability to hot unplug that secret object as well
and be sure the order of unplug matches that inverse order of plug.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Add a secret object to/for a char source dev
John Ferlan [Fri, 21 Oct 2016 23:02:35 +0000 (19:02 -0400)]
qemu: Add a secret object to/for a char source dev

Add the secret object so the 'passwordid=' can be added if the command line
if there's a secret defined in/on the host for TCP chardev TLS objects.

Preparation for the secret involves adding the secinfo to the char source
device prior to command line processing. There are multiple possibilities
for TCP chardev source backend usage.

Add test for at least a serial chardev as an example.

8 years agoqemu: Need to remove TLS object in RemoveRNGDevice
John Ferlan [Mon, 24 Oct 2016 19:59:11 +0000 (15:59 -0400)]
qemu: Need to remove TLS object in RemoveRNGDevice

Commit id '6e6b4bfc' added the object, but forgot the other end.

8 years agoqemu: Fix depedency order in qemuRemoveDiskDevice
John Ferlan [Tue, 25 Oct 2016 19:32:27 +0000 (15:32 -0400)]
qemu: Fix depedency order in qemuRemoveDiskDevice

Need to remove the drive first, then the secobj and/or encobj if they exist.
This is because the drive has a dependency on secobj (or the secret for
the networked storage server) and/or the encobj (or the secret for the
LUKS encrypted volume).  Deleting either object first leaves an drive
without it's respective objects.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovirsh: Add _length parameters to virsh output
John Ferlan [Sun, 2 Oct 2016 12:24:31 +0000 (08:24 -0400)]
virsh: Add _length parameters to virsh output

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

Add the duration parameters to the virsh input/output for blkdeviotune
command and describe them in the pod file.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovirsh: Create macros to add IOTUNE values
John Ferlan [Sun, 2 Oct 2016 11:55:32 +0000 (07:55 -0400)]
virsh: Create macros to add IOTUNE values

Rework the repetitive lines to add iotune values into easier to read macros.
One to handle the SCALED values and one to handle the non scaled values.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Add the length options to the iotune command line
John Ferlan [Mon, 19 Sep 2016 11:14:21 +0000 (07:14 -0400)]
qemu: Add the length options to the iotune command line

Add in the block I/O throttling length/duration parameter to the command
line if supported. If not supported, fail command creation.

Add the xml2argvtest for testing.

8 years agoconf: Add support for blkiotune "_length" options
John Ferlan [Mon, 19 Sep 2016 10:41:05 +0000 (06:41 -0400)]
conf: Add support for blkiotune "_length" options

Modify _virDomainBlockIoTuneInfo and rng schema to support the _length
options for bps/iops throttling values. Document the new values.

8 years agoqemu: Add length for bps/iops throttling parameters to driver
John Ferlan [Sun, 18 Sep 2016 16:02:50 +0000 (12:02 -0400)]
qemu: Add length for bps/iops throttling parameters to driver

Add support for a duration/length for the bps/iops and friends.

Modify the API in order to add the "blkdeviotune." specific definitions
for the iotune throttling duration/length options

    total_bytes_sec_max_length
    write_bytes_sec_max_length
    read_bytes_sec_max_length
    total_iops_sec_max_length
    write_iops_sec_max_length
    read_iops_sec_max_length

8 years agocaps: Add new capability for the bps/iops throttling length
John Ferlan [Mon, 19 Sep 2016 10:47:19 +0000 (06:47 -0400)]
caps: Add new capability for the bps/iops throttling length

Add the capability to detect if the qemu binary can support the feature
to use bps-max-length and friends.

8 years agoinclude: Add new definitions for duration for bps/iops throttling
John Ferlan [Mon, 19 Sep 2016 11:38:32 +0000 (07:38 -0400)]
include: Add new definitions for duration for bps/iops throttling

Add new options to allow proving a duration/length in seconds to allow the
bps/iops (and friends) to occur:

    total_bytes_sec_max_length
    write_bytes_sec_max_length
    read_bytes_sec_max_length
    total_iops_sec_max_length
    write_iops_sec_max_length
    read_iops_sec_max_length

Add continue for compiler hint to return to for control

8 years agoqemu: Introduce qemuDomainSetBlockIoTuneDefaults
John Ferlan [Thu, 6 Oct 2016 19:08:00 +0000 (15:08 -0400)]
qemu: Introduce qemuDomainSetBlockIoTuneDefaults

Create a helper to set the bytes/iops iotune default values based on
the current qemu setting for both the live and persistent definitions.
NB: This also fixes an unreported bug where the persistent values for
*_max and size_iops_sec would be set back to 0 if unrelated persistent
values were set.

8 years agoqemu: Move setting of conf_disk in qemuDomainSetBlockIoTune
John Ferlan [Thu, 6 Oct 2016 18:21:29 +0000 (14:21 -0400)]
qemu: Move setting of conf_disk in qemuDomainSetBlockIoTune

Since persistent_def is the only place that uses it, let's just keep
it closer to where it's used.

8 years agoqemu: Return real error message for block_set_io_throttle
John Ferlan [Thu, 6 Oct 2016 18:13:27 +0000 (14:13 -0400)]
qemu: Return real error message for block_set_io_throttle

This patch will also adjust the qemuMonitorJSONSetBlockIoThrottle error
procession so that rather than returning/displaying:

    "error: internal error: Unexpected error"

Fetch the actual error message from qemu and display that

8 years agoqemu: Create a macro to handle setting bytes/iops iotune values
John Ferlan [Thu, 6 Oct 2016 17:57:32 +0000 (13:57 -0400)]
qemu: Create a macro to handle setting bytes/iops iotune values

Create a macros to hide all the comparisons for each of the fields.

Add a 'continue;' for a compiler hint that we only need to find one
this should be similar enough to the if - elseif - elseif logic.

8 years agoqemu: Move TLS object remove from DetachChr to RemoveChr
John Ferlan [Mon, 24 Oct 2016 19:47:56 +0000 (15:47 -0400)]
qemu: Move TLS object remove from DetachChr to RemoveChr

Commit id '2c32237' added the TLS object removal to the DetachChrDevice
all when it should have been added to the RemoveChrDevice since that's
the norm for similar processing (e.g. disk)

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovirQEMUCapsReset: also clear out hostCPUModel
Ján Tomko [Mon, 24 Oct 2016 15:35:32 +0000 (17:35 +0200)]
virQEMUCapsReset: also clear out hostCPUModel

After succesfully reading an outdated caps cache from disk,
calling virQEMUCapsReset did not properly clear out the calculated
host CPU model. This lead to a memory leak when the host CPU model
pointer was overwritten later in virQEMUCapsNewForBinaryInternal.

Introduced by commit 68c70118.

8 years agolibxl: fix leaking of allocated migration ports
Jim Fehlig [Fri, 14 Oct 2016 17:55:52 +0000 (11:55 -0600)]
libxl: fix leaking of allocated migration ports

Although the migration port is immediately released in the
finish phase of migration, it was never set in the domain
private object when allocated in the prepare phase. So
libxlDomainMigrationFinish() always released a 0-initialized
migrationPort, leaking any allocated port. After enough
migrations to exhaust the migration port pool, migration would
fail with

error: internal error: Unable to find an unused port in range
       'migration' (49152-49216)

Fix it by setting libxlDomainObjPrivate->migrationPort to the
port allocated in the prepare phase. While at it, also fix
leaking an allocated port if the prepare phase fails.

8 years agodoc: update virsh domstats documentation for vcpu statistics
Viktor Mihajlovski [Thu, 13 Oct 2016 11:42:47 +0000 (13:42 +0200)]
doc: update virsh domstats documentation for vcpu statistics

Added description for new vcpu.<num>.halted statistics value.
While there, also added a description for vcpu.<num>.wait and
clarified the units displayed for time and wait.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
8 years agoqemu: add vcpu.n.halted to vcpu domain stats
Viktor Mihajlovski [Thu, 13 Oct 2016 11:42:46 +0000 (13:42 +0200)]
qemu: add vcpu.n.halted to vcpu domain stats

Extended qemuDomainGetStatsVcpu to include the per vcpu halted
indicator if reported by QEMU. The key for new boolean value
has the format "vcpu.<n>.halted".

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
8 years agoqemu: Add domain support for VCPU halted state
Viktor Mihajlovski [Thu, 13 Oct 2016 11:42:45 +0000 (13:42 +0200)]
qemu: Add domain support for VCPU halted state

Adding a field to the domain's private vcpu object to hold the halted
state information.
Adding two functions in support of the halted state:
- qemuDomainGetVcpuHalted: retrieve the halted state from a
  private vcpu object
- qemuDomainRefreshVcpuHalted: obtain the per-vcpu halted states
  via qemu monitor and store the results in the private vcpu objects

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Hao QingFeng <haoqf@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
8 years agoqemu: Add monitor support for CPU halted state
Viktor Mihajlovski [Thu, 13 Oct 2016 11:42:44 +0000 (13:42 +0200)]
qemu: Add monitor support for CPU halted state

Extended the qemuMonitorCPUInfo with a halted flag. Extract the halted
flag for both text and JSON monitor.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
8 years agoqemu: replace calls to virDomainPCIAddressReserveNext*() with static function
Laine Stump [Fri, 2 Sep 2016 20:39:18 +0000 (16:39 -0400)]
qemu: replace calls to virDomainPCIAddressReserveNext*() with static function

An upcoming commit will remove the "flag" argument from all the calls
to reserve the next available address|slot, but I don't want to change
the arguments in the hypervisor-agnostic
virDomainPCIAddressReserveNext*() functions, so this patch places a
simple qemu-specific wrapper around those functions - the new
functions don't take a flags arg, but grab it from the device's
info->pciConnectFlags.

8 years agoconf: make virDomainPCIAddressGetNextSlot() a local static function
Laine Stump [Thu, 1 Sep 2016 15:38:02 +0000 (11:38 -0400)]
conf: make virDomainPCIAddressGetNextSlot() a local static function

This function is no longer needed outside of domain_addr.c.

8 years agoqemu: use virDomainPCIAddressReserveNextAddr in qemuDomainAssignDevicePCISlots
Laine Stump [Thu, 1 Sep 2016 15:23:06 +0000 (11:23 -0400)]
qemu: use virDomainPCIAddressReserveNextAddr in qemuDomainAssignDevicePCISlots

instead of calling virDomainPCIAddressGetNextSlot() (which I want to
turn into a local static in domain_addr.c).

8 years agoconf: new function virDomainPCIAddressReserveNextAddr()
Laine Stump [Thu, 1 Sep 2016 13:29:01 +0000 (09:29 -0400)]
conf: new function virDomainPCIAddressReserveNextAddr()

There is an existing virDomainPCIAddressReserveNextSlot() which will
reserve all functions of the next available PCI slot. One place in the
qemu PCI address assignment code requires reserving a *single*
function of the next available PCI slot. This patch modifies and
renames virDomainPCIAddressReserveNextSlot() so that it can fulfill
both the original purpose and the need to reserve a single function.

(This is being done so that the abovementioned code in qemu can have
its "kind of open coded" solution replaced with a call to this new
function).

8 years agodomain: fix migration to older libvirt
Pavel Hrdina [Fri, 21 Oct 2016 14:42:26 +0000 (16:42 +0200)]
domain: fix migration to older libvirt

Since TLS was introduced hostwide for libvirt 2.3.0 and a domain
configurable haveTLS was implemented for libvirt 2.4.0, we have to
modify the migratable XML for specific case where the 'tls' attribute
is based on setting from qemu.conf.

The "tlsFromConfig" is libvirt internal attribute and is stored only in
status XML to ensure that when libvirtd is restarted this internal flag
is not lost by the restart.

That flag is used to decide whether we should put *tls* attribute to
migratable XML or not.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodomain: Add optional 'tls' attribute for TCP chardev
Pavel Hrdina [Mon, 24 Oct 2016 12:05:54 +0000 (14:05 +0200)]
domain: Add optional 'tls' attribute for TCP chardev

Add an optional "tls='yes|no'" attribute for a TCP chardev.

For QEMU, this will allow for disabling the host config setting of the
'chardev_tls' for a domain chardev channel by setting the value to "no" or
to attempt to use a host TLS environment when setting the value to "yes"
when the host config 'chardev_tls' setting is disabled, but a TLS environment
is configured via either the host config 'chardev_tls_x509_cert_dir' or
'default_tls_x509_cert_dir'

Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodomain_conf: remove union for one member from redirdev struct
Pavel Hrdina [Mon, 24 Oct 2016 12:24:51 +0000 (14:24 +0200)]
domain_conf: remove union for one member from redirdev struct

Currently the union has only one member so remove that union.  If there
is a need to add a new type of source for new bus in the future this
will force the author to add a union and properly check bus type before
any access to union member.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodomain_conf: fix memory leak in virDomainDefAddConsoleCompat
Pavel Hrdina [Fri, 21 Oct 2016 19:20:37 +0000 (21:20 +0200)]
domain_conf: fix memory leak in virDomainDefAddConsoleCompat

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemu: Add TLS hotplug for qemuDomainAttachRNGDevice
John Ferlan [Fri, 21 Oct 2016 14:06:50 +0000 (10:06 -0400)]
qemu: Add TLS hotplug for qemuDomainAttachRNGDevice

Commit id '2c322378' missed the nuance that the rng backend could be
using a TCP chardev and if TLS is enabled on the host, thus will need
to have the TLS object added.

8 years agoqemu: Add TLS hotplug for qemuDomainAttachRedirdevDevice
John Ferlan [Fri, 21 Oct 2016 13:59:53 +0000 (09:59 -0400)]
qemu: Add TLS hotplug for qemuDomainAttachRedirdevDevice

Commit id '2c322378' missed the nuance that the redirdev backend could
be using a TCP chardev and if TLS is enabled on the host, thus will need
to have the TLS object added.

8 years agoqemu: Clean up error path in qemuDomainAttachRedirdevDevice
John Ferlan [Fri, 21 Oct 2016 13:53:30 +0000 (09:53 -0400)]
qemu: Clean up error path in qemuDomainAttachRedirdevDevice

It's about to get more complicated - let's alter the logic to handle
various failures. Adds saving of the error as well.

8 years agoqemu: Introduce qemuDomainGetChardevTLSObjects for hotplug
John Ferlan [Fri, 21 Oct 2016 13:38:18 +0000 (09:38 -0400)]
qemu: Introduce qemuDomainGetChardevTLSObjects for hotplug

As it turns out more than one place will need these objects, so rather
than cut-copy-paste in each, make a helper

8 years agoconf: Use virDomainChrSourceDefNew for virDomainRNGDef allocation
John Ferlan [Fri, 21 Oct 2016 22:33:41 +0000 (18:33 -0400)]
conf: Use virDomainChrSourceDefNew for virDomainRNGDef allocation

Rather than VIR_ALLOC() the data, use virDomainChrSourceDefNew in order
to get the private data if necessary.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoconf: Use virDomainChrSourceDefPtr for _virDomainRedirdevDef 'source.chr'
John Ferlan [Fri, 21 Oct 2016 22:27:52 +0000 (18:27 -0400)]
conf: Use virDomainChrSourceDefPtr for _virDomainRedirdevDef 'source.chr'

Use a pointer and the virDomainChrSourceDefNew() function in order to
allocate the structure for _virDomainRedirdevDef.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoconf: Use virDomainChrSourceDefPtr for _virDomainSmartcardDef 'passthru'
John Ferlan [Fri, 21 Oct 2016 22:08:02 +0000 (18:08 -0400)]
conf: Use virDomainChrSourceDefPtr for _virDomainSmartcardDef 'passthru'

Use a pointer and the virDomainChrSourceDefNew() function in order to
allocate the structure for _virDomainSmartcardDef.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoxenFormatXLDisk: Unify commas pattern for arguments
Michal Privoznik [Thu, 20 Oct 2016 13:59:01 +0000 (21:59 +0800)]
xenFormatXLDisk: Unify commas pattern for arguments

instead of:

  virBufferAdd(buf, "arg1,");
  virBufferAdd(buf, "arg2");

lets have:

  virBufferAdd(buf, "arg1");
  virBufferAdd(buf, ",arg2");

Because it's better. Consider we want to add conditionally arg3.
With this change, it's simple:

  if (cond)
    virBufferAdd(buf, ",arg3");

with current code there might be a comma hanging at EOL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: change first arg of qemuDomainAttachChrDeviceAssignAddr()
Laine Stump [Wed, 12 Oct 2016 19:24:57 +0000 (15:24 -0400)]
qemu: change first arg of qemuDomainAttachChrDeviceAssignAddr()

from virDomainDefPtr to virDomainObjPtr so that the function has
access to the other parts of the virDomainObjPtr. Take advantage of
this by removing the "priv" arg and retrieving it from the
virDomainObjPtr instead.

No functional change.

8 years agoqemu: make error message in qemuDomainPCIAddressSetCreate more clear.
Laine Stump [Thu, 13 Oct 2016 18:50:23 +0000 (14:50 -0400)]
qemu: make error message in qemuDomainPCIAddressSetCreate more clear.

This error should only ever be seen by a developer anyway, but the
existing message made even less sense that this new version.

8 years agoqemu: remove superfluous setting of addrs->nbuses
Laine Stump [Thu, 13 Oct 2016 18:49:12 +0000 (14:49 -0400)]
qemu: remove superfluous setting of addrs->nbuses

This is already set by virDomainPCIAddressSetAlloc().

8 years agoconf: add typedef for anonymous enum used for memballoon device model
Laine Stump [Fri, 7 Oct 2016 19:51:30 +0000 (15:51 -0400)]
conf: add typedef for anonymous enum used for memballoon device model

For some reason the values of memballoon model are set using an
anonymous enum, making it impossible to perform nice tricks like
demanding there are cases for all possible values in a switch. This
patch turns the anonymous enum into virDomainMemballoonModel.

8 years agoqemu: replace "def->nets[i]" with "net" and "def->sounds[i]" with "sound"
Laine Stump [Wed, 12 Oct 2016 19:01:32 +0000 (15:01 -0400)]
qemu: replace "def->nets[i]" with "net" and "def->sounds[i]" with "sound"

More occurences of repeatedly dereferencing the same pointer stored in
an array are replaced with the definition of a temporary pointer that
is then used directly. No functional change.

8 years agoqemu: replace a lot of "def->controllers[i]" with equivalent "cont"
Laine Stump [Tue, 6 Sep 2016 18:35:26 +0000 (14:35 -0400)]
qemu: replace a lot of "def->controllers[i]" with equivalent "cont"

There's no functional change here. This pointer was just used so many
times that the extra long lines became annoying.

8 years agoconf: Move the privateData from virDomainChrDef to virDomainChrSourceDef
John Ferlan [Fri, 21 Oct 2016 12:31:37 +0000 (08:31 -0400)]
conf: Move the privateData from virDomainChrDef to virDomainChrSourceDef

Commit id '5f2a132786' should have placed the data in the host source
def structure since that's also used by smartcard, redirdev, and rng in
order to provide a backend tcp channel.  The data in the private structure
will be necessary in order to provide the secret properly.

This also renames the previous names from "Chardev" to "ChrSource" for
the private data structures and API's

8 years agoIntroduce virDomainChrSourceDefNew for virDomainChrDefPtr
John Ferlan [Fri, 21 Oct 2016 11:45:54 +0000 (07:45 -0400)]
Introduce virDomainChrSourceDefNew for virDomainChrDefPtr

Change the virDomainChrDef to use a pointer to 'source' and allocate
that pointer during virDomainChrDefNew.

This has tremendous "fallout" in the rest of the code which mainly
has to change source.$field to source->$field.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovmx: Use the allocator virDomainChrDefNew
John Ferlan [Fri, 21 Oct 2016 12:09:51 +0000 (08:09 -0400)]
vmx: Use the allocator virDomainChrDefNew

Rather than VIR_ALLOC of the virDomainChrDefPtr

8 years agodoc: Describe the VCPU states returned by virsh vcpuinfo
Viktor Mihajlovski [Thu, 13 Oct 2016 11:08:01 +0000 (13:08 +0200)]
doc: Describe the VCPU states returned by virsh vcpuinfo

Added a brief description of the VCPU states.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
8 years agoqemuBuildHostNetStr: remove dead code
Ján Tomko [Fri, 14 Oct 2016 14:17:06 +0000 (16:17 +0200)]
qemuBuildHostNetStr: remove dead code

This function is never called for VIR_DOMAIN_NET_TYPE_HOSTDEV,
and the dead code comment agrees.

Introduced by commit 1dcbef8a.

8 years agoqemuBuildHostNetStr: do not start options with a comma
Ján Tomko [Fri, 14 Oct 2016 14:23:18 +0000 (16:23 +0200)]
qemuBuildHostNetStr: do not start options with a comma

Put the comma at the end and trim it later for consistency.

8 years agoqemuBuildHostNetStr: use type_sep earlier
Ján Tomko [Fri, 14 Oct 2016 13:16:46 +0000 (15:16 +0200)]
qemuBuildHostNetStr: use type_sep earlier

When hotplugging networks with ancient QEMUs not supporting
QEMU_CAPS_NETDEV, we use space instead of a comma as the separator
between the network type and other options.

Except for "user", all the network types pass other options
and use up the first separator by the time we get to the section
that adds the alias (or vlan for QEMUs without CAPS_NETDEV).

Since the alias/vlan is mandatory, convert all preceding code to add
the separator at the end, removing the need to rewrite type_sep for
all types but NET_TYPE_USER.

8 years agovz: set something in disk driver name
Nikolay Shirokovskiy [Thu, 22 Sep 2016 14:55:42 +0000 (17:55 +0300)]
vz: set something in disk driver name

Absent driver name attribute is invalid xml. Which in turn makes
unusable 'virsh edit' for example. The value does not make
much sense and ignored on input so nobody will hurt.

8 years agovz: add serial number to disk devices
Nikolay Shirokovskiy [Thu, 22 Sep 2016 14:55:41 +0000 (17:55 +0300)]
vz: add serial number to disk devices

vz sdk supports setting serial number only for disk devices.
Getting serial upon cdrom(for example) is error however
setting is just ignored. Let's check for disk device
explicitly for clarity in both cases.

Setting serial number for other devices is ignored
with an info note just as before.

We need usual conversion from "" to NULL in direction
vz sdk -> libvirt, because "" is not valid for libvirt
and "" means unspecifiend in vz sdk which is NULL for libvirt.

8 years agobhyve: Need to add parameter to virDomainChrDefNew
John Ferlan [Fri, 21 Oct 2016 11:52:26 +0000 (07:52 -0400)]
bhyve: Need to add parameter to virDomainChrDefNew

Commit id '5f2a13278' missed this one.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovz: set localhost as vnc address
Mikhail Feoktistov [Tue, 18 Oct 2016 16:19:04 +0000 (12:19 -0400)]
vz: set localhost as vnc address

We should set localhost as vnc address in case of empty string.
Because Virtuozzo sets 0.0.0.0 as default vnc address.

8 years agovirt-wireshark.m4: Defer $(prefix) substitution
Michal Privoznik [Thu, 20 Oct 2016 02:25:13 +0000 (10:25 +0800)]
virt-wireshark.m4: Defer $(prefix) substitution

The autoconf manual says we shouldn't be using this variable (and
some others) outside of Makefiles as it prevents users providing
their own prefix at the installation phase.

https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agonetworkValidate: Forbid new-line char in network name
Sławek Kapłoński [Wed, 19 Oct 2016 20:57:48 +0000 (22:57 +0200)]
networkValidate: Forbid new-line char in network name

New line character in name of network is now forbidden because it
mess virsh output and can be confusing for users.  Validation of
name is done in network driver, after parsing XML to avoid
problems with disappeared network which was already created with
new-line char in name.

Closes-Bug: https://bugzilla.redhat.com/show_bug.cgi?id=818064
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agonetwork: Use new util function to check name
Sławek Kapłoński [Wed, 19 Oct 2016 20:57:47 +0000 (22:57 +0200)]
network: Use new util function to check name

New util function virXMLCheckIllegalChars is now used to test if
parsed network contains illegal char '/' in it's name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirxml: Add function to check if string contains some illegal chars
Sławek Kapłoński [Wed, 19 Oct 2016 20:57:46 +0000 (22:57 +0200)]
virxml: Add function to check if string contains some illegal chars

This new function can be used to check if e.g. name of XML
node don't contains forbidden chars like "/" or "\n".

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Introduce qemuDomainChardevPrivatePtr
John Ferlan [Fri, 17 Jun 2016 10:36:11 +0000 (06:36 -0400)]
qemu: Introduce qemuDomainChardevPrivatePtr

Modeled after the qemuDomainHostdevPrivatePtr (commit id '27726d8c'),
create a privateData pointer in the _virDomainChardevDef to allow storage
of private data for a hypervisor in order to at least temporarily store
secret data for usage during qemuBuildCommandLine.

NB: Since the qemu_parse_command (qemuParseCommandLine) code is not
expecting to restore the secret data, there's no need to add code
code to handle this new structure there.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoconf: Introduce {default|chardev}_tls_x509_secret_uuid
John Ferlan [Thu, 8 Sep 2016 14:04:59 +0000 (10:04 -0400)]
conf: Introduce {default|chardev}_tls_x509_secret_uuid

Add a new qemu.conf variables to store the UUID for the secret that could
be used to present credentials to access the TLS chardev.  Since this will
be a server level and it's possible to use some sort of default, introduce
both the default and chardev logic at the same time making the setting of
the chardev check for it's own value, then if not present checking whether
the default value had been set.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoxl: fix 8126d870 broken test
Cédric Bosdonnat [Wed, 19 Oct 2016 18:51:15 +0000 (20:51 +0200)]
xl: fix 8126d870 broken test

xlconfigtest expects the comma, don't clean it up even if there is
no target to write.