]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agobhyve: add support for setting fbuf resolution
Fabian Freyer [Wed, 6 May 2020 13:35:53 +0000 (13:35 +0000)] 
bhyve: add support for setting fbuf resolution

The resolution of the VNC framebuffer can now be set via the resolution
definition introduced in 5.9.0.

Also, add "gop" to the list of model types  the <resolution/>
sub-element is valid for.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agobhyve: support parsing fbuf PCI device
Fabian Freyer [Wed, 6 May 2020 13:35:52 +0000 (13:35 +0000)] 
bhyve: support parsing fbuf PCI device

Add a new helper function, bhyveParsePCIFbuf, to parse the bhyve-argv
parameters for a frame-buffer device to <graphics/> and <video/>
definitions.

For now, only the listen address, port, and vga mode are detected.
Unsupported parameters are silently skipped.

This involves upgrading the private API to expose the
virDomainGraphicsDefNew helper function, which is used by
bhyveParsePCIFbuf.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agobhyve: add missing test files
Roman Bogorodskiy [Tue, 22 Sep 2020 11:59:37 +0000 (15:59 +0400)] 
bhyve: add missing test files

Fixes: 4277e61e22b7532dc476c44a356081053da470f8
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 years agonews: Document changes to NVDIMM handling on ppc64
Andrea Bolognani [Tue, 22 Sep 2020 10:24:04 +0000 (12:24 +0200)] 
news: Document changes to NVDIMM handling on ppc64

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: revert latest pSeries NVDIMM design changes
Daniel Henrique Barboza [Tue, 15 Sep 2020 02:42:56 +0000 (23:42 -0300)] 
qemu: revert latest pSeries NVDIMM design changes

In [1], changes were made to remove the existing auto-alignment
for pSeries NVDIMM devices. That design promotes strange situations
where the NVDIMM size reported in the domain XML is different
from what QEMU is actually using. We removed the auto-alignment
and relied on standard size validation.

However, this goes against Libvirt design philosophy of not
tampering with existing guest behavior, as pointed out by Daniel
in [2]. Since we can't know for sure whether there are guests that
are relying on the auto-alignment feature to work, the changes
made in [1] are a direct violation of this rule.

This patch reverts [1] entirely, re-enabling auto-alignment for
pSeries NVDIMM as it was before. Changes will be made to ease
the limitations of this design without hurting existing
guests.

This reverts the following commits:

- commit 2d93cbdea9d1b8dbf36bc0ffee6cb73d83d208c7
  Revert "formatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic"

- commit 0ee56369c8b4f2f898b6aa1ff1f51ab033be1c02
  qemu_domain.c: change qemuDomainMemoryDeviceAlignSize() return type

- commit 07de813924caf37e535855541c0c1183d9d382e2
  qemu_domain.c: do not auto-align ppc64 NVDIMMs

- commit 0ccceaa57c50e5ee528f7073fa8723afd62b88b7
  qemu_validate.c: add pSeries NVDIMM size alignment validation

- commit 4fa2202d884414ad34d9952e72fb39b1d93c7e14
  qemu_domain.c: make qemuDomainGetMemorySizeAlignment() public

[1] https://www.redhat.com/archives/libvir-list/2020-July/msg02010.html
[2] https://www.redhat.com/archives/libvir-list/2020-September/msg00572.html

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agotests: avoid close of bad file handle in commandtest
Daniel P. Berrangé [Mon, 21 Sep 2020 17:37:03 +0000 (18:37 +0100)] 
tests: avoid close of bad file handle in commandtest

Closed file handles need to be initialized to -1, not 0. This caused a
inappropriate double close of stdin, which is not desirable, although
it had no ill effects.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotests: don't mix FILE* and UNIX FD I/O on same stream
Daniel P. Berrangé [Mon, 21 Sep 2020 17:32:29 +0000 (18:32 +0100)] 
tests: don't mix FILE* and UNIX FD I/O on same stream

There is currently a hang in test27 that exhibits itself on FreeBSD 11.4
only. The behaviour is that virCommandProcessIO gets POLLIN on the
FD for stdout, but read() blocks. Meanwhile commandtest also blocks
in write for stderr because the pipe buffers are full.

This fix in commandhelper likely does not really address the root cause
just hides it due to the buffering done by FILE *. Mixing UNIX FD I/O
and FILE * I/O is bad practice regardless.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoudevProcessCSS: Check if def->driver is non-NULL
Marc Hartmayer [Mon, 21 Sep 2020 17:06:32 +0000 (19:06 +0200)] 
udevProcessCSS: Check if def->driver is non-NULL

Don't process subchannel devices where `def->driver` is not set. This
fixes the following segfault:

