]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agotests: Refresh capabilities for QEMU on ppc64
Andrea Bolognani [Thu, 16 May 2019 14:29:53 +0000 (16:29 +0200)]
tests: Refresh capabilities for QEMU on ppc64

Now that we're probing machine type properties using the
latest machine type rather than the "spapr-machine" parent,
we can finally discover properties that are not available
on all machine types.

This commit refreshes replies for QEMU 4.0.0 as well as
3.1.0 to show not only that we're actually discovering new
machine type properties this way, but also that the number
of available machine type properties increases with each
subsequent QEMU release.

If qom-list-properties had been available in QEMU 2.10.0,
we could now drop the explicit version number checks for
the QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT and
QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT capabilities, but
unfortunately it wasn't, so we have to keep them around
still.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoqemu: Probe canonicalized machine type
Andrea Bolognani [Thu, 16 May 2019 08:34:01 +0000 (10:34 +0200)]
qemu: Probe canonicalized machine type

Now that we have the list of machine types available when
probing machine type properties, we can list properties for
the canonicalized version of the "pseries" machine type
instead of having to go through "spapr-machine", which we
know to be the parent type for all "pseries-*-machine"
types. By doing this, we'll be able to find even properties
that are only available from a certain versioned machine
type forward, and can't thus be obtained when looking at
the parent type only.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoqemu: Add -machine suffix automatically
Andrea Bolognani [Thu, 16 May 2019 08:18:58 +0000 (10:18 +0200)]
qemu: Add -machine suffix automatically

The QOM type for machine types is the machine type name
followed by the -machine suffix. Since this is always the
case, we can make virQEMUCapsMachineProps more readable
and avoid repetition by not including the suffix there and
adding it automatically while processing the data; moreover,
when later on we will start figuring out which specific
versioned machine type to probe at runtime instead of doing
so statically, adding the suffix dynamically will become
necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoqemu: Move call to virQEMUCapsProbeQMPMachineProps()
Andrea Bolognani [Thu, 16 May 2019 13:46:58 +0000 (15:46 +0200)]
qemu: Move call to virQEMUCapsProbeQMPMachineProps()

We're going to need information about available machine types
when probing machine type properties soon, and that means we
have to change the order we call QMP commands.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoqemu: Introduce virQEMUCapsProbeQMPMachineProps()
Andrea Bolognani [Thu, 16 May 2019 13:45:08 +0000 (15:45 +0200)]
qemu: Introduce virQEMUCapsProbeQMPMachineProps()

Up until now we've probed machine type properties, along with
properties for other types, in virQEMUCapsProbeQMPDevices(), but
soon we're going to need some logic that is specific to machine
types and as such wouldn't quite fit into that function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoqemu: blockjob: Fix saving of inactive XML after completed legacy blockjob
Peter Krempa [Fri, 17 May 2019 08:15:53 +0000 (10:15 +0200)]
qemu: blockjob: Fix saving of inactive XML after completed legacy blockjob

Commit c257352797 introduced a logic bug where we will never save the
inactive XML after a blockjob as the variable which was determining
whether to do so is cleared right before. Thus even if we correctly
modify the inactive state it will be rolled back when libvirtd is
restarted.

Reported-by: Thomas Stein <hello@himbee.re>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agobuild: drop check for udev_monitor_set_receive_buffer_size
Ján Tomko [Mon, 13 May 2019 14:22:40 +0000 (16:22 +0200)]
build: drop check for udev_monitor_set_receive_buffer_size

It has been exported by systemd commit
commit a571c23e954cb88cdd5faa28593b19bd7c340130
    libudev: export udev_monitor_set_receive_buffer_size()
released in v183.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agobuild: bump minimum udev version to 219
Ján Tomko [Mon, 13 May 2019 14:17:46 +0000 (16:17 +0200)]
build: bump minimum udev version to 219

This is the version of systemd RHEL/CentOS 7 uses:
https://repology.org/project/systemd/versions
Oldest tracked openSUSE distros have 228,
Ubuntu 16.04 has 229 and Gentoo's alternative eudev
has bumped the version to 219 back in 2015.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agovirt-aa-helper: allow sysfs path used for vhost-scsi
Christian Ehrhardt [Wed, 15 May 2019 11:35:32 +0000 (13:35 +0200)]
virt-aa-helper: allow sysfs path used for vhost-scsi

When a vhost scsi device is hotplugged virt-aa-helper is called to
add the respective path.
For example the config:
  <hostdev mode='subsystem' type='scsi_host' managed='no'>
    <source protocol='vhost' wwpn='naa.50014059de6fba4f'/>
  </hostdev>
Will call it to add:
 /sys/kernel/config/target/vhost//naa.50014059de6fba4f

But in general /sys paths are filtered in virt-aa-helper.c:valid_path
To allow the path used for vhost-scsi we need to add it to the list of
known and accepted overrides.

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1829223
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonode_device_udev: remove deprecated logging function
Pavel Hrdina [Thu, 9 May 2019 13:23:19 +0000 (15:23 +0200)]
node_device_udev: remove deprecated logging function

The function was deprecated in udev 219 and all the supported OSes
don't have older version of udev or systemd.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuxml2argvtest: add test for remove cpu features
Christian Ehrhardt [Thu, 25 Apr 2019 09:51:55 +0000 (11:51 +0200)]
qemuxml2argvtest: add test for remove cpu features

