]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agoqemu: move temp file of screenshot and memorypeek to per-domain dir
Peng Liang [Mon, 13 Sep 2021 14:23:46 +0000 (22:23 +0800)] 
qemu: move temp file of screenshot and memorypeek to per-domain dir

The temp files of screenshot and memory peek, which are created by QEMU,
are put in the cache directory.  However, the caches of domain
capabilities, which are created and used by libvirtd, are also put in
the cache directory.  In order to make the cache directory more secure,
move the temp files of screenshot and memory peek to per-domain
directory.

Since the temp files are just temporary files and are only used by
libvirtd (libvirtd will delete them after use), the use of screenshot
and memory peek will be affected.

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirDomainDefParseXML: Use automatic memory management
Tim Wiederhake [Fri, 17 Sep 2021 13:40:09 +0000 (15:40 +0200)] 
virDomainDefParseXML: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: command: Remove qemuBuildRBDSecinfoURI
Peter Krempa [Wed, 22 Sep 2021 11:32:06 +0000 (13:32 +0200)] 
qemu: command: Remove qemuBuildRBDSecinfoURI

Merge the code into the only caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: domain: Rename secrets setup function
Peter Krempa [Wed, 22 Sep 2021 07:47:05 +0000 (09:47 +0200)] 
qemu: domain: Rename secrets setup function

Since there's just one type left, we can change the name to a more
generic one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Simplify qemuDomainSecretInfo
Peter Krempa [Wed, 22 Sep 2021 07:34:31 +0000 (09:34 +0200)] 
qemu: Simplify qemuDomainSecretInfo

Now that we've removed support for plaintext secrets qemuDomainSecretInfo
can be simplified by removing the 'type' field and merging in all the
fields from 'qemuDomainSecretAES'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildSCSIiSCSIHostdevDrvStr: Don't call qemuDiskSourceNeedsProps
Peter Krempa [Tue, 21 Sep 2021 16:26:43 +0000 (18:26 +0200)] 
qemuBuildSCSIiSCSIHostdevDrvStr: Don't call qemuDiskSourceNeedsProps

It always returns true for iSCSI, so we can remove the fallback logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: Remove qemuBuildGeneralSecinfoURI
Peter Krempa [Tue, 21 Sep 2021 16:24:55 +0000 (18:24 +0200)] 
qemu: command: Remove qemuBuildGeneralSecinfoURI

After removal of plaintext secrets this function is a noop.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Remove VIR_DOMAIN_SECRET_INFO_TYPE_PLAIN and associated code
Peter Krempa [Tue, 21 Sep 2021 16:23:00 +0000 (18:23 +0200)] 
qemu: Remove VIR_DOMAIN_SECRET_INFO_TYPE_PLAIN and associated code

