]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agotests: reduce variable scope in testSELinuxCheckLabels
Ján Tomko [Fri, 3 Sep 2021 19:16:41 +0000 (21:16 +0200)] 
tests: reduce variable scope in testSELinuxCheckLabels

And use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8
Ján Tomko [Fri, 3 Sep 2021 18:17:09 +0000 (20:17 +0200)] 
tests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8

Also use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: reduce variable scope in testEscapeDatastoreItem
Ján Tomko [Fri, 3 Sep 2021 18:16:15 +0000 (20:16 +0200)] 
tests: esxutils: reduce variable scope in testEscapeDatastoreItem

Also use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: refactor testParseDatastorePath
Ján Tomko [Fri, 3 Sep 2021 18:15:46 +0000 (20:15 +0200)] 
tests: esxutils: refactor testParseDatastorePath

Reduce variable scope to match their lifetime,
use g_auto and remove now pointless labels in favor
of direct returns.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agosecretxml2xmltest: refactor testCompareXMLToXMLFiles
Ján Tomko [Sat, 4 Sep 2021 18:34:55 +0000 (20:34 +0200)] 
secretxml2xmltest: refactor testCompareXMLToXMLFiles

Use g_auto where possible and remove the pointless label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: bhyve: use bitwise shift when defining flags
Ján Tomko [Tue, 24 Nov 2020 14:25:27 +0000 (15:25 +0100)] 
tests: bhyve: use bitwise shift when defining flags

Although I'm sure we all know the powers of two by heart now,
this is the prevalent style for flag defition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: bhyve: remove magic constants
Ján Tomko [Tue, 24 Nov 2020 14:24:26 +0000 (15:24 +0100)] 
tests: bhyve: remove magic constants

Refer to flags by their identifier, not value.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agovirsh: add support for '--validate' option in create nwfilter-binding
Kristina Hanicova [Thu, 26 Aug 2021 12:32:35 +0000 (14:32 +0200)] 
virsh: add support for '--validate' option in create nwfilter-binding

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agonwfilter_driver: allow VIR_NWFILTER_BINDING_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:32:34 +0000 (14:32 +0200)] 
nwfilter_driver: allow VIR_NWFILTER_BINDING_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: virnwfilterbindingdef: add validation against schema in create
Kristina Hanicova [Thu, 26 Aug 2021 12:32:33 +0000 (14:32 +0200)] 
conf: virnwfilterbindingdef: add validation against schema in create

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virNWFilterBindingDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add virNWFilterBindingCreateFlags
Kristina Hanicova [Thu, 26 Aug 2021 12:32:32 +0000 (14:32 +0200)] 
api: add virNWFilterBindingCreateFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in create network port
Kristina Hanicova [Thu, 26 Aug 2021 12:23:57 +0000 (14:23 +0200)] 
virsh: add support for '--validate' option in create network port

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agobridge_driver: allow VIR_NETWORK_PORT_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:23:56 +0000 (14:23 +0200)] 
bridge_driver: allow VIR_NETWORK_PORT_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: virnetworkportdef: add validation against schema in network port create
Kristina Hanicova [Thu, 26 Aug 2021 12:23:55 +0000 (14:23 +0200)] 
conf: virnetworkportdef: add validation against schema in network port create

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virNetworkPortDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add VIR_NETWORK_PORT_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:23:54 +0000 (14:23 +0200)] 
api: add VIR_NETWORK_PORT_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu_driver: Don't check for g_strdup_printf() retval
Michal Privoznik [Mon, 6 Sep 2021 12:00:41 +0000 (14:00 +0200)] 
qemu_driver: Don't check for g_strdup_printf() retval

The g_strdup_printf() function can't fail really. There's no need
to check for its return value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu_driver.c: Fix file mode
Michal Privoznik [Mon, 6 Sep 2021 11:44:17 +0000 (13:44 +0200)] 
qemu_driver.c: Fix file mode