CPU features that always were a no-op in qemu got removed there.
We no more specify them as that would trigger errors and fail to start
qemu. This test ensures that those features really are not rendered into
qemu command line.

Without the related fix this test will trigger and fail like:
 In 'tests/qemuxml2argvdata/cpu-no-removed-features.args':
 Offset 371
 Expect [ ]
 Actual [,-osxsave,-ospke ]

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: do not define known no-op features
Christian Ehrhardt [Thu, 25 Apr 2019 09:04:29 +0000 (11:04 +0200)]
qemu: do not define known no-op features

Qemu dropped cpu features for osxsave and ospke [1][2].
The reason for the instant removal is that those features were never
configurable as discussed in [3].

Fortunately the use cases adding those flags in the past are rare, but
they exist. One that I identified are e.g. older virt-install when used
with --cpu=host-model and there always could be the case of a user
adding it to the guest xml.

This triggers an issue like:
  qemu-system-x86_64: can't apply global Broadwell-noTSX-x86_64-
  cpu.osxsave=on: Property '.osxsave' not found

Ensure that this does no more break spawning newer qemu versions by
not rendering those features into the qemu command line.

Fixes: https://bugs.launchpad.net/fedora/+source/qemu/+bug/1825195
Resolves: https://bugzilla.redhat.com/1644848

[1]: https://git.qemu.org/?p=qemu.git;a=commit;h=f1a2352
[2]: https://git.qemu.org/?p=qemu.git;a=commit;h=9ccb978
[3]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg561877.html

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agocpu_map: Define md-clear CPUID bit
Jiri Denemark [Fri, 5 Apr 2019 13:11:20 +0000 (15:11 +0200)]
cpu_map: Define md-clear CPUID bit

CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091

The bit is set when microcode provides the mechanism to invoke a flush
of various exploitable CPU buffers by invoking the VERW instruction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5
Jiri Denemark [Fri, 5 Apr 2019 09:19:30 +0000 (11:19 +0200)]
cputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemuDomainSnapshotCreateXML: Don't leak parsed snapshot definition
Michal Privoznik [Tue, 14 May 2019 13:43:06 +0000 (15:43 +0200)]
qemuDomainSnapshotCreateXML: Don't leak parsed snapshot definition

This function gets snapshot XML (provided by used) as an
argument. It parses it into a local variable @def and then sets
some more members (e.g. it creates a copy of live domain XML).
Then it proceeds to checking if snapshot XML is valid (e.g. it
contains as many disks as currently in the domain). If this fails
then the control jumps to endjob label and subsequently return
from the function. This is where AUTOFREE function for @def is
ran. Well, because the code says to run plain VIR_FREE() we leak
some memory because @def is actually an object and therefore
it should have been declared as AUTOUNREF.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agostoragepoolxml2argvtest: Avoid double free
Michal Privoznik [Tue, 14 May 2019 08:42:42 +0000 (10:42 +0200)]
storagepoolxml2argvtest: Avoid double free

A double free may occur in testCompareXMLToArgvFiles() when @def
is freed right after virStoragePoolObjNew() failed and the second
time at cleanup label.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirCommand: Make virCommandPassFDGetFDIndex fail if passed command is in error state
Michal Privoznik [Tue, 14 May 2019 08:40:27 +0000 (10:40 +0200)]
virCommand: Make virCommandPassFDGetFDIndex fail if passed command is in error state

The idea of virCommand* APIs is that a possible error that
occurred while constructing cmd line is kept in virCommand
struct. If that's the case all subsequent calls to virCommand*()
are NO-OPs or they return an error. Well,
virCommandPassFDGetFDIndex() is not honoring that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirNetServerPreExecRestart: Check for retval of virJSONValueNewArray()
Michal Privoznik [Tue, 14 May 2019 08:39:27 +0000 (10:39 +0200)]
virNetServerPreExecRestart: Check for retval of virJSONValueNewArray()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirstorageobj: Don't clear vols if they weren't initialized
Michal Privoznik [Tue, 14 May 2019 08:31:52 +0000 (10:31 +0200)]
virstorageobj: Don't clear vols if they weren't initialized

If virStoragePoolObjNew() fails to create new volume object list
then virObjectUnref() is called and since refcounter is 1 then
virStoragePoolObjDispose() is called which in turn calls
virStoragePoolObjClearVols() which in turn dereferences
obj->volumes.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirresctrl: Sort resctrl array correctly in virResctrlMonitorGetStats()
Huaqiang [Fri, 10 May 2019 15:21:47 +0000 (23:21 +0800)]
virresctrl: Sort resctrl array correctly in virResctrlMonitorGetStats()

The qsort element is a pointer of virResctrlMonitorStats, and
the comparing function's arguments have a type of pointer of
virResctrlMonitorStatsPtr.

Signed-off-by: Huaqiang <huaqiang.wang@intel.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirsh: Don't leak disk targets in cmdDomBlkError
Michal Privoznik [Mon, 13 May 2019 12:32:06 +0000 (14:32 +0200)]
virsh: Don't leak disk targets in cmdDomBlkError