There's no code which could set it any more so we can remove the
generators.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_ISCSI_PASSWORD_SECRET
Peter Krempa [Tue, 21 Sep 2021 16:13:02 +0000 (18:13 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_ISCSI_PASSWORD_SECRET

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: domain: Always assume QEMU_CAPS_ISCSI_PASSWORD_SECRET
Peter Krempa [Tue, 21 Sep 2021 16:06:05 +0000 (18:06 +0200)] 
qemu: domain: Always assume QEMU_CAPS_ISCSI_PASSWORD_SECRET

QEMU supports the 'password-secret' parameter to pass a QCryptoSecret
since 2.9. Remove the alternate plaintext logic.

Unfortunately this had a ripple effect of removing qemuCaps from a lot
of functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: domain: Remove qemuDomainSupportsEncryptedSecret
Peter Krempa [Tue, 21 Sep 2021 15:58:30 +0000 (17:58 +0200)] 
qemu: domain: Remove qemuDomainSupportsEncryptedSecret

The answer is now always 'true', so we can remove the function and
simplify the logic in places where it's called.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_OBJECT_SECRET
Peter Krempa [Tue, 21 Sep 2021 15:53:26 +0000 (17:53 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_OBJECT_SECRET

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume presence of QEMU_CAPS_OBJECT_SECRET
Peter Krempa [Tue, 21 Sep 2021 15:50:00 +0000 (17:50 +0200)] 
qemu: Always assume presence of QEMU_CAPS_OBJECT_SECRET

The secret object is supported since qemu-2.6 and can't be compiled out.
Assume the presence to simplify the code.

This enables the use of the secret key for most tests not using real
caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: Remove use of virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC)
Peter Krempa [Tue, 21 Sep 2021 15:33:52 +0000 (17:33 +0200)] 
util: Remove use of virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC)

It always returns true. Make the logic a bit simpler to see through.

This completely removes 'virCryptoHaveCipher' as it's pointless in the
current form.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoscripts: apibuild: fix spacing
Ján Tomko [Tue, 21 Sep 2021 16:04:00 +0000 (18:04 +0200)] 
scripts: apibuild: fix spacing

Syntax check reports:
E226 missing whitespace around arithmetic operator

Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoscripts: fix API parsing of *** pointers
Daniel P. Berrangé [Mon, 20 Sep 2021 16:24:45 +0000 (17:24 +0100)] 
scripts: fix API parsing of *** pointers

The currrent generated API contains *** pointer types with bogus
whitespace in the middle:

  <arg name='keys' type='char ** *' info='pointer to a variable to store authorized keys'/>

because the tokenizer only tries to merge 2 distinct '*' together.
This refactors the code to merge an arbitrary number, resulting
in

  <arg name='keys' type='char ***' info='pointer to a variable to store authorized keys'/>

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agovirDevMapperGetTargets: Fix non-linux implementation
Peter Krempa [Tue, 21 Sep 2021 12:30:19 +0000 (14:30 +0200)] 
virDevMapperGetTargets: Fix non-linux implementation

s/GSlist/GSList/

Fixes: 6c49c2ee9fcb88de02cdc333f666a8e95d60a3b0
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agoschemas: Allow <unique_id/> to be zero
Michal Privoznik [Thu, 16 Sep 2021 11:21:33 +0000 (13:21 +0200)] 
schemas: Allow <unique_id/> to be zero

The value of zero is valid <unique_id/> (see
virNodeDeviceGetSCSIHostCaps()) but our RNG does not think so.
Switching the type to 'unsignedInt' does allow value of zero.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoschemas: Provide grammar for scsi_generic capabilities
Michal Privoznik [Thu, 16 Sep 2021 09:18:01 +0000 (11:18 +0200)] 
schemas: Provide grammar for scsi_generic capabilities

A nodedev can have 'scsi_generic' capabilities but corresponding
RNG is missing. Fortunately, it's very simple - there's only one
mandatory child element <char/>.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoschemas: Make <type/> for capscsi type optional
Michal Privoznik [Thu, 16 Sep 2021 08:29:21 +0000 (10:29 +0200)] 
schemas: Make <type/> for capscsi type optional

The <type/> element for <capability type='scsi'> part of nodedev
XML is optional (see udevProcessSCSIDevice()) and as such might
not be formatted into nodedev XML (see
virNodeDeviceCapSCSIDefFormat()). Reflect this in our RNG.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agomeson: Enable ZFS storage backend more often
Michal Privoznik [Tue, 14 Sep 2021 07:38:44 +0000 (09:38 +0200)] 
meson: Enable ZFS storage backend more often

Currently, the ZFS storage backend is enabled only if both zfs
and zpool binaries were found during configure phase. This is not
consistent with our attempts to move dependencies on binaries
from compile to runtime. And also it is inconsistent with other
backends, e.g. vstorage.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agomeson: Don't set $PROG_PATH macros
Michal Privoznik [Tue, 14 Sep 2021 08:41:02 +0000 (10:41 +0200)] 
meson: Don't set $PROG_PATH macros

Now, that there is no user of $PROG_PATH macros the meson script
can be changed so that it doesn't set those macros. It's
redundant as $PROG macro contains the same value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Use $PROG instead of $PROG_PATH
Michal Privoznik [Tue, 14 Sep 2021 08:40:42 +0000 (10:40 +0200)] 
lib: Use $PROG instead of $PROG_PATH

Due to the way we detect programs at runtime there's no
difference between $PROG and $PROG_PATH macros that come from
meson-config.h. Either both are set to the path found during
configure or both are set to just "$prog", e.g.:

  #define EBTABLES "/sbin/ebtables"
  #define EBTABLES_PATH "/sbin/ebtables"
  #define FLAKE8 "flake8"
  #define FLAKE8_PATH "flake8"

Change those few places which use _PATH.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_FW_CFG
Peter Krempa [Mon, 20 Sep 2021 15:10:09 +0000 (17:10 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_FW_CFG

The code assumes that all supported qemu versions have this capability
so we can retire it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Assume QEMU_CAPS_FW_CFG
Peter Krempa [Mon, 20 Sep 2021 15:04:33 +0000 (17:04 +0200)] 
qemu: Assume QEMU_CAPS_FW_CFG

qemu supports this since 81b2b81062 ("fw_cfg: insert fw_cfg file blobs
via qemu cmdline") released in qemu-v2.4.0 and it can't be compiled out.

Assume that the option always works and remove the corresponding check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Assume QEMU_CAPS_LOADPARM for s390 only
Peter Krempa [Tue, 27 Jul 2021 08:41:50 +0000 (10:41 +0200)] 
qemu: capabilities: Assume QEMU_CAPS_LOADPARM for s390 only

Added to 'query-command-line-options' in qemu commit 5559716c98
("util/qemu-config: Add loadparm to qemu machine_opts") released in
qemu-v2.10.0 but makes sense for s390 only. Treat it the same as the
keywrap capabilities in previous commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Assume QEMU_CAPS_AES_KEY_WRAP and QEMU_CAPS_DEA_KEY_WRAP for...
Peter Krempa [Tue, 27 Jul 2021 08:41:16 +0000 (10:41 +0200)] 
qemu: capabilities: Assume QEMU_CAPS_AES_KEY_WRAP and QEMU_CAPS_DEA_KEY_WRAP for s390 only

qemu introduced these options in 2eb1cd0768 ("s390x: CPACF: Handle key
wrap machine options") released in qemu-v2.3.0 but was exposed in
query-command-line-options only in 5bcfa0c543 ("util/qemu-config: fix
missing machine command line options").

The problem is that they are exposed even for architectures which don't
actually in fact support those.

Make the two capabilities a bit more useful by assuming them only on
s390 and thus removing them from other arches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: QEMU_CAPS_MEM_MERGE
Peter Krempa [Mon, 9 Aug 2021 13:06:52 +0000 (15:06 +0200)] 
qemu: capabilities:  QEMU_CAPS_MEM_MERGE

The code assumes that the feature tracked by this capability always
exists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume QEMU_CAPS_MEM_MERGE
Peter Krempa [Mon, 9 Aug 2021 12:56:11 +0000 (14:56 +0200)] 
qemu: Always assume QEMU_CAPS_MEM_MERGE

Supported since qemu commit 8490fc78e7 ("add -machine mem-merge=on|off
option") released in qemu-v1.3.0 and can't be compiled out.

Assume that it's present and remove the validation code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_SPLASH_TIMEOUT
Peter Krempa [Mon, 9 Aug 2021 11:18:27 +0000 (13:18 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_SPLASH_TIMEOUT

The code assumes that the feature tracked by this capability always
exists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume QEMU_CAPS_SPLASH_TIMEOUT
Peter Krempa [Mon, 9 Aug 2021 11:15:11 +0000 (13:15 +0200)] 
qemu: Always assume QEMU_CAPS_SPLASH_TIMEOUT

Supported since qemu commit 3d3b8303c6 ("showing a splash picture when
start") released in qemu-v1.0 and can't be compiled out.

Assume that it's present and remove the validation code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Remove negative case for 'boot-menu-enable-with-timeout'
Peter Krempa [Mon, 20 Sep 2021 14:36:53 +0000 (16:36 +0200)] 
qemuxml2argvtest: Remove negative case for 'boot-menu-enable-with-timeout'

The feature is now always present. Remove the negative test case as the
upcomming commit will remove the checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_REBOOT_TIMEOUT
Peter Krempa [Mon, 9 Aug 2021 11:00:22 +0000 (13:00 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_REBOOT_TIMEOUT

The code assumes that the feature tracked by this capability always
exists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Always assume QEMU_CAPS_REBOOT_TIMEOUT
Peter Krempa [Mon, 9 Aug 2021 08:02:06 +0000 (10:02 +0200)] 
qemu: Always assume QEMU_CAPS_REBOOT_TIMEOUT

Supported since ac05f34924 ("add a boot parameter to set reboot
timeout") released in qemu-v1.3.0 and can't be compiled out.

Assume that it's present and remove the validation code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argv: Remove negative case for 'reboot-timeout-enabled'
Peter Krempa [Fri, 6 Aug 2021 13:37:07 +0000 (15:37 +0200)] 
tests: qemuxml2argv: Remove negative case for 'reboot-timeout-enabled'

All supported qemu versions now support this feature so this test is
pointless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: capabilities: Retire QEMU_CAPS_BOOT_STRICT
Peter Krempa [Fri, 6 Aug 2021 13:23:00 +0000 (15:23 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_BOOT_STRICT

It's not used since last commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: Always assume 'QEMU_CAPS_BOOT_STRICT'
Peter Krempa [Mon, 20 Sep 2021 14:22:59 +0000 (16:22 +0200)] 
qemu: command: Always assume 'QEMU_CAPS_BOOT_STRICT'

Added by c8a6ae8bb9 in qemu-v1.5.0 and can't be compiled out. Assume
that it's present and fix all fake-caps tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuMonitorJSONGetStatus: Refactor cleanup
Peter Krempa [Wed, 17 Mar 2021 17:05:52 +0000 (18:05 +0100)] 
qemuMonitorJSONGetStatus: Refactor cleanup

Use g_autofree for the JSON values to remove cleanup label and ret
variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: virstring: Remove unused 'virStringListMerge'
Peter Krempa [Mon, 20 Sep 2021 11:09:10 +0000 (13:09 +0200)] 
util: virstring: Remove unused 'virStringListMerge'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDevMapperGetTargets: Use a linked list as return type
Peter Krempa [Mon, 20 Sep 2021 12:30:59 +0000 (14:30 +0200)] 
virDevMapperGetTargets: Use a linked list as return type

Of the two callers one simply iterates over the returned paths and the
second one appends the returned paths to another linked list. Simplify
all of this by directly returning a linked list.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: virdevmapper: Sanitize use of macros for buffer size
Peter Krempa [Mon, 29 Mar 2021 13:03:50 +0000 (15:03 +0200)] 
util: virdevmapper: Sanitize use of macros for buffer size

There are two distinct uses of an arbitrary buffers size when querying
the device mapper. One is related to loading the /proc/devices file,
while the other is used as buffer for ioctls to the devmapper.

Split up the macros used here so that it's clear that they are not meant
for the same thing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Implement virtio-blk queue-size option
Hiroki Narukawa [Thu, 9 Sep 2021 03:34:48 +0000 (12:34 +0900)] 
qemu: Implement virtio-blk queue-size option

The option "queue-size" in virtio-blk was added in qemu-2.12.0, and
default value increased from qemu-5.0.0.

However, increasing this value may lead to drop of random access
performance.

Signed-off-by: Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: add QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE capability
Hiroki Narukawa [Thu, 9 Sep 2021 03:34:47 +0000 (12:34 +0900)] 
qemu: add QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE capability

To support virtio-blk queue-size option, this commit adds capability
detection to the option.

Signed-off-by: Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: add queue_size option to disk
Hiroki Narukawa [Thu, 9 Sep 2021 03:34:46 +0000 (12:34 +0900)] 
conf: add queue_size option to disk

The option "queue-size" for virtio-blk was added in qemu-2.12.0, and
default value increased from qemu-5.0.0.

However, increasing this value may lead to drop of random access
performance.

Signed-off-by: Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovirDomainDiskDefCheckABIStability: add disk queue count ABI stability check
Hiroki Narukawa [Thu, 9 Sep 2021 03:34:45 +0000 (12:34 +0900)] 
virDomainDiskDefCheckABIStability: add disk queue count ABI stability check

virtio-blk num-queue is visible to guest OS, so this must be kept while
live migration.

Signed-off-by: Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2*test: Make disk-virtio-queues tests use DO_TEST_CAPS_LATEST
Hiroki Narukawa [Thu, 9 Sep 2021 03:34:44 +0000 (12:34 +0900)] 
qemuxml2*test: Make disk-virtio-queues tests use DO_TEST_CAPS_LATEST

Currently disk-virtio-queues test is now using specifying a fake
capability.

By this commit this test will make use of DO_TEST_CAPS_LATEST.

Signed-off-by: Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovsh: Ensure that bool --options don't have completer
Michal Privoznik [Fri, 17 Sep 2021 07:58:03 +0000 (09:58 +0200)] 
vsh: Ensure that bool --options don't have completer

Let's check whether a boolean --option doesn't have completer or
completer_flags set. These options are just flags and don't
accept any value, thus they can't have any completer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh: Extend checks for aliased commands
Michal Privoznik [Fri, 17 Sep 2021 07:52:43 +0000 (09:52 +0200)] 
vsh: Extend checks for aliased commands

If a command is an alias, then it can only have .name, .flags and
.alias set and .flags should contain just VSH_CMD_FLAG_ALIAS.
Check if that's the case in self-test.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Provide local path completer for vol-download --file
Michal Privoznik [Fri, 17 Sep 2021 07:58:54 +0000 (09:58 +0200)] 
virsh: Provide local path completer for vol-download --file

The vol-download command takes mandatory --file argument which
points to a local (possibly non-existent) path. If the file
exists then it's overwritten. Set the argument's completer so
that self-test doesn't report it as missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Provide local path completer for screenshot --file
Michal Privoznik [Fri, 17 Sep 2021 07:50:09 +0000 (09:50 +0200)] 
virsh: Provide local path completer for screenshot --file

The screenshot command takes optional --file argument which can
point to an existing local path (in which case the file is
overwritten). Set the argument's completer so that self-test
doesn't report it as missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 20 Sep 2021 07:37:17 +0000 (09:37 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 28.3% (2933 of 10353 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
3 years agoTranslated using Weblate (Korean)
simmon [Mon, 20 Sep 2021 07:37:16 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 82.9% (8591 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 82.9% (8591 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 [Mon, 20 Sep 2021 07:37:16 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 82.9% (8591 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 80.9% (8378 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 [Mon, 20 Sep 2021 07:37:15 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 80.9% (8378 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 79.3% (8219 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 [Mon, 20 Sep 2021 07:37:14 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 79.3% (8219 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 [Mon, 20 Sep 2021 07:37:13 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 78.5% (8130 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 [Mon, 20 Sep 2021 07:37:11 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 78.5% (8130 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 [Mon, 20 Sep 2021 07:37:10 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 78.1% (8095 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 [Mon, 20 Sep 2021 07:37:09 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 78.1% (8095 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 [Mon, 20 Sep 2021 07:37:08 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 73.2% (7583 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 [Mon, 20 Sep 2021 07:37:06 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 73.2% (7583 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 [Mon, 20 Sep 2021 07:37:05 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 73.2% (7582 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 [Mon, 20 Sep 2021 07:37:04 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 73.2% (7582 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 73.2% (7581 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 [Mon, 20 Sep 2021 07:37:03 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 65.6% (6794 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 65.6% (6792 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 65.6% (6792 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 [Mon, 20 Sep 2021 07:37:02 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 65.6% (6792 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 63.6% (6585 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 (Finnish)
Jan Kuparinen [Mon, 20 Sep 2021 07:37:01 +0000 (09:37 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 23.0% (2388 of 10353 strings)

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

Translated using Weblate (Finnish)

Currently translated at 22.9% (2377 of 10353 strings)

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

Translated using Weblate (Finnish)

Currently translated at 22.7% (2351 of 10353 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 [Mon, 20 Sep 2021 07:37:00 +0000 (09:37 +0200)] 
Translated using Weblate (Korean)

Currently translated at 62.1% (6434 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 62.1% (6431 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 [Mon, 20 Sep 2021 07:36:59 +0000 (09:36 +0200)] 
Translated using Weblate (Korean)

Currently translated at 62.1% (6431 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 55.9% (5792 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 agogitlab: remove obsolete job rules for TEMPORARILY_DISABLED variable
Daniel P. Berrangé [Mon, 20 Sep 2021 12:02:22 +0000 (13:02 +0100)] 
gitlab: remove obsolete job rules for TEMPORARILY_DISABLED variable

We previously had a 'rules:' entry that caused a job to be skipped if
the variable "TEMPORARILY_DISABLED" was set. This is no longer needed
since we can set a similar flag in ci/manifest.yml and re-generate
to temporarily skip a job.

Unfortunately the 'rules:' entry had an unexpected side-effect on
the pipelines that was never previously noticed. Instead of only
running pipelines on push, the mere existance of the 'rules:' entry
caused triggering of pipelines on merge requests too.

The newly auto-generated ci/gitlab.yml file does not have a 'rules:'
for the container job template, and thus only runs on git push.

The result is that build jobs try to run on merge requests and the
container jobs they depend on don't exist. This breaks the entire
pipeline with a message that the config is invalid due to broken
job dependencies.

This fixes a regression introduced in

  commit ccc7a44adbea003d6a0dc2f156adb2856c28bd4c
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Thu Sep 9 14:49:01 2021 +0100

    ci: re-generate containers/gitlab config from manifest

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotools: virsh-snapshot: refactor small functions
Kristina Hanicova [Fri, 17 Sep 2021 13:23:17 +0000 (15:23 +0200)] 
tools: virsh-snapshot: refactor small functions

This patch includes:
* removal of dead code
* simplifying nested if conditions
* removal of unnecessary variables
* usage of "direct" boolean return

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoFix typos
Tim Wiederhake [Fri, 10 Sep 2021 10:48:47 +0000 (12:48 +0200)] 
Fix typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agovsh: Move 'vshReadlineOptionsGenerator' out of '#if WITH_READLINE'
Peter Krempa [Fri, 17 Sep 2021 08:58:28 +0000 (10:58 +0200)] 
vsh: Move 'vshReadlineOptionsGenerator' out of '#if WITH_READLINE'

It's now also used in vshCompleteHelpCommand which is outside of the
conditionally compiled code.

Fixes: 80f70c74a7
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agovirsh-completer: Provide completer for '--top' and '--base' for blockjobs
Peter Krempa [Thu, 16 Sep 2021 15:49:50 +0000 (17:49 +0200)] 
virsh-completer: Provide completer for '--top' and '--base' for blockjobs

Complete with the indexed targets (e.g. vda[3]) based on existing
indexes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Introduce virshCompleteEmpty and use it for places where we can't suggest...
Peter Krempa [Wed, 15 Sep 2021 15:42:08 +0000 (17:42 +0200)] 
virsh: Introduce virshCompleteEmpty and use it for places where we can't suggest anything

For now this serves just as an annotation because readline and also the
bash completion script insist on completing local paths when an empty
list is returned.

This will serve for future reference once we'll be able to properly
refuse to suggest anything.

The completer is used for fields such as names for new objects,
description strings, password strings etc, URIs and hostnames which we
can't feasibly autocomplete.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Use 'virshCompletePathLocalExisting' for options reading local files
Peter Krempa [Wed, 15 Sep 2021 15:26:35 +0000 (17:26 +0200)] 
virsh: Use 'virshCompletePathLocalExisting' for options reading local files

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: completer: Introduce dummy completer for local files
Peter Krempa [Wed, 15 Sep 2021 15:08:37 +0000 (17:08 +0200)] 
virsh: completer: Introduce dummy completer for local files

For now the completion does the correct thing of completing a local path
if NULL is returned.

Introduce 'virshCompletePathLocalExisting' and use it in the
'VIRSH_COMMON_OPT_FILE' macro.

This for now serves as an annotation for the function which want to read
a file on the host running virsh. In the future this can be used with a
more sophisticated implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Expand VIRSH_COMMON_OPT_FILE for cases when it's not a local file used by...
Peter Krempa [Thu, 16 Sep 2021 11:03:02 +0000 (13:03 +0200)] 
virsh: Expand VIRSH_COMMON_OPT_FILE for cases when it's not a local file used by virsh

In cases such as the APIs for managed save management, the file path
provided via the '--file' option is passed to the API.

We'll need to make them distinct from cases for when virsh is using the
file so that different completers can be used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Provide completers for options taking comma separated list of disk targets
Peter Krempa [Thu, 16 Sep 2021 13:11:03 +0000 (15:11 +0200)] 
virsh: Provide completers for options taking comma separated list of disk targets

'--storage' of the 'undefine' command and '--migrate-disks' of the
'migrate' command take a list of disk targets as an argument.

We can simply combine 'virshDomainDiskTargetCompleter' with
'virshCommaStringListComplete' to provide the completions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovsh: Add completer for '--command' of 'help' command
Peter Krempa [Thu, 16 Sep 2021 14:07:19 +0000 (16:07 +0200)] 
vsh: Add completer for '--command' of 'help' command

Wrap 'vshReadlineCommandGenerator' into a function with proper prototype
to provide a completer for the help command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Use 'virshStoragePoolNameCompleter' for two options
Peter Krempa [Thu, 16 Sep 2021 12:52:50 +0000 (14:52 +0200)] 
virsh: Use 'virshStoragePoolNameCompleter' for two options

'--pool' of the 'pool-event' command and '--inputpool' of
'vol-create-from' use the above mentioned completer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh-snapshot: Use 'virshSnapshotNameCompleter' for '--from' of 'snapshot-list'
Peter Krempa [Thu, 16 Sep 2021 12:31:13 +0000 (14:31 +0200)] 
virsh-snapshot: Use 'virshSnapshotNameCompleter' for '--from' of 'snapshot-list'

When listing a snapshot tree, the '--from' option takes a name of a
snapshot to limit the subset. Use virshSnapshotNameCompleter as
completer for the option.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovsh: Introduce '--completers-missing' for 'self-test' command
Peter Krempa [Thu, 4 Mar 2021 14:47:28 +0000 (15:47 +0100)] 
vsh: Introduce '--completers-missing' for 'self-test' command

Make it simple to spot which options of which commands are missing
autocompletion functions by introducing this hidden option.

In the future when we'll have completers for everything this can be also
used as a hard fail so that completers are always added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovshCmddefCheckInternals: Sanitize command alias validation
Peter Krempa [Thu, 16 Sep 2021 13:44:25 +0000 (15:44 +0200)] 
vshCmddefCheckInternals: Sanitize command alias validation

We don't need to validate the real command twice, but it's better to
check that the real command name exists and it's not an alias to prevent
loops.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Remove hack using 'VSH_CMD_FLAG_ALIAS' to hide virsh commands
Peter Krempa [Thu, 16 Sep 2021 13:57:28 +0000 (15:57 +0200)] 
virsh: Remove hack using 'VSH_CMD_FLAG_ALIAS' to hide virsh commands

Introduce a proper flag 'VSH_CMD_FLAG_HIDDEN' for hiding commands from
output so that we can validate that there aren't any loops or
misconfigured commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh-completer*.h: Use modern header style
Peter Krempa [Thu, 16 Sep 2021 09:19:01 +0000 (11:19 +0200)] 
virsh-completer*.h: Use modern header style

Prevent the need to edit the function declarations to put them into the
header. There was even inconsistent use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirshCheckpointNameCompleter: Sanitize forward declaration use
Peter Krempa [Thu, 16 Sep 2021 09:11:42 +0000 (11:11 +0200)] 
virshCheckpointNameCompleter: Sanitize forward declaration use

Include the proper header instead of duplicating the declaration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: update nodedev driver docs for new mdev features
Jonathon Jongsma [Wed, 2 Jun 2021 20:03:12 +0000 (15:03 -0500)] 
docs: update nodedev driver docs for new mdev features

Add up-to-date information about creating and defining mediated devices
in libvirt.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: Expand manpage documentation for nodedev commands
Jonathon Jongsma [Wed, 2 Jun 2021 16:42:33 +0000 (11:42 -0500)] 
docs: Expand manpage documentation for nodedev commands

Bring the documentation for nodedev-list up to date with the latest
code, especially documenting the --active and -all options.

Also add documentation for the nodedev-define, nodedev-undefine, and
nodedev-start commands.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: Make code flow in cmdManagedSaveRemove more straightforward
Jiri Denemark [Wed, 15 Sep 2021 14:15:11 +0000 (16:15 +0200)] 
virsh: Make code flow in cmdManagedSaveRemove more straightforward

By doing so we can get rid of the code which violates our coding style
guidelines.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
3 years agovirsh: add support for '--validate' option in create network
Kristina Hanicova [Wed, 15 Sep 2021 11:07:31 +0000 (13:07 +0200)] 
virsh: add support for '--validate' option in create network

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonetwork: allow VIR_NETWORK_CREATE_VALIDATE flag
Kristina Hanicova [Wed, 15 Sep 2021 11:07:30 +0000 (13:07 +0200)] 
network: allow VIR_NETWORK_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNetworkCreateFlags
Kristina Hanicova [Wed, 15 Sep 2021 11:07:29 +0000 (13:07 +0200)] 
api: add virNetworkCreateFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: add driver support for networkCreateXMLFlags()
Kristina Hanicova [Wed, 15 Sep 2021 11:07:28 +0000 (13:07 +0200)] 
src: add driver support for networkCreateXMLFlags()

I added new driver functions to handle creating network with
given flags. I 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>
3 years agoapi: add public virNetworkCreateXMLFlags() and remote protocol
Kristina Hanicova [Wed, 15 Sep 2021 11:07:27 +0000 (13:07 +0200)] 
api: add public virNetworkCreateXMLFlags() and remote protocol

This new API creates network with given flags.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: log error on attempts to modify ACPI index of active device
Laine Stump [Thu, 9 Sep 2021 17:02:56 +0000 (13:02 -0400)] 
conf: log error on attempts to modify ACPI index of active device

The ACPI index of a device in a running guest can't be modified, and
libvirt doesn't actually attempt to modify it, but it was possible for
a user to request such a modification, and libvirt wouldn't complain,
thus misleading the user into thinking that it had actually been changed.

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: reformat virDomainDefCompatibleDevice for upcoming additional check
Laine Stump [Thu, 9 Sep 2021 16:57:32 +0000 (12:57 -0400)] 
conf: reformat virDomainDefCompatibleDevice for upcoming additional check

The next patch will add another check similar to the existing check
for a change in alias name. This patch reformats the code in
preparation so that the next patch's purpose will be clear.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotools/virsh-pool: refactor smaller functions
Kristina Hanicova [Wed, 15 Sep 2021 14:27:15 +0000 (16:27 +0200)] 
tools/virsh-pool: refactor smaller functions

I think these functions look much more readable with just simple
if conditions.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Fix typo in qemuBuilNumaCellCache
Michal Privoznik [Wed, 15 Sep 2021 13:47:16 +0000 (15:47 +0200)] 
qemu: Fix typo in qemuBuilNumaCellCache

The function should be named qemuBuildNumaCellCache (note the
missing 'd' in Build).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonews: mention new nodedev API
Jonathon Jongsma [Tue, 14 Sep 2021 20:17:05 +0000 (15:17 -0500)] 
news: mention new nodedev API

Add news item about the new API for node devices.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat>
3 years agodocs: fix migration_features element name in formatcaps.html.in
Robin Lee [Mon, 13 Sep 2021 07:17:09 +0000 (15:17 +0800)] 
docs: fix migration_features element name in formatcaps.html.in

Signed-off-by: Robin Lee <cheeselee@fedoraproject.org>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>