]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agoconf: device: compare drive address fields separately
Ján Tomko [Tue, 16 Nov 2021 13:46:39 +0000 (14:46 +0100)] 
conf: device: compare drive address fields separately

Commit 3210c8b04 introduced a separate field 'diskbus' for
internal use by the commandline formatter.

Adjust the check for address equality to compare the relevant
fields separately instead of the whole struct.

This means that the changes of the 'diskbus' field added
in commit 03ed14d2d4 no longer affect the outcome of the address
equality check.

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

Fixes: 3210c8b047534f7e1d3ccde7ea3bcf11e7c92ad9
Fixes: 03ed14d2d4a4e51568b1ee5a6e6c9c3371bb4d34
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 15 Nov 2021 20:16:05 +0000 (21:16 +0100)] 
Translated using Weblate (Swedish)

Currently translated at 28.9% (3018 of 10441 strings)

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

Translated using Weblate (Swedish)

Currently translated at 28.7% (2998 of 10441 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 (Polish)
Piotr Drąg [Mon, 15 Nov 2021 20:16:04 +0000 (21:16 +0100)] 
Translated using Weblate (Polish)

Currently translated at 22.4% (2347 of 10441 strings)

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

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Mon, 15 Nov 2021 20:16:04 +0000 (21:16 +0100)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10441 of 10441 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 agoqemu: add DEVICE_UNPLUG_GUEST_ERROR event support
Daniel Henrique Barboza [Fri, 29 Oct 2021 19:54:26 +0000 (16:54 -0300)] 
qemu: add DEVICE_UNPLUG_GUEST_ERROR event support

The upcoming QEMU 6.2.0 implements a new event called
DEVICE_UNPLUG_GUEST_ERROR, a new event that reports generic device
unplug errors that were detected by the guest and reported back to QEMU.

This new event is going to be specially useful for pseries guests that
uses newer kernels (must have kernel commit 29c9a2699e71), which is the
case for Fedora 34 at this moment. These guests have the capability of
reporting CPU removal errors back to QEMU which, starting in 6.2.0, will
emit the DEVICE_UNPLUG_GUEST_ERROR event. Libvirt can use this event to
abort the device removal immediately instead of waiting for 'setvcpus'
timeout.

QEMU 6.2.0 is also going to emit DEVICE_UNPLUG_GUEST_ERROR for memory
hotunplug errors, both in pseries and ACPI guests. QEMU 6.1.0 reports
memory removal errors using the MEM_UNPLUG_ERROR event, which is going to
be deprecated by DEVICE_UNPLUG_GUEST_ERROR in 6.2.0. Given that
Libvirt wasn't handling the MEM_UNPLUG_ERROR event we don't need to
worry about it - adding support to DEVICE_UNPLUG_GUEST_ERROR will be
enough to cover all future cases.

This patch adds support to DEVICE_UNPLUG_GUEST_ERROR by adding the
minimal wiring required for Libvirt to be aware of it. The monitor
callback for this event will abort the pending removal operation of the
device reported by the "device" property of the event. Most of the heavy
lifting is already done by existing code that handles
QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_GUEST_REJECTED, making our life
easier to abort the pending removal operation.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
3 years agotests: update QEMU and domain ppc64 capabilities for qemu 6.2
Daniel Henrique Barboza [Tue, 26 Oct 2021 17:37:06 +0000 (13:37 -0400)] 
tests: update QEMU and domain ppc64 capabilities for qemu 6.2

This patch updates domaincapsdata and qemucapabilitiesdata for ppc64
with qemu commit v6.1.0-1714-gc5b2f55981.

Changes in all 'ppc64-latest.ags' files were needed. The changes are
mundane despite the volume. For all 'ppc64-latest.args' files the
changes are:

- removing '-sandbox' command line;
- 'secret' and 'memory-backend-ram' objects are now using qom-type format;
- '-device' is now using qom-type format.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
3 years agovirsh: Remove unnecessary else branches
Michal Privoznik [Mon, 8 Nov 2021 15:09:48 +0000 (16:09 +0100)] 
virsh: Remove unnecessary else branches

In a few cases we call a public API, wrapped in an if() statement
with both branches written out explicitly. The error branch jumps
onto cleanup label, while the successful prints out a message.
Right after these ifs there's 'ret = true;' and the cleanup
label. The code is a bit more readable if only the error branch
is kept and printing happens at the same level as setting the ret
variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristína Hanicová <khanicov@redhat.com>
3 years agoexamples/dommigrate: Make retval portable
Michal Privoznik [Mon, 8 Nov 2021 12:33:09 +0000 (13:33 +0100)] 
examples/dommigrate: Make retval portable

Currently, the dommigrate example returns 0 or 1 for success or
failure state, respectively. Except for a few cases where it
forgot to change the @ret variable just before jumping onto the
'cleanup' label. Making the code follow our usual pattern
(initialize @ret to an error value and set it to success value
only at the end) fixes those cases. Also, using EXIT_SUCCESS and
EXIT_FAILURE is more portable (even though on my system they are
just an alias to values the example already uses).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristína Hanicová <khanicov@redhat.com>
3 years agoexamples/dommigrate: Don't set retval in usage()
Michal Privoznik [Mon, 8 Nov 2021 12:30:55 +0000 (13:30 +0100)] 
examples/dommigrate: Don't set retval in usage()

The usage() function should just print expected arguments. Make
the function return void then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristína Hanicová <khanicov@redhat.com>
3 years agovirNetDevVPortProfileParse: Use g_autofree
Michal Privoznik [Thu, 4 Nov 2021 12:38:02 +0000 (13:38 +0100)] 
virNetDevVPortProfileParse: Use g_autofree

Explicit calls to VIR_FREE() can be dropped then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristína Hanicová <khanicov@redhat.com>
3 years agoqemuMonitorOpen: Rework domain object refcounting
Michal Privoznik [Wed, 27 Oct 2021 12:41:58 +0000 (14:41 +0200)] 
qemuMonitorOpen: Rework domain object refcounting

Similarly to one of previous commits, there's no need to
increment domain object refcounter before unlocking it. Any
number of lock and unlock calls over domain object has no effect
on the refcounter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu_agent: Drop destroy callback
Michal Privoznik [Wed, 27 Oct 2021 11:35:16 +0000 (13:35 +0200)] 
qemu_agent: Drop destroy callback

After previous cleanups this callback is unused. Remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuAgentOpen: Rework domain object refcounting
Michal Privoznik [Wed, 27 Oct 2021 11:38:22 +0000 (13:38 +0200)] 
qemuAgentOpen: Rework domain object refcounting

Currently, when opening an agent socket the qemuConnectAgent()
increments domain object refcounter and calls qemuAgentOpen()
where the domain object pointer is simply stored inside
_qemuAgent struct. If qemuAgentOpen() fails, then it clears @cb
member only to avoid qemuProcessHandleAgentDestroy() being called
(which decrements the domain object refcounter) and the domain
object refcounter is then decreased explicitly in
qemuConnectAgent().

The same result can be achieved with much cleaner code: increment
the refcounter inside qemuAgentOpen() and drop the dance around
@cb.

Also, the comment in qemuConnectAgent() about holding an extra
reference is not correct. The thread that called
qemuConnectAgent() already holds a reference to the domain
object. No matter how many time the object is locked and unlocked
the reference counter can't be decreased.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu_agent: Rework domain object locking when opening agent
Michal Privoznik [Wed, 27 Oct 2021 11:38:05 +0000 (13:38 +0200)] 
qemu_agent: Rework domain object locking when opening agent

Just like qemuMonitorOpen(), hold the domain object locked
throughout the whole time of qemuConnectAgent() and unlock it
only for a brief time of actual connect() (because this is the
only part that has a potential of blocking).

The reason is that qemuAgentOpen() does access domain object
(well, its privateData) AND also at least one argument (@context)
depends on domain object. Accessing these without the lock is
potentially dangerous.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1845468#c12
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonews: Mention the addition of virt-pki-query-dn binary
Martin Kletzander [Thu, 11 Nov 2021 14:59:48 +0000 (15:59 +0100)] 
news: Mention the addition of virt-pki-query-dn binary

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoAdd suggestions for virt-pki-query-dn usage
Martin Kletzander [Thu, 11 Nov 2021 14:56:05 +0000 (15:56 +0100)] 
Add suggestions for virt-pki-query-dn usage

To make it easier for users to figure out how the DN should be formatted.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotools: Add virt-pki-query-dn binary
Martin Kletzander [Thu, 11 Nov 2021 14:35:38 +0000 (15:35 +0100)] 
tools: Add virt-pki-query-dn binary

With this program we do not have to depend on the output of `certtool -i`, which
changed the order of the fields at some point and the newest version is
incompatible with what libvirt expects in tls_allowed_dn_list configuration
option.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoRemove needless space
Martin Kletzander [Thu, 11 Nov 2021 14:55:45 +0000 (15:55 +0100)] 
Remove needless space

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Simplify explanation of tls_allowed_dn_list wildcards
Martin Kletzander [Thu, 11 Nov 2021 14:44:58 +0000 (15:44 +0100)] 
docs: Simplify explanation of tls_allowed_dn_list wildcards

This removes a dead link, the need for users to understand a glib function and a
improper reference to fnmatch (as we only expand asterisks to any string).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpc: Resize dname for longer DN from TLS certs
Martin Kletzander [Mon, 8 Nov 2021 15:04:57 +0000 (16:04 +0100)] 
rpc: Resize dname for longer DN from TLS certs

And to make that easier, allocate it on the heap.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotests: Drop cleanup/error labels
Michal Privoznik [Mon, 1 Nov 2021 09:20:57 +0000 (10:20 +0100)] 
tests: Drop cleanup/error labels

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agotest: Use g_autofree more
Michal Privoznik [Mon, 1 Nov 2021 09:33:49 +0000 (10:33 +0100)] 
test: Use g_autofree more

This commit doesn't aim to extinguish every VIR_FREE() call, but
only those which were touched by the previous commit. The aim is
to drop cleanup/error labels.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agotests: Use g_autoptr(qemuMonitorTest)
Michal Privoznik [Mon, 1 Nov 2021 08:51:01 +0000 (09:51 +0100)] 
tests: Use g_autoptr(qemuMonitorTest)

Instead of calling qemuMonitorTestFree() explicitly, we can use
g_autoptr() and let it be called automagically.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuConnectStealCPUModelFromInfo: Drop needless 'cleanup' label
Michal Privoznik [Mon, 1 Nov 2021 09:37:11 +0000 (10:37 +0100)] 
qemuConnectStealCPUModelFromInfo: Drop needless 'cleanup' label

Previous commit rendered 'cleanup' label and @ret variable
redundant. The same result can be achieved by returning 0/-1
directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemu: Use g_autoptr(qemuMonitorCPUModelInfo)
Michal Privoznik [Mon, 1 Nov 2021 11:58:27 +0000 (12:58 +0100)] 
qemu: Use g_autoptr(qemuMonitorCPUModelInfo)

There are two instances of an explicit call to
qemuMonitorCPUModelInfoFree() which in fact can be turned into
g_auto().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoPrefer g_auto(GStrv) over g_strfreev()
Michal Privoznik [Mon, 1 Nov 2021 09:34:10 +0000 (10:34 +0100)] 
Prefer g_auto(GStrv) over g_strfreev()

There are a few cases where a string list is freed by an explicit
call of g_strfreev(), but the same result can be achieved by
g_atuo(GStrv).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuagenttest: Don't leak virTypedParameter on failure
Michal Privoznik [Mon, 1 Nov 2021 09:34:33 +0000 (10:34 +0100)] 
qemuagenttest: Don't leak virTypedParameter on failure

There are two functions (testQemuAgentOSInfo() and
testQemuAgentTimezone()) which call virTypedParamsFree() only in
successful paths. If an error is met then those parameters would
be leaked. Fix this by placing the virTypedParamsFree() calls on
better place.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoUse virSecretObjEndAPI() more
Michal Privoznik [Wed, 10 Nov 2021 09:01:02 +0000 (10:01 +0100)] 
Use virSecretObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virSecretObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoUse virNodeDeviceObjEndAPI() more
Michal Privoznik [Wed, 10 Nov 2021 08:59:55 +0000 (09:59 +0100)] 
Use virNodeDeviceObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virNodeDeviceObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoUse virNWFilterBindingObjEndAPI() more
Michal Privoznik [Wed, 10 Nov 2021 08:57:42 +0000 (09:57 +0100)] 
Use virNWFilterBindingObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virNWFilterBindingObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoUse virInterfaceObjEndAPI() more
Michal Privoznik [Wed, 10 Nov 2021 08:56:29 +0000 (09:56 +0100)] 
Use virInterfaceObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virInterfaceObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoUse virDomainObjEndAPI() more
Michal Privoznik [Wed, 10 Nov 2021 08:52:23 +0000 (09:52 +0100)] 
Use virDomainObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virDomainObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agolibxl: Free data returned from libxl_userdata_retrieve
Jim Fehlig [Thu, 28 Oct 2021 21:58:16 +0000 (15:58 -0600)] 
libxl: Free data returned from libxl_userdata_retrieve

Found via valgrind

==15016== 3,701 bytes in 2 blocks are definitely lost in loss record 975 of 1,009
==15016==    at 0x4C2A2AF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==15016==    by 0x1FCD30CB: libxl_read_file_contents (in /usr/lib64/libxenlight.so.4.12.0)
==15016==    by 0x1FCCA58A: ??? (in /usr/lib64/libxenlight.so.4.12.0)
==15016==    by 0x1FCCA6C2: libxl_userdata_retrieve (in /usr/lib64/libxenlight.so.4.12.0)
==15016==    by 0x1FA42A5A: libxlReconnectDomain (libxl_driver.c:394)
==15016==    by 0x53BAC99: virDomainObjListHelper (virdomainobjlist.c:802)
==15016==    by 0x530842F: virHashForEach (virhash.c:575)
==15016==    by 0x53BC0E0: virDomainObjListForEach (virdomainobjlist.c:817)
==15016==    by 0x1FA423C4: libxlReconnectDomains (libxl_driver.c:468)
==15016==    by 0x1FA423C4: libxlStateInitialize (libxl_driver.c:778)
==15016==    by 0x54E8E9E: virStateInitialize (libvirt.c:657)
==15016==    by 0x12DBFA: daemonRunStateInit (remote_daemon.c:797)
==15016==    by 0x535BF79: virThreadHelper (virthread.c:206)

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_process: continue to process fakereboot after restarting libvirtd
Bihong Yu [Mon, 25 Oct 2021 09:04:55 +0000 (17:04 +0800)] 
qemu_process: continue to process fakereboot after restarting libvirtd

During the vm rebooting, the vm could be paused if the libvirtd is
restarted for some reason, which is not expected. We need continue
fakereboot process if fakereboot flags is true and the vm is in
paused-user status.

Signed-off-by: Bihong Yu <yubihong@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_process: set fakereboot flags false after processing fakereboot over
Bihong Yu [Mon, 25 Oct 2021 09:04:54 +0000 (17:04 +0800)] 
qemu_process: set fakereboot flags false after processing fakereboot over

During the vm rebooting, the vm could be shut down if the libvirtd is
restarted for some reason, which is not expected. We move set
fakereboot flags false after processing fakereboot over, so we can
ensure that fakereboot process have been executed.

Signed-off-by: Bihong Yu <yubihong@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_block: Refactor qemuBlockExportAddNBD()
Kristina Hanicova [Tue, 26 Oct 2021 15:19:37 +0000 (17:19 +0200)] 
qemu_block: Refactor qemuBlockExportAddNBD()

This patch improves readability of the function and makes the
code look cleaner by removing the 'else' branches after return
and reordering of the 'if' branches.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu_command: do not use host-nodes for system memory
Pavel Hrdina [Tue, 9 Nov 2021 14:00:53 +0000 (15:00 +0100)] 
qemu_command: do not use host-nodes for system memory

Commit 88957116c9d3cb4705380c3702c9d4315fb500bb switched to use
memory-backend-* for regular VM memory as well. That change indirectly
started using 'host-nodes' for system memory which results in QEMU
calling mbind() to bind the system memory to specific NUMA node if the
VM XML contains the configuration similar to this:

  ...
  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>
  ...

Once the VM was started with that configuration it was no longer
possible to change the memory NUMA nodeset.

Fixes: 677c90cc1d1fcb3aba09b5d4f0f8f83099911775
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetsocket: pass HOME and XDG_RUNTIME_DIR to ssh
Дамјан Георгиевски [Tue, 2 Nov 2021 15:01:03 +0000 (16:01 +0100)] 
virnetsocket: pass HOME and XDG_RUNTIME_DIR to ssh

openssh supports environment variable expansion in its ssh_config
file[1]. These two environment variables can be used to
expand paths for ssh sockets and other files.

Ex.
```
Host *
 ControlMaster auto
 ControlPath ${XDG_RUNTIME_DIR}/ssh-%C.ctl
 IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket
```

see also:
[1] https://man7.org/linux/man-pages/man5/ssh_config.5.html#ENVIRONMENT_VARIABLES
[2] https://gitlab.com/libvirt/libvirt/-/issues/232

Signed-off-by: Дамјан Георгиевски <gdamjan@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: add minor clarifications for librbd encryption
Or Ozeri [Sun, 31 Oct 2021 12:08:40 +0000 (07:08 -0500)] 
docs: add minor clarifications for librbd encryption

This should make the documentation less confusing mainly for
Ceph people.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotestVshTableHeader: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 11:49:16 +0000 (12:49 +0100)] 
testVshTableHeader: Cleanup

