]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
8 years agovirlog: Introduce virLogOutputFree
Erik Skultety [Mon, 4 Jul 2016 10:19:38 +0000 (12:19 +0200)]
virlog: Introduce virLogOutputFree

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirlog: Convert virLogFilters to a list of pointers to filters
Erik Skultety [Tue, 29 Mar 2016 13:54:08 +0000 (15:54 +0200)]
virlog: Convert virLogFilters to a list of pointers to filters

Same as with outputs; since the operations will be further divided into smaller
tasks, creating a filter will become a separate operation that will return
a reference to a newly created filter.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirlog: Convert virLogOutputs to a list of pointers to outputs
Erik Skultety [Thu, 17 Mar 2016 13:52:57 +0000 (14:52 +0100)]
virlog: Convert virLogOutputs to a list of pointers to outputs

Right now, we define outputs one after another. However, the correct flow
should be to define a set of outputs as a whole unit. Therefore each output
should be first created, placed into an array/list and the list will be
defined. Output creation should be a separate operation, so an output will be
returned by a reference. From that perspective, it makes perfect sense to
only store pointers to actual outputs.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirlog: Return void instead of int in virLogReset<Foo> methods
Erik Skultety [Wed, 30 Mar 2016 10:25:35 +0000 (12:25 +0200)]
virlog: Return void instead of int in virLogReset<Foo> methods

In this particular case, reset is meant as clearing the whole list of
outputs/filters, not resetting it to a predefined default setting. Looking at
it from that perspective, returning the number of records removed doesn't help
the caller in any way (not that any of the callers would actually check for
it). Well, callers could detect an error from the number of successfully
removed records, but the only thing that can fail in virLogReset is force
closing a file descriptor in which case the error isn't propagated back to
virLogReset anyway. Conclusion: there is no practical use for having a return
type of 'int' rather than 'void' in this case.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoqemu: Memory locking is only required for KVM guests on ppc64
Andrea Bolognani [Wed, 29 Jun 2016 08:22:32 +0000 (10:22 +0200)]
qemu: Memory locking is only required for KVM guests on ppc64

Due to the way the hardware works, KVM on ppc64 always requires
memory locking; however, that is not the case for non-KVM ppc64
guests, eg. ppc64 guests that are running on x86_64 with TCG.

Only require memory locking for ppc64 guests if they are using
KVM or, as it's the case for all architectures, they have host
devices assigned using VFIO.

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

8 years agomaint: update to latest gnulib
Martin Kletzander [Mon, 4 Jul 2016 07:46:12 +0000 (09:46 +0200)]
maint: update to latest gnulib

Fix mingw build regarding rpl_{printf,scanf} symbols.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: support setting host-side IP addresses/routes
Laine Stump [Tue, 21 Jun 2016 16:00:45 +0000 (12:00 -0400)]
qemu: support setting host-side IP addresses/routes

For type='ethernet' interfaces only.

(This patch had been pushed earlier in
commit 0b4645a7e061abc8a4be71fe89865cf248ce6e56, but was reverted in
commit 84d47a3cce71175bc1d8af596f835f66f38a190c because it had been
accidentally pushed during the freeze for release 2.0.0)

8 years agolxc: support setting host-side IP addresses/routes
Laine Stump [Fri, 17 Jun 2016 18:52:48 +0000 (14:52 -0400)]
lxc: support setting host-side IP addresses/routes

(This patch had been pushed earlier in
commit cd5c9f21ded4f8e6216eba02b8795f70503ab404, but was reverted in
commit 1549f16832ca23918b651fb4985a2e9f257cd429 because it had been
accidentally pushed during the freeze for release 2.0.0)

8 years agoutil: support setting peer for virNetDevIPInfo addresses
Laine Stump [Fri, 10 Jun 2016 16:37:37 +0000 (12:37 -0400)]
util: support setting peer for virNetDevIPInfo addresses

This will apply to any IP address setting that uses
virNetDevIPInfoAddToDev() (which so far is only the guest-side of LXC
type='ethernet' interfaces).

(This patch had been pushed earlier in
commit cb20f989df393ec97ba65afb06089d0ab87af484, but was reverted in
commit cba06aea8d500d4ea7e2f40272be484027dd3e4a because it had been
accidentally pushed during the freeze for release 2.0.0)

