]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agodocs: Convert 'internals/command' to rst and move it to 'kbase/internals'
Peter Krempa [Tue, 5 Apr 2022 11:58:56 +0000 (13:58 +0200)]
docs: Convert 'internals/command' to rst and move it to 'kbase/internals'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: Convert 'docs' index page to rst
Peter Krempa [Mon, 4 Apr 2022 14:14:31 +0000 (16:14 +0200)]
docs: Convert 'docs' index page to rst

Along with the conversion we need to adapt the stylesheets to apply to
the new document similarly to how we do that in the knowledge base.

Note that one visible difference is that now a 'Documentation' heading
is visible on top of the page.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: kbase: Section of 'internals' documents into a subfolder
Peter Krempa [Tue, 5 Apr 2022 11:27:42 +0000 (13:27 +0200)]
docs: kbase: Section of 'internals' documents into a subfolder

Add an 'internals' subfolder to 'docs/kbase' to house all the documents
under internals. The output files are still under 'docs/kbase'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: Simplify passing of 'href_base' XSL variable
Peter Krempa [Tue, 5 Apr 2022 14:52:57 +0000 (16:52 +0200)]
docs: Simplify passing of 'href_base' XSL variable

Historically we had two top level XSL files for top level and nested
documents which only differ in what they pass for 'href_base' to the
main 'page.xsl' file.

We can instead pass the variable as argument from the build system so
that we have just one XSL file and also allow for more nested document
trees in the future.

The '404' page is special even with the current XSL way so we add a
special case for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agokbase: index: Split off 'internals' section
Peter Krempa [Tue, 5 Apr 2022 11:17:30 +0000 (13:17 +0200)]
kbase: index: Split off 'internals' section

Add a separate column of documents regarding internals of libvirt and
move the 'migrationinternals' and 'incrementalbackupinternals' pages
under the new heading.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Move validation checks from virDomainDiskDefIotuneParse into domain_validate.c
Moteen Shah [Mon, 11 Apr 2022 12:40:49 +0000 (18:10 +0530)]
conf: Move validation checks from virDomainDiskDefIotuneParse into domain_validate.c

Move validation from virDomainDiskDefIotuneParse into the validation callback.

Signed-off-by: Moteen Shah <codeguy.moteen@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: fix event registration for single event
Ján Tomko [Mon, 11 Apr 2022 07:30:12 +0000 (09:30 +0200)]
virsh: fix event registration for single event

Allocate a larger 'data' array than strictly needed
for simplicity and use 'ndata' as the index when
filling it to put the single event at the first unused
place, instead of at its index in the virshDomainEventCallbacks
array.

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

Fixes: c6bb2746933bbe65877a5f8a8d60e100b0bf8a59
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilterStateInitialize: Simplify and fix error handling
Tim Wiederhake [Fri, 8 Apr 2022 11:54:09 +0000 (13:54 +0200)]
nwfilterStateInitialize: Simplify and fix error handling

Under certain circumstances nwfilterStateInitialize could leak memory:
If e.g. the call to virNWFilterConfLayerInit fails, the error path
err_techdrivers_shutdown does not free the previously allocated memory
held in driver->stateDir.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirNWFilterDriverState: Destroy mutex safely
Tim Wiederhake [Fri, 8 Apr 2022 11:46:23 +0000 (13:46 +0200)]
virNWFilterDriverState: Destroy mutex safely

Allow nwfilterStateCleanupLocked to be called on a partially constructed
driver object.

This enables the next patch to simplify and fix error handling in
nwfilterStateInitialize.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilterDriverRemoveDBusMatches: Prevent unsubscribing from null id
Tim Wiederhake [Fri, 8 Apr 2022 11:42:30 +0000 (13:42 +0200)]
nwfilterDriverRemoveDBusMatches: Prevent unsubscribing from null id

Allow nwfilterDriverRemoveDBusMatches to be called without
nwfilterDriverInstallDBusMatches being called previously.

This enables a later patch to use nwfilterDriverRemoveDBusMatches
as a cleanup function safely.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirNWFilterSnoopState: Prevent mutex leak
Tim Wiederhake [Fri, 8 Apr 2022 10:50:35 +0000 (12:50 +0200)]
virNWFilterSnoopState: Prevent mutex leak