Remove unnecessary label and goto. This also fixes a bug where a
failure to create the table would result in the test passing.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotestLXCCapsInit: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 11:44:11 +0000 (12:44 +0100)] 
testLXCCapsInit: Cleanup

Remove unnecessary label and goto. Cleanup line breaks.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agofillXenCaps: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 11:25:45 +0000 (12:25 +0100)] 
fillXenCaps: Cleanup

Rework to remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirSCSIVHostOpenVhostSCSI: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 11:03:43 +0000 (12:03 +0100)] 
virSCSIVHostOpenVhostSCSI: Cleanup

Remove unnecessary label, goto, and closing of not-open file descriptor.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirBufferAddBuffer: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:34:54 +0000 (11:34 +0100)] 
virBufferAddBuffer: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirSaveCookieParse: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:19:15 +0000 (11:19 +0100)] 
virSaveCookieParse: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirNetworkEventDispatchDefaultFunc: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:17:09 +0000 (11:17 +0100)] 
virNetworkEventDispatchDefaultFunc: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirDomainCapsCPUModelsCopy: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:12:34 +0000 (11:12 +0100)] 
virDomainCapsCPUModelsCopy: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirCHDomainObjBeginJob: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:09:37 +0000 (11:09 +0100)] 
virCHDomainObjBeginJob: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoadminConnectListServers: Cleanup
Tim Wiederhake [Mon, 8 Nov 2021 10:05:29 +0000 (11:05 +0100)] 
adminConnectListServers: Cleanup

Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobridge_driver: Drop needless fwd declarations
Michal Privoznik [Mon, 8 Nov 2021 10:04:37 +0000 (11:04 +0100)] 
bridge_driver: Drop needless fwd declarations