Thread 21 "nodedev-init" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3ffb08fc910 (LWP 64303)]
(gdb) bt
 #0  0x000003fffd1272b4 in __strcmp_vx () at /lib64/libc.so.6
 #1  0x000003ffc260c3a8 in udevProcessCSS (device=0x3ff9018d130, def=0x3ff90194a90)
 #2  0x000003ffc260cb78 in udevGetDeviceDetails (device=0x3ff9018d130, def=0x3ff90194a90)
 #3  0x000003ffc260d126 in udevAddOneDevice (device=0x3ff9018d130)
 #4  0x000003ffc260d414 in udevProcessDeviceListEntry (udev=0x3ffa810d800, list_entry=0x3ff90001990)
 #5  0x000003ffc260d638 in udevEnumerateDevices (udev=0x3ffa810d800)
 #6  0x000003ffc260e08e in nodeStateInitializeEnumerate (opaque=0x3ffa810d800)
 #7  0x000003fffdaa14b6 in virThreadHelper (data=0x3ffa810df00)
 #8  0x000003fffc309ed6 in start_thread ()
 #9  0x000003fffd185e66 in thread_start ()
(gdb) p *def
$2 = {
  name = 0x0,
  sysfs_path = 0x3ff90198e80 "/sys/devices/css0/0.0.ff40",
  parent = 0x0,
  parent_sysfs_path = 0x0,
  parent_wwnn = 0x0,
  parent_wwpn = 0x0,
  parent_fabric_wwn = 0x0,
  driver = 0x0,
  devnode = 0x0,
  devlinks = 0x3ff90194670,
  caps = 0x3ff90194380
}

Fixes: 05e6cdafa6e0 ("node_device: detect CSS devices")
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
4 years agobhyve: soften requirements for slot 1
Roman Bogorodskiy [Sun, 20 Sep 2020 14:53:57 +0000 (18:53 +0400)] 
bhyve: soften requirements for slot 1

Currently, slot 1 is only allowed to be used by the LPC device.
Relax this requirement and allow to use slot 1 if it was explicitly
specified by the user for any other device type. In this case the LPC
device will have the next available address.

If slot 1 was not used by the user, it'll be reserved for the LPC
device, even if it is not configured to make address assignment
consistent in case the LPC device becomes necessary (e.g. the user
adds a console or a video device which require LPC).

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agobhyve: support 'isa' controller for LPC
Roman Bogorodskiy [Sun, 17 Feb 2019 13:04:00 +0000 (17:04 +0400)] 
bhyve: support 'isa' controller for LPC

Support modeling of the 'isa' controller for bhyve. User can manually
define any PCI slot for the 'isa' controller, including PCI slot 1,
but other devices are not allowed to use this address.

When domain configuration requires the 'isa' controller to be present,
automatically add it on domain post-parse stage.

Now, as this controller is always available when needed, it's not
necessary to implicitly add it to the bhyve command line, so remove
bhyveBuildLPCArgStr().

Also, make bhyveDomainDefNeedsISAController() static as it's no longer
used outside of bhyve_domain.c.

As more than one ISA controller is not supported by bhyve,
and multiple controllers with the same index are forbidden,
so forbid ISA controllers with non-zero index for bhyve.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: add 'isa' controller type
Roman Bogorodskiy [Sun, 17 Feb 2019 13:04:00 +0000 (17:04 +0400)] 
conf: add 'isa' controller type

Introduce 'isa' controller type. In domain XML it looks this way:

    ...
    <controller type='isa' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
               function='0x0'/>
    </controller>
    ...

Currently, this is needed for the bhyve driver to allow choosing a
specific PCI address for that. In bhyve, this controller is used to
attach serial ports and a boot ROM.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: fix non-null pointer parameter annotations
Daniel P. Berrangé [Mon, 21 Sep 2020 08:57:45 +0000 (09:57 +0100)] 
util: fix non-null pointer parameter annotations

An extra parameter was added to virQEMUBuildQemuImgKeySecretOpts in

  commit ecfc4094d832a23fb56e1825d799c93488c168d7
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Tue Sep 15 16:30:37 2020 +0100

    storage: add support for qcow2 LUKS encryption

but the non-null pointer annotations were not adjusted to take account.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agonews: dbus: use GLib implementation instead of libdbus
Pavel Hrdina [Thu, 17 Sep 2020 16:32:49 +0000 (18:32 +0200)] 
news: dbus: use GLib implementation instead of libdbus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agonews: node_device: remove HAL node device backend
Pavel Hrdina [Thu, 17 Sep 2020 16:31:13 +0000 (18:31 +0200)] 
news: node_device: remove HAL node device backend

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoremote: slightly improve debugging of socket selection
Daniel P. Berrangé [Wed, 16 Sep 2020 13:51:47 +0000 (14:51 +0100)] 
remote: slightly improve debugging of socket selection