virNWFilterDHCPSnoopShutdown would never destroy the mutexes created
in virNWFilterDHCPSnoopInit. Additionally, if in virNWFilterDHCPSnoopInit
the call to virMutexInitRecursive succeeds and the call to virMutexInit
fails, this would lead to either virNWFilterSnoopState.snoopLock being
initialized twice or virNWFilterSnoopState.activeLock destroyed without
being initialized first.

This enables a later patch to use virNWFilterDHCPSnoopShutdown as a
cleanup function safely, as it is a no-op if virNWFilterSnoopState was
not yet initialized.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirNWFilterObjListFree: Prevent null pointer derefernce
Tim Wiederhake [Fri, 8 Apr 2022 10:38:14 +0000 (12:38 +0200)]
virNWFilterObjListFree: Prevent null pointer derefernce

Allow virNWFilterObjListFree to be called with a NULL argument.
This enables a later patch to use virNWFilterObjListFree as a
cleanup function safely, as it is a no-op if virNWFilterObj was
not yet initialized.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Drop QEMU_CAPS_INCOMING_DEFER
Jiri Denemark [Thu, 7 Apr 2022 16:04:38 +0000 (18:04 +0200)]
qemu: Drop QEMU_CAPS_INCOMING_DEFER

The capability is not used anymore since "-incoming defer" is supported
by all QEMU versions we care about.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Simplify qemuProcessIncomingDef
Jiri Denemark [Thu, 7 Apr 2022 15:30:20 +0000 (17:30 +0200)]
qemu: Simplify qemuProcessIncomingDef

All QEMU releases currently supported by libvirt already understand
"-incoming defer". We can drop the code handling "-incoming URI".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovboxSetBootDeviceOrder: Remove whitespace alignment in VIR_DEBUG statements
Peter Krempa [Mon, 28 Mar 2022 14:15:12 +0000 (16:15 +0200)]
vboxSetBootDeviceOrder: Remove whitespace alignment in VIR_DEBUG statements

Don't try to align the output, it's not future-proof and it's for
debugging only.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainLoaderDefFormat: Use modern XML formatting approach
Peter Krempa [Mon, 28 Mar 2022 13:18:39 +0000 (15:18 +0200)]
virDomainLoaderDefFormat: Use modern XML formatting approach

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirXMLFormatElement: Introduce virXMLFormatElementInternal
Peter Krempa [Mon, 28 Mar 2022 14:00:58 +0000 (16:00 +0200)]
virXMLFormatElement: Introduce virXMLFormatElementInternal

The new function aggregates the internal working of virXMLFormatElement
and virXMLFormatElementEmpty and also allows skipping the newline
after the opening tag to allow using this helper also in cases where we
don't format any child elements but directly a value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodrivers: Group global features together
Andrea Bolognani [Wed, 16 Feb 2022 17:50:42 +0000 (18:50 +0100)]
drivers: Group global features together

All these features are supposed to be handled by the call to
virDriverFeatureIsGlobal() placed right above the switch
statement, so if any of them is actually encountered inside
the switch statement it means there's a bug in the driver and
we should report an error.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'formatstoragecaps' page to rST
Peter Krempa [Thu, 10 Mar 2022 16:57:54 +0000 (17:57 +0100)]
docs: Convert 'formatstoragecaps' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agodocs: Convert 'formatdomaincaps' to rST
Peter Krempa [Thu, 10 Mar 2022 16:57:53 +0000 (17:57 +0100)]
docs: Convert 'formatdomaincaps' to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoci: Refresh Dockerfiles and vars files
Erik Skultety [Wed, 6 Apr 2022 11:14:56 +0000 (13:14 +0200)]
ci: Refresh Dockerfiles and vars files

In this batch:
- dnsmasq is dropped as build dependency
- Alpine Edge rpcgen package collision fix

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: convert 'csharp' page to rst
Peter Krempa [Mon, 4 Apr 2022 12:49:54 +0000 (14:49 +0200)]
docs: convert 'csharp' page to rst

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: csharp: Remove project-specific information
Peter Krempa [Mon, 4 Apr 2022 12:13:37 +0000 (14:13 +0200)]
docs: csharp: Remove project-specific information

The enumeration of functions and types supported by the bindings was
moved to the 'README.rst' file in the 'libvirt-csharp' repo:

https://gitlab.com/libvirt/libvirt-csharp/-/merge_requests/8

Remove the corresponding bits from the main repository.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: convert 'windows' page to rst
Pavel Hrdina [Thu, 25 Mar 2021 17:08:51 +0000 (18:08 +0100)]
docs: convert 'windows' page to rst

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: Move 'tlscerts' page to 'kbase/'
Peter Krempa [Mon, 4 Apr 2022 14:40:45 +0000 (16:40 +0200)]
docs: Move 'tlscerts' page to 'kbase/'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: convert 'tlscerts' page to rst
Pavel Hrdina [Thu, 25 Mar 2021 16:09:04 +0000 (17:09 +0100)]
docs: convert 'tlscerts' page to rst

Note that links from the first table leading to sections of this
document further below were removed for simplicity.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: convert 'python' page to rst
Pavel Hrdina [Thu, 25 Mar 2021 15:58:44 +0000 (16:58 +0100)]
docs: convert 'python' page to rst

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: convert 'dbus' page to rst
Pavel Hrdina [Tue, 23 Mar 2021 23:10:39 +0000 (00:10 +0100)]
docs: convert 'dbus' page to rst

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agolib: Set up cpuset controller for restrictive numatune
Michal Privoznik [Fri, 1 Apr 2022 12:30:05 +0000 (14:30 +0200)]
lib: Set up cpuset controller for restrictive numatune

The aim of 'restrictive' numatune mode is to rely solely on
CGroups to have QEMU running on configured NUMA nodes.  However,
we were never setting the cpuset controller when a domain was
starting up. We are doing so only when
virDomainSetNumaParameters() is called (aka live pinning).

This is obviously wrong. Fortunately, fix is simple as
'restrictive' is similar to 'strict' - every location where
VIR_DOMAIN_NUMATUNE_MEM_STRICT occurs can be audited and
VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE case can be added.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2070380
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoch: Explicitly forbid live changing nodeset for strict numatune
Michal Privoznik [Fri, 1 Apr 2022 13:35:58 +0000 (15:35 +0200)]
ch: Explicitly forbid live changing nodeset for strict numatune

This is similar to v7.10.0-354-g06f405c627 except this time it
fixes CH driver.

With strict numatune we can't guarantee that all memory is moved
to new location. Therefore, let's forbid moving memory in that
case. However, allow it for restrictive mode, which is documented
to be best effort.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agohypervisor: Drop dead code in virDomainCgroupSetupGlobalCpuCgroup()
Michal Privoznik [Fri, 1 Apr 2022 11:14:59 +0000 (13:14 +0200)]
hypervisor: Drop dead code in virDomainCgroupSetupGlobalCpuCgroup()

Since its introduction in v1.3.2-43-gef1fa55e46 there is a dead
code in virDomainCgroupSetupGlobalCpuCgroup() (well,
qemuSetupGlobalCpuCgroup() back then). The code formats NUMA
nodeset but never sets it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Don't short circuit around virDomainCgroupSetupVcpuBW()
Michal Privoznik [Fri, 1 Apr 2022 11:13:10 +0000 (13:13 +0200)]
lib: Don't short circuit around virDomainCgroupSetupVcpuBW()

The virDomainCgroupSetupVcpuBW() is a NOP if both period and
quota to set are zero. There's no need to check in all the
callers for this special case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Use virReportSystemError() more
Michal Privoznik [Tue, 29 Mar 2022 08:10:59 +0000 (10:10 +0200)]
lib: Use virReportSystemError() more