Some forward declarations in bridge_driver.c are not needed
really. They only create a noise when trying to jump onto the
correct tag. Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: Invalidate capabilities cache on host cpuid mismatch
Tim Wiederhake [Mon, 2 Aug 2021 14:44:30 +0000 (16:44 +0200)] 
qemu: Invalidate capabilities cache on host cpuid mismatch

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

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirQEMUCapsCachePriv: Add host cpuid information
Tim Wiederhake [Fri, 15 Oct 2021 15:28:00 +0000 (17:28 +0200)] 
virQEMUCapsCachePriv: Add host cpuid information

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirQEMUCaps: Add host cpuid information
Tim Wiederhake [Mon, 2 Aug 2021 14:44:22 +0000 (16:44 +0200)] 
virQEMUCaps: Add host cpuid information

Many things can affect the availability of cpu flags (e.g. software
upgrades, kernel versions, kernel command line, etc.) and invalidate the
cached capabilities without notice. Add CPUID information to the
capabilities cache.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Implement virCPUDataGetHost for x86
Tim Wiederhake [Thu, 4 Nov 2021 13:43:31 +0000 (14:43 +0100)] 
cpu_x86: Implement virCPUDataGetHost for x86

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Add virCPUDataGetHost
Tim Wiederhake [Wed, 3 Nov 2021 16:26:58 +0000 (17:26 +0100)] 
cpu_x86: Add virCPUDataGetHost

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirhostcpu: Add virHostCPUGetCPUID
Tim Wiederhake [Thu, 4 Nov 2021 13:27:08 +0000 (14:27 +0100)] 
virhostcpu: Add virHostCPUGetCPUID

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_ppc64: Implement virCPUDataNewCopy for ppc64
Tim Wiederhake [Mon, 11 Oct 2021 10:34:23 +0000 (12:34 +0200)] 
cpu_ppc64: Implement virCPUDataNewCopy for ppc64

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_arm: Implement virCPUDataNewCopy for arm
Tim Wiederhake [Mon, 11 Oct 2021 10:31:36 +0000 (12:31 +0200)] 
cpu_arm: Implement virCPUDataNewCopy for arm

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Implement virCPUDataNewCopy for x86
Tim Wiederhake [Thu, 7 Oct 2021 11:56:53 +0000 (13:56 +0200)] 
cpu_x86: Implement virCPUDataNewCopy for x86

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu: Add virCPUDataNewCopy
Tim Wiederhake [Thu, 7 Oct 2021 11:46:44 +0000 (13:46 +0200)] 
cpu: Add virCPUDataNewCopy

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_ppc64: Implement virCPUDataIsIdentical for ppc64
Tim Wiederhake [Mon, 11 Oct 2021 10:21:04 +0000 (12:21 +0200)] 
cpu_ppc64: Implement virCPUDataIsIdentical for ppc64

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_arm: Implement virCPUDataIsIdentical for arm
Tim Wiederhake [Mon, 11 Oct 2021 09:52:22 +0000 (11:52 +0200)] 
cpu_arm: Implement virCPUDataIsIdentical for arm

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_arm: No need to protect macro definitions
Tim Wiederhake [Mon, 11 Oct 2021 09:51:55 +0000 (11:51 +0200)] 
cpu_arm: No need to protect macro definitions

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Implement virCPUDataIsIdentical for x86
Tim Wiederhake [Wed, 6 Oct 2021 13:16:11 +0000 (15:16 +0200)] 
cpu_x86: Implement virCPUDataIsIdentical for x86

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu: Add virCPUDataIsIdentical
Tim Wiederhake [Wed, 6 Oct 2021 12:53:05 +0000 (14:53 +0200)] 
cpu: Add virCPUDataIsIdentical

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu: Split up virCPUDataParse
Tim Wiederhake [Wed, 13 Oct 2021 10:56:51 +0000 (12:56 +0200)] 
cpu: Split up virCPUDataParse