The virDomainGetDiskErrors() API copies disk targets into @disks
array that we allocate. But we forgot to free it:

==140828== 16 bytes in 4 blocks are definitely lost in loss record 41 of 242
==140828==    at 0x4C2F08F: malloc (vg_replace_malloc.c:299)
==140828==    by 0x8C406D9: strdup (in /lib64/libc-2.28.so)
==140828==    by 0x5377DD3: virStrdup (virstring.c:966)
==140828==    by 0x54C112F: testDomainGetDiskErrors (test_driver.c:3068)
==140828==    by 0x55C863D: virDomainGetDiskErrors (libvirt-domain.c:10988)
==140828==    by 0x15D1FA: cmdDomBlkError (virsh-domain-monitor.c:1215)
==140828==    by 0x17F1A8: vshCommandRun (vsh.c:1335)
==140828==    by 0x13489E: main (virsh.c:920)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotest_driver: implement virDomainGetDiskErrors
Ilias Stamatis [Sun, 12 May 2019 23:26:14 +0000 (01:26 +0200)]
test_driver: implement virDomainGetDiskErrors

Return the number of disks present in the configuration of the test
domain when called with @errors as NULL and @maxerrors as 0.

Otherwise report an error for every second disk, assigning available
error codes in a cyclic order.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoexamples: Install under $(docdir)
Andrea Bolognani [Fri, 10 May 2019 14:32:22 +0000 (16:32 +0200)]
examples: Install under $(docdir)

Our build system doesn't currently install the various
example programs provided along libvirt; however, both the
upstream .spec file and the Debian packaging go out of
their way to make sure these useful demos are included in
the respective documentation packages.

Moreover, doing so without help from the upstream build
system is easy to get wrong: the libvirt-docs RPM package,
for example, ends up missing one of the examples and
including a bunch of empty .deps/ directories.

Install the examples in $(docdir) as part of our regular
procedure, so that users and downstreams don't have to do
anything special about them.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Install documentation under $(docdir)
Andrea Bolognani [Fri, 10 May 2019 14:22:11 +0000 (16:22 +0200)]
docs: Install documentation under $(docdir)

At the moment we allow the user to specify exactly where
they want the HTML documentation to be installed with an
extreme level of precision through the --with-html-dir and
--with-html-subdir configure options.

Most of the time, of course, the user will stick with the
default, that is $(datadir)/doc/$(PACKAGE)-$(VERSION)/html.

So close to $(docdir)! Including the version number in
the path, specifically, seems entirely unnecessary since
different releases of libvirt are not going to be able to
coexist on the same system anyway.

Drop all these custom flexibilty for flexibilty's sake
shenaningans in favor of the standard, well understood
$(docdir).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Introduce $(devhelphtml_generated)
Andrea Bolognani [Fri, 10 May 2019 12:54:52 +0000 (14:54 +0200)]
docs: Introduce $(devhelphtml_generated)

Our XSLT magic generates one Devhelp-compatible HTML file
per documentation module, but so far we have only shipped
and installed documentation for virterror.

Now that we have $(modules), however, we can generate the
list of files the same way we do for regular documentation
and make sure we always ship and install everything.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Introduce $(modules)
Andrea Bolognani [Fri, 10 May 2019 12:48:46 +0000 (14:48 +0200)]
docs: Introduce $(modules)

This variable contains a lists of documentation modules,
in a neutral format.

Right now is only used to define $(apihtml_generated), but
later on we're gonna reuse it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Fix regression with undefine --snapshots-metadata
Eric Blake [Fri, 10 May 2019 14:38:31 +0000 (09:38 -0500)]
qemu: Fix regression with undefine --snapshots-metadata

In refactoring the snapshot code to prepare for checkpoints, I changed
qemuDomainMomentDiscardAll to take a callback that would handle the
cleanup of either a snapshot or a checkpoint, but failed to set the
callback on one of the two snapshot callers.  As a result, 'virsh
undefine $dom --snapshots-metadata' crashed on a NULL function
dereference.

Fixes: a487890d371b8cc3662c1717dfe07eea3f1ef1c0
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1707708
Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoAdd support for podman in Makefile.ci
Martin Kletzander [Tue, 7 May 2019 15:37:39 +0000 (17:37 +0200)]
Add support for podman in Makefile.ci

This way more users can run our CI builds locally.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirSysinfoParseX86BaseBoard: Free memory upfront if no board detected
Michal Privoznik [Thu, 9 May 2019 13:59:33 +0000 (15:59 +0200)]
virSysinfoParseX86BaseBoard: Free memory upfront if no board detected

If no board was detected then VIR_REALLOC_N() done at the end of
the function will actually free the memory (because nborads ==
0), but @boards will be set to a non-NULL pointer. This makes it
unnecessary harder for a caller to see if any board was detected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirSysinfoRead: Simplify #ifdef underbush
Michal Privoznik [Tue, 7 May 2019 14:10:21 +0000 (16:10 +0200)]
virSysinfoRead: Simplify #ifdef underbush

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agobuild: restore support for libyajl 2.0.1
Ján Tomko [Thu, 9 May 2019 11:11:44 +0000 (13:11 +0200)]
build: restore support for libyajl 2.0.1