Instead of reporting virReportError(..., g_strerror(), ...) let's
use proper virReportSystemError(). Generated with help of cocci:

  @@
  expression c;
  @@
      <...
  -   virReportError(c,
  +   virReportSystemError(errno,
                         ...,
  -                      g_strerror(errno),
                         ...);
      ...>

But then I had to hand fix format strings, because I'm not sure
if cocci even knows how to do that. And even if it did, I surely
don't.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotools: snapshot: remove pointless checks
Ján Tomko [Fri, 1 Apr 2022 13:11:01 +0000 (15:11 +0200)]
tools: snapshot: remove pointless checks

There's no need to check whether a flag is not set just to set it
in that case.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: Rename @main variable in qemuDomainRemoveLogs()
Michal Privoznik [Wed, 6 Apr 2022 08:10:24 +0000 (10:10 +0200)]
qemu: Rename @main variable in qemuDomainRemoveLogs()

Older GCC fails to understand that 'char *main' is a variable and
not main() function. Rename the variable to appease old GCC.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Nikolay Shirokovskiy <nshirokovskiy@openvz.org>
3 years agoAUTHORS: change my (Nikolay Shirokovskiy) email
Nikolay Shirokovskiy [Wed, 6 Apr 2022 07:56:10 +0000 (10:56 +0300)]
AUTHORS: change my (Nikolay Shirokovskiy) email

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@openvz.org>
3 years agotools: support --remove-logs flag on destroing domain
Nikolay Shirokovskiy [Mon, 14 Feb 2022 12:19:53 +0000 (15:19 +0300)]
tools: support --remove-logs flag on destroing domain

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: support VIR_DOMAIN_DESTROY_REMOVE_LOGS flag
Nikolay Shirokovskiy [Mon, 14 Feb 2022 12:19:52 +0000 (15:19 +0300)]
qemu: support VIR_DOMAIN_DESTROY_REMOVE_LOGS flag

Note that we attempt to remove logs only if virtlogd is in use.
Otherwise we do not know the pattern for rotated files.

For example for VM named "foo" we can not use "foo.log*" pattern to
remove rotated logs as we can have VM named "foo.log" with log
"foo.log.log".  We can add extra check that filename does not end with
".log" but for VM "foo.log" we can have rotated log "foo.log.log.1". Ok
let's check we don't have "log" in filename part corresponging to * but
what if someone will use logrotate with "%Y.log-%m-%d" 'dateformat'
option. In this case the check will exclude proper rotated files.

Yes, the last example if quite artificial but it shows it is difficult
to find out correctly rotated files when rotated files pattern is not
known. Thus the above decision only to support case with virtlogd when
we know the pattern.

Another reason for not removing log files when logrotate is present is
that due to races some files can escape deletion. For example foo.log.3
will be rotated to foo.log.4 after removing function will read directory
files and thus foo.log.4 will not be deleted.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolibvirt: introduce VIR_DOMAIN_DESTROY_REMOVE_LOGS flag
Nikolay Shirokovskiy [Mon, 14 Feb 2022 12:19:51 +0000 (15:19 +0300)]
libvirt: introduce VIR_DOMAIN_DESTROY_REMOVE_LOGS flag

If this flag is set on calling virDomainDestroyFlags flags then remove
per domain logs if possible.

This can be used by libguestfs to delete logs for temporary domain.
Otherwise such logs will stay wasting disk resources.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Remove any reference of KVM device assignment
Michal Privoznik [Tue, 5 Apr 2022 08:38:47 +0000 (10:38 +0200)]
virsh: Remove any reference of KVM device assignment

The KVM device assignment was removed in v5.7.0-rc1~103 but virsh
and its manpage still mention it. Don't do that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirportallocator: Use automatic mutex management
Tim Wiederhake [Fri, 25 Mar 2022 09:37:03 +0000 (10:37 +0100)]
virportallocator: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_monitor: Use automatic mutex management
Tim Wiederhake [Fri, 25 Mar 2022 09:20:08 +0000 (10:20 +0100)]
ch_monitor: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodatatypes: Use automatic mutex management
Tim Wiederhake [Thu, 24 Mar 2022 12:26:29 +0000 (13:26 +0100)]
datatypes: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovbox_common: Use automatic mutex management
Tim Wiederhake [Thu, 24 Mar 2022 12:20:50 +0000 (13:20 +0100)]
vbox_common: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_agent: Use automatic mutex management
Tim Wiederhake [Thu, 24 Mar 2022 12:13:14 +0000 (13:13 +0100)]
qemu_agent: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonode_device_udev: Use automatic mutex management
Tim Wiederhake [Thu, 24 Mar 2022 08:30:41 +0000 (09:30 +0100)]
node_device_udev: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agointerface_backend_netcf: Use automatic mutex management
Tim Wiederhake [Thu, 24 Mar 2022 08:18:41 +0000 (09:18 +0100)]
interface_backend_netcf: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonode_device_driver: Use automatic mutex management
Tim Wiederhake [Tue, 22 Mar 2022 16:47:44 +0000 (17:47 +0100)]
node_device_driver: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobridge_driver: Use automatic mutex management
Tim Wiederhake [Tue, 22 Mar 2022 16:47:08 +0000 (17:47 +0100)]
bridge_driver: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdaemon: Use automatic mutex management
Tim Wiederhake [Tue, 22 Mar 2022 16:28:38 +0000 (17:28 +0100)]
virnetdaemon: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_command: Generate cmd line for virtio-net.rss hash properties
Andrew Melnychenko [Sun, 9 Jan 2022 21:07:37 +0000 (23:07 +0200)]
qemu_command: Generate cmd line for virtio-net.rss hash properties

Also, validate that the requested feature is supported by QEMU.

Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_capabilities: Add capability for virtio-net "rss" and "hash".
Andrew Melnychenko [Sun, 9 Jan 2022 21:07:36 +0000 (23:07 +0200)]
qemu_capabilities: Add capability for virtio-net "rss" and "hash".

Introduce QEMU_CAPS_VIRTIO_RSS capability which tracks
virtio-net.rss attribute introduced in qemu-5.2.

Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodomain_conf: Add configs for virtio net RSS and Hash report.
Andrew Melnychenko [Sun, 9 Jan 2022 21:07:35 +0000 (23:07 +0200)]
domain_conf: Add configs for virtio net RSS and Hash report.

Added "rss" and "rss_hash_report" configuration that should be
used with qemu virtio RSS. Both options are triswitches. Used as
"driver" options and affects only NIC with model type "virtio".
In other patches - options should turn on virtio-net RSS and hash
properties.

Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonetwork: Convert managed property of hostdev-pci ports correctly
Andrea Bolognani [Thu, 24 Mar 2022 18:32:13 +0000 (19:32 +0100)]
network: Convert managed property of hostdev-pci ports correctly

virNetworkForwardDef.managed is a bool but
virNetworkPortDef.hostdevpci.managed is a virTristateBool, which
means that the current code performs the following incorrect
conversion:

  false -> BOOL_ABSENT
  true  -> BOOL_YES

Using the virTristateBoolFromBool() helper solves the issue.

Fixes: 6cb0ec48bd95c95489a987e05a88e8bcf1f9109c
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Format managed property of hostdev-pci ports correctly
Andrea Bolognani [Thu, 24 Mar 2022 18:07:40 +0000 (19:07 +0100)]
conf: Format managed property of hostdev-pci ports correctly

The property is parsed using virTristateBoolTypeFromString() but
formatted as if it was a regular bool, which results in the
following incorrect conversion:

  BOOL_ABSENT -> managed='no'
  BOOL_YES    -> managed='yes'
  BOOL_NO     -> managed='yes'

Use the virTristateBoolTypeToString() helper to ensure the
setting can survive a roundtrip conversion.

Fixes: 4b4a981d60d3372fb73bb3546ab1052844b2e3d5
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Restore error checking in VideoAccelDefParseXML()
Andrea Bolognani [Thu, 24 Mar 2022 19:15:54 +0000 (20:15 +0100)]
conf: Restore error checking in VideoAccelDefParseXML()

The check that ensures that at least one property among accel3d,
accel2d and rendernode has been provided by the user had been
lost during the conversion to virXMLPropTristateBool().

Fixes: 0fe2d8dd335054fae38b46bbbac58a4662e1a1d0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Don't ignore XMLParseAllowReboot() errors
Andrea Bolognani [Thu, 24 Mar 2022 18:48:08 +0000 (19:48 +0100)]
qemu: Don't ignore XMLParseAllowReboot() errors

The function may fail and report an error, in which case we
should not just continue as if nothing happened.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Accept <allowReboot value='default'/>
Andrea Bolognani [Thu, 24 Mar 2022 18:47:16 +0000 (19:47 +0100)]
qemu: Accept <allowReboot value='default'/>

Up until a few commits ago, libvirt produced this XML and so
we need to be able to read it back to prevent a bunch of

  error : virXMLPropEnumInternal:516 : XML error: Invalid value
  for attribute 'value' in element 'allowReboot': 'default'

messages from being logged on daemon upgrade when there are
running guests.

Fixes: 0fe2d8dd335054fae38b46bbbac58a4662e1a1d0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: Introduce virXMLPropTristateBoolAllowDefault()
Andrea Bolognani [Thu, 24 Mar 2022 18:46:12 +0000 (19:46 +0100)]
util: Introduce virXMLPropTristateBoolAllowDefault()

We need it for a single scenario in which prop='default' has to
be treated as valid input.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Format <allowReboot> conditionally
Andrea Bolognani [Thu, 24 Mar 2022 18:49:40 +0000 (19:49 +0100)]
qemu: Format <allowReboot> conditionally

If the value is VIR_TRISTATE_BOOL_ABSENT we should just omit
the element entirely.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Use virTristateBoolToBool() more
Andrea Bolognani [Fri, 25 Mar 2022 14:53:54 +0000 (15:53 +0100)]
conf: Use virTristateBoolToBool() more

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Don't pass PROP_NONZERO to virXMLPropTristateBool()
Andrea Bolognani [Thu, 24 Mar 2022 13:04:09 +0000 (14:04 +0100)]
conf: Don't pass PROP_NONZERO to virXMLPropTristateBool()

It's the default behavior.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: Fixing compiler warning in cputest
Boris Fiuczynski [Mon, 4 Apr 2022 18:22:37 +0000 (20:22 +0200)]
tests: Fixing compiler warning in cputest

Found when building on Fedora 36 on s390x.

 C compiler for the host machine: gcc (gcc 12.0.1 "gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)")
 C linker for the host machine: gcc ld.bfd 2.37-24

 In function ‘cpuTestUpdateLiveCompare’,
     inlined from ‘cpuTestUpdateLive’ at ../dist-unpack/libvirt-8.2.5/tests/cputest.c:784:12:
 ../dist-unpack/libvirt-8.2.5/tests/cputest.c:696:21: warning: potential null pointer dereference [-Wnull-dereference]
   696 |              featAct->policy == VIR_CPU_FEATURE_REQUIRE) ||
       |              ~~~~~~~^~~~~~~~

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Provide completer for PCI backend drivers
Amneesh Singh [Sat, 2 Apr 2022 10:31:47 +0000 (16:01 +0530)]
virsh: Provide completer for PCI backend drivers