8 years agoconf: support host-side IP/route information in <interface>
Laine Stump [Thu, 9 Jun 2016 19:35:08 +0000 (15:35 -0400)]
conf: support host-side IP/route information in <interface>

This is place as a sub-element of <source>, where other aspects of the
host-side connection to the network device are located (network or
bridge name, udp listen port, etc). It's a bit odd that the interface
we're configuring with this info is itself named in <target dev='x'/>,
but that ship sailed long ago:

    <interface type='ethernet'>
      <mac address='00:16:3e:0f:ef:8a'/>
      <source>
        <ip address='192.168.122.12' family='ipv4'
            prefix='24' peer='192.168.122.1'/>
        <ip address='192.168.122.13' family='ipv4' prefix='24'/>
        <route family='ipv4' address='0.0.0.0'
               gateway='192.168.122.1'/>
        <route family='ipv4' address='192.168.124.0' prefix='24'
               gateway='192.168.124.1'/>
      </source>
    </interface>

In practice, this will likely only be useful for type='ethernet', so
its presence in any other type of interface is currently forbidden in
the generic device Validate function (but it's been put into the
general population of virDomainNetDef rather than the
ethernet-specific union member so that 1) we can more easily add the
capability to other types if needed, and 2) we can retain the info
when set to an invalid interface type all the way through to
validation and report a proper error, rather than just ignoring it
(which is currently what happens for many other type-specific
settings).

(NB: The already-existing configuration of IP info for the guest-side
of interfaces is in subelements directly under <interface>, and the
name of the guest-side interface (when configurable) is in <guest
dev='x'/>).

(This patch had been pushed earlier in
commit fe6a77898a38f491403a70cc49925a584101daee, but was reverted in
commit d658456530c1010a49f45865613ed361a0fcc5b4 because it had been
accidentally pushed during the freeze for release 2.0.0)

8 years agoconf: allow setting peer address in <ip> element of <interface>
Vasiliy Tolstov [Mon, 4 Apr 2016 21:00:03 +0000 (21:00 +0000)]
conf: allow setting peer address in <ip> element of <interface>

The peer attribute is used to set the property of the same name in the
interface IP info:

  <interface type='ethernet'>
    ...
    <ip family='ipv4' address='192.168.122.5'
        prefix='32' peer='192.168.122.6'/>
    ...
  </interface>

Note that this element is used to set the IP information on the
*guest* side interface, not the host side interface - that will be
supported in an upcoming patch.

(This patch now has quite a history: it was originally pushed in
commit 690969af, which was subsequently reverted in commit 1d14b13f,
then reworked and pushed (along with a lot of other related/supporting
patches) in commit 93135abf1; however *that* commit had been
accidentally pushed during dev. freeze for release 2.0.0, so it was
again reverted in commit f6acf039f0).

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Signed-off-by: Laine Stump <laine@laine.org>
8 years agoutil: new function virNetDevIPInfoAddToDev
Laine Stump [Thu, 16 Jun 2016 16:22:07 +0000 (12:22 -0400)]
util: new function virNetDevIPInfoAddToDev

This patch takes the code out of
lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
IP routes to the interface, and puts it into a utility function
virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
anyone.

One small change in functionality -
lxcContainerRenameAndEnableInterfaces() previously would add all IP
addresses to the interface while it was still offline, then set the
interface online, and then add the routes. Because I don't want the
utility function to set the interface online, I've moved this up so
the interface is first set online, then IP addresses and routes are
added. This is the same order that the network service from
initscripts (in ifup-ether) does it, so it shouldn't pose any problem
(and hasn't, in the tests that I've run).

(This patch had been pushed earlier in commit
f1e0d0da11c473905470c28a6488bf57d9d0ae6e, but was reverted in commit
05eab47559950403aa67d18b098273269ae6916e because it had been
accidentally pushed during the freeze for release 2.0.0)

8 years agoqemu: Introduce helper qemuDomainSecretDiskCapable
John Ferlan [Fri, 24 Jun 2016 19:47:09 +0000 (15:47 -0400)]
qemu: Introduce helper qemuDomainSecretDiskCapable