Commit 105756660f944e7db02de3b55b98bb7c11cd03bf was too eager and did
not consider SLES 12 which still has 2.0.1 that does not ship
a pkg-config file.

Similar to how we check for readline, prefer pkg-config if available
and fall back to the old detection code if not found.

NB: this is not a clean revert because we're not reintroducing support
for YAJL 1.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoDon't include Makefile.ci in Makefile.am
Martin Kletzander [Tue, 7 May 2019 15:21:55 +0000 (17:21 +0200)]
Don't include Makefile.ci in Makefile.am

The way it works now the Makefile needs to be both make valid and automake
valid.  That is fine for now, but if we want to use anything more advanced, like
conditionals, we cannot have it like that any more.

So instead forward all ci-* rules to that file.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
6 years agosnapshot: Make virDomainSnapshotDef a virObject
Eric Blake [Thu, 9 May 2019 14:59:06 +0000 (09:59 -0500)]
snapshot: Make virDomainSnapshotDef a virObject

This brings about a couple of benefits:
- use of VIR_AUTOUNREF() simplifies several callers
- Fixes a todo about virDomainMomentObjList not being polymorphic enough

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agosnapshot: Add virDomainSnapshotDefNew
Eric Blake [Wed, 8 May 2019 18:30:38 +0000 (13:30 -0500)]
snapshot: Add virDomainSnapshotDefNew

In preparation for making virDomainSnapshotDef a descendant of
virObject, it is time to fix all callers that allocate an object to
use virDomainSnapshotDefNew() instead of VIR_ALLOC().  Fortunately,
there aren't very many :)

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agosnapshot: s/current/parent/ as prep for virObject
Eric Blake [Wed, 8 May 2019 22:10:58 +0000 (17:10 -0500)]
snapshot: s/current/parent/ as prep for virObject

VIR_CLASS_NEW insists that descendents of virObject have 'parent' as
the name of their inherited base class member at offset 0. While it
would be possible to write a new class-creation macro that takes the
actual field name 'current', and rewrite VIR_CLASS_NEW to call the new
macro with the hard-coded name 'parent', it seems less confusing if
all object code uses similar naming. Thus, this is a mechanical rename
in preparation of making virDomainSnapshotDef a descendent of
virObject.

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agosnapshot: s/parent/parent_name/ as prep for virObject
Eric Blake [Wed, 8 May 2019 16:39:13 +0000 (11:39 -0500)]
snapshot: s/parent/parent_name/ as prep for virObject

VIR_CLASS_NEW insists that descendents of virObject have 'parent' as
the name of their inherited base class member at offset 0. While it
would be possible to write a new class-creation macro that takes the
actual field name, and rewrite VIR_CLASS_NEW to call the new macro
with the hard-coded name 'parent', so that we could make
virDomainMomentDef use a custom name for its base class, it seems less
confusing if all object code uses similar naming. Thus, this is a
mechanical rename in preparation of making virDomainSnapshotDef a
descendent of virObject, when we can no longer use 'parent' for a
different purpose than the base class.

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: Refactor/simplify qemuDomainStorageSourceAccessAllow
Peter Krempa [Thu, 18 Apr 2019 14:20:35 +0000 (16:20 +0200)]
qemu: Refactor/simplify qemuDomainStorageSourceAccessAllow

Use qemuDomainStorageSourceAccessModify with correct flags to do the
job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Mark when modifying access to existing source in qemuDomainStorageSourceAccessM...
Peter Krempa [Thu, 18 Apr 2019 14:16:57 +0000 (16:16 +0200)]
qemu: Mark when modifying access to existing source in qemuDomainStorageSourceAccessModify

Some operations e.g. namespace setup are not necessary when modifying
access to a file which the VM can already access. Add a flag which
allows to skip them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Allow skipping the revoke step in qemuDomainStorageSourceAccessModify
Peter Krempa [Thu, 18 Apr 2019 14:10:52 +0000 (16:10 +0200)]
qemu: Allow skipping the revoke step in qemuDomainStorageSourceAccessModify

In some cases when we need to modify access permissions for a storage
source which is already used by the VM we should not revoke all
permissions on a failure. Allow this in qemuDomainStorageSourceAccessModify
by adding a new flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Use bools rather than labels in qemuDomainStorageSourceAccessModify
Peter Krempa [Thu, 18 Apr 2019 14:06:19 +0000 (16:06 +0200)]
qemu: Use bools rather than labels in qemuDomainStorageSourceAccessModify

Rather than jumping to the correct label use a set of booleans to
determine which operation needs to be rolled back. This will allow more
flexibility when e.g. rollback after a failed operation will not be
necessary/desired.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Allow forcing read-only mode in qemuDomainStorageSourceAccessModify
Peter Krempa [Thu, 18 Apr 2019 13:48:39 +0000 (15:48 +0200)]
qemu: Allow forcing read-only mode in qemuDomainStorageSourceAccessModify

Add a new flag which will set the image as read-only even if the image
data allows writing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Refactor/simplify qemuDomainStorageSourceAccessRevoke
Peter Krempa [Thu, 18 Apr 2019 12:40:27 +0000 (14:40 +0200)]
qemu: Refactor/simplify qemuDomainStorageSourceAccessRevoke