Related: https://gitlab.com/libvirt/libvirt/-/issues/9
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Provide completer for CPU architectures
Amneesh Singh [Sat, 2 Apr 2022 10:31:46 +0000 (16:01 +0530)]
virsh: Provide completer for CPU architectures

Related: https://gitlab.com/libvirt/libvirt/-/issues/9
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Provide completer for virtualization types
Amneesh Singh [Sat, 2 Apr 2022 10:31:45 +0000 (16:01 +0530)]
virsh: Provide completer for virtualization types

Related: https://gitlab.com/libvirt/libvirt/-/issues/9
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_STORAGE_WERROR and QEMU_CAPS_USB_STORAGE_WERROR
Peter Krempa [Mon, 14 Feb 2022 16:15:59 +0000 (17:15 +0100)]
qemu: capabilities: Retire QEMU_CAPS_STORAGE_WERROR and QEMU_CAPS_USB_STORAGE_WERROR

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume QEMU_CAPS_STORAGE_WERROR
Peter Krempa [Mon, 14 Feb 2022 16:10:01 +0000 (17:10 +0100)]
qemu: Always assume QEMU_CAPS_STORAGE_WERROR

All supported QEMUs now accept werror/rerror as argument for the
frontend disk device, so we can remove the old code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_OVERCOMMIT
Peter Krempa [Wed, 9 Feb 2022 16:21:33 +0000 (17:21 +0100)]
qemu: capabilities: Retire QEMU_CAPS_OVERCOMMIT

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: Always assume QEMU_CAPS_OVERCOMMIT
Peter Krempa [Thu, 10 Feb 2022 11:57:26 +0000 (12:57 +0100)]
qemu: command: Always assume QEMU_CAPS_OVERCOMMIT