The current debug message reports the "mode" after selection has
completed, however, the "mode" value can be changed by the selection
logic. It is thus beneficial to report most values upfront, and only
report newly changed values at the end.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agostorage: add support for qcow2 LUKS encryption
Daniel P. Berrangé [Tue, 15 Sep 2020 15:30:37 +0000 (16:30 +0100)] 
storage: add support for qcow2 LUKS encryption

The storage driver was wired up to support creating raw volumes in LUKS
format, but was never adapted to support LUKS-in-qcow2. This is trivial
as it merely requires the encryption properties to be prefixed with
the "encrypt." prefix, and "encrypt.format=luks" when creating the
volume.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotests: remove redundant LUKS volume data files
Daniel P. Berrangé [Thu, 17 Sep 2020 11:32:54 +0000 (12:32 +0100)] 
tests: remove redundant LUKS volume data files

The two removed files have exactly the same config as other LUKS volume
data files, simply with different file names. Consolidate down to just
two LUKS volume data files as that's all that we need for the test
coverage.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoutil: detect LUKS encryption scheme in qcow2 files
Daniel P. Berrangé [Wed, 16 Sep 2020 17:00:35 +0000 (18:00 +0100)] 
util: detect LUKS encryption scheme in qcow2 files

Crypt method number 2 indicates LUKS format.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoscripts: fix logic error in argv wrapping code
Daniel P. Berrangé [Thu, 17 Sep 2020 11:49:12 +0000 (12:49 +0100)] 
scripts: fix logic error in argv wrapping code

The first piece of the command we process must be added to the list
straight away regardless of whether it starts with a '-' or not.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agolibxl: use b_info->{acpi,acpi} when available
Marek Marczykowski-Górecki [Thu, 10 Sep 2020 04:18:01 +0000 (06:18 +0200)] 
libxl: use b_info->{acpi,acpi} when available

b_info->u.hvm.{acpi,apic} are deprecated. But also, on recent libxl
version (4.14) the old one seems to be broken. While libxl part should
be fixed too, update the usage here and at some point drop support for
the old version.
b_info->acpi was added in Xen 4.8
b_info->apic was added in Xen 4.10
Xen 4.10 is the oldest version that still has security support (until
December 2020).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agodrop libdbus from libvirt
Pavel Hrdina [Tue, 15 Sep 2020 12:22:57 +0000 (14:22 +0200)] 
drop libdbus from libvirt

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/rpc/virnetdaemon: convert to use GLib DBus
Pavel Hrdina [Wed, 16 Sep 2020 14:01:51 +0000 (16:01 +0200)] 
src/rpc/virnetdaemon: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/remote/remote_daemon: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:44:03 +0000 (16:44 +0200)] 
src/remote/remote_daemon: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/nwfilter/nwfilter_driver: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:43:47 +0000 (16:43 +0200)] 
src/nwfilter/nwfilter_driver: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/network/bridge_driver: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:43:32 +0000 (16:43 +0200)] 
src/network/bridge_driver: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/lxc/lxc_controller: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:43:12 +0000 (16:43 +0200)] 
src/lxc/lxc_controller: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/util/virsystemd: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:42:42 +0000 (16:42 +0200)] 
src/util/virsystemd: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/util/virfirewalld: convert to use GLib DBus
Pavel Hrdina [Tue, 15 Sep 2020 12:00:53 +0000 (14:00 +0200)] 
src/util/virfirewalld: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosrc/util/virpolkit: convert to use GLib DBus
Pavel Hrdina [Wed, 9 Sep 2020 14:42:16 +0000 (16:42 +0200)] 
src/util/virpolkit: convert to use GLib DBus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: introduce virgdbusmock to mock GLib DBus functions
Pavel Hrdina [Fri, 11 Sep 2020 12:17:01 +0000 (14:17 +0200)] 
tests: introduce virgdbusmock to mock GLib DBus functions

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests/virmock: extend number of arguments
Pavel Hrdina [Fri, 11 Sep 2020 12:12:07 +0000 (14:12 +0200)] 
tests/virmock: extend number of arguments

Rewrite to use GLib DBus instead of libdbus will introduce function with
large number of arguments that we will have to mock for our tests so we
need to extend the number of arguments for our macros.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: introduce helpers for GLib DBus implementation
Pavel Hrdina [Tue, 8 Sep 2020 11:55:24 +0000 (13:55 +0200)] 
util: introduce helpers for GLib DBus implementation

With libdbus our wrappers had a special syntax to create the DBus
messages by defining the DBus message signature followed by list
of arguments providing data based on the signature.

There will be no similar helper with GLib implementation as they
provide same functionality via GVariant APIs. The syntax is slightly
different mostly for how arrays, variadic types and dictionaries are
created/parsed.

Additional difference is that with GLib DBus everything is wrapped in
extra tuple (struct). For more details refer to the documentation [1].

