]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agotests: command: Fix build on ppc64/aarch64
Andrea Bolognani [Wed, 13 Jul 2016 16:53:22 +0000 (18:53 +0200)]
tests: command: Fix build on ppc64/aarch64

Commit ca10bb040fcf introduced a new test that fails to build
on at least some architectures:

  commandtest.c: In function 'test25':
  commandtest.c:1121:5: error: comparison is always true due to
                        limited range of data type [-Werror=type-limits]
    if (rv >= 0) {
    ^

Change the type of 'rv' from char to int, which is the proper
return type for virCommandExec() anyway.

8 years agospec: Fix indentation
Andrea Bolognani [Wed, 13 Jul 2016 17:01:14 +0000 (19:01 +0200)]
spec: Fix indentation

Commit ffc49e579c14 broke syntax-check:

  cppi: libvirt.spec.in: line 622: not properly indented
  cppi: libvirt.spec.in: line 624: not properly indented
  cppi: libvirt.spec.in: line 640: not properly indented
  cppi: libvirt.spec.in: line 642: not properly indented
  maint.mk: incorrect preprocessor indentation
  cfg.mk:697: recipe for target 'sc_spec_indentation' failed

Indent the new conditionals properly.

8 years agoconf: Make really sure we don't access non-existing vCPUs again
Martin Kletzander [Tue, 12 Jul 2016 11:44:10 +0000 (13:44 +0200)]
conf: Make really sure we don't access non-existing vCPUs again

MinGW complained that we might be dereferencing a NULL pointer.  While
that can't be true, the logic certainly allows for that.

../../src/conf/domain_conf.c: In function 'virDomainDefPostParse':
../../src/conf/domain_conf.c:4224:18: error: potential null pointer dereference [-Werror=null-dereference]
         if (!vcpu->online && vcpu->cpumask) {
              ~~~~^~~~~~~~

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibvirt.spec.in: require systemd-container on >= f24
Daniel P. Berrange [Tue, 12 Jul 2016 14:57:39 +0000 (15:57 +0100)]
libvirt.spec.in: require systemd-container on >= f24

The systemd-machined tools libvirt uses were split into a
systemd-container RPM. Without depending on this, libvirt
may silently fallback to the non-systemd cgroup impl which
is not desirable.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: command: Fix awkward formatting
Andrea Bolognani [Wed, 13 Jul 2016 15:50:44 +0000 (17:50 +0200)]
qemu: command: Fix awkward formatting

8 years agoconf: Make really sure we don't access non-existing vCPUs
Martin Kletzander [Tue, 12 Jul 2016 11:44:10 +0000 (13:44 +0200)]
conf: Make really sure we don't access non-existing vCPUs

MinGW complained that we might be dereferencing a NULL pointer.  While
that can't be true, the logic certainly allows for that.

src/conf/domain_conf.c: In function 'virDomainDefGetVcpuPinInfoHelper':
src/conf/domain_conf.c:1545:17: error: potential null pointer dereference [-Werror=null-dereference]
         if (vcpu->cpumask)
              ~~~~^~~~~~~~~

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agodnsmasq: disable IPv6 default gateway in RA for isolated networks
Maxim Perevedentsev [Fri, 1 Jul 2016 11:50:18 +0000 (14:50 +0300)]
dnsmasq: disable IPv6 default gateway in RA for isolated networks

IPv6 RA always contains an implicit default route via
the link-local address of the source of RA. This forces
the guest to install a route via isolated network, which
may disturb the guest's networking in case of multiple interfaces.
More info in 013427e6e733f7a662f4e8a9c11f7dad4cd65e3f.

The validity of this route is controlled by "default [route] lifetime"
field of RA. If the lifetime is set to 0 seconds, then no route
is installed by receiver.

dnsmasq 2.67+ supports "ra-param=<interface>,<RA interval>,<default
lifetime>" option. We pass "ra-param=*,0,0"
(here, RA_interval=0 means default) to disable default gateway in RA
for isolated networks.

8 years agoFix message about dnsmasq BINDTODEVICE capability.
Maxim Perevedentsev [Fri, 1 Jul 2016 11:50:17 +0000 (14:50 +0300)]
Fix message about dnsmasq BINDTODEVICE capability.

8 years agoqemu: getAutoDumpPath() return value should be dumpfile not domname.
Yan Fu [Wed, 13 Jul 2016 04:39:29 +0000 (12:39 +0800)]
qemu: getAutoDumpPath() return value should be dumpfile not domname.

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

So we spend some time and effort constructing perfect file name
for an automatic coredump of a domain, but then just leak it and
use the domain name anyway. This is probably due to a silly
mistake that slipped even through review.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agosystemd: fix ready notification on abstract socket
Jim Fehlig [Mon, 11 Jul 2016 23:26:48 +0000 (17:26 -0600)]
systemd: fix ready notification on abstract socket

At least with systemd v210, NOTIFY_SOCKET is abstact, e.g.
@/org/freedesktop/systemd1/notify. sendmsg() fails on such a socket
with "Connection refused". The unix(7) man page contains the following
details wrt abstract socket addresses

abstract: an abstract socket address is distinguished (from a
          pathname socket) by the fact that sun_path[0] is a null byte
          ('\0').  The socket's address in this namespace is given by the
          additional bytes in sun_path that are covered by the specified
          length of the address structure.  (Null bytes in the name have
          no special significance.)

So we need to be more precise about the address length, setting it to
the sizeof sa_family_t + length of address copied to sun_path instead
of setting it to the sizeof the entire sockaddr_un struct.

Resolves: https://bugzilla.opensuse.org/show_bug.cgi?id=987668
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
8 years agoesx: Fetch snapshot info directly for filtering
Tomáš Golembiovský [Tue, 12 Jul 2016 03:20:03 +0000 (05:20 +0200)]
esx: Fetch snapshot info directly for filtering

When fetching domains with virConnectListAllDomains() and when filtering
by snapshot existence is requested the ESX driver first lists all the
domains and then check one-by-one for snapshot existence. This process
takes unnecessarily long time.

To significantly improve the time necessary to finish the query we can
request the snapshot related info directly when querying the list of
domains from VMware.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
8 years agobuild: drop hack for old mingw ssize_t
Eric Blake [Tue, 12 Jul 2016 03:39:50 +0000 (21:39 -0600)]
build: drop hack for old mingw ssize_t

The old 32-bit-only mingw project had a mismatch in its <sys/types.h>
that omitted ssize_t, but where size_t was a different rank than
int as picked by gnulib.  But now that mingw64 (both 32- and 64-bit)
is the more popular platform (Fedora has dropped mingw in favor of
mingw64), we no longer need to carry a hack to gnulib to cater to
the old mingw.  This reverts part of commit 1012dc29333.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agobuild: virrandommock.c not needed on mingw
Eric Blake [Mon, 11 Jul 2016 22:43:57 +0000 (16:43 -0600)]
build: virrandommock.c not needed on mingw

We can't mock tests on Mingw, which lacks dlopen() and friends;
follow the paradigms used in other mock files of conditionally
compiling nothing when not building for Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agovirCommandExec: Report error if execve fails
Michal Privoznik [Mon, 11 Jul 2016 14:03:34 +0000 (16:03 +0200)]
virCommandExec: Report error if execve fails

In an unlikely event of execve() failing, the virCommandExec()
function does not report any error, even though checks that are
at the beginning of the function are verbose when failing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agostorage: dir: adapts .wipeVol for ploop volumes
Olga Krishtal [Mon, 27 Jun 2016 15:03:38 +0000 (18:03 +0300)]
storage: dir: adapts .wipeVol for ploop volumes

The modification of .volWipe callback wipes ploop volume using one of
given wiping algorithm: dod, nnsa, etc.
However, in case of ploop volume we need to reinitialize root.hds and DiskDescriptor.xml.

v2:
- added check on ploop tools presens
- virCommandAddArgFormat changed to virCommandAddArg

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agoqemu: format intel-iommu on the command line
Ján Tomko [Wed, 22 Jun 2016 15:27:57 +0000 (17:27 +0200)]
qemu: format intel-iommu on the command line

<devices>
  <iommu model='intel'/>
</devices>

results in:

-device intel-iommu

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

8 years agoAdd QEMU_CAPS_DEVICE_INTEL_IOMMU
Ján Tomko [Wed, 22 Jun 2016 15:24:24 +0000 (17:24 +0200)]
Add QEMU_CAPS_DEVICE_INTEL_IOMMU

Check whether QEMU supports -device intel-iommu

Note that the presence of this option does not mean that it's
usable because of a bug in earlier QEMU versions, but it's
better than nothing.

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

8 years agoIntroduce <iommu> device
Ján Tomko [Wed, 22 Jun 2016 14:28:22 +0000 (16:28 +0200)]
Introduce <iommu> device

A device with an attribute 'model', with just one model
so far:

<devices>
  ...
  <iommu model='intel'/>
</devices>

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

8 years agotest-wrap-argv: set cutoff at 78 characters
Ján Tomko [Mon, 11 Jul 2016 14:27:53 +0000 (16:27 +0200)]
test-wrap-argv: set cutoff at 78 characters

For every but the last argument, we also need space for a space
and a backslash.

Rewrap everything longer than 78 characters.

8 years agotest-wrap-argv: print diff instead of the incorrectly wrapped file
Ján Tomko [Mon, 11 Jul 2016 14:15:02 +0000 (16:15 +0200)]
test-wrap-argv: print diff instead of the incorrectly wrapped file

Commit c9c03ea stopped creating an intermediate file during syntax-check
to save on execution time. It also switched to outputting the whole
incorrectly wrapped file instead of a diff needed to fix it.

Feed the newly wrapped file to diff via a pipe.

Note that fixing it by running test-wrap-argv.pl --in-place or
the unit test with VIR_TEST_REGENERATE_OUTPUT is easier.

8 years agotestutils: only rewrap args files
Ján Tomko [Mon, 11 Jul 2016 13:30:35 +0000 (15:30 +0200)]
testutils: only rewrap args files

test-wrap-argv.pl does not know how to rewrap other files.

8 years agotestutils: find perl early
Ján Tomko [Mon, 11 Jul 2016 12:45:49 +0000 (14:45 +0200)]
testutils: find perl early

Commit 843a70a changed test-wrap-argv.pl to use
/usr/bin/env perl
instead of
/usr/bin/perl

However when called from qemuxml2argvtest with
VIR_TEST_REGENERATE_OUTPUT, PATH is set to '/bin'.

Find the path to perl early in virTestMain, in case we
are going to need it later after we've overridden PATH.

8 years agoqemuxml2argvtest: drop empty pseries-vio-address-clash.args
Ján Tomko [Mon, 11 Jul 2016 14:31:53 +0000 (16:31 +0200)]
qemuxml2argvtest: drop empty pseries-vio-address-clash.args

Unused since its introduction in commit 4b942fe.

8 years agotests: add missing directories in EXTRA_DIST
Luyao Huang [Tue, 12 Jul 2016 08:28:22 +0000 (16:28 +0800)]
tests: add missing directories in EXTRA_DIST

In commit ec5dcf2a and b0b4a35c we have moved qemuhotplugtest's XMLs to
new directories but forgot to fix the Makefile. Add 2 directories in
EXTRA_DIST to fix broken VPATH build. Also remove now unused
qemuhotplugtestdata directory from the Makefile as well as from the
tree.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoremote: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:53:55 +0000 (13:53 +0100)]
remote: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agosanlock: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:53:42 +0000 (13:53 +0100)]
sanlock: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolockd: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:53:28 +0000 (13:53 +0100)]
lockd: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoselinux: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:53:00 +0000 (13:53 +0100)]
selinux: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirt-login-shell: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:52:42 +0000 (13:52 +0100)]
virt-login-shell: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agouri: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:52:26 +0000 (13:52 +0100)]
uri: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibxl: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:52:04 +0000 (13:52 +0100)]
libxl: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolxc: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:51:49 +0000 (13:51 +0100)]
lxc: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirtlogd: convert to typedef virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 12:51:22 +0000 (13:51 +0100)]
virtlogd: convert to typedef virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirtlockd: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 10:45:37 +0000 (11:45 +0100)]
virtlockd: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibvirt: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 10:38:17 +0000 (11:38 +0100)]
libvirt: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 10:37:54 +0000 (11:37 +0100)]
qemu: convert to typesafe virConf accessors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibvirtd: convert to typesafe virConf accessors
Daniel P. Berrange [Fri, 8 Jul 2016 10:37:40 +0000 (11:37 +0100)]
libvirtd: convert to typesafe virConf accessors