This makes it possible to call virCPUDataParse with a xmlNodePtr,
which will be required by a later patch.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu: Change virCPUArchDataParse to take xmlNodePtr
Tim Wiederhake [Wed, 13 Oct 2021 10:53:43 +0000 (12:53 +0200)] 
cpu: Change virCPUArchDataParse to take xmlNodePtr

The function does not need a full xmlXPathContextPtr any longer and a
later patch will require a call to this function with only a xmlNodePtr
available.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Add x86ParseDataItemList
Tim Wiederhake [Tue, 12 Oct 2021 17:51:04 +0000 (19:51 +0200)] 
cpu_x86: Add x86ParseDataItemList

Factor out duplicated code from x86FeatureParse and virCPUx86DataParse.
This also consolidates error messages.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Simplify x86ParseMSR
Tim Wiederhake [Tue, 12 Oct 2021 15:45:32 +0000 (17:45 +0200)] 
cpu_x86: Simplify x86ParseMSR

... by using virXMLProp*() helpers. These only require a xmlNodePtr and
do not need a xmlXPathContextPtr. Reflect that in the function signature.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agocpu_x86: Simplify x86ParseCPUID
Tim Wiederhake [Tue, 12 Oct 2021 15:39:14 +0000 (17:39 +0200)] 
cpu_x86: Simplify x86ParseCPUID