Starting with qemu-3.1 we always have the '-overcommit' argument and use
it instead of '-realtime'. Remove the capability check and fix all
fake-caps tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE
Peter Krempa [Wed, 9 Feb 2022 16:21:33 +0000 (17:21 +0100)]
qemu: capabilities: Retire QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE

The flag was based on a version check which no longer made sense. Remove
the flag by replacing it's only use by an arch-check which is equivalent
at this point.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE
Peter Krempa [Thu, 10 Feb 2022 11:55:47 +0000 (12:55 +0100)]
qemu: capabilities: Retire QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE
Peter Krempa [Thu, 3 Feb 2022 12:31:28 +0000 (13:31 +0100)]
qemu: Always assume QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE

All qemu versions now support FD passing either directly or via FDset.
Assume that we always have this capability so that we can simplify
chardev handling in many cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Remove probing of QEMU_CAPS_NUMA via 'query-command-line-options'
Peter Krempa [Thu, 10 Feb 2022 10:30:19 +0000 (11:30 +0100)]
qemu: capabilities: Remove probing of QEMU_CAPS_NUMA via 'query-command-line-options'

For modern qemu versions we use the presence of 'set-numa-node' qmp
command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Remove tautological version checks
Peter Krempa [Thu, 10 Feb 2022 10:04:42 +0000 (11:04 +0100)]
qemu: capabilities: Remove tautological version checks