The libvirtdconftest was previously used to test data type
handling of the libvirtd config file. Now we're using the
typedef APIs, this test case has little value, and is pretty
hard to fixup with deal with the new APIs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirconf: add typed value accessor methods
Daniel P. Berrange [Thu, 7 Jul 2016 15:52:47 +0000 (16:52 +0100)]
virconf: add typed value accessor methods

Currently many users of virConf APIs are defining the same
macros for calling virConfValue() and then doing type
checking. To remove this repeated code, add a set of
typesafe accessor methods.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirconf: fix off-by-1 when appending \n to config file
Daniel P. Berrange [Fri, 8 Jul 2016 13:47:20 +0000 (14:47 +0100)]
virconf: fix off-by-1 when appending \n to config file

If the config file does not end with a \n, the parser will append
one. When re-allocating the array though, it is mistakenly assuming
that 'len' is the length including the trailing NUL, but it does
not. So we must add 2 to len, when reallocating, not 1.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agotests: remove pointless virconftest.sh wrapper
Daniel P. Berrange [Thu, 7 Jul 2016 14:39:00 +0000 (15:39 +0100)]
tests: remove pointless virconftest.sh wrapper

The virconftest is different from all our other tests in that
the C program only tests a single in/out config file pair. It
relies on a shell wrapper to invoke it once for each test
file.