... by using virXMLProp*() helpers. These only require a xmlNodePtr and
do not need a xmlXPathContextPtr. Reflect that in the function signature.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: Fix regex for sc_require_attribute_cleanup_initialization
Peter Krempa [Fri, 5 Nov 2021 09:13:07 +0000 (10:13 +0100)] 
syntax-check: Fix regex for sc_require_attribute_cleanup_initialization

When I was cleaning up the regex after we removed most of our custom
autofree helpers I've forgot to delete one closing brace, thus the regex
was not matching anything.

Fixes: 65f702020e8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoremote_daemon: Validate tcp_min_ssf value only if found in config
Michal Privoznik [Fri, 5 Nov 2021 13:25:09 +0000 (14:25 +0100)] 
remote_daemon: Validate tcp_min_ssf value only if found in config

If there is no tcp_min_ssf value set in daemon config we still
compare it against the default (56 which corresponds to DES) and
if the value is below our expected minimum (112 which corresponds
to 3DES) an error is reported and the daemon refuses to start.
This is not what we want. What we want is to check the value iff
the value was specified in the config file.

Fixes: 58a48cff840
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: add guest interface information in 'virDomainGetGuestInfo'
zhanglei [Fri, 15 Oct 2021 10:07:51 +0000 (18:07 +0800)] 
NEWS: add guest interface information in 'virDomainGetGuestInfo'

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: add guest interface information in 'qemuDomainGetGuestInfo'
zhanglei [Fri, 15 Oct 2021 10:07:50 +0000 (18:07 +0800)] 
qemu: add guest interface information in 'qemuDomainGetGuestInfo'

