]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoqemuDomainBuildNamespace: Clean up temp files
Michal Privoznik [Mon, 12 Jun 2017 15:46:30 +0000 (17:46 +0200)]
qemuDomainBuildNamespace: Clean up temp files

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

After 290a00e41d we know how to deal with file mount points.
However, when cleaning up the temporary location for preserved
mount points we are still calling rmdir(). This won't fly for
files. We need to call unlink(). Now, since we don't really care
if the cleanup succeeded or not (it's the best effort anyway), we
can call both rmdir() and unlink() without need for
differentiation between files and directories.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoReport more correct information for cache control
Martin Kletzander [Mon, 5 Jun 2017 12:00:45 +0000 (14:00 +0200)]
Report more correct information for cache control

On some platforms the number of bits in the cbm_mask might not be
divisible by 4 (and not even by 2), so we need to properly count the
bits.  Similar file, min_cbm_bits, is properly parsed and used, but if
the number is greater than one, we lose the information about
granularity when reporting the data in capabilities.  For that matter
always report granularity, but if it is not the same as the minimum,
add that information in there as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoapparmor, libvirt-qemu: Allow access to certificates used by libvirt-vnc
Serge Hallyn [Tue, 23 May 2017 16:22:48 +0000 (18:22 +0200)]
apparmor, libvirt-qemu: Allow access to certificates used by libvirt-vnc

When setting up VncTLS according to the official Libvirt documentation,
only one certificate for libvirt/libvirt-vnc is used. The document
indicates to use the following directories :

 /etc/pki/CA
 /etc/pki/libvirt
 /etc/pki/libvirt/private

in order to manage the certificates used by libvirt-vnc.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/901272

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agoapparmor, libvirt-qemu: Allow access to ceph config
Serge Hallyn [Tue, 23 May 2017 16:22:45 +0000 (18:22 +0200)]
apparmor, libvirt-qemu: Allow access to ceph config

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agoapparmor, libvirtd: Allow libxl-save-helper to run on Debian/Ubuntu
Stefan Bader [Fri, 16 Jun 2017 08:20:11 +0000 (10:20 +0200)]
apparmor, libvirtd: Allow libxl-save-helper to run on Debian/Ubuntu

On Debian/Ubuntu the libxl-save-helper (used when saving/restoring
a domain through libxl) is located under /usr/lib/xen-<version>/bin.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1334195

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agoapparmor, libvirt-qemu: Add ppc64el related changes
Serge Hallyn [Tue, 23 May 2017 16:22:42 +0000 (18:22 +0200)]
apparmor, libvirt-qemu: Add ppc64el related changes

Updates profile to allow running on ppc64el.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1374554

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agoapparmor, virt-aa-helper: Allow aarch64 UEFI.
William Grant [Tue, 23 May 2017 16:22:41 +0000 (18:22 +0200)]
apparmor, virt-aa-helper: Allow aarch64 UEFI.

Allow access to aarch64 UEFI images.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Guido Günther <agx@sigxcpu.org>
7 years agovirt-aa-helper: Generalize test for firmware paths
Christian Ehrhardt [Tue, 23 May 2017 16:22:40 +0000 (18:22 +0200)]
virt-aa-helper: Generalize test for firmware paths

This replaces individual tests for firmware locations by
a generic function which will simplify having additional
locations in the future.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agovirt-aa-helper, apparmor: allow /usr/share/OVMF/ too
Simon McVittie [Tue, 23 May 2017 16:22:39 +0000 (18:22 +0200)]
virt-aa-helper, apparmor: allow /usr/share/OVMF/ too

The split firmware and variables files introduced by
https://bugs.debian.org/764918 are in a different directory for
some reason. Let the virtual machine read both.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
7 years agoqemu: Allow live-updates of coalesce settings
Martin Kletzander [Thu, 15 Jun 2017 12:22:26 +0000 (14:22 +0200)]
qemu: Allow live-updates of coalesce settings

Change the settings from qemuDomainUpdateDeviceLive() as otherwise the
call would succeed even though nothing has changed.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoTemporarily disable format truncation warnings
Daniel P. Berrange [Thu, 15 Jun 2017 13:22:54 +0000 (14:22 +0100)]
Temporarily disable format truncation warnings

GCC 7.1 introduces a new -Wformat-truncation warning
flag that reports if it thinks the maximum possible
size of the formatted output will exceed the provided
fixed buffer. This is enabled automatically by the
-Wformat warning flag. There are quite a few places
hit by this in libvirt which need rewriting. This is
non-trivial work in some places, so temporarily
disable the new warning until those fixes can be
implemented.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoDisable the -Wduplicated-branches warning
Daniel P. Berrange [Wed, 14 Jun 2017 14:10:02 +0000 (15:10 +0100)]
Disable the -Wduplicated-branches warning

Depending on the platform/architecture, a number of conditionals
in libvirt code expand the same on both branches. This is expected
behaviour and harmless, so disable the warning to avoid creating
unexpected build failures

Two examples, mingw32:

../../src/util/vircommand.c: In function 'virCommandWait':
../../src/util/vircommand.c:2562:51: error: this condition has identical branches [-Werror=duplicated-branches]
             *exitstatus = cmd->rawStatus ? status : WEXITSTATUS(status);
                                                   ^
and gcc7.1

In file included from util/virobject.c:28:0:
util/virobject.c: In function 'virClassNew':
util/viratomic.h:176:46: error: this condition has identical branches [-Werror=duplicated-branches]
            (void)(0 ? *(atomic) ^ *(atomic) : 0);                      \
                                             ^
util/virobject.c:144:20: note: in expansion of macro 'virAtomicIntInc'
    klass->magic = virAtomicIntInc(&magicCounter);
                   ^~~~~~~~~~~~~~~

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: Use qemuDomainCheckABIStability where needed
Jiri Denemark [Wed, 14 Jun 2017 12:56:21 +0000 (14:56 +0200)]
qemu: Use qemuDomainCheckABIStability where needed

Most places which want to check ABI stability for an active domain need
to call this API rather than the original
qemuDomainDefCheckABIStability. The only exception is in snapshots where
we need to decide what to do depending on the saved image data.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemuDomainCheckABIStability
Jiri Denemark [Wed, 14 Jun 2017 11:43:37 +0000 (13:43 +0200)]
qemu: Add qemuDomainCheckABIStability

When making ABI stability checks for an active domain, we need to make
sure we use the same migratable definition which virDomainGetXMLDesc
with the MIGRATABLE flag provides, otherwise the ABI check will fail.
This is implemented in the new qemuDomainCheckABIStability which takes a
domain object and generates the right migratable definition from it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemuDomainMigratableDefCheckABIStability
Jiri Denemark [Wed, 14 Jun 2017 11:43:12 +0000 (13:43 +0200)]
qemu: Add qemuDomainMigratableDefCheckABIStability

This patch separates the actual ABI checks from getting migratable defs
in qemuDomainDefCheckABIStability so that we can create another wrapper
which will use different methods to get the migratable defs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Introduce qemuDomainDefFromXML helper
Jiri Denemark [Wed, 14 Jun 2017 11:42:16 +0000 (13:42 +0200)]
qemu: Introduce qemuDomainDefFromXML helper

The main goal of this function is to enable reusing the parsing code
from qemuDomainDefCopy.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Don't try to use hugepages if not enabled
Michal Privoznik [Wed, 14 Jun 2017 08:40:20 +0000 (10:40 +0200)]
qemu: Don't try to use hugepages if not enabled

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

My fix 671d18594f4 was incomplete. If domain doesn't have
hugepages enabled, because of missing condition we would still be
putting hugepages path onto qemu cmd line. Clean up the
conditions so that it's more visible next time.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoUse sys/uio.h for writev()
Daniel P. Berrange [Wed, 14 Jun 2017 13:38:01 +0000 (14:38 +0100)]
Use sys/uio.h for writev()

With glibc >= 2.25.90 writev() is only available if you explicitly
include sys/uio.h. This matches the documented requirements, but
older glibc and other *NIX pulled in writev indirectly so the bug
wasn't noticed previously.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agomaint: update to latest gnulib
Daniel P. Berrange [Wed, 14 Jun 2017 10:18:57 +0000 (11:18 +0100)]
maint: update to latest gnulib

This fixes an incompatibility with glibc 2.25.90

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: monitor: Fix a memory leak in qemuMonitorJSONAttachCharDevCommand
Erik Skultety [Tue, 13 Jun 2017 15:55:36 +0000 (17:55 +0200)]
qemu: monitor: Fix a memory leak in qemuMonitorJSONAttachCharDevCommand

With the current logic, we only free @tlsalias as part of the error
label and would have to free it explicitly earlier in the code. Convert
the error label to cleanup, so that we have only one sink, where we
handle all frees. Since JSON object append operation consumes pointers,
make sure @backend is cleared before we hit the cleanup label.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Prefer hugepages over mem source='file'
Michal Privoznik [Thu, 8 Jun 2017 14:45:02 +0000 (16:45 +0200)]
qemu: Prefer hugepages over mem source='file'

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

Consider the following XML:

  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='1'/>
    </hugepages>
    <source type='file'/>
    <access mode='shared'/>
  </memoryBacking>

  <numa>
    <cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
    <cell id='1' cpus='4-7' memory='512000' unit='KiB'/>
  </numa>

The following cmd line is generated:

  -object
  memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,
  share=yes,size=524288000 -numa node,nodeid=0,cpus=0-3,memdev=ram-node0
  -object
  memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,
  share=yes,size=524288000 -numa node,nodeid=1,cpus=4-7,memdev=ram-node1

This is obviously wrong as for node 1 hugepages should have been
used. The hugepages configuration is more specific than <source
type='file'/>.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Allow memAccess for hugepages again
Michal Privoznik [Tue, 6 Jun 2017 08:58:37 +0000 (10:58 +0200)]
qemu: Allow memAccess for hugepages again

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

Historically, we've always supported memAccess for domains backed
by hugepages. However, somewhere along the way we've regressed
and stopped allowing such configuration. Fix it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemuxml2xmltest: Test hugepage enabled domains
Michal Privoznik [Thu, 8 Jun 2017 14:20:31 +0000 (16:20 +0200)]
qemuxml2xmltest: Test hugepage enabled domains

We have couple of hugepage enabled domains for qemuxml2argvtest.
Unfortunately, often when adding a test case there I forget to
add it to xml2xml test too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemuDomainAttachMemory: Crate hugepage dir if needed
Michal Privoznik [Wed, 7 Jun 2017 12:47:37 +0000 (14:47 +0200)]
qemuDomainAttachMemory: Crate hugepage dir if needed

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

It may happen that a domain is started without any huge pages.
However, user might try to attach a DIMM module later. DIMM
backed by huge pages (why would somebody want to mix regular and
huge pages is beyond me). Therefore we have to create the dir if
we haven't done so far.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuProcessBuildDestroyHugepagesPath: create path more frequently
Michal Privoznik [Wed, 7 Jun 2017 11:38:14 +0000 (13:38 +0200)]
qemuProcessBuildDestroyHugepagesPath: create path more frequently

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

Currently, the per-domain path for huge pages mmap() for qemu is
created iff domain has memoryBacking and hugepages in it
configured. However, this alone is not enough because there can
be a DIMM module with hugepages configured too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agodaemonUnixSocketPaths: Unify exit paths
Michal Privoznik [Wed, 3 May 2017 06:01:14 +0000 (08:01 +0200)]
daemonUnixSocketPaths: Unify exit paths

Right now, there is a lot of exit points from the function.
Depending on their position they need to copy the same free
calls. This goes against our style where we usually have just one
exit point from the function which also does the necessary free.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Fix starting a domain with corrupted managed save file
Jiri Denemark [Tue, 13 Jun 2017 11:25:07 +0000 (13:25 +0200)]
qemu: Fix starting a domain with corrupted managed save file

Commit v3.4.0-44-gac793bd71 fixed a memory leak, but failed to return
the special -3 value. Thus an attempt to start a domain with corrupted
managed save file would removed the corrupted file and report
"An error occurred, but the cause is unknown" instead of starting the
domain from scratch.

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

7 years agodaemon: fix memory leak in daemonUnixSocketPaths
Yi Wang [Mon, 12 Jun 2017 06:02:20 +0000 (02:02 -0400)]
daemon: fix memory leak in daemonUnixSocketPaths

@rundir, allocated by virGetUserRuntimeDirectory, is leaked in case
virFileMakePath fails.

Signed-off-by: Xi Xu <xu.xi8@zte.com.cn>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agocpu_ppc64: Add support for host-model on POWER9
Jiri Denemark [Wed, 17 May 2017 14:39:16 +0000 (16:39 +0200)]
cpu_ppc64: Add support for host-model on POWER9

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu/doc: Fix function name for handling events
Philipp Hahn [Mon, 12 Jun 2017 15:11:20 +0000 (17:11 +0200)]
qemu/doc: Fix function name for handling events

Insert missing "IO" into function name.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agoqemu: Explain why mdevs are assumed to be PCI Express
Andrea Bolognani [Mon, 12 Jun 2017 09:57:31 +0000 (17:57 +0800)]
qemu: Explain why mdevs are assumed to be PCI Express

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoUse ATTRIBUTE_FALLTHROUGH
Marc Hartmayer [Wed, 7 Jun 2017 08:46:41 +0000 (10:46 +0200)]
Use ATTRIBUTE_FALLTHROUGH

Use ATTRIBUTE_FALLTHROUGH, introduced by commit
5d84f5961b8e28e802f600bb2d2c6903e219092e, instead of comments to
indicate that the fall through is an intentional behavior.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
7 years agoqemu: add a comment for mon->watch
Marc Hartmayer [Wed, 7 Jun 2017 08:46:40 +0000 (10:46 +0200)]
qemu: add a comment for mon->watch

Add a comment for mon->watch to make clear what's the purpose of this
value.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
7 years agorpc: first allocate the memory and then set the count
Marc Hartmayer [Wed, 7 Jun 2017 08:46:39 +0000 (10:46 +0200)]
rpc: first allocate the memory and then set the count

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
7 years agobhyve: tests: add vnc test to bhyvexml2xmltest
Roman Bogorodskiy [Mon, 8 May 2017 11:35:59 +0000 (15:35 +0400)]
bhyve: tests: add vnc test to bhyvexml2xmltest

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Release address for redirected device hotplug attach failure
Shivaprasad G Bhat [Tue, 30 May 2017 11:22:17 +0000 (16:52 +0530)]
qemu: Release address for redirected device hotplug attach failure

The virDomainUSBAddressEnsure returns 0 or -1, so commit id 'de325472'
checking for 1 like qemuDomainAttachChrDeviceAssignAddr was wrong.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
7 years agoRevert "util: virqemu: introduce virQEMUBuildBufferEscape"
Pavel Hrdina [Sat, 10 Jun 2017 09:37:34 +0000 (11:37 +0200)]
Revert "util: virqemu: introduce virQEMUBuildBufferEscape"

This reverts commit 22b02f44920388534d3da65cc6f0a70714dcf075.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: skip only ',' for VNC and Spice unix socket
Pavel Hrdina [Sat, 10 Jun 2017 09:38:57 +0000 (11:38 +0200)]
qemu: skip only ',' for VNC and Spice unix socket

Commit 824272cb28d attempted to fix escaping of characters in unix
socket path but it was wrong.  We need to escape only ',', there is
no escape character for '='.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Fix memory leak in qemuDomainBlockCopyCommon()
Jie Wang [Fri, 9 Jun 2017 09:12:34 +0000 (17:12 +0800)]
qemu: Fix memory leak in qemuDomainBlockCopyCommon()

Exiting early through the cleanup path did result in 'mirror'
being leaked.

7 years agoqemu: report an error if usb keyboards are unsupported
Ján Tomko [Fri, 9 Jun 2017 06:27:07 +0000 (08:27 +0200)]
qemu: report an error if usb keyboards are unsupported

Be nicer to the user and report a proper error instead of:
An error occurred, but the cause is unknown

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

7 years agovirsh: workaround readline prototypes warnings
Roman Bogorodskiy [Fri, 26 May 2017 17:43:42 +0000 (21:43 +0400)]
virsh: workaround readline prototypes warnings

When building with clang 4.0.0, virsh build fails like this:

gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools'
  CC       virsh-virsh.o
In file included from virsh.c:45:
In file included from /usr/local/include/readline/readline.h:31:
/usr/local/include/readline/rltypedefs.h:35:22: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef int Function () __attribute__ ((deprecated));
                     ^
                      void
/usr/local/include/readline/rltypedefs.h:36:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef void VFunction () __attribute__ ((deprecated));
                       ^
                        void
/usr/local/include/readline/rltypedefs.h:37:26: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef char *CPFunction () __attribute__ ((deprecated));
                         ^
                          void
/usr/local/include/readline/rltypedefs.h:38:28: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef char **CPPFunction () __attribute__ ((deprecated));
                           ^
                            void
In file included from virsh.c:45:
/usr/local/include/readline/readline.h:385:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
extern int rl_message ();
                      ^
                       void
5 errors generated.
gmake[3]: *** [Makefile:2823: virsh-virsh.o] Error 1

Fix that by adding -D_FUNCTION_DEF to READLINE_CFLAGS to fix *Function
related warnings and add a check for stdarg.h so we have HAVE_STDARG_H
defined that's needed by the readline headers to use proper rl_message
declaration.

Bug report on the readline mailing list:

 http://lists.gnu.org/archive/html/bug-readline/2017-05/msg00004.html

7 years agoqemuDomainChangeNet: Forbid changing MTU
Michal Privoznik [Thu, 8 Jun 2017 11:45:31 +0000 (13:45 +0200)]
qemuDomainChangeNet: Forbid changing MTU

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

Currently, any attempt to change MTU on an interface that is
plugged to a running domain is silently ignored. We should either
do what's asked or error out. Well, we can update the host side
of the interface, but we cannot change 'host_mtu' attribute for
the virtio-net device. Therefore we have to error out.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Set iface MTU on hotplug
Michal Privoznik [Thu, 8 Jun 2017 08:14:36 +0000 (10:14 +0200)]
qemu: Set iface MTU on hotplug

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

While implementing MTU (572eda12ad and friends), I've forgotten
to actually set MTU on the host NIC in case of hotplug. We
correctly tell qemu on the monitor what the MTU should be, but we
are not actually setting it on the host NIC.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: format virtio-related options on the command line
Ján Tomko [Wed, 24 May 2017 15:09:12 +0000 (17:09 +0200)]
qemu: format virtio-related options on the command line

Format iommu_platform= and ats= for virtio devices.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemuxml2argvtest: add virtio-options test case
Ján Tomko [Wed, 24 May 2017 15:09:46 +0000 (17:09 +0200)]
qemuxml2argvtest: add virtio-options test case

Add a test case to demonstrate the addition of new command line options

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to input devices
Ján Tomko [Mon, 8 Aug 2016 13:42:18 +0000 (15:42 +0200)]
Add virtio-related options to input devices

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to video
Ján Tomko [Mon, 6 Jun 2016 14:51:31 +0000 (16:51 +0200)]
Add virtio-related options to video

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to rng devices
Ján Tomko [Mon, 6 Jun 2016 15:01:56 +0000 (17:01 +0200)]
Add virtio-related options to rng devices

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to filesystems
Ján Tomko [Mon, 6 Jun 2016 14:50:57 +0000 (16:50 +0200)]
Add virtio-related options to filesystems

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to controllers
Ján Tomko [Mon, 6 Jun 2016 14:50:22 +0000 (16:50 +0200)]
Add virtio-related options to controllers

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to disks
Ján Tomko [Mon, 6 Jun 2016 14:49:17 +0000 (16:49 +0200)]
Add virtio-related options to disks

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoadd virtio-related options to memballoon
Ján Tomko [Wed, 24 May 2017 14:47:28 +0000 (16:47 +0200)]
add virtio-related options to memballoon

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAdd virtio-related options to interfaces
Ján Tomko [Wed, 24 May 2017 14:44:44 +0000 (16:44 +0200)]
Add virtio-related options to interfaces

<interface type='user'>
  <mac address='52:54:56:5a:5c:5e'/>
  <model type='virtio'/>
  <driver iommu='on' ats='on'/>
</interface>

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: use a leading space in virDomainVirtioNetDriverFormat
Ján Tomko [Wed, 7 Jun 2017 18:50:39 +0000 (20:50 +0200)]
conf: use a leading space in virDomainVirtioNetDriverFormat

Instead of formatting a space after every option.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemuxml2xmltest: add virtio-options test
Ján Tomko [Wed, 24 May 2017 14:47:21 +0000 (16:47 +0200)]
qemuxml2xmltest: add virtio-options test

Add a test case with all the virtio devices we know to demonstrate
the addition of new options.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: format device-iotlb on intel-iommu command line
Ján Tomko [Wed, 3 May 2017 15:18:47 +0000 (17:18 +0200)]
qemu: format device-iotlb on intel-iommu command line

Format the device-iotlb attribute.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: add iotlb attribute to iommu
Ján Tomko [Wed, 3 May 2017 15:07:55 +0000 (17:07 +0200)]
conf: add iotlb attribute to iommu

Add a new iotlb attribute to the iommu device
to control the device IOTLB support for intel-iommu.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agovirNetDevOpenvswitchGetVhostuserIfname: Fix off by one error
Michal Privoznik [Thu, 8 Jun 2017 12:58:22 +0000 (14:58 +0200)]
virNetDevOpenvswitchGetVhostuserIfname: Fix off by one error

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

We try to get the last element of the passed path by calling
strrch(path, '/'). However, the pointer that strrchr() returns
points at the slash, We want string that starts right after that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Query for vhostuser iface names at runtime
Michal Privoznik [Wed, 7 Jun 2017 13:43:58 +0000 (15:43 +0200)]
qemu: Query for vhostuser iface names at runtime

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

Currently, we are querying for vhostuser interface name in post
parse callback. At that time interface might not yet exist.
However, it has to exist when starting domain. Therefore it makes
more sense to query its name at that point. This partially
reverts 57b5e27.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirDomainControllerDefFormat: do not mix attributes and subelements
Ján Tomko [Tue, 6 Jun 2017 11:12:05 +0000 (13:12 +0200)]
virDomainControllerDefFormat: do not mix attributes and subelements

Move out the PCI controller's subelements formatting out of the switch
handling attributes. This removes the need for a few bool variables.

7 years agoconf: eliminate monster condition in virDomainControllerDefFormat
Ján Tomko [Fri, 26 May 2017 16:13:59 +0000 (18:13 +0200)]
conf: eliminate monster condition in virDomainControllerDefFormat

Move most of the subelement formatting out of the giant if.

7 years agovirNetClientStreamQueuePacket: Set st->incomingEOF on the end of stream
Michal Privoznik [Tue, 6 Jun 2017 12:45:55 +0000 (14:45 +0200)]
virNetClientStreamQueuePacket: Set st->incomingEOF on the end of stream

While reworking client side of streams, I had to postpone payload
decoding so that stream holes and stream data can be
distinguished in virNetClientStreamRecvPacket. That's merely what
18944b7aea46d does. However, I accidentally removed one important
bit: when server sends us an empty STREAM packet (with no
payload) - meaning end of stream - st->incomingEOF flag needs to
be set. It used to be before I touched the code. After I removed
it, virNetClientStreamRecvPacket will try to fetch more data from
the stream, but it will never come.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
7 years agovirDomainNetDefParseXML: Fix typo
Michal Privoznik [Wed, 7 Jun 2017 15:52:40 +0000 (17:52 +0200)]
virDomainNetDefParseXML: Fix typo

In 9cb891141c we've introduced some logic to clearing suggested
macvtap/macvlan ifnames. The logic consists of comparing ifname
string with strings that libvirt would generate. However, due to
a typo only VIR_NET_GENERATED_MACVTAP_PREFIX was compared. Twice.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agodocs: correct improper information about domain states in virsh manpage
Laine Stump [Tue, 6 Jun 2017 16:07:49 +0000 (12:07 -0400)]
docs: correct improper information about domain states in virsh manpage

Commit 24d4a0a1f removed the non-existent "dying" state from the list
of possible domain states given in the virsh manpage, but didn't
correct the count of states from 8 down to 7. This patch fixes that
mismatch by completely removing any reference to the exact number of
states (thus preventing a potential future mismatch), while wording
the sentence in a more readable/truthful manner.

7 years agoqemu: Fix serial stub console allocation
Erik Skultety [Mon, 29 May 2017 10:58:34 +0000 (12:58 +0200)]
qemu: Fix serial stub console allocation

When adding the aliased serial stub console, the structure wasn't
properly allocated (VIR_ALLOC instead of virDomainChrDefNew) which then
resulted in SIGSEGV in virDomainChrSourceIsEqual during a serial device
coldplug.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agoqemu: Use updated CPU when starting QEMU if possible
Jiri Denemark [Wed, 31 May 2017 10:34:10 +0000 (12:34 +0200)]
qemu: Use updated CPU when starting QEMU if possible

If QEMU is new enough and we have the live updated CPU definition in
either save or migration cookie, we can use it to enforce ABI. The
original guest CPU from domain XML will be stored in private data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Store updated CPU in save cookie
Jiri Denemark [Fri, 2 Jun 2017 20:52:03 +0000 (22:52 +0200)]
qemu: Store updated CPU in save cookie

Since the domain XML saved in a snapshot or saved image uses the
original guest CPU definition but we still want to enforce ABI when
restoring the domain if libvirt and QEMU are new enough, we save the
live updated CPU definition in a save cookie.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Send updated CPU in migration cookie
Jiri Denemark [Fri, 26 May 2017 15:06:56 +0000 (17:06 +0200)]
qemu: Send updated CPU in migration cookie

Since the domain XML send during migration uses the original guest CPU
definition but we still want the destination to enforce ABI if it is new
enough, we send the live updated CPU definition in a migration cookie.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Always send persistent XML during migration
Jiri Denemark [Wed, 7 Jun 2017 07:35:25 +0000 (09:35 +0200)]
qemu: Always send persistent XML during migration

When persistent migration of a transient domain is requested but no
custom XML is passed to the migration API we would just let the
destination daemon make a persistent definition from the live definition
itself. This is not a problem now, but once the destination daemon
starts replacing the original CPU definition with the one from migration
cookie before starting a domain, it would need to add more ugly hacks to
reverse the operation. Let's just always send the persistent definition
in the cookie to make things a bit cleaner.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Report the original CPU in migratable xml
Jiri Denemark [Fri, 19 May 2017 13:20:31 +0000 (15:20 +0200)]
qemu: Report the original CPU in migratable xml

The destination host may not be able to start a domain using the live
updated CPU definition because either libvirt or QEMU may not be new
enough. Thus we need to send the original guest CPU definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Remember CPU def from domain start
Jiri Denemark [Tue, 16 May 2017 11:26:54 +0000 (13:26 +0200)]
qemu: Remember CPU def from domain start

When starting a domain we update the guest CPU definition to match what
QEMU actually provided (since it is allowed to add or removed some
features unless check='full' is specified). Let's store the original CPU
in domain private data so that we can use it to provide a backward
compatible domain XML.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Store save cookie in save images and snapshots
Jiri Denemark [Thu, 25 May 2017 08:20:57 +0000 (10:20 +0200)]
qemu: Store save cookie in save images and snapshots

The following patches will add an actual content in the cookie and use
the data when restoring a domain.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Implement virSaveCookie object and callbacks
Jiri Denemark [Fri, 2 Jun 2017 20:50:18 +0000 (22:50 +0200)]
qemu: Implement virSaveCookie object and callbacks

This patch implements a new save cookie object and callbacks for qemu
driver. The actual useful content will be added in the object later.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Add save cookie callbacks to xmlopt
Jiri Denemark [Thu, 1 Jun 2017 22:44:46 +0000 (00:44 +0200)]
conf: Add save cookie callbacks to xmlopt

virDomainXMLOption gains driver specific callbacks for parsing and
formatting save cookies.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Introduce virSaveCookie
Jiri Denemark [Thu, 1 Jun 2017 22:44:06 +0000 (00:44 +0200)]
conf: Introduce virSaveCookie

The code will be used by snapshots and domain save/restore code to store
additional data for a saved running domain. It is analogous to migration
cookies, but simple and one way only.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Introduce virQEMUSaveData structure
Jiri Denemark [Tue, 6 Jun 2017 22:08:25 +0000 (00:08 +0200)]
qemu: Introduce virQEMUSaveData structure

The new structure encapsulates save image header and associated data
(domain XML).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Refactor qemuDomainSaveHeader
Jiri Denemark [Tue, 6 Jun 2017 21:41:57 +0000 (23:41 +0200)]
qemu: Refactor qemuDomainSaveHeader

The function is now called virQEMUSaveDataWrite and it is now doing
everything it needs to save both the save image header and domain XML to
a file. Be it a new file or an existing file in which a user wants to
change the domain XML.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Introduce virQEMUSaveDataFinish
Jiri Denemark [Tue, 6 Jun 2017 20:49:11 +0000 (22:49 +0200)]
qemu: Introduce virQEMUSaveDataFinish

The function is supposed to update the save image header after a
successful migration to the save image file.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Introduce virQEMUSaveData{New,Free}
Jiri Denemark [Tue, 6 Jun 2017 20:29:24 +0000 (22:29 +0200)]
qemu: Introduce virQEMUSaveData{New,Free}

This is a preparation for creating a new virQEMUSaveData structure which
will encapsulate all save image header data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Fix memory leaks in qemuDomainSaveImageOpen
Jiri Denemark [Tue, 6 Jun 2017 20:27:57 +0000 (22:27 +0200)]
qemu: Fix memory leaks in qemuDomainSaveImageOpen

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Rename xml_len in virQEMUSaveHeader as data_len
Jiri Denemark [Tue, 23 May 2017 18:32:07 +0000 (20:32 +0200)]
qemu: Rename xml_len in virQEMUSaveHeader as data_len

Since virQEMUSaveHeader will be followed by more than just domain XML,
the old name would be confusing as it was designed to describe the
length of all data following the save image header.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Pass xmlopt to virDomainSnapshotDefFormat
Jiri Denemark [Thu, 1 Jun 2017 22:27:33 +0000 (00:27 +0200)]
conf: Pass xmlopt to virDomainSnapshotDefFormat

This will be used later when a save cookie will become part of the
snapshot XML using new driver specific parser/formatter functions.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Make virDomainSnapshotDefFormat easier to read
Jiri Denemark [Thu, 1 Jun 2017 13:57:55 +0000 (15:57 +0200)]
conf: Make virDomainSnapshotDefFormat easier to read

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Refactor virCPUDefParseXML
Jiri Denemark [Tue, 23 May 2017 07:29:36 +0000 (09:29 +0200)]
conf: Refactor virCPUDefParseXML

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Make error reporting in virCPUDefIsEqual optional
Jiri Denemark [Wed, 31 May 2017 14:42:42 +0000 (16:42 +0200)]
conf: Make error reporting in virCPUDefIsEqual optional

The function will be used in paths where mismatching CPU defs are not an
error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agovirsh: Add support for VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB
Peter Krempa [Tue, 6 Jun 2017 13:32:49 +0000 (15:32 +0200)]
virsh: Add support for VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB

Allow using the new flag with virsh.

7 years agoqemu: Conditionally allow block-copy for persistent domains
Peter Krempa [Tue, 6 Jun 2017 13:13:51 +0000 (15:13 +0200)]
qemu: Conditionally allow block-copy for persistent domains

Allow starting the block-copy job for a persistent domain if a user
declares by using a flag that the job will not be recovered if the VM is
switched off while the job is active.

This allows to use the block-copy job with persistent VMs under the same
conditions as would apply to transient domains.

7 years agoqemu: Set operation on completed migration job
Jiri Denemark [Wed, 31 May 2017 08:08:28 +0000 (10:08 +0200)]
qemu: Set operation on completed migration job

Without this patch libvirt would just report the operation of a
completed job as "unknown" instead of "incoming migration".

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agointerface: Convert virInterfaceObj to use virObjectLockable
John Ferlan [Mon, 15 May 2017 18:31:44 +0000 (14:31 -0400)]
interface: Convert virInterfaceObj to use virObjectLockable

Now that we have a bit more control, let's convert our object into
a lockable object and let that magic handle the create and lock/unlock.

This commit also introduces virInterfaceObjEndAPI in order to handle the
lock unlock and object unref in one call for consumers returning a NULL
obj upon return. This removes the need for virInterfaceObj{Lock|Unlock}
external API's.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agointerface: Consume @def in virInterfaceObjNew
John Ferlan [Fri, 2 Jun 2017 11:56:59 +0000 (07:56 -0400)]
interface: Consume @def in virInterfaceObjNew

Move the consumption of @def in virInterfaceObjNew and then handle that
in the error path of virInterfaceObjListAssignDef since it's caller expects
to need to free @def when NULL is returned and so would virInterfaceObjFree.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agointerface: Introduce virInterfaceObjNew
John Ferlan [Thu, 20 Apr 2017 14:40:22 +0000 (10:40 -0400)]
interface: Introduce virInterfaceObjNew

Create/use a helper to perform the object allocation

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: process: Save vcpu ordering information on reconnect
Peter Krempa [Tue, 6 Jun 2017 05:39:25 +0000 (07:39 +0200)]
qemu: process: Save vcpu ordering information on reconnect

vCPU ordering information would not be updated if a vCPU emerged or
disappeared during the time libvirtd is not running. This allowed to
create invalid configuration like:

    [...]
    <vcpu id='56' enabled='yes' hotpluggable='yes' order='57'/>
    <vcpu id='57' enabled='yes' hotpluggable='yes' order='58'/>
    <vcpu id='58' enabled='yes' hotpluggable='yes'/>

Call the function that records the information on reconnect.

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

7 years agovirFDStreamThread: Make sure we won't exceed @length
Michal Privoznik [Mon, 5 Jun 2017 11:22:23 +0000 (13:22 +0200)]
virFDStreamThread: Make sure we won't exceed @length

There's a problem with current streams after I switched them from
iohelper to thread implementation. Previously, iohelper made sure
not to exceed specified @length resulting in the pipe EOF
appearing at the exact right moment (the pipe was used to tunnel
the data from the iohelper to the daemon). Anyway, when switching
to thread I had to write the I/O code from scratch. Whilst doing
that I took an inspiration from the iohelper code, but since the
usage of pipe switched to slightly different meaning, there was
no 1:1 relationship between the codes.

Moreover, after introducing VIR_FDSTREAM_MSG_TYPE_HOLE, the
condition that should made sure we won't exceed @length was
completely wrong.

The fix is to:

a) account for holes for @length
b) cap not just data sections but holes too (if @length would be
exceeded)