Introduce a helper to help determine if a disk src could be possibly used
for a disk secret... Going to need this for hot unplug.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoencryption: Add <cipher> and <ivgen> to encryption
John Ferlan [Wed, 1 Jun 2016 23:21:26 +0000 (19:21 -0400)]
encryption: Add <cipher> and <ivgen> to encryption

For a luks device, allow the configuration of a specific cipher to be
used for encrypting the volume.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoencryption: Add luks parsing for storageencryption
John Ferlan [Wed, 1 Jun 2016 19:01:31 +0000 (15:01 -0400)]
encryption: Add luks parsing for storageencryption

Add parse and format of the luks/passphrase secret including tests for
volume XML parsing.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Add 'usage' for encryption
John Ferlan [Mon, 30 May 2016 11:47:46 +0000 (07:47 -0400)]
util: Add 'usage' for encryption

In order to use more common code and set up for a future type, modify the
encryption secret to allow the "usage" attribute or the "uuid" attribute
to define the secret. The "usage" in the case of a volume secret would be
the path to the volume as dictated by the backwards compatibility brought
on by virStorageGenerateQcowEncryption where it set up the usage field as
the vol->target.path and didn't allow someone to provide it. This carries
into virSecretObjListFindByUsageLocked which takes the secret usage attribute
value from from the domain disk definition and compares it against the
usage type from the secret definition. Since none of the code dealing
with qcow/qcow2 encryption secrets uses usage for lookup, it's a mostly
cosmetic change. The real usage comes in a future path where the encryption
is expanded to be a luks volume and the secret will allow definition of
the usage field.

This code will make use of the virSecretLookup{Parse|Format}Secret common code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoconf: Add new secret type "passphrase"
John Ferlan [Wed, 1 Jun 2016 19:00:57 +0000 (15:00 -0400)]
conf: Add new secret type "passphrase"

Add a new secret type known as "passphrase" - it will handle adding the
secret objects that need a passphrase without a specific username.

The format is:

   <secret ...>
     <uuid>...</uuid>
     ...
     <usage type='passphrase'>
       <name>mumblyfratz</name>
     </usage>
   </secret>

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoconf: No need to check for usage fields during Format
John Ferlan [Fri, 24 Jun 2016 14:25:15 +0000 (10:25 -0400)]
conf: No need to check for usage fields during Format

Since the virSecretDefParseUsage ensures each of the fields is present,
no need to check during virSecretDefFormatUsage (also virBufferEscapeString
is a no-op with a NULL argument).

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoAllow custom metadata in network configuration XML
Brandon Bennett [Wed, 22 Jun 2016 22:05:50 +0000 (16:05 -0600)]
Allow custom metadata in network configuration XML

    This replicates the metadata field found in the domain configuration
    and adds it to the network configuration XML.

8 years agoutil: new function virXMLNodeSanitizeNamespaces()
Laine Stump [Fri, 24 Jun 2016 15:19:35 +0000 (11:19 -0400)]
util: new function virXMLNodeSanitizeNamespaces()

This is a generic version of virDomainDefMetadataSanitize() - the same
functionality is now needed for network metadata.

8 years agodocs: remove outdated suggestion to make patches with "diff -urp"/"git diff"
Laine Stump [Wed, 29 Jun 2016 19:36:31 +0000 (15:36 -0400)]
docs: remove outdated suggestion to make patches with "diff -urp"/"git diff"

I can't think of any good reason to do either of those, and having the
examples there will just lead to unusable patch emails from people who
can't be bothered to read the entire page.

8 years agoutil: hostcpu: Only define /dev/kvm path once
Andrea Bolognani [Fri, 24 Jun 2016 17:34:38 +0000 (19:34 +0200)]
util: hostcpu: Only define /dev/kvm path once

Remove the local kvmpath variable from
virHostCPUGetThreadsPerSubcore() and use the file-global
KVM_DEVICE define instead.

8 years agoexamples: check asprintf return value in client_info.c
Ján Tomko [Fri, 1 Jul 2016 12:57:43 +0000 (14:57 +0200)]
examples: check asprintf return value in client_info.c

On error, asprintf returns -1 and the contents of the string
pointer is undefined. In the rest of the libvirt code,
the virAsprintf wrapper takes care of that.

Check the return value and report a generic error, since we
purposefully avoid linking to virutil.