Support return guest interface information from guest agent

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: refactor 'qemuAgentGetInterfaces'
zhanglei [Fri, 15 Oct 2021 10:07:49 +0000 (18:07 +0800)] 
qemu: refactor 'qemuAgentGetInterfaces'

Add report_unsupported parameter to qemuAgentGetInterfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add interface information to guestinfo command
zhanglei [Fri, 15 Oct 2021 10:07:48 +0000 (18:07 +0800)] 
virsh: add interface information to guestinfo command

The new parameter group returns information about network interfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agodomain: add interface information to 'virDomainGetGuestInfo'
zhanglei [Fri, 15 Oct 2021 10:07:47 +0000 (18:07 +0800)] 
domain: add interface information to 'virDomainGetGuestInfo'

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuTPMEmulatorReconfigure: Fix two build issues
Peter Krempa [Fri, 5 Nov 2021 08:48:52 +0000 (09:48 +0100)] 
qemuTPMEmulatorReconfigure: Fix two build issues

1) 'activePcrBanksStr' is not initialized:

../../../libvirt/src/qemu/qemu_tpm.c: In function ‘qemuExtTPMStart’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘activePcrBanksStr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   28 |   g_free (*pp);
      |   ^~~~~~~~~~~~
../../../libvirt/src/qemu/qemu_tpm.c:613:22: note: ‘activePcrBanksStr’ was declared here
  613 |     g_autofree char *activePcrBanksStr;
      |                      ^~~~~~~~~~~~~~~~~