Use qemuDomainStorageSourceAccessModify instead of the individual calls.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Allow using qemuDomainStorageSourceAccessModify on singe images
Peter Krempa [Thu, 18 Apr 2019 12:36:38 +0000 (14:36 +0200)]
qemu: Allow using qemuDomainStorageSourceAccessModify on singe images

Add a new flag QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN to select whether
to work on single image or full chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Convert boolean flags to enum flags in qemuDomainStorageSourceAccessModify
Peter Krempa [Thu, 18 Apr 2019 11:02:43 +0000 (13:02 +0200)]
qemu: Convert boolean flags to enum flags in qemuDomainStorageSourceAccessModify

Upcoming patches will add a few more flags. Add an enum to collect them
so that we don't end up with multiple bools.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: domain: Rename qemuDomainStorageSourceChainAccessPrepare
Peter Krempa [Thu, 18 Apr 2019 08:36:30 +0000 (10:36 +0200)]
qemu: domain: Rename qemuDomainStorageSourceChainAccessPrepare

The function will be able to deal with non-chains too so drop 'Chain'
and also change the suffix to 'Modify' as it's used both for setup and
teardown.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Split entry points to qemuDomainStorageSourceChainAccessPrepare
Peter Krempa [Thu, 18 Apr 2019 08:18:51 +0000 (10:18 +0200)]
qemu: Split entry points to qemuDomainStorageSourceChainAccessPrepare

Introduce qemuDomainStorageSourceChainAccess(Allow|Revoke) as entry
points to qemuDomainStorageSourceChainAccessPrepare for symmetry with
the functions for single backing chain elements.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Move and rename qemuHotplugPrepareDiskSourceAccess
Peter Krempa [Thu, 18 Apr 2019 08:04:26 +0000 (10:04 +0200)]
qemu: Move and rename qemuHotplugPrepareDiskSourceAccess

Move it to qemu_domain.c and call it
qemuDomainStorageSourceChainAccessPrepare.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Rename qemuDomainDiskChainElement(Revoke|Prepare)
Peter Krempa [Thu, 18 Apr 2019 07:41:38 +0000 (09:41 +0200)]
qemu: Rename qemuDomainDiskChainElement(Revoke|Prepare)

Use qemuDomainStorageSourceAccess(Allow|Revoke) instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agospec: Bump minimum supported Fedora version to 29
Andrea Bolognani [Tue, 7 May 2019 10:10:58 +0000 (12:10 +0200)]
spec: Bump minimum supported Fedora version to 29

Fedora 30 is out, which means that Fedora 28 is going to be
EOL very soon. Let's get ahead of the game and drop support
for it right now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonews: add note about optional "Removed features" section
Daniel P. Berrangé [Tue, 16 Apr 2019 09:59:37 +0000 (10:59 +0100)]
news: add note about optional "Removed features" section

Most releases don't need a "Removed features" section so don't include
it in the template by default, but leave a reminder in case it is
relevant.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agotests: perform cross compiler builds on GitLab CI
Daniel P. Berrangé [Fri, 25 Jan 2019 17:38:53 +0000 (17:38 +0000)]
tests: perform cross compiler builds on GitLab CI

GitLab CI provides some shared build runners that use Docker containers.
This resource can usefully run cross-compiled builds since all other CI
build testing is currently x86 only, and Travis CI is already very busy
testing native builds.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agolib: Build sources before running 'check-access'
Michal Privoznik [Mon, 6 May 2019 14:19:22 +0000 (16:19 +0200)]
lib: Build sources before running 'check-access'

If the source tree was freshly configured and no objects are
built yet then 'make check-access' has no test to run. Build
the sources beforehand.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirtestmock: Initialize symbols from stat() and its friends
Michal Privoznik [Mon, 6 May 2019 14:11:57 +0000 (16:11 +0200)]
virtestmock: Initialize symbols from stat() and its friends

Introduced by ff376c6283c97.

Previously, init_syms() was called from stat() mock and its
friends. This is crucial because checkPath() might call
printFile() which in turn calls real_fopen(). But if stat() or
one of its friends is the first function called then because of
lacking init_syms() call no real_* is initialized.

The other thing is that we really want the recorded action to be
"stat" instead of __FUNCTION__ because there's no good in
recording that it was __xstat64 who touched some file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirfilemock: Init symbols in canonicalize_file_name()
Michal Privoznik [Mon, 6 May 2019 14:08:34 +0000 (16:08 +0200)]
virfilemock: Init symbols in canonicalize_file_name()

If a program that is using this mock calls canonicalize_file_name()
as the very first function then it will face SIGSEGV because
real_canonicalize_file_name is uninitialized.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Add parameter to virDomainDiskSourceFormat
Eric Blake [Thu, 4 Apr 2019 20:32:05 +0000 (15:32 -0500)]
conf: Add parameter to virDomainDiskSourceFormat