This gets rid of the shell wrapper and makes the C program
actually run over each test file using the normal test pattern.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemuhotplugtest: Move domain and device XMLs to different directories
Tomasz Flendrich [Thu, 7 Jul 2016 22:53:19 +0000 (00:53 +0200)]
qemuhotplugtest: Move domain and device XMLs to different directories

This way we can safely differentiate what XMLs contain whole domain
definitions and which contain just devices.  Thanks to that we can
test the domain XMLs in virschematest again.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemuhotplugtest: Move all XMLs to one directory
Tomasz Flendrich [Thu, 7 Jul 2016 22:52:41 +0000 (00:52 +0200)]
qemuhotplugtest: Move all XMLs to one directory

This makes the search for related XMLs easier, plus they are not used in
the xml2argv tests anyway.  This also makes future patches cleaner.
While on that remove unnecessary '-hotplug' from the filenames.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemuxml2argvmock: Don't leak @netdef->ifname
Michal Privoznik [Sat, 9 Jul 2016 06:57:46 +0000 (08:57 +0200)]
qemuxml2argvmock: Don't leak @netdef->ifname

In the mock, we have a stub for virNetDevTapCreate(). However,
the mocked version does not exactly as it's native counterpart.
The function receives a string, which is an interface name that
caller would like to have, but it's not guaranteed that they will
get just that one. If they don't, the function free()-s the one
passed and returns the new one. Just like the mocked version. But
what is the mocked version missing is the free().

==1068== 6 bytes in 1 blocks are definitely lost in loss record 9 of 132
==1068==    at 0x4C29F80: malloc (vg_replace_malloc.c:296)
==1068==    by 0xDE13356: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==1068==    by 0xAE2333E: virXMLPropString (virxml.c:479)
==1068==    by 0xAE45975: virDomainNetDefParseXML (domain_conf.c:9038)
==1068==    by 0xAE5C0BB: virDomainDefParseXML (domain_conf.c:16734)
==1068==    by 0xAE5EB96: virDomainDefParseNode (domain_conf.c:17444)
==1068==    by 0xAE5EA05: virDomainDefParse (domain_conf.c:17391)
==1068==    by 0xAE5EA93: virDomainDefParseFile (domain_conf.c:17415)
==1068==    by 0x433430: testCompareXMLToArgvFiles (qemuxml2argvtest.c:278)
==1068==    by 0x433A18: testCompareXMLToArgvHelper (qemuxml2argvtest.c:414)
==1068==    by 0x446ED4: virTestRun (testutils.c:179)
==1068==    by 0x43A099: mymain (qemuxml2argvtest.c:1016)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuxml2argvtest: Don't leak dummy monitor
Michal Privoznik [Fri, 8 Jul 2016 21:45:22 +0000 (23:45 +0200)]
qemuxml2argvtest: Don't leak dummy monitor

It's just test, but why leak it?

==26971== 20 bytes in 1 blocks are definitely lost in loss record 623 of 704
==26971==    at 0x4C29F80: malloc (vg_replace_malloc.c:296)
==26971==    by 0xE560447: vasprintf (vasprintf.c:76)
==26971==    by 0xAE0DEE2: virVasprintfInternal (virstring.c:480)
==26971==    by 0xAE0DFF7: virAsprintfInternal (virstring.c:501)
==26971==    by 0x4751F3: qemuProcessPrepareMonitorChr (qemu_process.c:2651)
==26971==    by 0x4334B1: testCompareXMLToArgvFiles (qemuxml2argvtest.c:297)
==26971==    by 0x4339AC: testCompareXMLToArgvHelper (qemuxml2argvtest.c:413)
==26971==    by 0x446E7A: virTestRun (testutils.c:179)
==26971==    by 0x445D33: mymain (qemuxml2argvtest.c:2029)
==26971==    by 0x44886F: virTestMain (testutils.c:969)
==26971==    by 0x445D9B: main (qemuxml2argvtest.c:2036)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainObjPrivateFree: Free @masterKey too
Michal Privoznik [Fri, 8 Jul 2016 21:37:24 +0000 (23:37 +0200)]
qemuDomainObjPrivateFree: Free @masterKey too