8 years agomingw-libvirt.spec.in: add perl + perl(Getopt::Long) BRs
Daniel P. Berrange [Fri, 1 Jul 2016 13:11:15 +0000 (14:11 +0100)]
mingw-libvirt.spec.in: add perl + perl(Getopt::Long) BRs

The default Fedora build roots for f25 and newer no longer
include perl. We must thus explicitly ask for it as the
RPC gendispatch.pl program needs it, and the Getopt::Long
module. Do this unconditionally since it isn't harmful for
older Fedora

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agomingw-libvirt.spec.in: fix packaging of admin API and other bugs
Daniel P. Berrange [Fri, 1 Jul 2016 11:41:32 +0000 (12:41 +0100)]
mingw-libvirt.spec.in: fix packaging of admin API and other bugs

When the admin API was enabled no entries were added to the
file list.

The virt-host-validate binary is also no longer built on
win32

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoevents: Rename argument uuid->key
Cole Robinson [Thu, 23 Jun 2016 16:14:23 +0000 (12:14 -0400)]
events: Rename argument uuid->key

Since it's not strictly a uuid anymore

8 years agoevents: Add explicit lookup 'key' value
Cole Robinson [Thu, 23 Jun 2016 16:06:39 +0000 (12:06 -0400)]
events: Add explicit lookup 'key' value

This allows event implementations to match on something other
than an object's uuid, like nodedev or interface objects which
don't have a uuid.

8 years agoevents: Pass in UUID as a string
Cole Robinson [Thu, 23 Jun 2016 15:50:05 +0000 (11:50 -0400)]
events: Pass in UUID as a string

This should not have any functional difference, it's just a step
towards matching on non-uuid string keys

8 years agoevents: Cleanup callback variable name
Cole Robinson [Thu, 23 Jun 2016 15:43:24 +0000 (11:43 -0400)]
events: Cleanup callback variable name

In every other instance virObjectEventCallbackPtr is named 'cb',
and in other code 'event' usually means a virObjectEventPtr

8 years agoevents: Add virObjectEventCallbackFree
Cole Robinson [Thu, 23 Jun 2016 15:40:53 +0000 (11:40 -0400)]
events: Add virObjectEventCallbackFree

8 years agoevents: Privatize virObjectEventCallback
Cole Robinson [Thu, 23 Jun 2016 15:29:50 +0000 (11:29 -0400)]
events: Privatize virObjectEventCallback

It's only used in object_event.c, so remove it from the header. We
need to move the _virObjectEventCallback definition earlier as a
result.

8 years agoIntroduce virDomainUSBDeviceDefForeach
Ján Tomko [Thu, 23 Jun 2016 03:04:48 +0000 (05:04 +0200)]
Introduce virDomainUSBDeviceDefForeach

A helper that will execute a callback on every USB device
in the domain definition.

With an ability to skip USB hubs, since we will want to treat
them differently in some cases.

8 years agoAdd USB addresses to qemuhotplug test cases
Ján Tomko [Thu, 23 Jun 2016 05:28:34 +0000 (07:28 +0200)]
Add USB addresses to qemuhotplug test cases

This test assumes the XML will be the same after formatting.
Add USB addresses to it to keep it working when we autoassign them.

8 years agoqemu: Avoid needless copies of static strings
Jiri Denemark [Wed, 29 Jun 2016 15:14:52 +0000 (17:14 +0200)]
qemu: Avoid needless copies of static strings

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Drop emitBootindex parameter
Jiri Denemark [Tue, 28 Jun 2016 21:13:17 +0000 (23:13 +0200)]
qemu: Drop emitBootindex parameter

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Use bootindex whenever possible
Jiri Denemark [Tue, 28 Jun 2016 20:15:25 +0000 (22:15 +0200)]
qemu: Use bootindex whenever possible

I'm not sure why our code claimed "-boot menu=on" cannot be used in
combination with per-device bootindex, but it was proved wrong about
four years ago by commit 8c952908. Let's always use bootindex when QEMU
supports it.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Remove redundant parameter in virQEMUCapsFillDomainCaps
Jiri Denemark [Mon, 27 Jun 2016 13:12:34 +0000 (15:12 +0200)]
qemu: Remove redundant parameter in virQEMUCapsFillDomainCaps