In the previous commit I accidentally changed the mode of
qemu_driver.c file. Restore the original mode.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: fix iothread residual when qemuProcessSetupIOThread failed
Lei Yang [Mon, 30 Aug 2021 08:02:50 +0000 (16:02 +0800)] 
qemu: fix iothread residual when qemuProcessSetupIOThread failed

In process of iothread hotplug, qemuDomainHotplugAddIOThread() calls
qemuProcessSetupIOThread(). When qemuProcessSetupIOThread() returned
a failure, only the cgroup directory 'iothread' was cleaned up within
the function. Right after that qemuDomainHotplugAddIOThread() would
return failure directly without rolling back the livedef and iothread
process that created previously.

Further, when 'virsh schedinfo domain --live' requires schedinfo of
such machine, the interface will always return a failure print as
follows: 'Failed to create v1 controller cpu for group: No such file
or directory'. The reason is qemuGetIOThreadsBWLive() using member
vm->def->iothreadids[0]->iothread_id to findout the corresponding
cgroup dircetory. In case mentioned previously, iothreadids[0] was not
been cleaned up while whose cgroup directroy has already been removed.

This patch rolls back the livedef and iothread process after
qemuProcessSetupIOThread() returned a failure. Of course we are not
limited to this function, we also perform the same rolling back after
any exception proecss in qemuDomainHotplugAddIOThread().

Signed-off-by: Lei Yang <yanglei209@huawei.com>
Signed-off-by: Wang Xin <wangxinxin.wang@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuValidateDomainDeviceDefDiskTransient: Validate that qemu doesn't terminate early
Masayoshi Mizuma [Mon, 30 Aug 2021 04:30:43 +0000 (00:30 -0400)] 
qemuValidateDomainDeviceDefDiskTransient: Validate that qemu doesn't terminate early

Setup of a disk with <transient shareBacking='yes'/> option issues a
reset of qemu. In cases when QEMU didn't yet support the 'set-action'
QMP libvirt would in certain cases setup the commandline without
'-no-shutdown' which caused qemu to exit during startup. Forbid this
specific scenario.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: process: Split out logic for setting the 'allowReboot' internal flag
Masayoshi Mizuma [Mon, 30 Aug 2021 04:30:42 +0000 (00:30 -0400)] 
qemu: process: Split out logic for setting the 'allowReboot' internal flag

