]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agoqemu: Remove scsi parameter for vhost-user-blk for qemu < 4.2
shenjiatong [Sat, 22 Jan 2022 04:10:35 +0000 (12:10 +0800)]
qemu: Remove scsi parameter for vhost-user-blk for qemu < 4.2

When trying to attach vhost-user-blk device to virtual machine using
qemu < 4.2 libvirt would mistakenly add a scsi=off parameter, which is
not supported by qemu.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/265
Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2argvtest: disk-vhostuser: Add invocation for qemu-4.2
Peter Krempa [Thu, 13 Jan 2022 11:47:17 +0000 (12:47 +0100)]
qemuxml2argvtest: disk-vhostuser: Add invocation for qemu-4.2

With qemu versions prior to qemu-5.0 we'll format 'scsi=off' for
virtio-blk disks, but also for vhost-user-blk. This is a bug as it's not
supported.

Add a test case to show that wrong configuration is generated by adding
running 'disk-vhostuser' test case on capabilities from qemu-4.2.

For this to be possible it's required to enable shared memory via NUMA
configuration as old QEMU's don't allow configuration of the default
memory backend. This is achieved by adding a copy of the
'disk-vhostuser' XML with NUMA enabled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agomeson: Explicitly specify run_command's check parameter
Martin Kletzander [Sat, 22 Jan 2022 19:30:11 +0000 (20:30 +0100)]
meson: Explicitly specify run_command's check parameter

An update to meson 0.61.1 meant that it started showing warnings due to the fact
that the default for run_command's 'check' parameter is going to change.  It
unveiled the fact that we were even missing that parameter in some calls where
we expected different outcome.  To make sure the behaviour does not change
specify the parameter explicitly.  In places where we check for the return code
the parameter should be 'false' so that meson does not fail.  In all other cases
the parameter should be set to 'true' to make sure possible failure also stops
meson.

The warning in meson was added in https://github.com/mesonbuild/meson/pull/9304

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoesx: Do not return root objects in a lookup
Martin Kletzander [Sat, 22 Jan 2022 19:29:43 +0000 (20:29 +0100)]
esx: Do not return root objects in a lookup

The lookups in esx_vi work a bit differently that we are used to.  The filters
(travelsalSpec and selectSet) choose how to look up the objects, but given a
root object the lookup lists all the objects of a requested type inside it as
well as the root object itself.  We then go through the results and find the one
which has the same name as was requested.  However in a case with nested folders
of a same name this could break when the first returned object in the list is
the parent folder as we'd select it only based on the name.  To avoid this also
add a check that the candidate we are trying to pick is not exactly the same
object (reference) as the root object.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agodocs: Fix spelling
Tim Wiederhake [Mon, 24 Jan 2022 08:41:44 +0000 (09:41 +0100)]
docs: Fix spelling

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
3 years agobhyve: handle all enum values in switches
Ján Tomko [Fri, 21 Jan 2022 17:01:29 +0000 (18:01 +0100)]
bhyve: handle all enum values in switches

Recent commits switched some variables to enums but did not
fix the warnings in the bhyve driver.

Fixes: 0eb42087c7907f43c114cb57b5ff2cf2a52dfea4
Fixes: a1ce98061c9a3f9ced367b2b9a3fe4071930a128
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virDomainHostdevDefParseXMLSubsys() to virXMLProp*()
Michal Privoznik [Thu, 20 Jan 2022 12:58:59 +0000 (13:58 +0100)]
conf: Convert virDomainHostdevDefParseXMLSubsys() to virXMLProp*()

After previous cleanups, the virDomainHostdevDefParseXMLSubsys()
function uses a mixture of virXMLProp*() and the old
virXMLPropString() + virXXXTypeFromString() patterns. Rework it
so that virXMLProp*() is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virNetworkPortDefParseXML() to virXMLProp*()
Michal Privoznik [Fri, 21 Jan 2022 09:19:34 +0000 (10:19 +0100)]
conf: Convert virNetworkPortDefParseXML() to virXMLProp*()

After previous cleanups, the virNetworkPortDefParseXML() function
uses a mixture of virXMLProp*() and the old virXMLPropString() +
virXXXTypeFromString() patterns. Rework it so that virXMLProp*()
is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virDomainNetDefParseXML() to virXMLProp*()
Michal Privoznik [Thu, 20 Jan 2022 12:15:03 +0000 (13:15 +0100)]
conf: Convert virDomainNetDefParseXML() to virXMLProp*()

After previous cleanups, the virDomainNetDefParseXML() function
uses a mixture of virXMLProp*() and the old virXMLPropString() +
virXXXTypeFromString() patterns. Rework it so that virXMLProp*()
is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virDomainFSDefParseXML() to virXMLProp*()
Michal Privoznik [Thu, 20 Jan 2022 12:14:53 +0000 (13:14 +0100)]
conf: Convert virDomainFSDefParseXML() to virXMLProp*()

After previous cleanups, the virDomainFSDefParseXML() function
uses a mixture of virXMLProp*() and the old virXMLPropString() +
virXXXTypeFromString() patterns. Rework it so that virXMLProp*()
is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virDomainDefParseBootXML() to virXMLProp*()
Michal Privoznik [Thu, 20 Jan 2022 20:57:49 +0000 (21:57 +0100)]
conf: Convert virDomainDefParseBootXML() to virXMLProp*()