2) 'pwdfile_fd' is unused:

../../../libvirt/src/qemu/qemu_tpm.c:615:19: error: unused variable 'pwdfile_fd' [-Werror,-Wunused-variable]
        VIR_AUTOCLOSE pwdfile_fd = -1;

Fixes: a5bbe1a8b63
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology
Jiri Denemark [Thu, 4 Nov 2021 18:49:36 +0000 (19:49 +0100)] 
qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology

It won't cause any harm as cpus is NULL when we pass a negative ncpus,
but doing so when the function expects unsigned value is not right.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Check return value of virJSONValueObjectAdd
Jiri Denemark [Thu, 4 Nov 2021 17:21:35 +0000 (18:21 +0100)] 
qemu: Check return value of virJSONValueObjectAdd

The return value was not properly checked in the code for input type
evdev.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: Avoid null pointer dereference when setting QoS on OVS
Jiri Denemark [Fri, 29 Oct 2021 09:13:33 +0000 (11:13 +0200)] 
util: Avoid null pointer dereference when setting QoS on OVS

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: tpm: Extend TPM domain XML with PCR banks to activate
Stefan Berger [Wed, 3 Nov 2021 17:04:23 +0000 (13:04 -0400)] 
qemu: tpm: Extend TPM domain XML with PCR banks to activate

Extend the TPM backend XML with a node 'active_pcr_banks' that allows a
user to specify the PCR banks to activate before starting a VM. Valid
choices for PCR banks are sha1, sha256, sha384 and sha512. When the XML
node is provided, the set of active PCR banks is 'enforced' by running
swtpm_setup before every start of the VM. The activation requires that
swtpm_setup v0.7 or later is installed and may not have any effect
otherwise.

<tpm model='tpm-tis'>
  <backend type='emulator' version='2.0'>
    <active_pcr_banks>
      <sha256/>
      <sha384/>
    </active_pcr_banks>
  </backend>
</tpm>

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2016599
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agomeson: Stop looking up ZFS programs at build time
Andrea Bolognani [Wed, 3 Nov 2021 09:32:14 +0000 (10:32 +0100)] 
meson: Stop looking up ZFS programs at build time

At this point, we're no longer using the availability of the
ZFS programs at build time to decide whether to enable ZFS
support, so the only purpose of these find_program() calls is
to record their absolute paths.

However, the virCommand facilities that we're ultimately using
to run them are already capable of performing this lookup at
runtime, and in fact that's exactly what we already do in the
case of, for example, vstorage.

Drop the build time lookups and always perform them at runtime.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agomeson: Enable ZFS storage backend even more often
Andrea Bolognani [Wed, 3 Nov 2021 09:57:41 +0000 (10:57 +0100)] 
meson: Enable ZFS storage backend even more often

Commit 73a2ff36163e already improved the situation a lot. This
pushes things even further.

If the user or, more likely, the distro packager explicitly
asked for ZFS support to be enabled, then we should comply with
that request regardless of whether the necessary programs are
available at build time.

This is particularly important in the context of Debian, where
ZFS cannot be a build dependency of libvirt due to licensing
issues but it can still be an optional runtime dependency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agodaemon: add tcp_min_ssf option
Ján Tomko [Tue, 4 Jun 2019 09:20:41 +0000 (11:20 +0200)] 
daemon: add tcp_min_ssf option

Add an option to allow the admin to requet a higher minimum SSF
for connections than the built-in default.

The current default is 56 (single DES equivalent, to support
old kerberos) and will be raised to 112 in the future.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodaemon: virNetSASLContext: store tcpMinSSF
Ján Tomko [Mon, 3 Jun 2019 13:50:06 +0000 (15:50 +0200)] 
daemon: virNetSASLContext: store tcpMinSSF