This one's a bit more complicated. In qemuProcessPrepareDomain()
a master key for encrypting secret for ciphered disks is created.
This object lives within qemuDomainObjPrivate object. It is freed
in qemuProcessStop(), but if nobody calls it (for instance like
our qemuxml2argvtest does), the key object leaks.

==17078== 32 bytes in 1 blocks are definitely lost in loss record 633 of 707
==17078==    at 0x4C2C070: calloc (vg_replace_malloc.c:623)
==17078==    by 0xAD924DF: virAllocN (viralloc.c:191)
==17078==    by 0x5050BA6: virCryptoGenerateRandom (qemuxml2argvmock.c:166)
==17078==    by 0x453DC8: qemuDomainMasterKeyCreate (qemu_domain.c:678)
==17078==    by 0x47A36B: qemuProcessPrepareDomain (qemu_process.c:4913)
==17078==    by 0x47C728: qemuProcessCreatePretendCmd (qemu_process.c:5542)
==17078==    by 0x433698: testCompareXMLToArgvFiles (qemuxml2argvtest.c:332)
==17078==    by 0x4339AC: testCompareXMLToArgvHelper (qemuxml2argvtest.c:413)
==17078==    by 0x446E7A: virTestRun (testutils.c:179)
==17078==    by 0x445BD9: mymain (qemuxml2argvtest.c:2022)
==17078==    by 0x44886F: virTestMain (testutils.c:969)
==17078==    by 0x445D9B: main (qemuxml2argvtest.c:2036)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuBuildCpuCommandLine: Don't leak @buf
Michal Privoznik [Fri, 8 Jul 2016 16:17:35 +0000 (18:17 +0200)]
qemuBuildCpuCommandLine: Don't leak @buf

Just like every other qemuBuild*CommandLine() function, this uses
a buffer to hold partial cmd line strings too. However, if
there's an error, the control jumps to 'cleanup' label leaving
the buffer behind and thus leaking it.

==2013== 1,006 bytes in 1 blocks are definitely lost in loss record 701 of 711
==2013==    at 0x4C29F80: malloc (vg_replace_malloc.c:296)
==2013==    by 0x4C2C32F: realloc (vg_replace_malloc.c:692)
==2013==    by 0xAD925A8: virReallocN (viralloc.c:245)
==2013==    by 0xAD95EA8: virBufferGrow (virbuffer.c:130)
==2013==    by 0xAD95F78: virBufferAdd (virbuffer.c:165)
==2013==    by 0x5097F5: qemuBuildCpuModelArgStr (qemu_command.c:6339)
==2013==    by 0x509CC3: qemuBuildCpuCommandLine (qemu_command.c:6437)
==2013==    by 0x51142C: qemuBuildCommandLine (qemu_command.c:9174)
==2013==    by 0x47CA3A: qemuProcessCreatePretendCmd (qemu_process.c:5546)
==2013==    by 0x433698: testCompareXMLToArgvFiles (qemuxml2argvtest.c:332)
==2013==    by 0x4339AC: testCompareXMLToArgvHelper (qemuxml2argvtest.c:413)
==2013==    by 0x446E7A: virTestRun (testutils.c:179)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirStorageEncryptionSecretFree: Don't leak secret lookup definition
Michal Privoznik [Fri, 8 Jul 2016 16:09:40 +0000 (18:09 +0200)]
virStorageEncryptionSecretFree: Don't leak secret lookup definition

When storage secret is parsed in virStorageEncryptionSecretParse(),
virSecretLookupParseSecret() which allocates some memory. This is
however never freed.

==21711== 134 bytes in 6 blocks are definitely lost in loss record 70 of 85
==21711==    at 0x4C29F80: malloc (vg_replace_malloc.c:296)
==21711==    by 0xBCA0356: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==21711==    by 0xA9F432E: virXMLPropString (virxml.c:479)
==21711==    by 0xA9D25B0: virSecretLookupParseSecret (virsecret.c:70)
==21711==    by 0xA9D616E: virStorageEncryptionSecretParse (virstorageencryption.c:172)
==21711==    by 0xA9D66B2: virStorageEncryptionParseXML (virstorageencryption.c:281)
==21711==    by 0xA9D68DF: virStorageEncryptionParseNode (virstorageencryption.c:338)
==21711==    by 0xAA12575: virDomainDiskDefParseXML (domain_conf.c:7606)
==21711==    by 0xAA2CAC6: virDomainDefParseXML (domain_conf.c:16658)
==21711==    by 0xAA2FC75: virDomainDefParseNode (domain_conf.c:17472)
==21711==    by 0xAA2FAE4: virDomainDefParse (domain_conf.c:17419)
==21711==    by 0xAA2FB72: virDomainDefParseFile (domain_conf.c:17443)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirsh: allow both --uuid and --name at same time
Chen Hanxiao [Sat, 9 Jul 2016 10:06:55 +0000 (18:06 +0800)]
virsh: allow both --uuid and --name at same time

#virsh list --uuid --name
49c765a0-25e7-40d0-964f-dac99724b32c   c7
918f1dd6-b19f-412b-ba17-d113bad89af8   f23

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agoqemu: Use qemuProcessSetupPid() in qemuProcessSetupVcpu()
Martin Kletzander [Mon, 4 Jul 2016 15:14:55 +0000 (17:14 +0200)]
qemu: Use qemuProcessSetupPid() in qemuProcessSetupVcpu()

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Use qemuProcessSetupPid() in qemuProcessSetupEmulator()
Martin Kletzander [Mon, 4 Jul 2016 15:14:43 +0000 (17:14 +0200)]
qemu: Use qemuProcessSetupPid() in qemuProcessSetupEmulator()

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Add qemuProcessSetupPid() and use it in qemuProcessSetupIOThread()
Martin Kletzander [Tue, 21 Jun 2016 15:33:06 +0000 (17:33 +0200)]
qemu: Add qemuProcessSetupPid() and use it in qemuProcessSetupIOThread()