[1] <https://developer.gnome.org/glib/stable/gvariant-format-strings.html>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: mock libdbus in networkxml2firewalltest
Pavel Hrdina [Tue, 15 Sep 2020 11:55:53 +0000 (13:55 +0200)] 
tests: mock libdbus in networkxml2firewalltest

This test calls into src/util/virfirewalld.c where it uses DBus to
figure out if firewalld is registered. Without the mock it luckily
fails and the test works correctly.

To isolate the tests from host environment we should mock the DBus
calls.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoremove HAL node device driver
Pavel Hrdina [Thu, 3 Sep 2020 12:20:43 +0000 (14:20 +0200)] 
remove HAL node device driver

There was one attempt a year ago done by me to drop HAL [1] but it was
never resolved. There was another time when Dan suggested to drop HAL
driver [2] but it was decided to keep it around in case device
assignment will be implemented for FreeBSD and the fact that
virt-manager uses node device driver [3].

I checked git history and code and it doesn't look like bhyve supports
device assignment so from that POV it should not block removing HAL.

The argument about virt-manager is not strong as well because libvirt
installed from FreeBSD packages doesn't have HAL support so it will not
affect these users as well [4].

The only users affected by this change would be the ones compiling
libvirt from GIT on FreeBSD.

I looked into alternatives and there is libudev-devd package on FreeBSD
but unfortunately it doesn't work as it doesn't list any devices when
used with libvirt. It provides libudev APIs using devd.

I also looked into devd directly and it provides some APIs but there are
no APIs for device monitoring and events so that would have to be
somehow done by libvirt.

Main motivation for dropping HAL support is to replace libdbus with GLib
dbus implementation and it cannot be done with HAL driver present in
libvirt because HAL APIs heavily depends on symbols provided by libdbus.

[1] <https://www.redhat.com/archives/libvir-list/2019-May/msg00203.html>
[2] <https://www.redhat.com/archives/libvir-list/2016-April/msg00992.html>
[3] <https://www.redhat.com/archives/libvir-list/2016-April/msg00994.html>
[4] <https://svnweb.freebsd.org/ports/head/devel/libvirt/Makefile?view=markup>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: virsh: Document the IO mode 'io_uring'
Lin Ma [Wed, 16 Sep 2020 07:17:36 +0000 (15:17 +0800)] 
docs: virsh: Document the IO mode 'io_uring'

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: event: options --list, --all and --event are mutually exclusive
Lin Ma [Wed, 16 Sep 2020 07:17:35 +0000 (15:17 +0800)] 
virsh: event: options --list, --all and --event are mutually exclusive

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: net-port-create: log errors for non-existent xml file
Lin Ma [Wed, 16 Sep 2020 07:17:34 +0000 (15:17 +0800)] 
virsh: net-port-create: log errors for non-existent xml file

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoaccess: ensure ACL files are rebuilt when protocol changes
Daniel P. Berrangé [Wed, 16 Sep 2020 09:42:02 +0000 (10:42 +0100)] 
access: ensure ACL files are rebuilt when protocol changes

Meson is not told that the .x protocol files are an input for the
generator, so it doesn't know to setup a rebuild dependancy.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: fix concurrency crash bug in force snapshot revert
Nikolay Shirokovskiy [Mon, 14 Sep 2020 11:58:05 +0000 (14:58 +0300)] 
qemu: fix concurrency crash bug in force snapshot revert

This patch is just revert of [1]. Actually we should NOT pass
QEMU_ASYNC_JOB_NONE as that patch suggests while we are in async job in order
to acquire nested jobs correctly. The patch tries to fix issues introduced by
another patch [2] where jobs are mistakenly cleared out in qemuProcessStop.
Later patch [3] fixed the issue introduced by patch [2]. Now we need to revert
[1] as well as we now still have same concurrency crash issues as [3] described
but for the force revert.

[1] 0c4408c83: qemu: Don't use asyncJob after stop during snapshot revert
[2] 888aa4b6b: qemuDomainObjPrivateDataClear: Don't leak @migParams
[3] d75f865fb: qemu: fix concurrency crash bug in snapshot revert

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: fix the number of threads per core
Matt Coleman [Tue, 15 Sep 2020 22:27:16 +0000 (18:27 -0400)] 
hyperv: fix the number of threads per core

The operands were reversed, producing an incorrect result.

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuBuildHostdevSCSIAttachPrepare: Propagate 'readonly' flag also for iSCSI
Peter Krempa [Tue, 15 Sep 2020 15:58:04 +0000 (17:58 +0200)] 
qemuBuildHostdevSCSIAttachPrepare: Propagate 'readonly' flag also for iSCSI

