]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
2 years agovirhostcpu: Fix build with clang and newest kernel headers
Peter Krempa [Tue, 23 Aug 2022 13:29:43 +0000 (15:29 +0200)] 
virhostcpu: Fix build with clang and newest kernel headers

The most recent environment e.g. present in our Fedora Rawhide builds
fail to build the tree with clang with the following error:

../src/util/virhostcpu.c:1291:25: error: field 'header' with variable sized type 'struct kvm_msrs' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
        struct kvm_msrs header;
                        ^

The problem seems to be that clang doesn't like the new way the
'entries' field in struct kvm_msrs is declared.

To work around the issue we can simply allocate the variable dynamically
and use the 'entries' member as it was intended to to access the
members.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoqemu: Do not keep swtpm pidfile around after stopping
Martin Kletzander [Thu, 18 Aug 2022 14:03:01 +0000 (16:03 +0200)] 
qemu: Do not keep swtpm pidfile around after stopping

Just like the socket, remove the pidfile when TPM emulator is being stopped.  In
order to make this a bit cleaner, try to remove it even if swtpm_ioctl does not
exist.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoutil: don't use virFirewallRuleToString() to log the rule being applied
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)] 
util: don't use virFirewallRuleToString() to log the rule being applied

Instead of separately building the commandline into a string to log,
just wait a few lines until we've built the virCommand object, and
call virCommandToString, which does the same thing.

(As a bonus, we were already calling virCommandToString to put the
commandline in a string in case of a failure when running it - from
the point of view of *that* usage, we're just moving the call to
virCommandToString *up* a few lines, i.e. we now only construct the
commandline string once.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: make virFirewallRuleToString() global
Laine Stump [Thu, 21 Apr 2022 21:42:30 +0000 (17:42 -0400)] 
util: make virFirewallRuleToString() global

Although the next commit will eliminate the one current use of
virFirewallRuleToString(), a future commit will once again have a use
for it, but in a different source file so it will need to be a global
function rather than static. Make that change now so that we don't get
a compile error from having an unused static function in the next
commit.

(The arg list is also changed to include the name of the command as a
separate argument rather than just assuming that it can be derived
from the rule's layer (which is correct for iptables, but won't be
correct for nftables)).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: remove unused function virFirewallApplyRuleFirewallD()
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)] 
util: remove unused function virFirewallApplyRuleFirewallD()

This was a wrapper to call a function in virfirewalld.c that sends an
iptables passthrough rule to firewalld. It hasn't been used in a year
or two, and won't ever be used in the future since passthrough rules
are only supported for iptables, and we've determined that we
shouldn't use iptables passthrough rules.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: replace g_snprintf with g_autofreed g_strdup_printf in viriptables.c
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)] 
util: replace g_snprintf with g_autofreed g_strdup_printf in viriptables.c

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: create separate config object for virNetworkDriverState
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)] 
network: create separate config object for virNetworkDriverState

Similar to the other drivers, virNetworkDriverState now has a
virObject-derived object called virNetworkDriverConfig which is used
for config items.

As a starting point, the directory paths used by the network driver
are moved there (again, parallelling what is done for other drivers).

Using items in virNetworkDriverConfig is (yes, again) similar to using
items in the other drivers' config - anything in the config object is
immutable (once initialized), so the state object only needs to be
locked while getting a reference to the config object, and then the
members of the config object can be safely used until the config
object is unrefed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: move driver state struct into bridge_driver_conf.h
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)] 
network: move driver state struct into bridge_driver_conf.h