Split out the logic which was used to determine whether qemu should
allow the guest OS to reboot for QEMU versions which don't support the
'set-action' QMP command.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Fri, 3 Sep 2021 17:08:41 +0000 (19:08 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.7% (4943 of 10353 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Fri, 3 Sep 2021 17:08:41 +0000 (19:08 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.7% (4943 of 10353 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 (Korean)
simmon [Tue, 31 Aug 2021 12:42:16 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 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 (Korean)
jason lee [Tue, 31 Aug 2021 12:42:15 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 47.3% (4897 of 10353 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:15 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4897 of 10353 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 (Korean)
jason lee [Tue, 31 Aug 2021 12:42:14 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.9% (4865 of 10353 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:12 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.5% (4820 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.4% (4809 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.3% (4795 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.3% (4794 of 10353 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 (Korean)
jason lee [Tue, 31 Aug 2021 12:42:11 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.1% (4781 of 10353 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 31 Aug 2021 12:42:10 +0000 (14:42 +0200)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10353 of 10353 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
3 years agoUpdate translation files
Weblate [Tue, 31 Aug 2021 12:42:08 +0000 (14:42 +0200)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:04 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4770 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4766 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4765 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 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 (Korean)
jason lee [Tue, 31 Aug 2021 12:42:03 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.5% (4719 of 10349 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Sinhala)
Hela Basa [Tue, 31 Aug 2021 12:42:02 +0000 (14:42 +0200)] 
Translated using Weblate (Sinhala)

Currently translated at 0.1% (2 of 10349 strings)

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

Co-authored-by: Hela Basa <r45xveza@pm.me>
Signed-off-by: Hela Basa <r45xveza@pm.me>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.6% (2344 of 10349 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 agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 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)
Ricky Tigg [Tue, 31 Aug 2021 12:41:59 +0000 (14:41 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.5% (2338 of 10349 strings)

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

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
3 years agomeson: avoid bogus warnings from clang and g_autoptr
Daniel P. Berrangé [Tue, 31 Aug 2021 14:05:15 +0000 (15:05 +0100)] 
meson: avoid bogus warnings from clang and g_autoptr

Clang has previously had trouble with G_DEFINE_AUTOPTR_CLEANUP_FUNC
generated code, thinking it was unused. We turn off -Wunused-function
to avoid tripping up on that with CLang.

New Clang has started having trouble with g_autoptr now too. In usage
scenarios where the variable is set, but never again read, it thinks
it is unused not realizing the destructor has useful side effects.
For this we have to skip -Wunused-but-set-variable on CLang.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoPost-release version bump to 7.8.0
Jiri Denemark [Wed, 1 Sep 2021 11:46:34 +0000 (13:46 +0200)] 
Post-release version bump to 7.8.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoRelease of libvirt-7.7.0 v7.7.0
Jiri Denemark [Wed, 1 Sep 2021 11:44:53 +0000 (13:44 +0200)] 
Release of libvirt-7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agonews: add FC VMID entry
Pavel Hrdina [Tue, 31 Aug 2021 12:53:17 +0000 (14:53 +0200)] 
news: add FC VMID entry

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: virstoragetest: remove tests without backing type
Ján Tomko [Tue, 31 Aug 2021 09:41:55 +0000 (11:41 +0200)] 
tests: virstoragetest: remove tests without backing type

As of qemu commit:

  commit 497a30dbb065937d67f6c43af6dd78492e1d6f6d
    qemu-img: Require -F with -b backing image

creating images with backing images requires specifying the format.

Remove tests which do not pass the backing format on the command
line.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpm: fix typo in post transaction scriptlet name
Daniel P. Berrangé [Tue, 31 Aug 2021 10:55:13 +0000 (11:55 +0100)] 
rpm: fix typo in post transaction scriptlet name

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu, xen: add missing deps on virtlockd/virtlogd sockets
Daniel P. Berrangé [Tue, 31 Aug 2021 09:59:39 +0000 (10:59 +0100)] 
qemu, xen: add missing deps on virtlockd/virtlogd sockets

The QEMU driver uses both virtlogd and virtlockd, while the Xen driver
uses virtlockd. The libvirtd.service unit contains deps on the socket
units for these services, but these deps were missed in the modular
daemons. As a result the virtlockd/virtlogd sockets are not started
when the virtqemud/virtxend daemons are started.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoNEWS: Update with description of changes to lifecycle action handling v7.7.0-rc2
Peter Krempa [Wed, 25 Aug 2021 09:50:08 +0000 (11:50 +0200)] 
NEWS: Update with description of changes to lifecycle action handling

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention bug with incorrect format recorded for qcow2+luks overlays
Peter Krempa [Wed, 25 Aug 2021 09:50:07 +0000 (11:50 +0200)] 
NEWS: Mention bug with incorrect format recorded for qcow2+luks overlays

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Move my contributions to correct release
Michal Privoznik [Fri, 27 Aug 2021 14:36:15 +0000 (16:36 +0200)] 
NEWS: Move my contributions to correct release

In previous commit I've documented my contributions for upcoming
7.7.0 release. But unfortunately I've placed the lines into wrong
release (7.6.0).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document my contributions for the upcoming release
Michal Privoznik [Thu, 26 Aug 2021 15:44:56 +0000 (17:44 +0200)] 
NEWS: Document my contributions for the upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention new SecurityManager APIs for labeling network devices
Jim Fehlig [Thu, 26 Aug 2021 22:53:36 +0000 (16:53 -0600)] 
NEWS: Mention new SecurityManager APIs for labeling network devices

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document new '--validate' option for virsh define commands
Kristina Hanicova [Thu, 26 Aug 2021 16:03:40 +0000 (18:03 +0200)] 
NEWS: Document new '--validate' option for virsh define commands

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: Set label on vhostuser net device when hotplugging
Jim Fehlig [Wed, 28 Jul 2021 00:13:36 +0000 (18:13 -0600)] 
qemu: Set label on vhostuser net device when hotplugging

Attaching a newly created vhostuser port to a VM fails due to an
apparmor denial

internal error: unable to execute QEMU command 'chardev-add': Failed
to bind socket to /run/openvswitch/vhu838c4d29-c9: Permission denied

In the case of a net device type VIR_DOMAIN_NET_TYPE_VHOSTUSER, the
underlying chardev is not labeled in qemuDomainAttachNetDevice prior
to calling qemuMonitorAttachCharDev.

A simple fix would be to call qemuSecuritySetChardevLabel using the
embedded virDomainChrSourceDef in the virDomainNetDef vhostuser data,
but this incurs the risk of incorrectly restoring the label. E.g.
consider the DAC driver behavior with a vhostuser net device, which
uses a socket for the chardev backend. The DAC driver uses XATTRS to
store original labelling information, but XATTRS are not compatible
with sockets. Without the original labelling information, the socket
labels will be restored with root ownership, preventing other
less-privileged processes from connecting to the socket.

This patch avoids overloading chardev labelling with vhostuser net
devices by introducing virSecurityManager{Set,Restore}NetdevLabel,
which is currently only implemented for the apparmor driver. The
new APIs are then used to set and restore labels for the vhostuser
net devices.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: fix generation of default resource partition
Pavel Hrdina [Wed, 25 Aug 2021 11:01:52 +0000 (13:01 +0200)] 
src: fix generation of default resource partition

Now that resource structure can have appid as well we need to adapt code
that creates default resource partition if not provided by user.
Otherwise starting a VM with appid defined would fail with following
error:

    error: unsupported configuration: Resource partition '(null)' must start with '/'

Fixes: 38b5f4faabccf681439d99e5394954c6ef7a5a40
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: formatdomain: fix typo
Ján Tomko [Thu, 26 Aug 2021 14:28:52 +0000 (16:28 +0200)] 
docs: formatdomain: fix typo

combiatnion -> combination

Fixes: 4ffc807214cb80086d57e1d3e7b60959a41d2874
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agopo: Refresh potfile for v7.7.0 v7.7.0-rc1
Jiri Denemark [Thu, 26 Aug 2021 10:10:50 +0000 (12:10 +0200)] 
po: Refresh potfile for v7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agotests: Fix typos
Tim Wiederhake [Wed, 25 Aug 2021 12:50:25 +0000 (14:50 +0200)] 
tests: Fix typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirscsi: Drop @tmp from virSCSIDeviceListDel
Michal Privoznik [Mon, 23 Aug 2021 10:54:32 +0000 (12:54 +0200)] 
virscsi: Drop @tmp from virSCSIDeviceListDel

Clang on Rawhide started to complain that @tmp variable in
virSCSIDeviceListDel() is set but not used. This is obviously a
false positive because the variable is used to free device stolen
from the list. Anyway, we can do without the variable so in this
specific case let's fix our code to appease Clang.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotest: Drop unused @cfg from qemu*test
Michal Privoznik [Tue, 24 Aug 2021 07:31:25 +0000 (09:31 +0200)] 
test: Drop unused @cfg from qemu*test

In qemumigrationcookiexmltest and qemustatusxml2xmltest there is
@cfg variable that is unused. It's set via virQEMUDriverGetConfig()
but then never used. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovirpci: Clarify lifetime of temporary object
Michal Privoznik [Mon, 23 Aug 2021 10:47:07 +0000 (12:47 +0200)] 
virpci: Clarify lifetime of temporary object

The virPCIDeviceIsBehindSwitchLackingACS() function checks
whether given PCI device is not behind a switch that lacks ACS.
It does so by starting at given device and traversing up, one
parent at time towards the root. The parent device is obtained
via virPCIDeviceGetParent() which allocates new virPCIDevice
structure. For freeing the structure we use g_autoptr() and a
temporary variable @tmp. However, Clang fails to understand our
clever algorithm and complains that the variable is set but never
used. This is obviously a false positive, but using a small trick
we can shut Clang up.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: snapshot: Translate 'volume' disks before attempting offline snapshot manipulation
Peter Krempa [Fri, 2 Jul 2021 14:00:05 +0000 (16:00 +0200)] 
qemu: snapshot: Translate 'volume' disks before attempting offline snapshot manipulation

When the VM is inactive the 'virStorageSource' struct doesn't have the
necessary data pointing to the actual storage. This is a problem for
inactive snapshot operations on VMs which use disk type='volume'.

Add the translation steps for reversion and deletion of snapshots.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1977155
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/202
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: process: Ignore 'RESET' event during startup
Peter Krempa [Tue, 20 Jul 2021 07:28:51 +0000 (09:28 +0200)] 
qemu: process: Ignore 'RESET' event during startup

In cases when we are adding a <transient/> disk with sharing backend
(and thus hotplugging it) we need to re-initialize ACPI tables so that
the VM boots from the correct device.

This has a side-effect of emitting the RESET event and forwarding it to
the clients which is not correct.

Fix this by ignoring RESET events during startup of the VM.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Properly update 'onReboot' action in qemu
Peter Krempa [Fri, 20 Aug 2021 13:40:18 +0000 (15:40 +0200)] 
qemuDomainSetLifecycleAction: Properly update 'onReboot' action in qemu

When qemu supports 'set-action' command we can update what happens on
reboot. Additionally we can fully relax the checks as we now properly
update the lifecycle actions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: process: Don't set 'allowReboot' when qemu supports 'set-action'
Peter Krempa [Mon, 23 Aug 2021 14:43:26 +0000 (16:43 +0200)] 
qemu: process: Don't set 'allowReboot' when qemu supports 'set-action'

We don't use the value of the flag when the new handling is in place so
we don't have to initialize it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: command: Always use '-no-shutdown'
Peter Krempa [Thu, 19 Aug 2021 11:50:16 +0000 (13:50 +0200)] 
qemu: command: Always use '-no-shutdown'

The '-no-shutdown' flag prevents qemu from terminating if a shutdown was
requested. Libvirt will handle the termination of the qemu process
anyways and using this consistently will allow greater flexibility for
the virDomainSetLifecycleAction API as well as will allow using
the 'system-reset' QMP command during startup to reinitiate devices
exported to the firmware.

This efectively partially reverts 0e034efaf9b963760516a65413fd9771034357aa

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessLaunch: Setup handling of 'on_reboot' via QMP when starting the process
Peter Krempa [Mon, 23 Aug 2021 14:40:46 +0000 (16:40 +0200)] 
qemuProcessLaunch: Setup handling of 'on_reboot' via QMP when starting the process

Rather than using '-no-reboot' use the QMP command to update the
lifecycle action of 'on_reboot'.

This will be identical to how we set the behaviour during lifetime and
also avoids problems with use of the 'system-reset' QMP command during
bringup of the VM (used to update the firmware table of disks when disks
were hotplugged as part of startup).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessHandleReset: Don't emulate lifecycle actions for RESET event
Peter Krempa [Fri, 20 Aug 2021 14:16:46 +0000 (16:16 +0200)] 
qemuProcessHandleReset: Don't emulate lifecycle actions for RESET event

The RESET event is delivered by qemu only when the guest OS is actually
allowed to reboot ('-no-reboot' or equivalent is not used) and due to
the nature of async handling of the events VM is actually already
executing guest code after the reboot, until our code gets to killing
it.

In general it should have been impossible to reach a state where the
reboot action is 'destroy' but we didn't use '-no-reboot' but due to
various bugs it was.

Due to the fact that this was not a desired operation and additionally
guest code already is executing I think the best option is not to kill
the VM any more (possible data loss?) and rely for the proper fix where
we use the new 'set-action' QMP command to enable an equivalent
behaviour to '-no-reboot' during runtime.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Forbid live update of 'on_reboot'
Peter Krempa [Fri, 20 Aug 2021 14:46:25 +0000 (16:46 +0200)] 
qemuDomainSetLifecycleAction: Forbid live update of 'on_reboot'

Without the ability to tell qemu to change the behaviour on reboot of
the guest it's fundamentally unsafe to change the action as the guest
would be able to execute instructions after the reboot before libvirt
terminates it due to the async nature of QMP events.

Stricten the code for now until we implement support for 'set-action'
QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: domain: Remove qemuDomainIsUsingNoShutdown
Peter Krempa [Mon, 23 Aug 2021 13:01:43 +0000 (15:01 +0200)] 
qemu: domain: Remove qemuDomainIsUsingNoShutdown

Directly use 'priv->allowReboot' as we now document what the behaiour is
to avoid another lookup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: migration: Don't transfer 'allowReboot' flag
Peter Krempa [Fri, 20 Aug 2021 14:11:05 +0000 (16:11 +0200)] 
qemu: migration: Don't transfer 'allowReboot' flag

The original idea was to ensure that the destination has the same
original state of the '-no-reboot' flag to ensure identical behaviour of
the 'vidDomainModifyLifecycleAction' API.

With newer qemu's we'll be able to modify the behaviour using the
monitor so old daemons won't be able to keep up anyways.

Remove this feature as it's not very useful and will be replaced by a
proper solution.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainObjPrivate: Annotate 'allowReboot' field
Peter Krempa [Thu, 19 Aug 2021 12:54:18 +0000 (14:54 +0200)] 
qemuDomainObjPrivate: Annotate 'allowReboot' field

Save further readers the headache of determining what it actually does
and note that it's not used with qemu version supporting the
'set-action' command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case
Peter Krempa [Mon, 23 Aug 2021 15:09:30 +0000 (17:09 +0200)] 
qemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case

Upcoming patches will modify how '-no-reboot' is handled when qemu
supports the 'set-action' QMP command. Add a test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported
Peter Krempa [Fri, 20 Aug 2021 12:54:37 +0000 (14:54 +0200)] 
qemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported

If current qemu supports 'set-action' use it instead of the single-use
command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: monitor: Implement monitor code for 'set-action' command
Peter Krempa [Fri, 20 Aug 2021 12:39:27 +0000 (14:39 +0200)] 
qemu: monitor: Implement monitor code for 'set-action' command

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION
Peter Krempa [Fri, 20 Aug 2021 10:56:08 +0000 (12:56 +0200)] 
qemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION

The 'set-action' QMP command allows modifying the behaviour when the
guest resets.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Honor 'restart' action for 'on_poweroff'
Peter Krempa [Thu, 19 Aug 2021 12:44:51 +0000 (14:44 +0200)] 
qemu: Honor 'restart' action for 'on_poweroff'

We simply terminate qemu instead of issuing a reset as the semantics of
the setting dictate.

Fix it by handling it identically to 'fake reboot'.

We need to forbid the combination of 'onReboot' -> 'destroy' and
'onPoweroff' -> reboot though as the handling would be hairy and it
honetly makes no sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Mon, 23 Aug 2021 14:49:11 +0000 (16:49 +0200)] 
qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'preserve' action.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'
Peter Krempa [Tue, 24 Aug 2021 11:44:00 +0000 (13:44 +0200)] 
qemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'

Some actions are not supported by qemu. Use the recently added
'qemuValidateLifecycleAction' helper to ensure that the API does the
same validation as we do on startup in the validation callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Thu, 19 Aug 2021 14:23:02 +0000 (16:23 +0200)] 
qemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'rename-restart' action.

At this point the following handling would take place:

'on_reboot' set to 'rename-restart' is ignored on guest-initiated
reboots, the guest simply reboots.

For on_poweroff set to 'rename-restart' the following happens:

guest initiated shutdown -> 'destroy'
libvirt initiated shutdown -> 'reboot'

In addition when 'on_reboot' is 'destroy' in addition to 'on_poweroff'
being 'rename-restart' the guest is able to execute instructions after
issuing a reset before libvirt terminates it. This will be addressed
separately later.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: validate: Reformat header and purge unused includes
Peter Krempa [Tue, 24 Aug 2021 07:26:35 +0000 (09:26 +0200)] 
qemu: validate: Reformat header and purge unused includes

Use the new style header formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Use 'qemuDomainSaveStatus' for saving status XML
Peter Krempa [Fri, 20 Aug 2021 13:26:47 +0000 (15:26 +0200)] 
qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML

We've got multiple random open-coded versions. Switch to the helper
function which doesn't report errors as they'd be mostly wrong as the
operation was indeed successful.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Add a note about argument range-check
Peter Krempa [Fri, 20 Aug 2021 13:17:00 +0000 (15:17 +0200)] 
qemuDomainSetLifecycleAction: Add a note about argument range-check

The public API wrapper range-checks the arguments. Save the next reader
the hassle of looking it up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuMonitorJSONSetWatchdogAction: Use automatic memory clearing
Peter Krempa [Fri, 20 Aug 2021 12:09:14 +0000 (14:09 +0200)] 
qemuMonitorJSONSetWatchdogAction: Use automatic memory clearing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add LATEST version of 'cpu-host-model'
Peter Krempa [Wed, 18 Aug 2021 12:30:10 +0000 (14:30 +0200)] 
qemuxml2argvtest: Add LATEST version of 'cpu-host-model'

This one will be slightly unstable given that CPU features are being
modified frequently in qemu especially when used with a modern cpu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemucapabilitiesdata: Update qemu caps dump for 6.1.0 release
Peter Krempa [Wed, 18 Aug 2021 09:31:48 +0000 (11:31 +0200)] 
qemucapabilitiesdata: Update qemu caps dump for 6.1.0 release

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions
Peter Krempa [Wed, 18 Aug 2021 12:28:23 +0000 (14:28 +0200)] 
qemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions

The host model expansion depends on the capability data, so in this case
it makes sense to have specific invocations of the test for all qemu
versions we have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Slightly modernize "cpu-host-model" case
Peter Krempa [Wed, 18 Aug 2021 12:21:45 +0000 (14:21 +0200)] 
qemuxml2argvtest: Slightly modernize "cpu-host-model" case

Switch to q35 in anticipation of using DO_TEST_CAPS* in further patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case
Peter Krempa [Wed, 18 Aug 2021 12:02:36 +0000 (14:02 +0200)] 
qemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case

Use the larger number in the original test to avoid having two files.

Additionally this avoids use of 'host-model' with DO_TEST_CAPS_LATEST in
cases when it isn't necessary for the purpose of the test as the CPU
model tends to change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'
Peter Krempa [Wed, 18 Aug 2021 11:45:30 +0000 (13:45 +0200)] 
qemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'

The test case doesn't really test anything about the specific CPU. Using
a host-model cpu with DO_TEST_CAPS_LATEST results in commandline changes
every time qemu updates the cpu definiton.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define storage pool
Kristina Hanicova [Tue, 24 Aug 2021 14:51:11 +0000 (16:51 +0200)] 
virsh: add support for '--validate' option in define storage pool

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag
Kristina Hanicova [Tue, 24 Aug 2021 14:51:10 +0000 (16:51 +0200)] 
storage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_conf: add validation against schema in pool define
Kristina Hanicova [Tue, 24 Aug 2021 14:51:09 +0000 (16:51 +0200)] 
storage_conf: add validation against schema in pool define

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virStoragePoolDefParse() function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virStoragePoolDefineFlags
Kristina Hanicova [Tue, 24 Aug 2021 14:51:08 +0000 (16:51 +0200)] 
api: add virStoragePoolDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxcxml2xmltest: Substitute 'inactive' variable with 'active'
Kristina Hanicova [Wed, 21 Jul 2021 08:25:22 +0000 (10:25 +0200)] 
lxcxml2xmltest: Substitute 'inactive' variable with 'active'

I removed negation from the name of a variable to make the code
more readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoAPI: discourage usage of non-ListAll APIs
Ján Tomko [Sun, 4 Oct 2020 22:20:27 +0000 (00:20 +0200)] 
API: discourage usage of non-ListAll APIs

They require the caller to provide the maximum number
of array elements upfront, leading to either incomplete
results or violations of the zero-one-infinity rule.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: simplify machine-type check for implicit floppy controller
Ján Tomko [Fri, 7 May 2021 20:12:43 +0000 (22:12 +0200)] 
qemu: simplify machine-type check for implicit floppy controller

Q35 machine types 2.3 and older had an integrated floppy controller.

Support for these machine types was removed by QEMU commit

  commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe
      q35: Remove old machine versions
  git describe: v2.5.0-1530-g86165b499e contains: v2.6.0-rc0~76^2~4

In libvirt, we have bumped the minimum QEMU version to 2.11:

  commit b4cbdbe90bbf85eaf687f532d5a52a11e664b781
    qemu: Formally deprecate support for qemu < 2.11
  git describe: v7.3.0-13-gb4cbdbe90b contains: v7.4.0-rc1~300

Since this QEMU version only supports Q35 machine versions 2.4+,
remove the code dealing with older ones.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: check unlink hint from virQEMUFileOpenAs()
Simon Rowe [Mon, 23 Aug 2021 15:40:48 +0000 (15:40 +0000)] 
qemu: check unlink hint from virQEMUFileOpenAs()

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoiohelper: skip lseek() and ftruncate() on block devices
Simon Rowe [Mon, 23 Aug 2021 15:40:47 +0000 (15:40 +0000)] 
iohelper: skip lseek() and ftruncate() on block devices

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: add support for '--validate' option in define network
Kristina Hanicova [Mon, 23 Aug 2021 16:50:14 +0000 (18:50 +0200)] 
virsh: add support for '--validate' option in define network

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonetwork: allow VIR_NETWORK_DEFINE_VALIDATE flag
Kristina Hanicova [Mon, 23 Aug 2021 16:50:13 +0000 (18:50 +0200)] 
network: allow VIR_NETWORK_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc & network_conf: add validation against schema in define
Kristina Hanicova [Mon, 23 Aug 2021 16:50:12 +0000 (18:50 +0200)] 
src & network_conf: add validation against schema in define

This patch also includes propagation of flags into the
virNetworkDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNetworkDefineFlags
Kristina Hanicova [Mon, 23 Aug 2021 16:50:11 +0000 (18:50 +0200)] 
api: add virNetworkDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: add driver support for networkDefineXMLFlags()
Kristina Hanicova [Mon, 23 Aug 2021 16:50:10 +0000 (18:50 +0200)] 
src: add driver support for networkDefineXMLFlags()

I have added new driver functions which define network with given
flags. I have also replaced definitions of the functions without
flags with function calls to the new ones.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>