The 'readonly' hostdev property is stored separately from the
virStorageSource as some hostdevs are not described by a virStorage
source. We need to propagate the flag to the virStorage source also for
iSCSI backends as it's used to generate the backend properties.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuxml2argvtest: hostdev-scsi-virtio-scsi: Add <readonly/> to one of the iSCSI hostdevs
Peter Krempa [Tue, 15 Sep 2020 15:48:22 +0000 (17:48 +0200)] 
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add <readonly/> to one of the iSCSI hostdevs

Test a readonly iSCSI backend as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: backup: Write TLS cert and secret object aliases into status XML
Peter Krempa [Mon, 14 Sep 2020 15:59:07 +0000 (17:59 +0200)] 
qemu: backup: Write TLS cert and secret object aliases into status XML

We've put the aliases into the backup job definition after the status
XML was already written so they didn't appear in the on-disk state.

Move the code putting them into the private definition earlier, so that
the status XML update done by saving blockjobs already writes them out.

Also add a note notifying that the block job status update writes the
status XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870488
Fixes: 423576679a5
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: backup: Remove note that TLS should be implemented
Peter Krempa [Mon, 14 Sep 2020 15:58:09 +0000 (17:58 +0200)] 
qemu: backup: Remove note that TLS should be implemented

Commit 423576679a5 implementing TLS forgot to remove the comment.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemustatusxml2xml: backup-pull: Test private data formatting/parsing
Peter Krempa [Mon, 14 Sep 2020 15:46:42 +0000 (17:46 +0200)] 
qemustatusxml2xml: backup-pull: Test private data formatting/parsing

Modify the test case to enable TLS and add private data containing
aliases of objects corresponding to a TLS setup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuxml2argvtest: hostdev-scsi-virtio-scsi: Use longer user-alias for SCSI hostdev
Peter Krempa [Thu, 10 Sep 2020 15:00:13 +0000 (17:00 +0200)] 
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Use longer user-alias for SCSI hostdev

Test that we can cope with a long useralias when generating SCSI hostdev
commandline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuDomainPrepareHostdev: Don't base backend nodename on device alias
Peter Krempa [Thu, 10 Sep 2020 13:43:54 +0000 (15:43 +0200)] 
qemuDomainPrepareHostdev: Don't base backend nodename on device alias

QEMU's blockdev nodenames which are used to back SCSI/iSCSI hostdevs are
limited to 32 characters. If a user passes a very long user alias as
name of the host device it's easy to end up with a too-long nodename.

To prevent this from happening don't base the nodename on the possibly
user-specified alias but on the normal sequential node name generator.

We then store the name in the status XML for further use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuDomainPrepareHostdev: base hostdev secret object names on backend alias
Peter Krempa [Thu, 10 Sep 2020 13:39:49 +0000 (15:39 +0200)] 
qemuDomainPrepareHostdev: base hostdev secret object names on backend alias

The secret object is used to pass data to the backend so it's better
fitting to base the secret object name on the SCSI host device backend
name.

Since we store the object alias in the status XML this modification is
safe in regards to existing guests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuDomainPrepareHostdev: Allocate backend nodenames in the prepare function
Peter Krempa [Thu, 10 Sep 2020 13:33:45 +0000 (15:33 +0200)] 
qemuDomainPrepareHostdev: Allocate backend nodenames in the prepare function

Allocate the nodename in the setup function rather than in the command
line generator.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuDomainSecretHostdevPrepare: remove
Peter Krempa [Thu, 10 Sep 2020 13:10:21 +0000 (15:10 +0200)] 
qemuDomainSecretHostdevPrepare: remove

The function is no longer used once we setup per-hostdev data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: domain: Extract preparation of hostdev specific data to a separate function
Peter Krempa [Thu, 10 Sep 2020 10:32:04 +0000 (12:32 +0200)] 
qemu: domain: Extract preparation of hostdev specific data to a separate function

Historically we've prepared secrets for all objects in one place. This
doesn't make much sense and it's semantically more appealing to prepare
everything for a single device type in one place.

Move the setup of the (iSCSI|SCSI) hostdev secrets into a new function
which will be used to setup other things as well in the future.

This is a similar approach we do for disks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuBlockStorageSourceAttachData: remove 'storageNodeNameCopy'
Peter Krempa [Thu, 10 Sep 2020 06:32:41 +0000 (08:32 +0200)] 
qemuBlockStorageSourceAttachData: remove 'storageNodeNameCopy'

This was a hack when we were locally regenerating the nodename so that
it's not leaked. Now that we use proper virStorageSource with
persistence it's no longer required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuBuildHostdevSCSI(A|De)tachPrepare: Use virStorageSource in def for SCSI hostdevs
Peter Krempa [Thu, 10 Sep 2020 06:25:37 +0000 (08:25 +0200)] 
qemuBuildHostdevSCSI(A|De)tachPrepare: Use virStorageSource in def for SCSI hostdevs