This is more similar to lxc and qemu drivers, where the driver state
struct is defined along with a config struct in ${driver}_conf.h

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:29:07 +0000 (13:29 -0400)] 
tests: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:28:55 +0000 (13:28 -0400)] 
qemu: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:28:39 +0000 (13:28 -0400)] 
conf: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:26:34 +0000 (13:26 -0400)] 
tests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovbox: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:26:13 +0000 (13:26 -0400)] 
vbox: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotest driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:55 +0000 (13:25 -0400)] 
test driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:32 +0000 (13:25 -0400)] 
qemu: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:11 +0000 (13:25 -0400)] 
network: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoesx: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:24:53 +0000 (13:24 -0400)] 
esx: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:24:41 +0000 (13:24 -0400)] 
conf: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Switch from macOS 11 to macOS 12
Andrea Bolognani [Thu, 11 Aug 2022 10:05:24 +0000 (12:05 +0200)] 
ci: Switch from macOS 11 to macOS 12

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoci: Refresh generated files
Andrea Bolognani [Thu, 11 Aug 2022 10:04:48 +0000 (12:04 +0200)] 
ci: Refresh generated files

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: fix syntax errors in IPv6 NAT example XML
Daniel P. Berrangé [Tue, 23 Aug 2022 15:10:56 +0000 (16:10 +0100)] 
docs: fix syntax errors in IPv6 NAT example XML

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agolib: Don't check for retval for virCommandNew*()
Michal Privoznik [Tue, 23 Aug 2022 12:35:47 +0000 (14:35 +0200)] 
lib: Don't check for retval for virCommandNew*()