After previous cleanups, the virDomainDefParseBootXML() function
uses a mixture of virXMLProp*() and the old virXMLPropString() +
virXXXTypeFromString() patterns. Rework it so that virXMLProp*()
is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: Convert virCPUDefParseXML() to virXMLProp*()
Michal Privoznik [Thu, 20 Jan 2022 20:57:35 +0000 (21:57 +0100)]
conf: Convert virCPUDefParseXML() to virXMLProp*()

After previous cleanups, the virCPUDefParseXML() function uses a
mixture of virXMLProp*() and the old virXMLPropString() +
virXXXTypeFromString() patterns. Rework it so that virXMLProp*()
is used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Almost eliminate use of virTristateBoolTypeFromString()
Michal Privoznik [Thu, 20 Jan 2022 12:58:49 +0000 (13:58 +0100)]
lib: Almost eliminate use of virTristateBoolTypeFromString()

There are couple of places where virTristateBoolTypeFromString()
is called. Well, the same result can be achieved by
virXMLPropTristateBool() and on fewer lines.

Note there are couple of places left untouched because those
don't care about error reporting and thus are shorter they way
they are now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Eliminate use of virTristateSwitchTypeFromString()
Michal Privoznik [Thu, 20 Jan 2022 10:24:55 +0000 (11:24 +0100)]
lib: Eliminate use of virTristateSwitchTypeFromString()

There are couple of places (all of them in XML parsing) where
virTristateSwitchTypeFromString() is called. Well, the same
result can be achieved by virXMLPropTristateSwitch() and on fewer
lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Use virTristateBool instead of virTristateSwitch in a few places
Michal Privoznik [Thu, 20 Jan 2022 13:14:31 +0000 (14:14 +0100)]
qemu: Use virTristateBool instead of virTristateSwitch in a few places

Both @accel2d and @accel3d are parsed as virTristateBool, but in
a few places (qemuDeviceVideoGetModel() and
qemuValidateDomainDeviceDefVideo()) they are compared to
virTristateSwitch enum either directly or via a variable of that
type. Clear this confusion by using the correct enum.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuValidateDomainDeviceDefFS: Use correct enum for fs->multidevs comparison
Michal Privoznik [Fri, 21 Jan 2022 11:22:07 +0000 (12:22 +0100)]
qemuValidateDomainDeviceDefFS: Use correct enum for fs->multidevs comparison

During validation of a virDomainFSDef QEMU capabilities are check
for multidevs support if the FS definition has it enabled.
However, the fs->multidevs is really type of virDomainFSMultidevs
but is compared against virDomainFSModel enum. Fortunately, both
values are the same so no user visible harm done here.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirNetworkPortDefParseXML: Fix a typo in an error message
Michal Privoznik [Thu, 20 Jan 2022 20:46:28 +0000 (21:46 +0100)]
virNetworkPortDefParseXML: Fix a typo in an error message

There's a typo in error message that's printed when parsing of
<plug type=''/> fails: "prt" is reported instead of "port".

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirxml: Extend virXMLPropU{Int,LongLong}() error message
Michal Privoznik [Thu, 20 Jan 2022 15:06:26 +0000 (16:06 +0100)]
virxml: Extend virXMLPropU{Int,LongLong}() error message

In case virXMLPropUInt() or virXMLPropULongLong() meets an
attribute with a negative integer the following error message is
printed:

  Invalid value ...: Expected integer value

This message is not as good as it could be. Let users know it's a
non-negative integer we are expecting.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: Fix the qemuBuldDomainLoaderPflashCommandLine name typo
Erik Skultety [Fri, 21 Jan 2022 14:20:22 +0000 (15:20 +0100)]
qemu: command: Fix the qemuBuldDomainLoaderPflashCommandLine name typo

The function should be called qemuBuildDomainLoaderPflashCommandLine.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
3 years agoman: virt-admin: Mention monolithic daemon URIs
Peter Krempa [Thu, 20 Jan 2022 15:20:22 +0000 (16:20 +0100)]
man: virt-admin: Mention monolithic daemon URIs

Hint users that they can use 'virt-admin' also for the new monolithic
daemons.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2038045
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Fix for modular daemons
Peter Krempa [Mon, 17 Jan 2022 15:19:59 +0000 (16:19 +0100)]
kbase: debuglogs: Fix for modular daemons

Modular daemons are now the default in many new installations, thus we
need to include steps how to determine that modular daemons are used and
modular-daemon specific locations for the config files and admin URIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agodocs: daemons: Add section on figuring out whether modular or monolithic daemon is...
Peter Krempa [Mon, 17 Jan 2022 09:24:14 +0000 (10:24 +0100)]
docs: daemons: Add section on figuring out whether modular or monolithic daemon is in use

Since we are at a transition period where some users may be running
monolithic libvirtd and others already the modular topology we need a
section that allows users to figure out which is in use.