Some version checks no longer make sense as the minimum supported qemu
is now qemu-3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Formally deprecate support for qemu < 3.1
Peter Krempa [Thu, 3 Feb 2022 12:14:29 +0000 (13:14 +0100)]
qemu: Formally deprecate support for qemu < 3.1

As of April 23 2022, Ubuntu 20.04 will be out for two years, which means
we no longer have to support Ubuntu 18.04 along with qemu-2.11 shipped
with it.

This then brings the minimum qemu version we have to support to
qemu-3.1:

   Debian 10/Stable: 3.1
 OpenSUSE Leap 15.3: 5.2
       Ubuntu 20.04: 4.2
    RHEL/Centos 8.4: 4.2

Next event in this space will be 2023/07/06 when Debian 11 will be out
for two years.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemucapabilities: Remove qemu-3.0 test data
Peter Krempa [Thu, 10 Feb 2022 09:43:17 +0000 (10:43 +0100)]
tests: qemucapabilities: Remove qemu-3.0 test data

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemucapabilities: Remove qemu-2.12 test data
Peter Krempa [Thu, 10 Feb 2022 09:43:17 +0000 (10:43 +0100)]
tests: qemucapabilities: Remove qemu-2.12 test data

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemucapabilities: Remove qemu-2.11 test data
Peter Krempa [Thu, 10 Feb 2022 09:43:17 +0000 (10:43 +0100)]
tests: qemucapabilities: Remove qemu-2.11 test data

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2agvtest: Retire tests based on qemu-3.0
Peter Krempa [Thu, 3 Feb 2022 12:18:32 +0000 (13:18 +0100)]
qemuxml2agvtest: Retire tests based on qemu-3.0

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2agvtest: Retire tests based on qemu-2.12
Peter Krempa [Thu, 3 Feb 2022 12:18:32 +0000 (13:18 +0100)]
qemuxml2agvtest: Retire tests based on qemu-2.12

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2agvtest: Retire tests based on qemu-2.11
Peter Krempa [Thu, 3 Feb 2022 12:18:32 +0000 (13:18 +0100)]
qemuxml2agvtest: Retire tests based on qemu-2.11

Upcoming patches will raise the minimum required qemu version to 3.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoci: Drop Ubuntu 1804
Peter Krempa [Tue, 15 Feb 2022 09:02:24 +0000 (10:02 +0100)]
ci: Drop Ubuntu 1804

As of April 23 2022, Ubuntu 20.04 will be out for two years, which per
our platform support policy means we no longer have to support
Ubuntu 18.04.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonews: Document virtio-iommu
Andrea Bolognani [Fri, 8 Oct 2021 14:30:16 +0000 (16:30 +0200)]
news: Document virtio-iommu

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Document virtio-iommu
Andrea Bolognani [Fri, 8 Oct 2021 14:28:48 +0000 (16:28 +0200)]
docs: Document virtio-iommu

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Generate command line for virtio-iommu
Andrea Bolognani [Fri, 24 Sep 2021 17:29:37 +0000 (19:29 +0200)]
qemu: Generate command line for virtio-iommu

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Add test for virtio-iommu address
Andrea Bolognani [Thu, 7 Oct 2021 17:44:26 +0000 (19:44 +0200)]
tests: Add test for virtio-iommu address