Store the minimum SSF value for TCP connections
in virNetSASLContext and introduce a getter for it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoremote: warn on low SSF
Ján Tomko [Wed, 16 Jan 2019 15:29:44 +0000 (16:29 +0100)] 
remote: warn on low SSF

Prepare for deprecating old kerberos ciphers by warning users
with a SSF lower than 112.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 2 Nov 2021 23:05:22 +0000 (00:05 +0100)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10441 of 10441 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 agoqemu: retire QEMU_CAPS_SPICE_UNIX
Ján Tomko [Tue, 2 Nov 2021 15:23:19 +0000 (16:23 +0100)] 
qemu: retire QEMU_CAPS_SPICE_UNIX

It is now unused.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: always assume QEMU_CAPS_SPICE_UNIX
Ján Tomko [Tue, 2 Nov 2021 15:17:36 +0000 (16:17 +0100)] 
qemu: always assume QEMU_CAPS_SPICE_UNIX

The presence of this capability depends on QEMU being compiled
with spice that has the SPICE_ADDR_FLAG_UNIX_ONLY constant.
It was added by spice commit 5365caeaae released in spice v0.12.6,
which is older than the spice version on our supported architectures.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: convert name-escape to use real caps
Ján Tomko [Tue, 2 Nov 2021 15:09:09 +0000 (16:09 +0100)] 
tests: convert name-escape to use real caps

For later QEMUs than 2.11 we do FD passing for character devices,
so lock the capabilites to this exact version.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: qemuxml2argv: use latest caps for spice tests
Ján Tomko [Tue, 2 Nov 2021 14:29:30 +0000 (15:29 +0100)] 
tests: qemuxml2argv: use latest caps for spice tests

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: qemuxml2xml: use latest caps for spice tests
Ján Tomko [Wed, 13 Oct 2021 15:03:33 +0000 (17:03 +0200)] 
tests: qemuxml2xml: use latest caps for spice tests

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: qemuxml2xmltest: move graphics-spice-timeout
Ján Tomko [Wed, 13 Oct 2021 15:09:16 +0000 (17:09 +0200)] 
tests: qemuxml2xmltest: move graphics-spice-timeout

Move the test closer to other graphics-spice tests.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotests: remove disks from spice tests
Ján Tomko [Wed, 13 Oct 2021 13:13:50 +0000 (15:13 +0200)] 
tests: remove disks from spice tests

Reduce the churn in following patches.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovirt-aa-helper: Purge profile if corrupted
Ioanna Alifieraki [Tue, 2 Nov 2021 14:04:45 +0000 (16:04 +0200)] 
virt-aa-helper: Purge profile if corrupted

This commit aims to address the bug reported in [1] and [2].
If the profile is corrupted (0-size) the VM cannot be launched.
To overcome this, check if the profile exists and if it has 0 size
remove it.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890084
[2] https://bugs.launchpad.net/bugs/1927519

Signed-off-by: Ioanna Alifieraki <ioanna-maria.alifieraki@canonical.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainGetStatsBlockExportDisk: Report stats also for helper images
Peter Krempa [Fri, 29 Oct 2021 14:04:45 +0000 (16:04 +0200)] 
qemuDomainGetStatsBlockExportDisk: Report stats also for helper images

Add stat entries also for the mirror destination and the backup job
scratch/target file. This is possible with '-blockdev' as we use unique
index for the entries.

The stats are reported when the VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING
is used.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2017928
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuMonitorJSONQueryBlockstats: query stats for helper images
Peter Krempa [Mon, 1 Nov 2021 10:35:41 +0000 (11:35 +0100)] 
qemuMonitorJSONQueryBlockstats: query stats for helper images

Use the 'query-nodes' flag to return all stats. The flag was introduced
prior to qemu-2.11 so we can always use it, but we invoke it only when
querying stats. The other invocation is used for detecting the nodenames
which is fragile code.

The images without a frontend don't have the device field so the
extraction code checks need to be relaxed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemustatusxml2xmldata: backup-pull: Add private data for scratch image
Peter Krempa [Mon, 1 Nov 2021 13:31:42 +0000 (14:31 +0100)] 
qemustatusxml2xmldata: backup-pull: Add private data for scratch image

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainBackupDefFormat: Propagate private data callbacks
Peter Krempa [Mon, 1 Nov 2021 11:42:39 +0000 (12:42 +0100)] 
virDomainBackupDefFormat: Propagate private data callbacks

The formatter for the backup job data didn't pass the virDomainXMLOption
struct to the disk formatter which meant that the private data of the
disk source were not formatted.

This didn't pose a problem for now as the blockjob list remembered the
nodenames for the jobs, but the backup source lost them.

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