For this purpose, the condition needs to be brought closer to the
code that handles holes and data sections.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoconf: only format <controller> as a pair tag when needed
Ján Tomko [Fri, 26 May 2017 16:10:11 +0000 (18:10 +0200)]
conf: only format <controller> as a pair tag when needed

Make the decision based on the usage of childBuf buffer.

This fixes the oddity in the test case introduced by commit c1c4d0d
where we would format an empty pair tag.

7 years agoconf: use a separate buffer for the subelements of <controller>
Ján Tomko [Fri, 26 May 2017 15:53:54 +0000 (17:53 +0200)]
conf: use a separate buffer for the subelements of <controller>

We need to decide whether to format <controller> as a single tag
or if it has any subelements.

Rewrite the function to use a separate buffer for subelements,
to make adding new options easier.

7 years agoconf: introduce virDomainControllerDriverFormat
Ján Tomko [Fri, 26 May 2017 15:47:50 +0000 (17:47 +0200)]
conf: introduce virDomainControllerDriverFormat

Split out formatting the <driver> subelement of <controller>
to make adding new options easier.

7 years agoaudit: Fix the output message for shmem
Martin Kletzander [Thu, 11 May 2017 08:10:54 +0000 (10:10 +0200)]
audit: Fix the output message for shmem

After some discussion on and off the linux-audit mailing list, we
should use different fields for the audit messages.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoremote: Consolidate remoteStream{Abort,Finish} functions
Martin Kletzander [Wed, 31 May 2017 14:58:49 +0000 (16:58 +0200)]
remote: Consolidate remoteStream{Abort,Finish} functions

They do the same thing with only one difference.  Let's put them
together (like we already do with virFDStreamCloseInt) so that future
changes don't miss one of the implementations.  Also to clean up the
code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agobhyveargv2xmltest: Fix call of virDomainDefCheckABIStability
Michal Privoznik [Mon, 5 Jun 2017 09:46:02 +0000 (11:46 +0200)]
bhyveargv2xmltest: Fix call of virDomainDefCheckABIStability

In 4f0aeed I've expanded the list of arguments for
virDomainDefCheckABIStability() but I forgot to fix
bhyveargv2xmltest.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoReset the whole stack in testutils
Martin Kletzander [Mon, 5 Jun 2017 07:38:31 +0000 (09:38 +0200)]
Reset the whole stack in testutils

The memset() was resetting only 30 bytes in the array (size of the
array), but it is array of pointers.  Since it is a static array,
let's just reset it by its size.

Found by gcc-7.1:

  testutils.c: In function 'virTestRun':
  testutils.c:243:13: error: 'memset' used with length equal to number
  of elements without multiplication by element size [-Werror=memset-elt-size]
    memset(testAllocStack, 0, ARRAY_CARDINALITY(testAllocStack));
    ^~~~~~

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>