Modify the attach/detach data generators to actually use the
virStorageSourceStructure embedded in the SCSI config data rather than
creating an ad-hoc internal one.

The modification will allow us to properly store the nodename used for
the backend in the status XML rather than re-generating it all the
time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: domain: Fill in (i)SCSI backend nodename if it is not present in status XML
Peter Krempa [Wed, 9 Sep 2020 15:58:34 +0000 (17:58 +0200)] 
qemu: domain: Fill in (i)SCSI backend nodename if it is not present in status XML

For upgrade reasons so that we can modify the used nodename we must
generate the old version for all status XMLs which don't have it stored
explicitly.

The change will be required as using the user-provided alias may result
in too-long nodenames which will be rejected by qemu.

Add code which fills in the appropriate old value and add test cases to
validate that it's added and also that existing nodenames are not
overwritten.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agotests: qemustatusxml2xmldata: Add local SCSI hostdev to 'upgrade' case
Peter Krempa [Thu, 10 Sep 2020 15:28:46 +0000 (17:28 +0200)] 
tests: qemustatusxml2xmldata: Add local SCSI hostdev to 'upgrade' case

Add a local SCSI host device to validate upcoming generated data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agotests: qemustatusxml2xmldata: Rename 'disk-secinfo-upgrade' case to 'upgrade'
Peter Krempa [Fri, 11 Sep 2020 13:40:23 +0000 (15:40 +0200)] 
tests: qemustatusxml2xmldata: Rename 'disk-secinfo-upgrade' case to 'upgrade'

The test case tests other things besides disk secinfos, so we can make
it more universal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoconf: Add virStorageSource member for SCSI host device config data
Peter Krempa [Wed, 9 Sep 2020 13:27:45 +0000 (15:27 +0200)] 
conf: Add virStorageSource member for SCSI host device config data

The backend for the SCSI host device is a storage source. While the
definition doesn't look like that it's converted to a storage source
when the VM is running.

Add the storage source to the definition object and also parse/format
its private data which will be used for internal state storage while
the VM is running.

Note that the virStorageSourcePtr may not be allocated all the time so
the private data parser allocates it if there is any private data
present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuxml2argvtest: hostdev-scsi-virtio-scsi: Add hostdev with useralias
Peter Krempa [Thu, 10 Sep 2020 13:48:38 +0000 (15:48 +0200)] 
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add hostdev with useralias

Add a SCSI host device with a user-specified alias to illustrate the
upcoming changes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agosyntax-check: Don't forbid curly braces around single line condition body
Peter Krempa [Thu, 10 Sep 2020 13:37:33 +0000 (15:37 +0200)] 
syntax-check: Don't forbid curly braces around single line condition body

This syntax rule doesn't make much sense, especially if there are so
much exceptions to it. Just remove it and adjust the coding style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirDomainHostdevSubsysSCSIHostDefParseXML: Switch to a more modern XML parsing approach
Peter Krempa [Wed, 9 Sep 2020 14:17:05 +0000 (16:17 +0200)] 
virDomainHostdevSubsysSCSIHostDefParseXML: Switch to a more modern XML parsing approach

Use XPath instead of iterating through the nodes.

Few error messages were modified so that the parser can be written in a
simpler way.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirDomainStorageNetworkParseHosts: Switch to a more modern XML parsing approach
Peter Krempa [Wed, 9 Sep 2020 14:17:05 +0000 (16:17 +0200)] 
virDomainStorageNetworkParseHosts: Switch to a more modern XML parsing approach

Use XPath to get the host list instead of iterating through the nodes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirDomainHostdevSubsysSCSIiSCSIClear: Inline contents into only caller
Peter Krempa [Wed, 9 Sep 2020 13:22:57 +0000 (15:22 +0200)] 
virDomainHostdevSubsysSCSIiSCSIClear: Inline contents into only caller

There's just one caller for the function. Move the code into the caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh-completer: use g_new0 instead of VIR_ALLOC_N
Ján Tomko [Mon, 14 Sep 2020 14:24:44 +0000 (16:24 +0200)] 
virsh-completer: use g_new0 instead of VIR_ALLOC_N

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh-completer: use g_free instead of VIR_FREE
Ján Tomko [Mon, 14 Sep 2020 14:10:15 +0000 (16:10 +0200)] 
virsh-completer: use g_free instead of VIR_FREE

All of them are in the cleanup section right before the variables
they free go out of scope.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh-completer: use g_clear_pointer in virshCommaStringListComplete
Ján Tomko [Mon, 14 Sep 2020 14:05:52 +0000 (16:05 +0200)] 
virsh-completer: use g_clear_pointer in virshCommaStringListComplete

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoesx: implement domainInterfaceAddresses
Pino Toscano [Mon, 14 Sep 2020 09:11:38 +0000 (11:11 +0200)] 
esx: implement domainInterfaceAddresses