This will be particularly important in the document about enabling
logging, as the active log file depends on which daemon is in use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoman: virt-admin: Remove misleading paragraph about unix socket permissions
Peter Krempa [Thu, 20 Jan 2022 17:17:47 +0000 (18:17 +0100)]
man: virt-admin: Remove misleading paragraph about unix socket permissions

The socket permissions are controlled by 'unix_sock_admin_perms', but
regardless the code requires that 'geteuid() != clientuid' to allow
clients thus it doesn't make sense to make users aware of it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Drop node.gif
Andrea Bolognani [Wed, 19 Jan 2022 16:54:53 +0000 (17:54 +0100)]
docs: Drop node.gif

It's the only GIF file we have in our repository.

We could convert it to PNG, but that would result in a
significantly bigger file (~5.5 KiB vs ~1.5 KiB).

Since the image doesn't really add much to the documentation,
drop it instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: update QEMU capabilities for qemu 6.2 release
Daniel Henrique Barboza [Thu, 20 Jan 2022 17:47:40 +0000 (14:47 -0300)]
tests: update QEMU capabilities for qemu 6.2 release

Update existing ppc64 6.2 caps to match what was released in QEMU 6.2.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoRevert "report error when virProcessGetStatInfo() is unable to parse data"
Michal Privoznik [Tue, 18 Jan 2022 11:40:09 +0000 (12:40 +0100)]
Revert "report error when virProcessGetStatInfo() is unable to parse data"

This reverts commit 938382b60ae5bd1f83b5cb09e1ce68b9a88f679a.

Turns out, the commit did more harm than good. It changed
semantics on some public APIs. For instance, while
qemuDomainGetInfo() previously did not returned an error it does
now. While the calls to virProcessGetStatInfo() is guarded with
virDomainObjIsActive() it doesn't necessarily mean that QEMU's
PID is still alive. QEMU might be gone but we just haven't
realized it (e.g. because the eof handler thread is waiting for a
job).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2041610
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: update QEMU and domain ppc64 capabilities for qemu 7.0
Daniel Henrique Barboza [Mon, 17 Jan 2022 17:45:28 +0000 (14:45 -0300)]
tests: update QEMU and domain ppc64 capabilities for qemu 7.0

Changes in all 'ppc64-latest.ags' files were needed due to the
JSONification of command line devices.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 20 Jan 2022 13:46:21 +0000 (14:46 +0100)]
Translated using Weblate (Swedish)

Currently translated at 31.3% (3281 of 10455 strings)

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

Translated using Weblate (Swedish)