Commits 4bc42986 and 218c81ea removed virDomainStorageSourceFormat on
the grounds that there were no external callers; however, the upcoming
backup code wants to output a <target> (push mode) or <scratch> (pull
mode) element that is in all other respects identical to a domain's
<source> element, where the previous virDomainStorageSourceFormat fit
the bill nicely. But rather than reverting the commits, it's easier to
just add an additional parameter for the element name to use, and
update all callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agotests: domaincaps: Add QEMU 4.0.0 for s390x
Boris Fiuczynski [Fri, 3 May 2019 08:47:01 +0000 (10:47 +0200)]
tests: domaincaps: Add QEMU 4.0.0 for s390x

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agotests: Add capabilities for QEMU 4.0.0 on s390x
Boris Fiuczynski [Fri, 3 May 2019 08:47:00 +0000 (10:47 +0200)]
tests: Add capabilities for QEMU 4.0.0 on s390x

In addition adjusting iothreads-virtio-scsi-ccw.s390x-latest.args to prevent
accidential drive id exposure by QEMU fixed by commit a1dce96236f
(qemu: Use the 'device_id' property of SCSI disks to avoid regressing),
and also adjusting *s390x-latest.args files to qemu deprecation changes made
in commit e8c2c8bd078 (Prefer '-overcommit mem-lock' over -realtime mlock').

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agodocs: Update drivers page to link to storage.html
John Ferlan [Tue, 30 Apr 2019 19:29:26 +0000 (15:29 -0400)]
docs: Update drivers page to link to storage.html

Rather than duplicate a list of storage pool backends on the
drivers.html page, let's just link directly to the storage driver
page similar to how the node device driver is done.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agotests: Add capabilities for QEMU 4.0.0 on ppc64
Andrea Bolognani [Mon, 29 Apr 2019 12:16:47 +0000 (14:16 +0200)]
tests: Add capabilities for QEMU 4.0.0 on ppc64

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agotests: Add capabilities for QEMU 4.0.0 on aarch64
Andrea Bolognani [Mon, 29 Apr 2019 12:06:02 +0000 (14:06 +0200)]
tests: Add capabilities for QEMU 4.0.0 on aarch64

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agotests: Refresh capabilities for QEMU 4.0.0 on riscv64
Andrea Bolognani [Mon, 29 Apr 2019 16:05:40 +0000 (18:05 +0200)]
tests: Refresh capabilities for QEMU 4.0.0 on riscv64

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agotests: Refresh capabilities for QEMU 4.0.0 on riscv32
Andrea Bolognani [Mon, 29 Apr 2019 16:05:28 +0000 (18:05 +0200)]
tests: Refresh capabilities for QEMU 4.0.0 on riscv32

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agotests: qemucaps: Bump capability test data for qemu-4.0 release on x86_64
Peter Krempa [Mon, 29 Apr 2019 12:22:32 +0000 (14:22 +0200)]
tests: qemucaps: Bump capability test data for qemu-4.0 release on x86_64

Capture and update the 4.0.0 qemu version replies now that it was
released. I opted to keep the CPU differences as there was a qemu bug
which reported an empty string in CPU caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoqemu: qapi: Implement worker for introspecting alternate types
Peter Krempa [Thu, 11 Apr 2019 12:54:41 +0000 (14:54 +0200)]
qemu: qapi: Implement worker for introspecting alternate types

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Implement worker for introspecting builtin types
Peter Krempa [Thu, 11 Apr 2019 12:54:41 +0000 (14:54 +0200)]
qemu: qapi: Implement worker for introspecting builtin types

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Implement worker for introspecting enums
Peter Krempa [Thu, 11 Apr 2019 12:54:41 +0000 (14:54 +0200)]
qemu: qapi: Implement worker for introspecting enums

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Prepare for extension of virQEMUQAPISchemaPathGet docs
Peter Krempa [Mon, 15 Apr 2019 15:26:47 +0000 (17:26 +0200)]
qemu: qapi: Prepare for extension of virQEMUQAPISchemaPathGet docs

Prepare section for boolean queries and make the typed query section
more clear.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Report schema and user errors for QAPI queries
Peter Krempa [Mon, 15 Apr 2019 13:33:58 +0000 (15:33 +0200)]
qemu: qapi: Report schema and user errors for QAPI queries

We treated broken schema as failure to look up given query. Treat it as
a separate error instead. It is unlikely to happen though.

Also prepare for possibility of user errors if query components which
can't be queired deeper have following components.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Use declarative approach for meta-type parsers in virQEMUQAPISchemaTraverse
Peter Krempa [Wed, 10 Apr 2019 12:22:14 +0000 (14:22 +0200)]
qemu: qapi: Use declarative approach for meta-type parsers in virQEMUQAPISchemaTraverse

Introduce an array of callbacks for given 'meta-type' of the QAPI schema
structure rather than using code to select it. This will simplify
extension for the other meta-types which are not handled yet.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Add helpers for virQEMUQAPISchemaTraverseContext
Peter Krempa [Fri, 12 Apr 2019 13:59:10 +0000 (15:59 +0200)]
qemu: qapi: Add helpers for virQEMUQAPISchemaTraverseContext

Rather than modifying the context struct add a helpers that does this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Rename local vars in virQEMUQAPISchemaTraverseObject
Peter Krempa [Fri, 12 Apr 2019 13:55:54 +0000 (15:55 +0200)]
qemu: qapi: Rename local vars in virQEMUQAPISchemaTraverseObject

Now that 'query' is no longer an argument we can reuse it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Convert arguments of QAPI traversal helpers to a struct
Peter Krempa [Fri, 12 Apr 2019 10:54:11 +0000 (12:54 +0200)]
qemu: qapi: Convert arguments of QAPI traversal helpers to a struct

Create a context data type for the QAPI path rather than passing an
increasing number of arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Optimize out some helper functions
Peter Krempa [Fri, 12 Apr 2019 07:19:39 +0000 (09:19 +0200)]
qemu: qapi: Optimize out some helper functions

virQEMUQAPISchemaTypeFromObject and virQEMUQAPISchemaTypeFromObject
can be very easily folded into virQEMUQAPISchemaTraverseObject removing
the need for the helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Separate virQEMUQAPISchemaTraverse into functions by object type
Peter Krempa [Wed, 10 Apr 2019 12:14:10 +0000 (14:14 +0200)]
qemu: qapi: Separate virQEMUQAPISchemaTraverse into functions by object type

Simplify virQEMUQAPISchemaTraverse by separating out the necessary
operations for given 'meta-type' into separate functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Convert virQEMUQAPISchemaTraverse to recursive lookup
Peter Krempa [Tue, 9 Apr 2019 13:11:22 +0000 (15:11 +0200)]
qemu: qapi: Convert virQEMUQAPISchemaTraverse to recursive lookup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Modify values returned by virQEMUQAPISchemaPathGet
Peter Krempa [Tue, 9 Apr 2019 12:09:33 +0000 (14:09 +0200)]
qemu: qapi: Modify values returned by virQEMUQAPISchemaPathGet

Return 1 if the schema entry was found optionally returning it rather
than depending on the returned object.

Some callers don't care which schema object belongs to the query, but
rather only want to know whether it exists. Additionally this will allow
introducing boolean queries for checking if enum values exist.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Return schema entry via argument in virQEMUQAPISchemaTraverse
Peter Krempa [Tue, 9 Apr 2019 11:25:49 +0000 (13:25 +0200)]
qemu: qapi: Return schema entry via argument in virQEMUQAPISchemaTraverse

To allow for boolean query string, let's return the queried schema entry
via argument rather than a return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Fix return value of impossible case in virQEMUQAPISchemaTraverse
Peter Krempa [Thu, 11 Apr 2019 07:10:39 +0000 (09:10 +0200)]
qemu: qapi: Fix return value of impossible case in virQEMUQAPISchemaTraverse

The return statement after the infinite loop without a break is there to
appease the compiler. Make it return NULL as it would be a failure if
control flow reaches that point.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: qemumonitorjson: Add tests for QAPI schema query
Peter Krempa [Tue, 9 Apr 2019 11:22:32 +0000 (13:22 +0200)]
tests: qemumonitorjson: Add tests for QAPI schema query

While we technically test the query strings in the qemucapabilitiestest
this was done to help refactor and extend the QAPI schema query
infrastructure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: qapi: Use automatic memory cleanup
Peter Krempa [Tue, 9 Apr 2019 08:36:16 +0000 (10:36 +0200)]
qemu: qapi: Use automatic memory cleanup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: qemumonitorjson: Rename schema validation test cases
Peter Krempa [Tue, 9 Apr 2019 08:32:33 +0000 (10:32 +0200)]
tests: qemumonitorjson: Rename schema validation test cases

Rename DO_TEST_QAPI_SCHEMA to DO_TEST_QAPI_VALIDATE.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirBuffer: Try harder to free buffer
Michal Privoznik [Thu, 18 Apr 2019 12:03:10 +0000 (14:03 +0200)]
virBuffer: Try harder to free buffer

Currently, the way virBufferFreeAndReset() works is it relies on
virBufferContentAndReset() to fetch the buffer content which is
then freed. This works as long as there is no bug in virBuffer*
implementation (not true apparently). Explicitly call free() over
buffer content.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agotests/virhostdevtest: remove virHostdevHostSupportsPassthroughKVM
Daniel Henrique Barboza [Thu, 2 May 2019 12:51:52 +0000 (09:51 -0300)]
tests/virhostdevtest: remove virHostdevHostSupportsPassthroughKVM

virhostdevtest is using pci mock to emulate all PCI attach/detach
operations. This means that that this test does not rely on KVM
support of the host anymore and the tests in this file shouldn't
be affected by it.

Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
6 years agoqemuConnectOpen: Drop unused @cfg and simplify
Michal Privoznik [Tue, 30 Apr 2019 09:44:22 +0000 (11:44 +0200)]
qemuConnectOpen: Drop unused @cfg and simplify

After 65a372d6e0 the @cfg variable is no longer used. This means
we can drop it and therefore drop 'cleanup' label with it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agovirbuffer: Use signed integer for storing error
Michal Privoznik [Thu, 18 Apr 2019 12:02:08 +0000 (14:02 +0200)]
virbuffer: Use signed integer for storing error

The @error member can contain a positive value (errno) or a
negative value (-1) to denote a usage error. It doesn't make
much sense to store it as unsigned then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agovirbuffer: Don't leak memory in virBufferAddBuffer
Michal Privoznik [Thu, 18 Apr 2019 11:59:15 +0000 (13:59 +0200)]
virbuffer: Don't leak memory in virBufferAddBuffer

If an error occurs in a virBuffer* API the idea is to free the
content immediately and set @error member used in error reporting
later. Well, this is not what how virBufferAddBuffer works.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agotest_driver: provide virDomainGetTime implementation
Ilias Stamatis [Wed, 24 Apr 2019 16:57:57 +0000 (18:57 +0200)]
test_driver: provide virDomainGetTime implementation

Implement testDomainGetTime by returning a fixed timestamp.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agomaint: Post-release version bump to 5.4.0
Michal Privoznik [Sat, 4 May 2019 21:39:23 +0000 (23:39 +0200)]
maint: Post-release version bump to 5.4.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoRelease of libvirt-5.3.0
Daniel Veillard [Sat, 4 May 2019 18:13:03 +0000 (20:13 +0200)]
Release of libvirt-5.3.0

* docs/news.xml: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
6 years agoqemu.conf: Make nvram list obsolete
Michal Privoznik [Tue, 16 Apr 2019 15:30:13 +0000 (17:30 +0200)]
qemu.conf: Make nvram list obsolete

Now that libvirt has firmware auto selection feature the nvram
config knob is more or less obsolete. It still makes sense in
cases where distro users are using does not provide FW descriptor
files, therefore I'm not removing it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agotest: match qemu VIR_DOMAIN_DEF_FEATURE* usage
Cole Robinson [Wed, 17 Apr 2019 14:38:57 +0000 (10:38 -0400)]
test: match qemu VIR_DOMAIN_DEF_FEATURE* usage

Match the XML feature usage of the qemu driver, so the test driver
doesn't reject things like <os firmware='efi'/>.

Particularly VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING is needed to
prevent regressions for test suite users with net model strings that
aren't in the virDomainNetModel enum yet

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agospec: fix f28 rpm without firewalld zone
Cole Robinson [Tue, 30 Apr 2019 14:39:31 +0000 (10:39 -0400)]
spec: fix f28 rpm without firewalld zone

Commit 3b71f2e42d added spec handling for with_firewalld_zone. We
now call %firewalld_reload if with_firewalld is set. But the matching
'BuildRequires: firewalld-filesystem' is only applied if
with_firewalld_zone is set.

Fix the former bit to use with_firewalld_zone

Reviewed-by: Laine Stump <laine@laine.org>
Reported-by: Yuval Turgeman <yturgema@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agolib: Preserve error around virDomainNetReleaseActualDevice()
Michal Privoznik [Tue, 30 Apr 2019 14:17:14 +0000 (16:17 +0200)]
lib: Preserve error around virDomainNetReleaseActualDevice()

This function is calling public API virNetworkLookupByName()
which resets the error. Therefore, if
virDomainNetReleaseActualDevice() is used in cleanup path it
actually resets the original error that got us jump into
'cleanup' label.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agonews: Update for 5.3.0 release
Michal Privoznik [Tue, 30 Apr 2019 12:40:37 +0000 (14:40 +0200)]
news: Update for 5.3.0 release

Some basic features/bugfixes/removed features. Of course we've
done a lot more than recoded here.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoRevert "network: use 'bridge' as actual type instead of 'network'"
Daniel P. Berrangé [Tue, 30 Apr 2019 12:26:30 +0000 (13:26 +0100)]
Revert "network: use 'bridge' as actual type instead of 'network'"

This caused the live XML to report the 'bridge' type instead of the
'network' type, which is a behavioural regression.

It also breaks 'virsh domif-setlink', 'virsh update-device' and
'virsh domiftune'

This reverts commit 518026e15959ab0e19b659a9f2ff502a54946498.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoRevert "virt drivers: don't handle type=network after resolving actual network type"
Daniel P. Berrangé [Tue, 30 Apr 2019 12:26:25 +0000 (13:26 +0100)]
Revert "virt drivers: don't handle type=network after resolving actual network type"

This reverts commit 2f5e6502e34d9ddba596fa824b2f2f3504b34a99.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoqemu_command: fix double_close vhostfd in qemuBuildHostdevCommandLine
Jie Wang [Tue, 30 Apr 2019 05:24:15 +0000 (13:24 +0800)]
qemu_command: fix double_close vhostfd in qemuBuildHostdevCommandLine

vhostfd passed to cmd->passfd in virCommandPassFD, virCommandFree will
always close cmd->passfd when qemuBuildSCSIVHostHostdevDevStr failed.

Signed-off-by: Jie Wang <wangjie88@huawei.com>
6 years agoutil: Fix uninitalized variable to avoid garbage value.
Julio Faracco [Tue, 30 Apr 2019 00:29:54 +0000 (21:29 -0300)]
util: Fix uninitalized variable to avoid garbage value.

This commit is similar with 692400f4. It fixes an uninitialized
variable to avoid garbage value. This case, returns 0 jiffies if an
error occurs with virNetDevBridgeGet.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
6 years agovirsh: Add source-protocol-ver to pool-define-as docs
John Ferlan [Mon, 29 Apr 2019 11:51:23 +0000 (07:51 -0400)]
virsh: Add source-protocol-ver to pool-define-as docs

Commit a3dbaa364 neglected to add the source-protocol-ver to the
pool-define-as command.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Fix typo in error message
John Ferlan [Mon, 29 Apr 2019 11:50:49 +0000 (07:50 -0400)]
conf: Fix typo in error message

Fix obvious typo.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>