virttype is already included in domCaps, no need to pass it separately.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agodomaincapstest: Don't read data from host
Jiri Denemark [Mon, 27 Jun 2016 13:40:31 +0000 (15:40 +0200)]
domaincapstest: Don't read data from host

virQEMUCapsFillDomainCaps would use virHostCPUGetKVMMaxVCPUs for KVM
domains.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Drop NR_DRIVERS macro
Jiri Denemark [Fri, 24 Jun 2016 16:43:19 +0000 (18:43 +0200)]
cpu: Drop NR_DRIVERS macro

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Drop generic driver
Jiri Denemark [Fri, 24 Jun 2016 16:42:31 +0000 (18:42 +0200)]
cpu: Drop generic driver

Pretending (partial) support for something we don't understand is risky.
Reporting a failure is much better.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoPost-release version bump to 2.1.0
Jiri Denemark [Fri, 1 Jul 2016 10:20:03 +0000 (12:20 +0200)]
Post-release version bump to 2.1.0

8 years agoLibvirt 2.0.0 release
Daniel Veillard [Fri, 1 Jul 2016 08:59:30 +0000 (10:59 +0200)]
Libvirt 2.0.0 release

* docs/news.html.in: update documentation
* po/*.po*: regenerate

8 years agodist: Speed up distribution compression
Martin Kletzander [Thu, 30 Jun 2016 14:05:24 +0000 (16:05 +0200)]
dist: Speed up distribution compression

This almost reverts b7200d723648.  The size is increased from 11M to 13M
and the compression is sped up from 2 minutes to 17 seconds.  The
compression level is removed because -9 doesn't allow multiple threads
to be spawned.  Effectively speeds up distcheck as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoconf: Don't free the constructed string in virDomainGetBlkioParametersAssignFromDef
Peter Krempa [Thu, 30 Jun 2016 12:33:24 +0000 (14:33 +0200)]
conf: Don't free the constructed string in virDomainGetBlkioParametersAssignFromDef

virTypedParameterAssign steals the string rather than copying it into
the typed parameter and thus freeing it leads to a crash when attempting
to serialize the results.

This was introduced in commit 9f50f6e2 and later made an universal
helper in 32e6339c.

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

8 years agoconf: def: Avoid unnecessary allocation of 'perf' events definition
Peter Krempa [Tue, 28 Jun 2016 12:37:29 +0000 (14:37 +0200)]
conf: def: Avoid unnecessary allocation of 'perf' events definition

Some code paths already assume that it is allocated since it was always
allocated by virDomainPerfDefParseXML. Make it member of virDomainDef
directly so that we don't have to allocate it all the time.

This fixes crash when attempting to connect to an existing process via
virDomainQemuAttach since we would not allocate it in that code path.

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

8 years agodocs: Warn against locked memory limit too high
Jiri Denemark [Tue, 28 Jun 2016 12:00:03 +0000 (14:00 +0200)]
docs: Warn against locked memory limit too high

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add test cases for SCSI disk hot-plug with QEMU
Marc Hartmayer [Mon, 27 Jun 2016 14:43:48 +0000 (16:43 +0200)]
tests: Add test cases for SCSI disk hot-plug with QEMU

Verify that SCSI controllers get created automatically when a SCSI disk
is hot-plugged to a domain that doesn't have a matching SCSI controller
defined already.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
8 years agoqemu: SCSI hostdev hot-plug: Fix automatic creation of SCSI controllers
Marc Hartmayer [Mon, 27 Jun 2016 14:43:47 +0000 (16:43 +0200)]
qemu: SCSI hostdev hot-plug: Fix automatic creation of SCSI controllers

Ensure that the given controller and all controllers with a smaller
index exist; there must not be any missing index in between.

Reviewed-by: Boris Fiuczynski <fiuczy@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 agoqemu: hot-plug: Fix broken SCSI disk hot-plug
Marc Hartmayer [Mon, 27 Jun 2016 14:43:46 +0000 (16:43 +0200)]
qemu: hot-plug: Fix broken SCSI disk hot-plug

The commit "qemu: hot-plug: Assume support for -device in
qemuDomainAttachSCSIDisk" dropped the code for the automatic SCSI
controller creation used in SCSI disk hot-plugging. If we are
hot-plugging a SCSI disk to a domain and there is no proper SCSI
controller defined, it results in an "error: internal error: Could not
find scsi controller with index X required for device" error.

For that reason reverting a hunk of the commit
d4d32005d6e8b2cc0a2f26b483ca1de10171db6d.

This patch also adds an extra comment to the code to clarify the
loop.

Reviewed-by: Boris Fiuczynski <fiuczy@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 agoqemu: Let empty default VNC password work as documented
Jiri Denemark [Tue, 28 Jun 2016 12:39:58 +0000 (14:39 +0200)]
qemu: Let empty default VNC password work as documented

CVE-2016-5008

Setting an empty graphics password is documented as a way to disable
VNC/SPICE access, but QEMU does not always behaves like that. VNC would
happily accept the empty password. Let's enforce the behavior by setting
password expiration to "now".

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Use proper async job to refresh virtio channels
Jiri Denemark [Wed, 29 Jun 2016 13:52:49 +0000 (15:52 +0200)]
qemu: Use proper async job to refresh virtio channels

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agolibvirt.spec.in: Use libnl-devel for RHEL-6
Jean-Marc Liger [Wed, 29 Jun 2016 16:37:28 +0000 (17:37 +0100)]
libvirt.spec.in: Use libnl-devel for RHEL-6

RHEL-6 still needs to use libnl instead of libnl3, so re-add
the spec conditional mistakenly removed in

  commit 3694e038fd12825042cca6204f7aa7322e2ed9c9
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed May 4 15:43:08 2016 +0100

    libvirt.spec.in: drop Fedora < 20 and RHEL < 6

8 years agoadmin: fix virt-admin startup crash by calling virAdmInitialize
Erik Skultety [Wed, 29 Jun 2016 14:12:58 +0000 (16:12 +0200)]
admin: fix virt-admin startup crash by calling virAdmInitialize

Similarly to what virsh virt-login-shell do, call virAdmInitialize prior to
initializing an event loop and initializing the error handler. Commit 97973ebb7
described and fixed an identical issue for libvirt_lxc.
Since virAdmInitialize becomes a public API after applying this patch,
the symbol is also added to public syms and the doc string of the method is
slightly enhanced analogically to virInitialize.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoFix possible invalid read in adminClientGetInfo
Ján Tomko [Wed, 29 Jun 2016 05:03:13 +0000 (07:03 +0200)]
Fix possible invalid read in adminClientGetInfo

virNetServerClientGetInfo returns the client's remote address
as a string, which is a part of the client object.

Use VIR_STRDUP to make a copy which can be freely accessed
even after the virNetServerClient object is unlocked.

To reproduce, put a sleep between virObjectUnlock in
virNetServerClientGetInfo and virTypedParamsAddString in
adminClientGetInfo, then close the queried connection during
that sleep.

8 years agovirStorageTranslateDiskSourcePool: Avoid double free
Michal Privoznik [Tue, 28 Jun 2016 12:44:57 +0000 (14:44 +0200)]
virStorageTranslateDiskSourcePool: Avoid double free

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

Consider the following disk for a domain:

    <disk type='volume' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <auth username='libvirt'>
        <secret type='iscsi' usage='libvirtiscsi'/>
      </auth>
      <source pool='iscsi-secret-pool' volume='unit:0:0:0' mode='direct' startupPolicy='optional'/>
      <target dev='sda' bus='scsi'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Now, startupPolicy is currently not allowed for iscsi disks, so
one would expect an error message to be thrown. But what a
surprise is waiting for users if they try to start up such
domain:

==15724== Invalid free() / delete / delete[] / realloc()
==15724==    at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==15724==    by 0x54B7A69: virFree (viralloc.c:582)
==15724==    by 0x552DC90: virStorageAuthDefFree (virstoragefile.c:1549)
==15724==    by 0x552F023: virStorageSourceClear (virstoragefile.c:2055)
==15724==    by 0x552F054: virStorageSourceFree (virstoragefile.c:2067)
==15724==    by 0x55556AA: virDomainDiskDefFree (domain_conf.c:1562)
==15724==    by 0x5557ABE: virDomainDefFree (domain_conf.c:2547)
==15724==    by 0x1B43CC42: qemuProcessStop (qemu_process.c:5918)
==15724==    by 0x1B43BA2E: qemuProcessStart (qemu_process.c:5511)
==15724==    by 0x1B48993E: qemuDomainObjStart (qemu_driver.c:7050)
==15724==    by 0x1B489B9A: qemuDomainCreateWithFlags (qemu_driver.c:7104)
==15724==    by 0x1B489C01: qemuDomainCreate (qemu_driver.c:7122)
==15724==  Address 0x21cfbb90 is 0 bytes inside a block of size 48 free'd
==15724==    at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==15724==    by 0x54B7A69: virFree (viralloc.c:582)
==15724==    by 0x552DC90: virStorageAuthDefFree (virstoragefile.c:1549)
==15724==    by 0x12D1C8D4: virStorageTranslateDiskSourcePool (storage_driver.c:3475)
==15724==    by 0x1B4396E4: qemuProcessPrepareDomain (qemu_process.c:4896)
==15724==    by 0x1B43B880: qemuProcessStart (qemu_process.c:5466)
==15724==    by 0x1B48993E: qemuDomainObjStart (qemu_driver.c:7050)
==15724==    by 0x1B489B9A: qemuDomainCreateWithFlags (qemu_driver.c:7104)
==15724==    by 0x1B489C01: qemuDomainCreate (qemu_driver.c:7122)
==15724==    by 0x561CA97: virDomainCreate (libvirt-domain.c:6787)
==15724==    by 0x12B6FD: remoteDispatchDomainCreate (remote_dispatch.h:4116)
==15724==    by 0x12B61A: remoteDispatchDomainCreateHelper (remote_dispatch.h:4092)

The problem is, in virStorageTranslateDiskSourcePool disk
def->src->auth is freed, but the pointer is not set to NULL. So
later, when qemuProcessStop starts to free the domain definition,
virStorageAuthDefFree() tries to free the memory again, instead
of jumping out immediately.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agologging: fixing log level initialization from cmdline
Jaroslav Suchanek [Tue, 28 Jun 2016 11:05:30 +0000 (13:05 +0200)]
logging: fixing log level initialization from cmdline

Reorder code for setting default log level from cmdline prior
initialization of log outputs. Thus the --verbose option is reflected.

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325072

8 years agoqemuDomainDeviceDefValidate: Drop unused qemuCaps
Jiri Denemark [Mon, 27 Jun 2016 15:44:52 +0000 (17:44 +0200)]
qemuDomainDeviceDefValidate: Drop unused qemuCaps

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agovz: Fix indentation in prlsdkGetNetAddresses()
Andrea Bolognani [Tue, 28 Jun 2016 08:09:52 +0000 (10:09 +0200)]
vz: Fix indentation in prlsdkGetNetAddresses()

8 years agovz: fix build for virNetDev* changes
Olga Krishtal [Mon, 27 Jun 2016 18:23:11 +0000 (21:23 +0300)]
vz: fix build for virNetDev* changes

Patch fixes vz build after changes in IP-related netdev functions(cf0568b0fbc1843d).

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agoRevert "util: new function virNetDevIPInfoAddToDev"
Ján Tomko [Mon, 27 Jun 2016 09:56:17 +0000 (11:56 +0200)]
Revert "util: new function virNetDevIPInfoAddToDev"

This reverts commit f1e0d0da11c473905470c28a6488bf57d9d0ae6e.

This feature was accidentally pushed in the feature freeze.

8 years agoRevert "conf: allow setting peer address in <ip> element of <interface>"
Ján Tomko [Mon, 27 Jun 2016 09:56:17 +0000 (11:56 +0200)]
Revert "conf: allow setting peer address in <ip> element of <interface>"

This reverts commit 93135abf1454d8a1c8542e8c951ed615305ffa24.

This feature was accidentally pushed in the feature freeze.

8 years agoRevert "conf: support host-side IP/route information in <interface>"
Ján Tomko [Mon, 27 Jun 2016 09:56:17 +0000 (11:56 +0200)]
Revert "conf: support host-side IP/route information in <interface>"

This reverts commit fe6a77898a38f491403a70cc49925a584101daee.

This feature was accidentally pushed in the feature freeze.