Setting up cgroups and other things for all kinds of threads (the
emulator thread, vCPU threads, I/O threads) was copy-pasted every time
new thing was added.  Over time each one of those functions changed a
bit differently.  So create one function that does all that setup and
start using it, starting with I/O thread setup.  That will shave some
duplicated code and maybe fix some bugs as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoFix logic in qemuDomainObjPrivateXMLParseVcpu
Daniel P. Berrange [Mon, 11 Jul 2016 09:30:03 +0000 (10:30 +0100)]
Fix logic in qemuDomainObjPrivateXMLParseVcpu

The code in qemuDomainObjPrivateXMLParseVcpu for parsing
the 'idstr' string was comparing the overall boolean
result against 0 which was always true

qemu/qemu_domain.c: In function 'qemuDomainObjPrivateXMLParseVcpu':
qemu/qemu_domain.c:1482:59: error: comparison of constant '0' with boolean expression is always false [-Werror=bool-compare]
     if ((idstr && virStrToLong_uip(idstr, NULL, 10, &idx)) < 0 ||
                                                           ^

It was further performing two distinct error checks in
the same conditional and reporting a single error message,
which was misleading in one of the two cases.

This splits the conditional check into two parts with
distinct error messages and fixes the logic error.

Fixes the bug in

  commit 5184f398b40a5e0d7d84b86182edcb2b48ab04ba
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Fri Jul 1 14:56:14 2016 +0200

    qemu: Store vCPU thread ids in vcpu private data objects

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: capabilities: Make virHostCPUGetKVMMaxVCPUs() errors fatal
Andrea Bolognani [Mon, 27 Jun 2016 11:53:43 +0000 (13:53 +0200)]
qemu: capabilities: Make virHostCPUGetKVMMaxVCPUs() errors fatal

An error in virHostCPUGetKVMMaxVCPUs() means we've been unable
to access /dev/kvm, or we're running on a platform that doesn't
support KVM in the first place.

If that's the case, we shouldn't ignore the error and report
domcapabilities even though we know the user won't be able to
start any KVM guest.

8 years agoutil: hostcpu: Drop obsolete compatibility code
Andrea Bolognani [Fri, 24 Jun 2016 17:34:37 +0000 (19:34 +0200)]
util: hostcpu: Drop obsolete compatibility code

All Linux releases we support (RHEL6 era) include these
definitions.

8 years agoutil: hostcpu: Add virHostCPUGetKVMMaxVCPUs() stub
Andrea Bolognani [Mon, 27 Jun 2016 11:47:53 +0000 (13:47 +0200)]
util: hostcpu: Add virHostCPUGetKVMMaxVCPUs() stub

If we don't HAVE_LINUX_KVM_H, we can't query /dev/kvm to discover
the limits on the number of vCPUs, so we report an error and
return a negative value instead.

8 years agoqemu: Store vCPU thread ids in vcpu private data objects
Peter Krempa [Fri, 1 Jul 2016 12:56:14 +0000 (14:56 +0200)]
qemu: Store vCPU thread ids in vcpu private data objects

Rather than storing them in an external array store them directly.

8 years agoqemu: Add cpu ID to the vCPU pid list in the status XML
Peter Krempa [Thu, 30 Jun 2016 13:06:46 +0000 (15:06 +0200)]
qemu: Add cpu ID to the vCPU pid list in the status XML

Note the vcpu ID so that once we allow non-contiguous vCPU topologies it
will be possible to pair thread id's with the vcpus.

8 years agoqemu: domain: Extract formating and parsing of vCPU thread ids
Peter Krempa [Thu, 30 Jun 2016 08:35:12 +0000 (10:35 +0200)]
qemu: domain: Extract formating and parsing of vCPU thread ids

Further patches will be adding index and modifying the source variables
so this will make it more clear.

8 years agoqemu: domain: Add vcpu private data structure
Peter Krempa [Wed, 29 Jun 2016 13:40:09 +0000 (15:40 +0200)]
qemu: domain: Add vcpu private data structure

Members will be added in follow-up patches.

8 years agoconf: Add private data for virDomainVcpuDef
Peter Krempa [Wed, 29 Jun 2016 12:55:24 +0000 (14:55 +0200)]
conf: Add private data for virDomainVcpuDef

Allow to store driver specific data on a per-vcpu basis.

Move of the virDomainDef*Vcpus* functions was necessary as
virDomainXMLOptionPtr was declared below this block and I didn't want to
split the function headers.

8 years agoconf: convert def->vcpus to a array of pointers
Peter Krempa [Wed, 29 Jun 2016 12:08:33 +0000 (14:08 +0200)]
conf: convert def->vcpus to a array of pointers

8 years agotests: qemuxml2xml: Format status XML header dynamically
Peter Krempa [Fri, 1 Jul 2016 08:30:53 +0000 (10:30 +0200)]
tests: qemuxml2xml: Format status XML header dynamically

Status XML tests were done by prepending a constant string to an
existing XML. With the planned changes the header will depend on data
present in the definition rather than just on the data that was parsed.

The first dynamic element in the header will be the vcpu thread list.
Reuse and rename qemuXML2XMLPreFormatCallback for gathering the relevant
data when checking the active XML parsing and formating and pass the
bitmap to a newly crated header generator.

8 years agoconf: Don't report errors from virDomainDefGetVcpu
Peter Krempa [Thu, 30 Jun 2016 07:26:04 +0000 (09:26 +0200)]
conf: Don't report errors from virDomainDefGetVcpu

Most callers make sure that it's never called with an out of range vCPU.
Every other caller reports a different error explicitly. Drop the error
reporting and clean up some dead code paths.

8 years agoconf: Rename virDomainVcpuInfoPtr to virDomainVcpuDefPtr
Peter Krempa [Wed, 29 Jun 2016 11:16:22 +0000 (13:16 +0200)]
conf: Rename virDomainVcpuInfoPtr to virDomainVcpuDefPtr

8 years agoconf: Extract code formatting vCPU info
Peter Krempa [Tue, 14 Jun 2016 09:35:39 +0000 (11:35 +0200)]
conf: Extract code formatting vCPU info

8 years agoconf: Annotate that private data for objects are not copied
Peter Krempa [Fri, 1 Jul 2016 14:38:31 +0000 (16:38 +0200)]
conf: Annotate that private data for objects are not copied

Our copy functions format and parse XML thus are not able to copy data.
Annotate the private data pointers that this is happening.

8 years agovirsh: Introduce vshReadlineParse for improved auto-completion
Nishith Shah [Fri, 8 Jul 2016 12:56:05 +0000 (18:26 +0530)]
virsh: Introduce vshReadlineParse for improved auto-completion

The new function works as expected, and matches the current level of
autocomplete offered, along with several other improvements like quotes
handling, multiple command completion and space handling. Now, it is easy
to introduce options completer here.

Signed-off-by: Nishith Shah <nishithshah.2211@gmail.com>
8 years agovirsh: Add option to suppress error in various functions
Nishith Shah [Fri, 8 Jul 2016 12:56:04 +0000 (18:26 +0530)]
virsh: Add option to suppress error in various functions

A bool 'report' has been introduced in various functions, which when set
to true will produce the error it is suppposed to produce, and when
false, will suppress the error. These functions are used in the next
patch for auto-completion.

Signed-off-by: Nishith Shah <nishithshah.2211@gmail.com>
8 years agovirsh: Fix variable types in readline generators
Nishith Shah [Fri, 8 Jul 2016 12:56:03 +0000 (18:26 +0530)]
virsh: Fix variable types in readline generators

Use unsigned int for array indexes and size_t for length variables.

Signed-off-by: Nishith Shah <nishithshah.2211@gmail.com>
8 years agovirsh: Break vshCmddefOptParse into helper functions
Nishith Shah [Fri, 8 Jul 2016 12:56:02 +0000 (18:26 +0530)]
virsh: Break vshCmddefOptParse into helper functions

Decompose vshCmddefOptParse into two helper functions, vshCmddefOptFill
and vshCmddefCheckInternals.

vshCmddefCheckInternals checks if the internal command definitions are
correct or not.

vshCmddefOptFill keeps track of the required options and mandatory
arguments through opts_required and opts_need_arg.

Signed-off-by: Nishith Shah <nishithshah.2211@gmail.com>
8 years agobhyve: implement virConnectGetDomainCapabilities
Fabian Freyer [Fri, 8 Jul 2016 18:53:33 +0000 (20:53 +0200)]
bhyve: implement virConnectGetDomainCapabilities

8 years agobhyve: fix bhyveargv2xml custom loader test
Roman Bogorodskiy [Sun, 10 Jul 2016 21:58:43 +0000 (00:58 +0300)]
bhyve: fix bhyveargv2xml custom loader test

Before pushing this test, I changed the appropriate args file
to pet test-wrap-argv.pl, but forgot to change the xml file, so
update it accordingly.

8 years agobhyve: add tests for bhyveParseCommandLineString
Fabian Freyer [Fri, 24 Jun 2016 18:41:20 +0000 (18:41 +0000)]
bhyve: add tests for bhyveParseCommandLineString

8 years agobhyve: implement argument parser for loader
Fabian Freyer [Wed, 1 Jun 2016 08:03:05 +0000 (10:03 +0200)]
bhyve: implement argument parser for loader

A simple getopt-based argument parser is added for the /usr/sbin/bhyveload
command, loosely based on its argument parser.

The boot disk is guessed by iterating over all
disks and matching their sources. If any non-default arguments are found,
def->os.bootloaderArgs is set accordingly, and the bootloader is treated as a
custom bootloader.

Custom bootloader are supported by setting the def->os.bootloader and
def->os.bootloaderArgs accordingly

grub-bhyve is also treated as a custom bootloader. Since we don't get the
device map in the native format anyways, we can't reconstruct the complete
boot order. While it is possible to check what type the grub boot disk is by
checking if the --root argument is "cd" or "hd0,msdos1", and then just use the
first disk found, implementing the grub-bhyve argument parser as-is in the
grub-bhyve source would mean adding a dependency to argp or duplicating lots
of the code of argp. Therefore it's not really worth implementing that now.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
8 years agobhyve: implement bhyve argument parser
Fabian Freyer [Wed, 1 Jun 2016 08:01:17 +0000 (10:01 +0200)]
bhyve: implement bhyve argument parser

A simpe getopt-based argument parser is added for the /usr/sbin/bhyve command,
loosely based on its argument parser, which reads the following from the bhyve
command line string:

* vm name
* number of vcpus
* memory size
* the time offset (UTC or localtime)
* features:
  * acpi
  * ioapic: While this flag is deprecated in FreeBSD r257423, keep checking for
    it for backwards compatibiility.
* the domain UUID; if not explicitely given, one will be generated.
* lpc devices: for now only the com1 and com2 are supported. It is required for
   these to be /dev/nmdm[\d+][AB], and the slave devices are automatically
   inferred from these to be the corresponding end of the virtual null-modem
   cable: /dev/nmdm<N>A <-> /dev/nmdm<N>B
* PCI devices:
  * Disks: these are numbered in the order they are found, for virtio and ahci
    disks separately. The destination is set to sdX or vdX with X='a'+index;
    therefore only 'z'-'a' disks are supported.
    Disks are considered to be block devices if the path
    starts with /dev, otherwise they are considered to be files.
  * Networks: only tap devices are supported. Since it isn't possible to tell
    the type of the network, VIR_DOMAIN_NET_TYPE_ETHERNET is assumed, since it
    is the most generic. If no mac is specified, one will be generated.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
8 years agobhyve: implement virConnectDomainXMLFromNative
Fabian Freyer [Wed, 1 Jun 2016 07:57:43 +0000 (09:57 +0200)]
bhyve: implement virConnectDomainXMLFromNative

First, remove escaped newlines and split up the string into an argv-list for
the bhyve and loader commands, respectively. This is done by iterating over the
string splitting it by newlines, and then re-iterating over each line,
splitting it by spaces.

Since this code reuses part of the code of qemu_parse_command.c
(in bhyveCommandLine2argv), add the appropriate copyright notices.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
8 years agognulib: add getopt module
Fabian Freyer [Thu, 9 Jun 2016 00:50:35 +0000 (00:50 +0000)]
gnulib: add getopt module

Unconditionally use gnulib's getopt module. This is needed by the bhyve driver
to provide a reentrant interface for getopt.

Several gnulib headers rely on features.h being included by ctype.h to provide
__GNUC_PREREQ, but on systems without glibc, this is not provided. In these
cases __GNUC_PREREQ gets redefined to 0, which causes build errors from checks
in src/internal.h.
Therefore, define __GNUC_PREREQ as early as possible. config-post.h is probably
the first header that is included, before any other headers.

8 years agotests: Add test cases for the empty bitmap
Marc Hartmayer [Wed, 6 Jul 2016 12:02:28 +0000 (14:02 +0200)]
tests: Add test cases for the empty bitmap

As the empty bitmap exists, we should also test it. This patch adds
test cases for the procedures 'virBitmapNextSetBit', 'virBitmapLastSetBit',
'virBitmapNextClearBit'.

Tested-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
8 years agoutil: bitmap: Mention the size == 0 handling
Marc Hartmayer [Wed, 6 Jul 2016 12:02:27 +0000 (14:02 +0200)]
util: bitmap: Mention the size == 0 handling

As there is an explicit constructor for the special case of empty
bitmaps, we should mention that the generic constructors rejects the
creation of empty bitmaps.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
8 years agoutil: bitmap: clarify virBitmapLastSetBit() behavior for empty bitmaps
Marc Hartmayer [Wed, 6 Jul 2016 12:02:26 +0000 (14:02 +0200)]
util: bitmap: clarify virBitmapLastSetBit() behavior for empty bitmaps

Before the variable 'bits' was initialized with 0 (commit
3470cd860d517760b13e26d97b6a842ff72687a1), the following bug was
possible.

A function call with an empty bitmap leads to undefined
behavior. Because if 'bitmap->map_len == 0' 'unusedBits' will be <= 0
and 'sz == 1'. So the non global and non static variable 'bits' would
have never been set. Consequently the check 'bits == 0' results in
undefined behavior.

This patch clarifies the current version of the function by handling the
empty bitmap explicitly. Also, for an empty bitmap there is obviously no
bit set so we can just return -1 (indicating no bit set) right away. The
explicit check for 'bits == 0' after the loop is unnecessary because we
only get to this point if no set bit was found.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
8 years agotests: env perl shebang for test-wrap-argv.pl
Fabian Freyer [Fri, 8 Jul 2016 18:47:04 +0000 (20:47 +0200)]
tests: env perl shebang for test-wrap-argv.pl

On some systems perl is not necessarily in /usr/bin/perl. Use the perl version
in the PATH instead.

8 years agoqemu: Drop useless SPICE migration code
Jiri Denemark [Wed, 29 Jun 2016 13:01:17 +0000 (15:01 +0200)]
qemu: Drop useless SPICE migration code

The spiceMigration flag will never be true if there is no SPICE graphics
configured for the domain.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Properly reset spiceMigration flag
Jiri Denemark [Tue, 5 Jul 2016 08:07:24 +0000 (10:07 +0200)]
qemu: Properly reset spiceMigration flag

Otherwise migration during which we didn't send client_migrate_info QMP
command will get stuck waiting for SPICE migration to finish if libvirtd
sent the QMP command in a previous migration attempt.

Broken by bd7c8a69.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agovirtlogd: increase max file size to 2 MB
Daniel P. Berrange [Fri, 1 Jul 2016 16:42:37 +0000 (17:42 +0100)]
virtlogd: increase max file size to 2 MB

People debugging guest OS boot processes and reported that
the default 128 KB size is too small to capture an entire
boot up sequence. Increase the default size to 2 MB which
should allow capturing a full boot up even with verbose
debugging.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovirtlogd: make max file size & number of backups configurable
Daniel P. Berrange [Fri, 1 Jul 2016 16:40:55 +0000 (17:40 +0100)]
virtlogd: make max file size & number of backups configurable

Currently virtlogd has a hardcoded max file size of 128kb
and max of 3 backups. This adds two new config parameters
to /etc/libvirt/virtlogd.conf to let these be customized.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: caps: Always assume QEMU_CAPS_SMP_TOPOLOGY
Peter Krempa [Thu, 23 Jun 2016 11:29:16 +0000 (13:29 +0200)]
qemu: caps: Always assume QEMU_CAPS_SMP_TOPOLOGY

Support for SMP topology was added by qemu commit dc6b1c09849484fbbc50
prior to 0.12.0, our minimum supported qemu version.

$ git describe --tags dc6b1c09849484fbbc50803307e4c7a3d81eab62
v0.11.0-rc0-449-gdc6b1c0
$ git describe --tags --contains dc6b1c09849484fbbc50803307e4c7a3d81eab
v0.12.0-rc0~1477

8 years agovirDomainHostdevDefFree: Don't leak privateData
Michal Privoznik [Thu, 7 Jul 2016 09:37:36 +0000 (11:37 +0200)]
virDomainHostdevDefFree: Don't leak privateData

After 27726d8c21 a privateData is allocated in
virDomainHostdevDefAlloc(). However, the counter part - freeing
them in Free() is missing which leads to the following memory
leak:

==6489== 24 bytes in 1 blocks are definitely lost in loss record 684 of 1,003
==6489==    at 0x4C2C070: calloc (vg_replace_malloc.c:623)
==6489==    by 0x54B7C94: virAllocVar (viralloc.c:560)
==6489==    by 0x5517BE6: virObjectNew (virobject.c:193)
==6489==    by 0x1B400121: qemuDomainHostdevPrivateNew (qemu_domain.c:798)
==6489==    by 0x5557B24: virDomainHostdevDefAlloc (domain_conf.c:2152)
==6489==    by 0x5575578: virDomainHostdevDefParseXML (domain_conf.c:12709)
==6489==    by 0x5582292: virDomainDefParseXML (domain_conf.c:16995)
==6489==    by 0x5583C98: virDomainDefParseNode (domain_conf.c:17470)
==6489==    by 0x5583B07: virDomainDefParse (domain_conf.c:17417)
==6489==    by 0x5583B95: virDomainDefParseFile (domain_conf.c:17441)
==6489==    by 0x55A3F24: virDomainObjListLoadConfig (virdomainobjlist.c:465)
==6489==    by 0x55A43E6: virDomainObjListLoadAllConfigs (virdomainobjlist.c:596)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: generate -display none
Paolo Bonzini [Tue, 5 Jul 2016 12:35:28 +0000 (14:35 +0200)]
qemu: generate -display none

This is preferrable to -nographic which (in addition to disabling
graphics output) redirects the serial port to stdio and on OpenBIOS
enables the firmware's serial console.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoqemu: detect -display
Paolo Bonzini [Tue, 5 Jul 2016 12:35:27 +0000 (14:35 +0200)]
qemu: detect -display

Add a new capability for the -display command line option, which has
been present since QEMU 1.0.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoconf: Isolate virDomainLiveConfigHelperMethod to libxl only
Peter Krempa [Fri, 1 Jul 2016 14:27:31 +0000 (16:27 +0200)]
conf: Isolate virDomainLiveConfigHelperMethod to libxl only

Libxl is the last user and I don't have the toolchain prepared to
compile the libxl driver. Move it to the libxl driver to avoid having to
refactor the code.

8 years agoconf: Don't use virDomainLiveConfigHelperMethod in virDomainObjGetMetadata
Peter Krempa [Fri, 1 Jul 2016 14:19:58 +0000 (16:19 +0200)]
conf: Don't use virDomainLiveConfigHelperMethod in virDomainObjGetMetadata

Few arguments of the function are not necessary any more which leads to
some cleanups. The 'uri' argument had a stray ATTRIBUTE_UNUSED.

8 years agoconf: Don't use virDomainLiveConfigHelperMethod in virDomainObjSetMetadata
Peter Krempa [Fri, 1 Jul 2016 14:19:58 +0000 (16:19 +0200)]
conf: Don't use virDomainLiveConfigHelperMethod in virDomainObjSetMetadata

8 years agoopenvz: Remove use of virDomainLiveConfigHelperMethod
Peter Krempa [Fri, 1 Jul 2016 14:07:51 +0000 (16:07 +0200)]
openvz: Remove use of virDomainLiveConfigHelperMethod

8 years agolxc: Synchronize implementation of qemuDomainSetMemoryParameters
Peter Krempa [Fri, 1 Jul 2016 14:01:26 +0000 (16:01 +0200)]
lxc: Synchronize implementation of qemuDomainSetMemoryParameters

The impls are identical and I don't have a reasonable idea where to
extract it.

This also kills yet another use of virDomainLiveConfigHelperMethod.

8 years agoqemu: driver: Make name of QEMU_SET_MEM_PARAMETER more universal
Peter Krempa [Fri, 1 Jul 2016 13:55:09 +0000 (15:55 +0200)]
qemu: driver: Make name of QEMU_SET_MEM_PARAMETER more universal

Use a VIR_ prefix even when it's a local helper macro. It will be later
synced with the LXC implementation.

8 years agospec: Move virt-admin into its own package
Michal Privoznik [Mon, 27 Jun 2016 08:15:21 +0000 (10:15 +0200)]
spec: Move virt-admin into its own package

The new package for the virt-admin binary is libvirt-admin.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agospec: Split libvirt-client
Michal Privoznik [Sat, 25 Jun 2016 06:37:22 +0000 (08:37 +0200)]
spec: Split libvirt-client

Currently, we have libvirt-client library which serves as a
collection point for all the libraries and client binaries we
have. Therefore we have couple of silly dependencies, for
instance libvirt-daemon depends on libvirt-client. Only because
the shared library is in the client package.
To solve this, new package libvirt-libs is introduced where all
the libraries are going to live. The client package is then set
to depend on this new package, just like the rest of packages
that suffer the same problem.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirlog: Introduce virLogFilterListFree
Erik Skultety [Tue, 29 Mar 2016 20:07:23 +0000 (22:07 +0200)]
virlog: Introduce virLogFilterListFree

This is just a convenience method for discarding a list of filters instead of
using a 'for' loop everywhere. It is safe to pass -1 as the number of elements
in the list as well as passing NULL as list reference.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirlog: Introduce virLogFilterFree
Erik Skultety [Mon, 4 Jul 2016 10:16:36 +0000 (12:16 +0200)]
virlog: Introduce virLogFilterFree

Provide a separate method to free a logging filter object. This will come handy
once a method to create an individual logging filter object is introduced.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirlog: Introduce virLogOutputListFree
Erik Skultety [Wed, 30 Mar 2016 12:11:12 +0000 (14:11 +0200)]
virlog: Introduce virLogOutputListFree

This is just a convenience method for discarding a list of outputs instead of
using a 'for' loop everywhere. It is safe to pass -1 as the number of elements
in the list as well as passing NULL as list reference.

Signed-off-by: Erik Skultety <eskultet@redhat.com>