Implement the .domainInterfaceAddresses hypervisor API, although only
functional for the VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT source.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoesx: generator: add GuestNicInfo object
Pino Toscano [Mon, 14 Sep 2020 09:10:58 +0000 (11:10 +0200)] 
esx: generator: add GuestNicInfo object

Add the definition of the GuestNicInfo object, with all the required
objects for it.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoesx: implement connectListAllNetworks
Pino Toscano [Mon, 14 Sep 2020 16:28:04 +0000 (18:28 +0200)] 
esx: implement connectListAllNetworks

Implement the .connectListAllNetworks networks API in the esx network
driver.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonode_device: mdev vfio-ccw support
Boris Fiuczynski [Mon, 14 Sep 2020 19:11:47 +0000 (21:11 +0200)] 
node_device: mdev vfio-ccw support

Allow vfio-ccw mdev devices to be created besides vfio-pci mdev devices
as well.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 years agonode_device: detect DASD devices
Boris Fiuczynski [Mon, 14 Sep 2020 19:11:46 +0000 (21:11 +0200)] 
node_device: detect DASD devices

Make Direct Access Storage Devices (DASDs) available in the node_device driver.

Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 years agovirsh: nodedev: ability to filter CSS capabilities
Boris Fiuczynski [Mon, 14 Sep 2020 19:11:45 +0000 (21:11 +0200)] 
virsh: nodedev: ability to filter CSS capabilities

Allow to filter for CSS devices.

Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 years agonode_device: detect CSS devices
Boris Fiuczynski [Mon, 14 Sep 2020 19:11:44 +0000 (21:11 +0200)] 
node_device: detect CSS devices

Make channel subsystem (CSS) devices available in the node_device driver.
The CCS devices reside in the computer system and provide CCW devices, e.g.:

  +- css_0_0_003a
      |
      +- ccw_0_0_1a2b
          |
          +- scsi_host0
              |
              +- scsi_target0_0_0
                  |
                  +- scsi_0_0_0_0

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 years agonode_device: refactor udevProcessCCW
Boris Fiuczynski [Mon, 14 Sep 2020 19:11:43 +0000 (21:11 +0200)] 
node_device: refactor udevProcessCCW

Refactor out CCW address parsing for later reuse.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 years agoqemuProcessReconnect: clear 'oldjob'
Ján Tomko [Mon, 14 Sep 2020 11:29:23 +0000 (13:29 +0200)] 
qemuProcessReconnect: clear 'oldjob'

After we started copying the privateData pointer in
qemuDomainObjRestoreJob, we should also free them
once we're done with them.

Register the clear function and use g_auto.
Also add a check for job->cb to qemuDomainObjClearJob,
to prevent freeing an uninitialized job.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: aca37c3fb2e8d733c2788ca4b796c153ea7ce391
4 years agoqemu: qemuDomainObjClearJob: use g_clear_pointer
Ján Tomko [Mon, 14 Sep 2020 11:22:46 +0000 (13:22 +0200)] 
qemu: qemuDomainObjClearJob: use g_clear_pointer

The function used g_clear_pointer for all but one pointer.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: rename qemuDomainObjFreeJob -> qemuDomainObjClearJob
Ján Tomko [Mon, 14 Sep 2020 11:20:35 +0000 (13:20 +0200)] 
qemu: rename qemuDomainObjFreeJob -> qemuDomainObjClearJob

This function does not free the job.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: Remove VIR_ALLOC_N_QUIET
Tim Wiederhake [Mon, 14 Sep 2020 08:01:54 +0000 (10:01 +0200)] 
util: Remove VIR_ALLOC_N_QUIET

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: Use glib memory functions in virJSONValueGetArrayAsBitmap
Tim Wiederhake [Mon, 14 Sep 2020 08:01:53 +0000 (10:01 +0200)] 
util: Use glib memory functions in virJSONValueGetArrayAsBitmap

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agotests: Use glib memory function in testConfRoundTrip
Tim Wiederhake [Mon, 14 Sep 2020 08:01:52 +0000 (10:01 +0200)] 
tests: Use glib memory function in testConfRoundTrip

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: Remove VIR_ALLOC_QUIET
Tim Wiederhake [Mon, 14 Sep 2020 08:01:51 +0000 (10:01 +0200)] 
util: Remove VIR_ALLOC_QUIET

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: Use glib memory functions in virLastErrorObject
Tim Wiederhake [Mon, 14 Sep 2020 08:01:50 +0000 (10:01 +0200)] 
util: Use glib memory functions in virLastErrorObject

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoutil: Use glib memory functions in virErrorCopyNew
Tim Wiederhake [Mon, 14 Sep 2020 08:01:49 +0000 (10:01 +0200)] 
util: Use glib memory functions in virErrorCopyNew

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agotests: Fix false positive in testConfRoundTrip
Tim Wiederhake [Mon, 14 Sep 2020 08:01:48 +0000 (10:01 +0200)] 
tests: Fix false positive in testConfRoundTrip