Currently translated at 31.2% (3266 of 10455 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>
3 years agoTranslated using Weblate (Korean)
simmon [Thu, 20 Jan 2022 13:46:20 +0000 (14:46 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10455 of 10455 strings)

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

Translated using Weblate (Korean)

Currently translated at 99.7% (10434 of 10455 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Thu, 20 Jan 2022 13:46:19 +0000 (14:46 +0100)]
Translated using Weblate (Finnish)

Currently translated at 22.8% (2392 of 10455 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agoqemu: fix inactive snapshot revert
Ján Tomko [Thu, 20 Jan 2022 13:53:33 +0000 (14:53 +0100)]
qemu: fix inactive snapshot revert

The commit splitting out the qemuSnapshotRevertInactive function
dropped the 'defined = true' line by accident and instead
returned -1, leaving the user with a cryptic error:
error: An error occurred, but the cause is unknown

https://bugzilla.redhat.com/show_bug.cgi?id=2039136
https://gitlab.com/libvirt/libvirt/-/issues/266

Fixes: 85e4a13c3f19078fb6af5ffb4a80022c142cbc7e
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage: Implement 'checkPool' method for 'disk' type pools
Peter Krempa [Thu, 20 Jan 2022 10:46:51 +0000 (11:46 +0100)]
storage: Implement 'checkPool' method for 'disk' type pools

If 'checkPool' is not implemented, the pool will be made inactive when
restarting libvirtd and subsequently re-loading the state from the pool
state XML.

Base the 'checkPool' implementation on logic similar to 'startPool'.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1910856
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirStoragePoolObjSourceFindDuplicateCb: Fix handling of VIR_STORAGE_POOL_ISCSI_DIRECT
Peter Krempa [Thu, 20 Jan 2022 10:43:22 +0000 (11:43 +0100)]
virStoragePoolObjSourceFindDuplicateCb: Fix handling of VIR_STORAGE_POOL_ISCSI_DIRECT

The direct SCSI pool doesn't expose the volumes in the host attempting
to match it using 'virStoragePoolObjSourceMatchTypeDEVICE' which in turn
uses 'virStoragePoolSourceFindDuplicateDevices' doesn't make sense.

Remove it from the source matching completely as we can open multiple
connections to the target.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorageDriverAutostartCallback: Refactor control flow
Peter Krempa [Thu, 20 Jan 2022 10:36:29 +0000 (11:36 +0100)]
storageDriverAutostartCallback: Refactor control flow

Use early returns to decrease the indentation level and make it more
obvious that the 'cleanup' path is a noop in those cases.

'virStoragePoolObjSetStarting' was called only when the code wanted to
start the pool, so if that was skipped, cleanup is noop as it's
conditional on the return value of 'virStoragePoolObjIsStarting'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirStoragePoolObjLoadAllConfigs: Use automatic memory clearing
Peter Krempa [Thu, 20 Jan 2022 10:34:46 +0000 (11:34 +0100)]
virStoragePoolObjLoadAllConfigs: Use automatic memory clearing

Refactor the inner loop to automatically free temporary variables and
remove unreachable error paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage: Add debug logs for storage pool config loading
Peter Krempa [Thu, 20 Jan 2022 10:33:46 +0000 (11:33 +0100)]
storage: Add debug logs for storage pool config loading

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: man: virsh: Document more carefully that 'guestinfo' can return nothing
Peter Krempa [Wed, 19 Jan 2022 08:49:31 +0000 (09:49 +0100)]
docs: man: virsh: Document more carefully that 'guestinfo' can return nothing

When invoking 'virsh guestinfo $VM' without explicitly specifying a
group of information to return, virsh always reports success even when
the guest agent doesn't report any information in the current state.
This is desired in situations when you are okay with stats being missing
and avoids spurious errors being reported.

Clarify that this is really desired in the man page.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2041665
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agokbase: debuglogs: Emphasise 'virt-admin'
Peter Krempa [Mon, 17 Jan 2022 13:34:36 +0000 (14:34 +0100)]
kbase: debuglogs: Emphasise 'virt-admin'

It's a tool name so use backticks to format it in monospace.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Extract client library logging setup
Peter Krempa [Mon, 17 Jan 2022 12:59:58 +0000 (13:59 +0100)]
kbase: debuglogs: Extract client library logging setup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Add a section describing log outputs and filters
Peter Krempa [Mon, 17 Jan 2022 12:45:02 +0000 (13:45 +0100)]
kbase: debuglogs: Add a section describing log outputs and filters

Outline what the given settings influence.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Section off the settings for legacy libvirt
Peter Krempa [Mon, 17 Jan 2022 11:15:17 +0000 (12:15 +0100)]
kbase: debuglogs: Section off the settings for legacy libvirt

Move out the settings required to pre libvirt-4.4.0 deployments into a
separate section so that the main point is not cluttered by now mostly
irrelevant settings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Un-nest section on enabling debug logs
Peter Krempa [Mon, 17 Jan 2022 10:55:40 +0000 (11:55 +0100)]
kbase: debuglogs: Un-nest section on enabling debug logs

Enabling the logs is the focus of this article. Decouple it from the
first section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agokbase: debuglogs: Use common heading hierarchy
Peter Krempa [Mon, 17 Jan 2022 10:04:15 +0000 (11:04 +0100)]
kbase: debuglogs: Use common heading hierarchy

Use the heading hierarchy as generated by pandoc which we use in most
of the converted XML format docs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agospec: Run pre/post-install stuff on 'daemon-driver-storage-core'
Peter Krempa [Wed, 19 Jan 2022 12:41:28 +0000 (13:41 +0100)]
spec: Run pre/post-install stuff on 'daemon-driver-storage-core'

'daemon-driver-storage' is just a meta-package, the actual daemon is in
the 'daemon-driver-storage-core' package, so without installing the meta
package the storage daemon is not being enabled.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2025644
Fixes: 50eae3f8859, b8ef6255444
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoremote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit
Peter Krempa [Tue, 18 Jan 2022 14:00:21 +0000 (15:00 +0100)]
remote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit

The existence of the unix socket path is used by the remote driver to
determine whether modular daemons are in use, so if the socket file
stays behind and the user decided to switch from modular to monolithic
daemon which was socket activated, the remote driver will insist on
picking '/var/run/libvirt/virtqemud-sock', even when it's no longer in
use:

 # systemctl start libvirtd.service
 # virsh list
  Id   Name   State
 --------------------

 # systemctl stop libvirtd.service
 Warning: Stopping libvirtd.service, but it can still be activated by:
   libvirtd.socket
   libvirtd-ro.socket
   libvirtd-admin.socket
 # systemctl start virtqemud.socket
 # virsh list
  Id   Name   State
 --------------------

 # systemctl stop virtqemud.socket
 # systemctl start libvirtd.service
 # virsh list
 error: failed to connect to the hypervisor
 error: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': Connection refused

 # virsh -c 'qemu:///system?socket=/var/run/libvirt/libvirt-sock' list
  Id   Name   State
 --------------------

Fix this by instructing systemd to delete the socket file when
deactivating the unit file for the socket.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
3 years agoqemuValidateDomainDeviceDefVideo: Reject non-default video head count for devices...
Peter Krempa [Tue, 18 Jan 2022 15:59:35 +0000 (16:59 +0100)]
qemuValidateDomainDeviceDefVideo: Reject non-default video head count for devices not supporting it

Only QXL and virtio-vga actually propagate the 'heads' attribute as
'max_outputs' to the commandline of qemu. Reject the setting when
non-default value is used for any other video type.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2036300
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuValidateDomainDeviceDefVideo: Refactor condition checking for qxl and virtio-vga
Peter Krempa [Tue, 18 Jan 2022 15:58:35 +0000 (16:58 +0100)]
qemuValidateDomainDeviceDefVideo: Refactor condition checking for qxl and virtio-vga

Subsequent patch will use the same condition so move the primary device
check into a nested condition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildDeviceVideoCmd: Simplify formatting of 'max_outputs' property
Peter Krempa [Tue, 18 Jan 2022 15:31:28 +0000 (16:31 +0100)]
qemuBuildDeviceVideoCmd: Simplify formatting of 'max_outputs' property

Since there's no capability to check now, we can simply move the
formatting of 'max_outputs' earlier.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_QXL_MAX_OUTPUTS and QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS
Peter Krempa [Tue, 18 Jan 2022 15:22:33 +0000 (16:22 +0100)]
qemu: capabilities: Retire QEMU_CAPS_QXL_MAX_OUTPUTS and QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS

Both are supported by qemu-2.11 and later, so we don't have to check for
them explicitly.

Note that QXL is supported only on x86_64, thus on other arches only the
capability for 'virtio-gpu' is removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildDeviceVideoCmd: Always assume support for 'max_outputs' property
Peter Krempa [Tue, 18 Jan 2022 15:19:03 +0000 (16:19 +0100)]
qemuBuildDeviceVideoCmd: Always assume support for 'max_outputs' property

Both the QXL video device and 'virtio' video device support
'max_outputs' in all qemu versions libvirt supports. This means we no
longer have to check the QEMU_CAPS_QXL_MAX_OUTPUTS and
QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainDeviceInfoParseXML: Reject '0' value for ACPI index
Peter Krempa [Tue, 18 Jan 2022 14:43:42 +0000 (15:43 +0100)]
virDomainDeviceInfoParseXML: Reject '0' value for ACPI index

Value of '0' is treated equivalently to when it's not provided by the
user. Reject an explicit '0' provided by the user as it would get
ignored.

In this rare case we can make the XML parser more strict, as libvirt
would never format the '<acpi/>' element if the index is '0' thus there
are no libvirt-generated XMLs we'd not load back, as of such this is
identical to rejecting it in the validation phase.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037146
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh-network: Don't check for virshXXXTypeFromString() >= VIR_XXX_LAST
Michal Privoznik [Mon, 10 Jan 2022 11:59:29 +0000 (12:59 +0100)]
virsh-network: Don't check for virshXXXTypeFromString() >= VIR_XXX_LAST

They way our VIR_ENUM_IMPL() and virXXXTypeFromString() work is
that for any string that's not recognized a negative one is
returned. And, since VIR_XXX_LAST is passed to VIR_ENUM_IMPL() we
can be sure that all enum members are covered. Therefore, there
is no way that virXXXTypeFromString() can return a value that's
bigger or equal to VIR_XXX_LAST.

I've noticed two places where such comparison was made, both in
cmdNetworkUpdate(). Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirsh: Introduce net-update --section completer
Michal Privoznik [Mon, 10 Jan 2022 11:44:23 +0000 (12:44 +0100)]
virsh: Introduce net-update --section completer

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Introduce net-update --command completer
Michal Privoznik [Mon, 10 Jan 2022 11:41:03 +0000 (12:41 +0100)]
virsh: Introduce net-update --command completer

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: set facility when opening syslog channel
Daniel P. Berrangé [Tue, 18 Jan 2022 16:48:00 +0000 (16:48 +0000)]
util: set facility when opening syslog channel

We're currently passing '0' which leaves the syslog facility
unset. Since we're passing an explicit facility for syslog
when using journald, it makes sense to be explicit when
using  syslog directly too.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoutil: fix syslog facility value
Daniel P. Berrangé [Tue, 18 Jan 2022 16:45:35 +0000 (16:45 +0000)]
util: fix syslog facility value

We set SYSLOG_PRIORITY when sending to journald to avoid our
messages getting tagged with the default facility which is
used for the kernel.

Unfortunately:

  commit fd00f0e6c75b00c3d97be8670afcd9094b823855
  Author: Guido Günther <agx@sigxcpu.org>
  Date:   Mon Sep 21 20:06:55 2015 +0200

    Use daemon log facility for journald

used the LOG_nnn constants from the syslog header without realizing
that these values have a bit-shift applied. While Linux defines a
LOG_FAC() macros to undo the bit-shift this doesn't appear to be
standardized. So the safe thing is to just use the raw value since
these values are fixed by RFC 5424.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: coding-style: One variable declaration per line
Tim Wiederhake [Thu, 13 Jan 2022 16:53:25 +0000 (17:53 +0100)]
docs: coding-style: One variable declaration per line

This was not mentioned before.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: coding-style: Clarify on virXXXPtr types
Tim Wiederhake [Tue, 11 Jan 2022 16:10:43 +0000 (17:10 +0100)]
docs: coding-style: Clarify on virXXXPtr types

This partially reverts commit 9ccbed6afb.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agomanpages: libvirt-guests: Fix typos
Tim Wiederhake [Wed, 19 Jan 2022 10:08:13 +0000 (11:08 +0100)]
manpages: libvirt-guests: Fix typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoqemu: simplify qemuProcessSetupRawIO
Ján Tomko [Thu, 13 Jan 2022 17:26:14 +0000 (18:26 +0100)]
qemu: simplify qemuProcessSetupRawIO

Remove the now unused 'driver' parameter, as well as the pointless
if (ret == 0) comparison which is always true after removing the
cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoutil: remove {Get,Set}UnprivSGIO
Ján Tomko [Thu, 13 Jan 2022 17:22:43 +0000 (18:22 +0100)]
util: remove {Get,Set}UnprivSGIO

These are no longer used.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoutil: remove virGetDeviceID
Ján Tomko [Thu, 13 Jan 2022 17:20:37 +0000 (18:20 +0100)]
util: remove virGetDeviceID

It was only used to construct the hash key for the (now removed)
shared devices in the qemu driver.

Remove it and its mocking.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: remove sharedDevices hash table
Ján Tomko [Thu, 13 Jan 2022 17:08:11 +0000 (18:08 +0100)]
qemu: remove sharedDevices hash table

Its only use was to check conflicts of the sgio attributes between
devices shared with other domains.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: remove all use of SGIO
Ján Tomko [Thu, 13 Jan 2022 16:47:03 +0000 (17:47 +0100)]
qemu: remove all use of SGIO

Now that the 'unfiltered' attribute is rejected by the validator,
remove all the code that deals with the feature.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoconf: reject unfiltered sgio on validation
Ján Tomko [Thu, 13 Jan 2022 13:04:49 +0000 (14:04 +0100)]
conf: reject unfiltered sgio on validation

No kernels supported by upstream libvirt have the feature.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoutil: remove virGetUnprivSGIOSysfsPath
Ján Tomko [Thu, 13 Jan 2022 12:09:31 +0000 (13:09 +0100)]
util: remove virGetUnprivSGIOSysfsPath

unpriv_sgio was a downstream-only feature in RHEL 6-8.
The libvirt support was merged upstream by mistake.

Remove the function that constructs the sysfs path and assume it
does not exist in all the callers.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: remove support for transitional virtio-input-host
Ján Tomko [Tue, 18 Jan 2022 15:01:04 +0000 (16:01 +0100)]
qemu: remove support for transitional virtio-input-host

virtio-input is virtio-1.0 only and these models have been only present
in one upstream QEMU release, then removed by:

      commit d923e30578a65392e50e530e3a29b2edf5c51c5b
          virtio-input-host-pci: cleanup types

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: remove support for transitional virtio-input-host
Ján Tomko [Tue, 18 Jan 2022 17:03:55 +0000 (18:03 +0100)]
qemu: remove support for transitional virtio-input-host

This device was virtio 1.0-only so adding the (non-)transitional model
did not make sense and it was only present in QEMU 4.0.

Report a validation error for both of the users that will ever hit this
code path.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: capabilities: do not check for transitional input host
Ján Tomko [Tue, 18 Jan 2022 14:25:50 +0000 (15:25 +0100)]
qemu: capabilities: do not check for transitional input host

The (non-)transitional version of this device was only present in
one upstream QEMU release (4.0), then removed by:

  commit d923e30578a65392e50e530e3a29b2edf5c51c5b
      virtio-input-host-pci: cleanup types

Remove them from probing as well, since they are unlikely to be found.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoutil: openvswitch: do not reuse cmd in InterfaceClearTxQos
Ján Tomko [Mon, 17 Jan 2022 16:33:39 +0000 (17:33 +0100)]
util: openvswitch: do not reuse cmd in InterfaceClearTxQos

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: openvswitch: do not reuse cmd in InterfaceSetTxQos
Ján Tomko [Mon, 17 Jan 2022 16:28:44 +0000 (17:28 +0100)]
util: openvswitch: do not reuse cmd in InterfaceSetTxQos

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: openvswitch: split out virNetDevOpenvswitchInterfaceSetRxQos
Ján Tomko [Mon, 17 Jan 2022 16:20:42 +0000 (17:20 +0100)]
util: openvswitch: split out virNetDevOpenvswitchInterfaceSetRxQos

The virNetDevOpenvswitchInterfaceSetQos function is uneven
because setting the Rx Qos is open-coded, while clearing it
is sepearated in another function.

Separate the setting too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: openvswitch: split out virNetDevOpenvswitchInterfaceSetTxQos
Ján Tomko [Mon, 17 Jan 2022 16:13:12 +0000 (17:13 +0100)]
util: openvswitch: split out virNetDevOpenvswitchInterfaceSetTxQos

The virNetDevOpenvswitchInterfaceSetQos function is uneven
because setting the Tx Qos is open-coded, while clearing it
is sepearated in another function.

Separate the setting too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: openvswitch: unexport InterfaceClear{Rx,Tx}Qos
Ján Tomko [Mon, 17 Jan 2022 15:39:20 +0000 (16:39 +0100)]
util: openvswitch: unexport InterfaceClear{Rx,Tx}Qos

This also removes the indentation error.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: openvswitch: move InterfaceClear{Rx,Tx}Qos
Ján Tomko [Mon, 17 Jan 2022 15:37:50 +0000 (16:37 +0100)]
util: openvswitch: move InterfaceClear{Rx,Tx}Qos

These functions are called by virNetDevOpenvswitchInterfaceSetQos
as well as virNetDevOpenvswitchInterfaceClearQos.

Move them above both fuctions.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: Stop storing dnsmasq version
Andrea Bolognani [Mon, 17 Jan 2022 16:31:52 +0000 (17:31 +0100)]
util: Stop storing dnsmasq version

We don't do anything with it after checking that it satisfies our
requirements and don't provide a way for users of the module to
access it, so carrying it around is pointless.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agospec: Drop BuildRequires on dnsmasq
Andrea Bolognani [Mon, 17 Jan 2022 16:27:52 +0000 (17:27 +0100)]
spec: Drop BuildRequires on dnsmasq

It's been an optional build time dependency for a long time, so
if Meson couldn't find it the only consequence was that libvirt
would look for it at runtime instead, which is what we are doing
for most of our non-library dependencies anyway.

Since 5c98d1cee0be we've stopped even looking for it at build
time, so there's no point in having it installed in the build
environment.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary()
Michal Privoznik [Wed, 12 Jan 2022 04:58:39 +0000 (05:58 +0100)]
virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary()

After previous cleanups, there's just one caller of
dnsmasqCapsNewEmpty() and it is dnsmasqCapsNewFromBinary().
And the former is pretty short. Therefore, it is not necessary
for the code to live in two separate functions. Dissolve the
former in the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop dnsmasqCapsNewFromBuffer()
Michal Privoznik [Wed, 12 Jan 2022 04:56:42 +0000 (05:56 +0100)]
virdnsmasq: Drop dnsmasqCapsNewFromBuffer()

The function is no longer used. Remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonetworkxml2conftest: Check if capabilities were created successfully
Michal Privoznik [Mon, 17 Jan 2022 12:14:45 +0000 (13:14 +0100)]
networkxml2conftest: Check if capabilities were created successfully

Now that looking up dnsmasq is handled/mocked we can start
checking whether dnsmasq capabilities were built successfully and
error out if that wasn't the case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonetworkxml2conftest: Use dnsmasqCapsNewFromBinary() to construct caps
Michal Privoznik [Wed, 12 Jan 2022 04:42:41 +0000 (05:42 +0100)]
networkxml2conftest: Use dnsmasqCapsNewFromBinary() to construct caps

DISCLAIMER: dnsmasq capabilities are empty as of v8.0.0-rc1~145.

In a real environment the dnsmasq capabilities are constructed
using dnsmasqCapsNewFromBinary(). We also have
dnsmasqCapsNewFromBuffer() to bypass checks that real code is
doing and just get capabilities object. The latter is used from
test suite.

However, with a little bit of mocking we can test the real life
code. All that's needed is to simulate dnsmasq's output for
--version and --help and mock a stat() that's done in
dnsmasqCapsRefreshInternal().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Require non NULL @caps in dnsmasqCapsGetBinaryPath()
Michal Privoznik [Mon, 10 Jan 2022 15:25:18 +0000 (16:25 +0100)]
virdnsmasq: Require non NULL @caps in dnsmasqCapsGetBinaryPath()

First observation: There is no way that caps->binaryPath can be
NULL. Second observation: There is no caller that passes NULL.
Let's drop the ternary operator and access @caps directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Lookup DNSMASQ in PATH
Michal Privoznik [Mon, 10 Jan 2022 15:19:31 +0000 (16:19 +0100)]
virdnsmasq: Lookup DNSMASQ in PATH

While it's true that our virCommand subsystem is happy with
non-absolute paths, the dnsmasq capability code is not. It stores
the path to dnsmasq within and makes it accessible via
dnsmasqCapsGetBinaryPath(). While strictly speaking no caller
necessarily needs canonicalized path, let's find dnsmasq once and
cache the result.

Therefore, when constructing the capabilities structure look up
the binary path. If DNSMASQ already contains an absolute path
then virFindFileInPath() will simply return a copy.

With this code in place, the virFileIsExecutable() check can be
removed from dnsmasqCapsRefreshInternal() because
virFindFileInPath() already made sure the binary is executable.

But introducing virFindFileInPath() means we have to mock it in
test suite because dnsmasqCaps are created in
networkxml2conftest.

Moreover, we don't need to check for dnsmasq in configure.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Don't run 'dnsmasq --help'
Michal Privoznik [Mon, 17 Jan 2022 12:22:09 +0000 (13:22 +0100)]
virdnsmasq: Don't run 'dnsmasq --help'

We don't query any capabilities of dnsmasq. We are only
interested in dnsmasq's version (obtained via 'dnsmasq
--version'). Therefore, there's no point in running 'dnsmasq
--help'. Its output is not processed even.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop !caps check from dnsmasqCapsRefreshInternal()
Michal Privoznik [Mon, 17 Jan 2022 12:20:50 +0000 (13:20 +0100)]
virdnsmasq: Drop !caps check from dnsmasqCapsRefreshInternal()

There is no way that the dnsmasqCapsRefreshInternal() function
can be called with @caps == NULL. Therefore, drop the if() that
checks for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop noRefresh member from from struct _dnsmasqCaps
Michal Privoznik [Mon, 17 Jan 2022 12:20:32 +0000 (13:20 +0100)]
virdnsmasq: Drop noRefresh member from from struct _dnsmasqCaps

The noRefresh member of _dnsmasqCaps struct is set only after it
was checked for and is never checked again. This is needless and
the member can be removed. There is no way that
dnsmasqCapsRefreshInternal() can be called after
dnsmasqCapsSetFromBuffer().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop mtime member from struct _dnsmasqCaps
Michal Privoznik [Mon, 17 Jan 2022 12:19:26 +0000 (13:19 +0100)]
virdnsmasq: Drop mtime member from struct _dnsmasqCaps

The _dnsmasqCaps struct has @mtime member which holds the mtime
of the dnsmasq binary. The idea was that capabilities don't need
to be queried if mtime hasn't changed since the last time.
However, the code that would try to query capabilities again was
removed and now we are left with code that stores mtime but has
no use for it.

Remove the member and code that uses it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop @force argument of dnsmasqCapsRefreshInternal()
Michal Privoznik [Mon, 17 Jan 2022 12:17:42 +0000 (13:17 +0100)]
virdnsmasq: Drop @force argument of dnsmasqCapsRefreshInternal()

This argument is not used really as the only caller passes true
and dnsmasqCapsRefreshInternal() only checks for false value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agolib: Prefer g_autoptr(dnsmasqCaps) instead of explicit unref
Michal Privoznik [Tue, 11 Jan 2022 15:51:32 +0000 (16:51 +0100)]
lib: Prefer g_autoptr(dnsmasqCaps) instead of explicit unref

The dnsmasqCaps type has its own cleanup function defined and
ready to use via g_autoptr(). Use automatic cleanup instead of
an explicit one.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty()
Michal Privoznik [Mon, 10 Jan 2022 15:15:29 +0000 (16:15 +0100)]
virdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty()

Both callers of dnsmasqCapsNewEmpty() pass DNSMASQ as an argument
which is then fed to a ternary operator which looks like this
(after substitution).

  DNSMASQ ? DNSMASQ : DNSMASQ

While I like tautologies, the code can be simplified by dropping
the argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemuDomainPinIOThread: Update live definition after process pinning
Peter Krempa [Tue, 18 Jan 2022 09:08:03 +0000 (10:08 +0100)]
qemuDomainPinIOThread: Update live definition after process pinning

Otherwise we'll keep using the new pinning value even if it can't be
applied to the thread.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2040555
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuDomainPinIOThread: Copy the cpu bitmap instead of re-parsing it
Peter Krempa [Tue, 18 Jan 2022 09:06:38 +0000 (10:06 +0100)]
qemuDomainPinIOThread: Copy the cpu bitmap instead of re-parsing it

The bitmap recorded in the live/persistent definition was re-parsed two
more times. We can copy it which is cheaper and less verbose.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Log which API is trying to acquire a job
Jiri Denemark [Tue, 11 Jan 2022 09:28:43 +0000 (10:28 +0100)]
qemu: Log which API is trying to acquire a job

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: mention removal of sysconfig
Olaf Hering [Wed, 12 Jan 2022 10:45:09 +0000 (11:45 +0100)]
NEWS: mention removal of sysconfig

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoremove sysconfig files
Olaf Hering [Wed, 12 Jan 2022 10:45:08 +0000 (11:45 +0100)]
remove sysconfig files

sysconfig files are owned by the admin of the host. They have the
liberty to put anything they want into these files. This makes it
difficult to provide different built-in defaults.

Remove the sysconfig file and place the current desired default into
the service file.

Local customizations can now go either into /etc/sysconfig/name
or /etc/systemd/system/name.service.d/my-knobs.conf

Attempt to handle upgrades in libvirt.spec.
Dirty files which are marked as %config will be renamed to file.rpmsave.
To restore them automatically, move stale .rpmsave files away, and
catch any new rpmsave files in %posttrans.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodocs: domain: document legacy audio for qemu
Olaf Hering [Wed, 12 Jan 2022 12:42:00 +0000 (13:42 +0100)]
docs: domain: document legacy audio for qemu

Adding a blurb like this was forgotten in 2009.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodocs: Add man page for libvirt-guests
Jim Fehlig [Fri, 7 Jan 2022 21:35:10 +0000 (14:35 -0700)]
docs: Add man page for libvirt-guests

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agobuild: Only install libvirt-guests when building libvirtd
Jim Fehlig [Mon, 10 Jan 2022 18:42:58 +0000 (11:42 -0700)]
build: Only install libvirt-guests when building libvirtd

libvirt-guests was already moved to the libvirt daemon package in commit
d800c50349. It only needs to be installed when building libvirtd.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agotestutils: Terminate usage string with a new line
Michal Privoznik [Mon, 17 Jan 2022 15:46:46 +0000 (16:46 +0100)]
testutils: Terminate usage string with a new line

If a test binary is executed with an argument then usage
information is printed out (that no arguments are accepted and
what environment variables affect execution). The string is
printed onto stderr but it is not terminated with a newline
character producing not so nice output.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoexamples: drop some conditionals checks from macros
Daniel P. Berrangé [Fri, 14 Jan 2022 10:34:43 +0000 (10:34 +0000)]
examples: drop some conditionals checks from macros

We no longer need to worry about GCC version older than 7.4.0. The other
remaining conditionals checks were also overkill for the example code.
In the unlikely event that someone tries to re-use the code in a
scenario where further conditions apply they can figure out.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>