The virCommand module is specifically designed so that no caller
has to check for retval of individual virCommand*() APIs except
for virCommandRun() where the actual error is reported. Moreover,
virCommandNew*() use g_new0() to allocate memory and thus it's
not really possible for those APIs to return NULL. Which is why
they are even marked as ATTRIBUTE_NONNULL. But there are few
places where we do check the retval which is a dead code
effectively. Drop those checks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
Ludek Janda [Tue, 23 Aug 2022 13:11:36 +0000 (15:11 +0200)] 
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.0% (10379 of 10480 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/zh_CN/

Co-authored-by: Ludek Janda <ljanda@redhat.com>
Signed-off-by: Ludek Janda <ljanda@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Sun, 21 Aug 2022 00:48:32 +0000 (02:48 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 43.0% (4513 of 10480 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoqemu: adjust memlock for multiple vfio/vdpa devices
Jonathon Jongsma [Wed, 20 Jul 2022 17:12:23 +0000 (12:12 -0500)] 
qemu: adjust memlock for multiple vfio/vdpa devices

When multiple VFIO or VDPA devices are assigned to a guest, the guest
can fail to start because the guest fails to map enough memory. For
example, the case mentioned in
https://bugzilla.redhat.com/show_bug.cgi?id=2111317 results in this
failure:

    2021-08-05T09:51:47.692578Z qemu-kvm: failed to write, fd=31, errno=14 (Bad address)
    2021-08-05T09:51:47.692590Z qemu-kvm: vhost vdpa map fail!
    2021-08-05T09:51:47.692594Z qemu-kvm: vhost-vdpa: DMA mapping failed, unable to continue

The current memlock limit calculation does not work for scenarios where
there are multiple such devices assigned to a guest. The root causes are
a little bit different between VFIO and VDPA devices.

For VFIO devices, the issue only occurs when a vIOMMU is present. In
this scenario, each vfio device is assigned a separate AddressSpace
fully mapping guest RAM. When there is no vIOMMU, the devices are all
within the same AddressSpace so no additional memory limit is needed.

For VDPA devices, each device requires the full memory to be mapped
regardless of whether there is a vIOMMU or not.

In order to enable these scenarios, we need to multiply memlock limit
by the number of VDPA devices plus the number of VFIO devices for guests
with a vIOMMU. This has the potential for pushing the memlock limit
above the host physical memory and negating any protection that these
locked memory limits are providing, but there is no other short-term
solution.

In the future, there should be have a revised userspace iommu interface
(iommufd) that the VFIO and VDPA backends can make use of. This will be
able to share locked memory limits between both vfio and vdpa use cases
and address spaces and then we can disable these short term hacks. But
this is still in development upstream.

Resolves: https://bugzilla.redhat.com/2111317

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agolibxl: Fix build with recent Xen that introduces new disk backend type
Oleksandr Tyshchenko [Fri, 29 Jul 2022 15:50:24 +0000 (18:50 +0300)] 
libxl: Fix build with recent Xen that introduces new disk backend type

Xen toolstack has gained basic Virtio support recently which becides
adding various virtio related stuff introduces new disk backend type
LIBXL_DISK_BACKEND_STANDALONE [1].

Unfortunately, this caused a regression in libvirt build with Xen support
enabled, reported by the osstest today [2]:

CC       libxl/libvirt_driver_libxl_impl_la-xen_xl.lo
../../src/libxl/xen_xl.c: In function 'xenParseXLDisk':
../../src/libxl/xen_xl.c:779:17: error: enumeration value 'LIBXL_DISK_BACKEND_STANDALONE'
   not handled in switch [-Werror=switch-enum]
                 switch (libxldisk->backend) {
                 ^~~~~~
cc1: all warnings being treated as errors

The interesting fact is that switch already has a default branch (which ought
to cover such new addition), but the error is triggered as -Wswitch-enum
gives a warning about an omitted enumeration code even if there is a default
label.

Also there is a similar issue in libxlUpdateDiskDef() which I have reproduced
after fixing the first one, but it that case the corresponding switch doesn't
have a default branch.

Fix both issues by inserting required enumeration item to make the compiler
happy and adding ifdef guard to be able to build against old Xen libraries
as well (without LIBXL_HAVE_DEVICE_DISK_SPECIFICATION). Also add a default
branch to switch in libxlUpdateDiskDef().

Please note, that current patch doesn't implement the proper handling of
LIBXL_DISK_BACKEND_STANDALONE and friends, it is just intended to fix
the regression immediately to unblock the osstest.  Also it worth mentioning
that current patch won't solve the possible additions in the future.

[1] https://lore.kernel.org/xen-devel/20220716163745.28712-1-olekstysh@gmail.com/
[2] https://lore.kernel.org/xen-devel/E1oHEQO-0008GA-Uo@osstest.test-lab.xenproject.org/

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: do not probe for -pcihost properties
Ján Tomko [Fri, 19 Aug 2022 14:32:03 +0000 (16:32 +0200)] 
qemu: do not probe for -pcihost properties

Now that we no longer care about any of their properties, there's no need
to call `device-list-properties` on these devices.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: retire QEMU_CAPS_Q35_PCI_HOLE64_SIZE
Ján Tomko [Fri, 19 Aug 2022 14:31:57 +0000 (16:31 +0200)] 
qemu: retire QEMU_CAPS_Q35_PCI_HOLE64_SIZE

We no longer use it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: Retire QEMU_CAPS_I440FX_PCI_HOLE64_SIZE
Ján Tomko [Fri, 19 Aug 2022 14:31:09 +0000 (16:31 +0200)] 
qemu: Retire QEMU_CAPS_I440FX_PCI_HOLE64_SIZE

We no longer use it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: always assume QEMU_CAPS_*_HOLE64_SIZE
Ján Tomko [Thu, 11 Aug 2022 17:08:35 +0000 (19:08 +0200)] 
qemu: always assume QEMU_CAPS_*_HOLE64_SIZE

Introduced back in 2013 by QEMU commit:
  commit 398489018183d613306ab022653552247d93919f

      pc: limit 64 bit hole to 2G by default

Released in 1.6.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: retire QEMU_CAPS_DUMP_GUEST_MEMORY
Ján Tomko [Thu, 11 Aug 2022 16:52:46 +0000 (18:52 +0200)] 
qemu: retire QEMU_CAPS_DUMP_GUEST_MEMORY

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: always assume QEMU_CAPS_DUMP_GUEST_MEMORY
Ján Tomko [Thu, 11 Aug 2022 16:50:00 +0000 (18:50 +0200)] 
qemu: always assume QEMU_CAPS_DUMP_GUEST_MEMORY

Introduced back in 2012 by QEMU commit:
  commit 783e9b4826b95e53e33c42db6b4bd7d89bdff147
      introduce a new monitor command 'dump-guest-memory' to dump guest's memory

Released in QEMU 1.2.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agotests: Reset macOS dyld environment
Andrea Bolognani [Wed, 17 Aug 2022 13:41:57 +0000 (15:41 +0200)] 
tests: Reset macOS dyld environment

This is needed to ensure the environment variables that we need
for the test program itself, specifically to load mock libraries,
do not interfere with any command that gets invoked by it, either
directly or indirectly. We already perform the same cleanup step
for LD_* variables.

This makes the test failures

  error : virCommandWait:2752 : internal error: Child process
    (/usr/libexec/qemu/vhost-user/test-vhost-user-gpu --print-capabilities)
    unexpected fatal signal 6: dyld[8896]: symbol not found in flat
    namespace '_virQEMUCapsGet'
  error : qemuVhostUserFillDomainGPU:394 : operation failed: Unable to
    find a satisfying vhost-user-gpu

that were showing up on macOS 12 go away.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: Preserve macOS dyld environment by default
Andrea Bolognani [Wed, 17 Aug 2022 13:37:16 +0000 (15:37 +0200)] 
util: Preserve macOS dyld environment by default

The DYLD_* environment variables on macOS have the same purpose
as the LD_* variables have on Linux. Since we're preserving the
latter by default, it makes sense to do the same for the former
as well.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Drop irrelevant CPU config from graphics-spice-timeout
Jiri Denemark [Thu, 18 Aug 2022 14:13:45 +0000 (16:13 +0200)] 
tests: Drop irrelevant CPU config from graphics-spice-timeout

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/243

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_tpm: Don't crash if qemuTPMPcrBankBitmapToStr(NULL)
Michal Privoznik [Thu, 11 Aug 2022 18:57:02 +0000 (20:57 +0200)] 
qemu_tpm: Don't crash if qemuTPMPcrBankBitmapToStr(NULL)

Historically, the tpm->data.emulator.activePcrBanks member was an
unsigned int but since it was used as a bitmap it was converted
to virBitmap type instead. Now, the virBitmap is allocated inside
of virDomainTPMDefParseXML() but only if <activePcrBanks/> was
found with at last one child element. Otherwise it stays NULL.

Fast forward to starting a domain with TPM 2.0 and no
<activePcrBanks/> configured. Eventually,
qemuTPMEmulatorBuildCommand() is called, which subsequently calls
qemuTPMEmulatorReconfigure() and finally
qemuTPMPcrBankBitmapToStr() passing the NULL value. Before
rewrite to virBitmap this function would return NULL for empty
activePcrBanks but now, well, now it crashes.

Fixes: 52c7c31c8038aa31d502f59a40e4fb4ba9f61113
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Fix leak in virVMXParseEthernet
Martin Kletzander [Thu, 18 Aug 2022 13:43:13 +0000 (15:43 +0200)] 
vmx: Fix leak in virVMXParseEthernet

Commit 580538c5dd7f forgot to free switchId.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_driver: use qemuMonitorQueryStats to extract halt poll time
Amneesh Singh [Thu, 18 Aug 2022 03:17:20 +0000 (08:47 +0530)] 
qemu_driver: use qemuMonitorQueryStats to extract halt poll time

This patch uses qemuMonitorQueryStats to query "halt_poll_success_ns"
and "halt_poll_fail_ns" for every vCPU. The respective values for each
vCPU are then added together.

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_capabilities: add "query-stats" QMP command to the QEMU capabilities
Amneesh Singh [Thu, 18 Aug 2022 03:17:19 +0000 (08:47 +0530)] 
qemu_capabilities: add "query-stats" QMP command to the QEMU capabilities

Related: https://gitlab.com/libvirt/libvirt/-/issues/276

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_monitor: add qemuMonitorQueryStats
Amneesh Singh [Thu, 18 Aug 2022 03:17:18 +0000 (08:47 +0530)] 
qemu_monitor: add qemuMonitorQueryStats

Related: https://gitlab.com/libvirt/libvirt/-/issues/276

This patch adds an API for the "query-stats" QMP command.

The query returns a JSON containing the statistics based on the target,
which can either be vCPU or VM, and the providers. The API deserializes
the query result into an array of GHashMaps, which can later be used to
extract all the query statistics. GHashMaps are used to avoid traversing
the entire array to find the statistics you are looking for. This would
be a singleton array if the target is a VM since the returned JSON is
also a singleton array in that case.

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agonews: Mention esx support for new interface types
Martin Kletzander [Thu, 18 Aug 2022 10:44:02 +0000 (12:44 +0200)] 
news: Mention esx support for new interface types

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2 years agovmx: Add support for VDS interface
Martin Kletzander [Wed, 17 Aug 2022 12:44:55 +0000 (14:44 +0200)] 
vmx: Add support for VDS interface

Since we cannot properly plug a new VM into the distributed switch, we can at
least report the provided pieces of information, so that XML editing still works
even for VMs with such interfaces.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf, docs, schemas: Add support for interface type vds
Martin Kletzander [Wed, 17 Aug 2022 12:35:17 +0000 (14:35 +0200)] 
conf, docs, schemas: Add support for interface type vds

This represents an interface connected to a VMWare Distributed Switch,
previously obscured as a dummy interface.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Require networkName for bridged and custom NICs
Martin Kletzander [Tue, 9 Aug 2022 13:00:06 +0000 (15:00 +0200)] 
vmx: Require networkName for bridged and custom NICs

Commit 70768cda9740 marked this particular config string optional, but
forgot that two of the interface types still require this name to
exist.  Mark it as optional only if there is no connectionType.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Rewrite virNetDevVPortProfileCopy
Martin Kletzander [Thu, 11 Aug 2022 12:59:09 +0000 (14:59 +0200)] 
conf: Rewrite virNetDevVPortProfileCopy

This makes it nicer to use as since it cannot fail shortens the usage in all
callers.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Fix vmx/xml filenames
Martin Kletzander [Thu, 11 Aug 2022 13:16:36 +0000 (15:16 +0200)] 
tests: Fix vmx/xml filenames

Commit 70768cda9740 added a functionality that was previously (in an unsubmitted
version of the commit) represented differently in the XML, but the filenames
kept the old name.  Fix the name so they are not misleading.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodocs: Fix missing slashes in the maxphysaddr example
Lin Ma [Wed, 17 Aug 2022 08:19:42 +0000 (16:19 +0800)] 
docs: Fix missing slashes in the maxphysaddr example

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 17 Aug 2022 08:19:11 +0000 (10:19 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 42.8% (4493 of 10480 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoschema: Add maxphysaddr element to hostcpu
Jim Fehlig [Thu, 11 Aug 2022 22:36:24 +0000 (16:36 -0600)] 
schema: Add maxphysaddr element to hostcpu

The output of "virsh capabilities" was not conformant to the
capability.rng schema. Add the missing element to the schema.

Fixes: c647bf29afb9890c792172ecf7db2c9c27babbb6
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoschema: Don't enforce ordering of hostcpu capabilities elements
Jim Fehlig [Thu, 11 Aug 2022 22:31:13 +0000 (16:31 -0600)] 
schema: Don't enforce ordering of hostcpu capabilities elements

The change to caps-test.xml demonstrates the need for the change to
cputypes.rng.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoschema: Remove optional nesting in hostcpu rng
Jim Fehlig [Thu, 11 Aug 2022 22:13:36 +0000 (16:13 -0600)] 
schema: Remove optional nesting in hostcpu rng

The hostcpu rng has an optional "model" element, with the remaining
elements each within a nested optional. Remove the optional nesting
and have each element explicitly listed as optional

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 15 Aug 2022 08:19:18 +0000 (10:19 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 42.4% (4453 of 10480 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoNEWS: Mention support for specifying vCPU address size
Jim Fehlig [Thu, 11 Aug 2022 17:21:11 +0000 (11:21 -0600)] 
NEWS: Mention support for specifying vCPU address size

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: retire QEMU_CAPS_VIRTIO_TX_ALG
Ján Tomko [Thu, 11 Aug 2022 13:34:59 +0000 (15:34 +0200)] 
qemu: retire QEMU_CAPS_VIRTIO_TX_ALG

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoqemu: always assume QEMU_CAPS_VIRTIO_TX_ALG
Ján Tomko [Thu, 11 Aug 2022 13:30:23 +0000 (15:30 +0200)] 
qemu: always assume QEMU_CAPS_VIRTIO_TX_ALG

Introduced back in 2010 by QEMU commit:
  commit a697a334b3c4d3250e6420f5d38550ea10eb5319
      virtio-net: Introduce a new bottom half packet TX

Released in QEMU 0.14.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agotests: qemuxml2xmltest: remove interface from disk test
Ján Tomko [Thu, 11 Aug 2022 13:29:33 +0000 (15:29 +0200)] 
tests: qemuxml2xmltest: remove interface from disk test

There is no need to specify an interface for a disk test.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoqemuDomainDetermineDiskChain: Remove 'report_broken' argument
Peter Krempa [Fri, 22 Jul 2022 09:47:36 +0000 (11:47 +0200)] 
qemuDomainDetermineDiskChain: Remove 'report_broken' argument

All callers pass 'true'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Assume and retire QEMU_CAPS_BLOCKDEV_BACKUP
Peter Krempa [Fri, 22 Jul 2022 09:41:59 +0000 (11:41 +0200)] 
qemu: Assume and retire QEMU_CAPS_BLOCKDEV_BACKUP

The blockdev-backup QMP command was introduced in qemu-2.3.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Assume support and retire QEMU_CAPS_BLOCK_WRITE_THRESHOLD
Peter Krempa [Fri, 22 Jul 2022 09:37:28 +0000 (11:37 +0200)] 
qemu: Assume support and retire QEMU_CAPS_BLOCK_WRITE_THRESHOLD

The event was introduced in qemu-2.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: capabilities: Retire QEMU_CAPS_QUERY_NAMED_BLOCK_NODES
Peter Krempa [Fri, 22 Jul 2022 09:34:59 +0000 (11:34 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_QUERY_NAMED_BLOCK_NODES

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Setup disk throttling for SD cards via monitor
Peter Krempa [Fri, 22 Jul 2022 09:29:54 +0000 (11:29 +0200)] 
qemu: Setup disk throttling for SD cards via monitor

Set it same way we set throttling for other disks in
qemuProcessSetupDiskThrottling.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Retire QEMU_CAPS_BLOCKDEV
Peter Krempa [Thu, 21 Jul 2022 15:16:23 +0000 (17:16 +0200)] 
qemu: Retire QEMU_CAPS_BLOCKDEV

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainDetermineDiskChain: Assume QEMU_CAPS_BLOCKDEV
Peter Krempa [Thu, 21 Jul 2022 15:14:35 +0000 (17:14 +0200)] 
qemuDomainDetermineDiskChain: Assume QEMU_CAPS_BLOCKDEV

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainValidateStorageSource: Remove 'maskBlockdev' argument
Peter Krempa [Thu, 21 Jul 2022 15:12:46 +0000 (17:12 +0200)] 
qemuDomainValidateStorageSource: Remove 'maskBlockdev' argument

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainValidateStorageSource: Remove QEMU_CAPS_BLOCKDEV validation
Peter Krempa [Thu, 21 Jul 2022 15:07:38 +0000 (17:07 +0200)] 
qemuDomainValidateStorageSource: Remove QEMU_CAPS_BLOCKDEV validation

While we assume that -blockdev is supported the validator had also some
corner cases for -drive. Since we use '-drive' exclusively for the
extremely rarely used SD cards it makes no sense to have the validation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainDiskGetBackendAlias: Assume QEMU_CAPS_BLOCKDEV is supported
Peter Krempa [Thu, 21 Jul 2022 15:04:37 +0000 (17:04 +0200)] 
qemuDomainDiskGetBackendAlias: Assume QEMU_CAPS_BLOCKDEV is supported

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainDiskBlockJobIsSupported: Assume QEMU_CAPS_BLOCKDEV is supported
Peter Krempa [Thu, 21 Jul 2022 14:58:50 +0000 (16:58 +0200)] 
qemuDomainDiskBlockJobIsSupported: Assume QEMU_CAPS_BLOCKDEV is supported

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainSecretStorageSourcePrepare: Remove cabapbility check when preparing cookies
Peter Krempa [Thu, 21 Jul 2022 14:27:57 +0000 (16:27 +0200)] 
qemuDomainSecretStorageSourcePrepare: Remove cabapbility check when preparing cookies

The capability is checked when we validate the source in the first
place. Also it won't make sense any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: domain: Assume QEMU_CAPS_BLOCKDEV for the domain private code
Peter Krempa [Thu, 21 Jul 2022 14:06:33 +0000 (16:06 +0200)] 
qemu: domain: Assume QEMU_CAPS_BLOCKDEV for the domain private code

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: command: Remove unused qemuGetDriveSourceString
Peter Krempa [Thu, 21 Jul 2022 13:28:23 +0000 (15:28 +0200)] 
qemu: command: Remove unused qemuGetDriveSourceString

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: command: Generate -drive for SD cards via JSON props
Peter Krempa [Thu, 21 Jul 2022 13:25:24 +0000 (15:25 +0200)] 
qemu: command: Generate -drive for SD cards via JSON props

Since we know we have a modern qemu at hand which can interpret the
dotted syntax, we can format the -drive needed for SD cards via the
common infrastructure we have for all blockdev stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: command: Delegate qemuBuildDriveStr to SD cards only
Peter Krempa [Thu, 21 Jul 2022 13:17:45 +0000 (15:17 +0200)] 
qemu: command: Delegate qemuBuildDriveStr to SD cards only

Remove the generic frontend-less -drive code from qemuBuildDriveStr by
assuming that we support only blockdev-enabled qemus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorAddDrive/qemuMonitorDriveDel
Peter Krempa [Thu, 21 Jul 2022 12:52:51 +0000 (14:52 +0200)] 
qemu: monitor: Remove unused qemuMonitorAddDrive/qemuMonitorDriveDel

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: block: Remove support for legacy disk hotplug/unplug
Peter Krempa [Thu, 21 Jul 2022 12:51:08 +0000 (14:51 +0200)] 
qemu: block: Remove support for legacy disk hotplug/unplug

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove 'driveAlias' argument of qemuBlockStorageSourceDetachPrepare
Peter Krempa [Thu, 21 Jul 2022 12:48:11 +0000 (14:48 +0200)] 
qemu: Remove 'driveAlias' argument of qemuBlockStorageSourceDetachPrepare

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: block: Remove unused qemuBlockStorageSourceChainDetachPrepareLegacy
Peter Krempa [Thu, 21 Jul 2022 12:46:06 +0000 (14:46 +0200)] 
qemu: block: Remove unused qemuBlockStorageSourceChainDetachPrepareLegacy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: hotplug: Remove pre-blockdev code paths
Peter Krempa [Thu, 21 Jul 2022 12:15:51 +0000 (14:15 +0200)] 
qemu: hotplug: Remove pre-blockdev code paths

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainRemoveDiskDevice: Remove special casing for disks on 'sd' bus
Peter Krempa [Thu, 21 Jul 2022 12:39:01 +0000 (14:39 +0200)] 
qemuDomainRemoveDiskDevice: Remove special casing for disks on 'sd' bus

SD card disks can't be detached, so it makes no sense to special case
them in the unplug code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Switch to -blockdev mode
Peter Krempa [Thu, 21 Jul 2022 12:33:06 +0000 (14:33 +0200)] 
qemuhotplugtest: Switch to -blockdev mode

Enable blockdev mode and convert the expected commands to the modern
equivalents in preparation for removing the old-style hotplug code
paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitor(Eject|Change)Media
Peter Krempa [Thu, 21 Jul 2022 11:10:56 +0000 (13:10 +0200)] 
qemu: monitor: Remove unused qemuMonitor(Eject|Change)Media

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: hotplug: Remove pre-blockdev code path from qemuDomainChangeEjectableMedia
Peter Krempa [Thu, 21 Jul 2022 11:08:00 +0000 (13:08 +0200)] 
qemu: hotplug: Remove pre-blockdev code path from qemuDomainChangeEjectableMedia

All media are changed in blockdev-instantiated cdroms now, remove the
old code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: driver: Remove remaining QEMU_CAPS_BLOCKDEV capability checks
Peter Krempa [Thu, 21 Jul 2022 11:06:00 +0000 (13:06 +0200)] 
qemu: driver: Remove remaining QEMU_CAPS_BLOCKDEV capability checks

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorBlockStatsUpdateCapacity
Peter Krempa [Thu, 21 Jul 2022 11:03:53 +0000 (13:03 +0200)] 
qemu: monitor: Remove unused qemuMonitorBlockStatsUpdateCapacity

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainBlocksStatsGather: Remove pre-blockdev code paths
Peter Krempa [Thu, 21 Jul 2022 11:01:58 +0000 (13:01 +0200)] 
qemuDomainBlocksStatsGather: Remove pre-blockdev code paths

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainBlockResize: Always refuse resize of empty/readonly disks
Peter Krempa [Thu, 21 Jul 2022 10:58:44 +0000 (12:58 +0200)] 
qemuDomainBlockResize: Always refuse resize of empty/readonly disks

The operation makes no sense regardless of the way how we specify disks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove pre-blockdev PFLASH setup
Peter Krempa [Wed, 20 Jul 2022 12:29:28 +0000 (14:29 +0200)] 
qemu: Remove pre-blockdev PFLASH setup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: command: Remove pre-blockdev floppy setup
Peter Krempa [Wed, 20 Jul 2022 12:15:44 +0000 (14:15 +0200)] 
qemu: command: Remove pre-blockdev floppy setup

With new qemu versions we setup floppies via -device.

Some legacy output tests were not modernized yet so the expected output
needs to be adjusted.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorDrivePivot
Peter Krempa [Wed, 20 Jul 2022 11:16:50 +0000 (13:16 +0200)] 
qemu: monitor: Remove unused qemuMonitorDrivePivot

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPivot
Peter Krempa [Wed, 20 Jul 2022 11:09:21 +0000 (13:09 +0200)] 
qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPivot

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorDiskNameLookup
Peter Krempa [Wed, 20 Jul 2022 10:42:14 +0000 (12:42 +0200)] 
qemu: monitor: Remove unused qemuMonitorDiskNameLookup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused arguments of qemuMonitorBlockStream
Peter Krempa [Wed, 20 Jul 2022 10:39:43 +0000 (12:39 +0200)] 
qemu: monitor: Remove unused arguments of qemuMonitorBlockStream

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPullCommon
Peter Krempa [Wed, 20 Jul 2022 10:23:38 +0000 (12:23 +0200)] 
qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPullCommon

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused arguments of qemuMonitorBlockCommit
Peter Krempa [Wed, 20 Jul 2022 10:15:55 +0000 (12:15 +0200)] 
qemu: monitor: Remove unused arguments of qemuMonitorBlockCommit

The 'persistjob' is always true and 'top' and 'base' are always NULL.
Adjust the functions to drop the arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: driver: Remove pre-blockdev code paths from qemuDomainBlockCommit
Peter Krempa [Wed, 20 Jul 2022 10:12:41 +0000 (12:12 +0200)] 
qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockCommit

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorDriveMirror
Peter Krempa [Wed, 20 Jul 2022 10:03:57 +0000 (12:03 +0200)] 
qemu: monitor: Remove unused qemuMonitorDriveMirror

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: driver: Remove pre-blockdev code paths from qemuDomainBlockCopyCommon
Peter Krempa [Wed, 20 Jul 2022 10:01:14 +0000 (12:01 +0200)] 
qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockCopyCommon

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: monitor: Remove unused qemuMonitorQueryNamedBlockNodes and clean up
Peter Krempa [Wed, 20 Jul 2022 09:26:12 +0000 (11:26 +0200)] 
qemu: monitor: Remove unused qemuMonitorQueryNamedBlockNodes and clean up

The top level API is unused so it can be removed but internally the JSON
version is called by other monitor commands which extract information
from the reply.

Thus qemuMonitorJSONQueryNamedBlockNodes is unexported and moved
appropriately.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: block: Remove unused qemuBlockGetNodeData
Peter Krempa [Wed, 20 Jul 2022 09:20:47 +0000 (11:20 +0200)] 
qemu: block: Remove unused qemuBlockGetNodeData

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainGetStatsBlock: Remove pre-blockdev code paths
Peter Krempa [Wed, 20 Jul 2022 09:19:05 +0000 (11:19 +0200)] 
qemuDomainGetStatsBlock: Remove pre-blockdev code paths

This function and its callees were a bit more entangled so remove the
pre-blockdev code separately.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: alias: Remove check for QEMU_CAPS_BLOCKDEV
Peter Krempa [Wed, 20 Jul 2022 07:24:50 +0000 (09:24 +0200)] 
qemu: alias: Remove check for QEMU_CAPS_BLOCKDEV

The only instance in this file can be simplified to avoid checking the
capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>