testConfRoundTrip would return 0 (success) if virConfWriteMem succeeded
and virTestCompareToFile failed.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh: limit completion of checkpoint-{create, delete} to active domains
Lin Ma [Fri, 11 Sep 2020 07:13:18 +0000 (15:13 +0800)] 
virsh: limit completion of checkpoint-{create, delete} to active domains

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: limit completion of backup-{begin, dumpxml} to active domains
Lin Ma [Fri, 11 Sep 2020 07:13:17 +0000 (15:13 +0800)] 
virsh: limit completion of backup-{begin, dumpxml} to active domains

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: limit completion of net-port* to active networks
Lin Ma [Fri, 11 Sep 2020 07:13:16 +0000 (15:13 +0800)] 
virsh: limit completion of net-port* to active networks

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: limit completion of net-dhcp-leases to active networks
Lin Ma [Fri, 11 Sep 2020 07:13:15 +0000 (15:13 +0800)] 
virsh: limit completion of net-dhcp-leases to active networks

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add logical CPU list completion for --cpulist argument
Lin Ma [Fri, 11 Sep 2020 07:13:14 +0000 (15:13 +0800)] 
virsh: Add logical CPU list completion for --cpulist argument

Currently this patch works for the commands emulatorpin, iothreadpin and
vcpupin.

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add vcpu list completion to setvcpu command
Lin Ma [Fri, 11 Sep 2020 07:13:13 +0000 (15:13 +0800)] 
virsh: Add vcpu list completion to setvcpu command

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add vcpu IDs completion to vcpupin command
Lin Ma [Fri, 11 Sep 2020 07:13:12 +0000 (15:13 +0800)] 
virsh: Add vcpu IDs completion to vcpupin command

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add iothread IDs completion to iothread* commands
Lin Ma [Fri, 11 Sep 2020 07:13:10 +0000 (15:13 +0800)] 
virsh: Add iothread IDs completion to iothread* commands

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add domain uuid completion to domname command
Lin Ma [Fri, 11 Sep 2020 07:13:09 +0000 (15:13 +0800)] 
virsh: Add domain uuid completion to domname command

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add network uuid completion to network-name command
Lin Ma [Fri, 11 Sep 2020 07:13:08 +0000 (15:13 +0800)] 
virsh: Add network uuid completion to network-name command

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options
Lin Ma [Fri, 11 Sep 2020 07:13:07 +0000 (15:13 +0800)] 
vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options

Commit c7151b0 added the completion for VSH_OT_INT options, say '--cellno'
and '--pagesize', So we need to ignore VSH_OT_INT otherwise we get the
incorrect completion.

before:
 # virsh freepages --pagesize <TAB><TAB>
--all     --cellno  1GiB      2MiB      4KiB

after:
 # virsh freepages --pagesize <TAB><TAB>
1GiB  2MiB  4KiB

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add event completer to --enable/--disable args of perf command
Lin Ma [Fri, 11 Sep 2020 07:13:06 +0000 (15:13 +0800)] 
virsh: Add event completer to --enable/--disable args of perf command

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: checkpoint: Only return domains that have checkpoints
Lin Ma [Fri, 11 Sep 2020 07:13:05 +0000 (15:13 +0800)] 
virsh: checkpoint: Only return domains that have checkpoints

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: managedsave-*: Only return domains that have a managed save image
Lin Ma [Fri, 11 Sep 2020 07:13:04 +0000 (15:13 +0800)] 
virsh: managedsave-*: Only return domains that have a managed save image

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: snapshot: Only return domains that have snapshot images
Lin Ma [Fri, 11 Sep 2020 07:13:03 +0000 (15:13 +0800)] 
virsh: snapshot: Only return domains that have snapshot images

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirshDomainNameCompleter: Add some of VIR_CONNECT_LIST_DOMAINS_ flags
Lin Ma [Fri, 11 Sep 2020 07:13:02 +0000 (15:13 +0800)] 
virshDomainNameCompleter: Add some of VIR_CONNECT_LIST_DOMAINS_ flags

Commit 3b225256 removed unused VIR_CONNECT_LIST_DOMAINS_* flags, But some
of them will be used in upcoming patches, So add some of them back.

Signed-off-by: Lin Ma <lma@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: virNetDevTapCreate: initialize fd to -1
Ján Tomko [Mon, 14 Sep 2020 11:01:35 +0000 (13:01 +0200)] 
util: virNetDevTapCreate: initialize fd to -1

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 95089f481e003d971fe0a082018216c58c1b80e5