virtio-iommu needs to be an integrated device, and our address
assignment code will make sure that is the case. If the user has
provided an explicit address, however, we should make sure any
addresses pointing to a different bus are rejected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Validate address type for virtio-iommu
Andrea Bolognani [Thu, 7 Oct 2021 17:53:45 +0000 (19:53 +0200)]
qemu: Validate address type for virtio-iommu

virtio-iommu is a PCI device and attempts to use a different
address type should be rejected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Assign PCI address to virtio-iommu
Andrea Bolognani [Thu, 23 Sep 2021 17:29:07 +0000 (19:29 +0200)]
qemu: Assign PCI address to virtio-iommu

The device is configured to be an integrated endpoint, as is
necessary for it to function correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Add virDomainDeviceInfo to virDomainIOMMUDef
Andrea Bolognani [Thu, 23 Sep 2021 14:28:15 +0000 (16:28 +0200)]
conf: Add virDomainDeviceInfo to virDomainIOMMUDef

This is needed so that IOMMU devices can have addresses.

Existing IOMMU devices (intel-iommu and SMMUv3) are system
devices and as such don't have an address associated to them, but
virtio-iommu is a PCI device and needs one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Validate use of ACPI with virtio-iommu
Andrea Bolognani [Thu, 7 Oct 2021 16:47:20 +0000 (18:47 +0200)]
qemu: Validate use of ACPI with virtio-iommu

virtio-iommu doesn't work without ACPI, so we need to make sure
the latter is enabled.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Validate capabilities for virtio-iommu
Andrea Bolognani [Thu, 7 Oct 2021 17:35:45 +0000 (19:35 +0200)]
qemu: Validate capabilities for virtio-iommu

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Validate machine type used with virtio-iommu
Andrea Bolognani [Wed, 22 Sep 2021 17:02:17 +0000 (19:02 +0200)]
qemu: Validate machine type used with virtio-iommu

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Add test cases for virtio-iommu
Andrea Bolognani [Thu, 23 Sep 2021 12:46:23 +0000 (14:46 +0200)]
tests: Add test cases for virtio-iommu

These represent valid uses of the device.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Introduce virtio model for <iommu>
Andrea Bolognani [Thu, 23 Sep 2021 17:40:55 +0000 (19:40 +0200)]
conf: Introduce virtio model for <iommu>

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Introduce QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS
Andrea Bolognani [Wed, 6 Oct 2021 16:35:39 +0000 (18:35 +0200)]
qemu: Introduce QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS

This capability detects the availability of the boot-bypass
property of the virtio-iommu-pci device.

This property was only introduced in QEMU 7.0 but, since the
device has been around for much longer, we end up querying its
properties for several more releases. As I don't have convenient
access to the 10+ binaries necessary to regenerate the replies,
I just put some fake data in there.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI
Andrea Bolognani [Wed, 22 Sep 2021 17:15:01 +0000 (19:15 +0200)]
qemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI

This capability detects the availability of the virtio-iommu-pci
device.

Note that, while this device is present even in somewhat old
versions of QEMU, it's only some recent changes that made it
actually usable for our purposes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Tweak some code
Andrea Bolognani [Thu, 23 Sep 2021 14:44:42 +0000 (16:44 +0200)]
qemu: Tweak some code

The altered code is functionally equivalent to the previous one,
but it's already laid down in a way that will make further
changes easier and less messy.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Introduce VIR_PCI_CONNECT_INTEGRATED
Andrea Bolognani [Mon, 27 Sep 2021 13:49:23 +0000 (15:49 +0200)]
conf: Introduce VIR_PCI_CONNECT_INTEGRATED

This new flag can be used to convince the PCI address assignment
algorithm to place a device directly on the root bus. It will be
used to implement support for virtio-iommu, which needs to be an
integrated device in order to work correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Add capabilities for QEMU 7.0.0 on aarch64
Andrea Bolognani [Fri, 18 Mar 2022 14:10:56 +0000 (15:10 +0100)]
tests: Add capabilities for QEMU 7.0.0 on aarch64

The QEMU binary is built from the v7.0.0-rc2 tag.

This causes the argument to -device to be generated in JSON
format, same as what 1a691fe1c840 has done for x86_64.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>