]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agoqemu: erase synchronous block job cancel mentions in comments
Nikolay Shirokovskiy [Mon, 16 Apr 2018 10:56:14 +0000 (13:56 +0300)]
qemu: erase synchronous block job cancel mentions in comments

Commit [1] dropped support for synchronous block job cancel.
This patch erases remnants from comments.

[1] commit 2350d101 "qemu: Remove support for legacy block jobs"

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agotests: Update caps for QEMU 2.12.0 on s390x
Shalini Chellathurai Saroja [Tue, 15 May 2018 11:46:44 +0000 (13:46 +0200)]
tests: Update caps for QEMU 2.12.0 on s390x

Let us update the existing xml and replies files for QEMU 2.12.0 on
s390x.

Used a z14 using a QEMU 2.12 GA build and the following sequence:

  tests/qemucapsprobe /usr/bin/qemu-system-s390x > \
         tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies

  VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiestest
  VIR_TEST_REGENERATE_OUTPUT=1 tests/domaincapstest

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agolog: actually do substring matches with fnmatch
Daniel P. Berrangé [Mon, 14 May 2018 13:51:14 +0000 (14:51 +0100)]
log: actually do substring matches with fnmatch

Historically we matched log filters with strstr(), and when switching to
fnmatch in cbb0fd3cfdc287f6f4653ef1f04a7cfb2ea51b27, it was stated that
we would continue to match substrings, with "foo" being equivalent to
"*foo*". Unfortuntely I forget to provide the code to actually make that
happen. This fixes it to prepend and append "*". We don't bother to
check if the pattern already has a leading/trailing '*', because
"**foo**" will match the same as "*foo*".

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoRemove check for gnutls/crypto.h
Ján Tomko [Tue, 15 May 2018 10:48:33 +0000 (12:48 +0200)]
Remove check for gnutls/crypto.h

Assume its presence for gnutls >= 3.2.

Check introduced by <commit 7d21d6b>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoFix indentation in virCryptoHaveCipher
Ján Tomko [Tue, 15 May 2018 11:08:15 +0000 (13:08 +0200)]
Fix indentation in virCryptoHaveCipher

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoRemove explicit check for gnutls_cipher_encrypt
Ján Tomko [Tue, 15 May 2018 10:45:12 +0000 (12:45 +0200)]
Remove explicit check for gnutls_cipher_encrypt

Introduced in gnutls 2.10, and we assume >= 3.2.

Commit 1ce9c08a added this check.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoRemove explicit check for gnutls_rnd
Ján Tomko [Tue, 15 May 2018 10:42:20 +0000 (12:42 +0200)]
Remove explicit check for gnutls_rnd

Introduced in gnutls 2.12, but we require gnutls >= 3.2
Check added by commit <2d23d14>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoDeprecate GNUTLS_GCRYPT
Ján Tomko [Tue, 15 May 2018 10:30:11 +0000 (12:30 +0200)]
Deprecate GNUTLS_GCRYPT

Now that we assume GnuTLS >= 3.0, we can ditch gcrypt support.
Introduced by <commit 6094b1f>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoRequire GnuTLS >= 3.2.0
Ján Tomko [Tue, 15 May 2018 10:26:42 +0000 (12:26 +0200)]
Require GnuTLS >= 3.2.0

Ubuntu 14.04 which is not targetted as a supported platform [0]
already has 3.2.11

[0] https://libvirt.org/platforms.html

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoSkip vircryptotest and virfilecachetest without gnutls
Ján Tomko [Tue, 15 May 2018 11:01:58 +0000 (13:01 +0200)]
Skip vircryptotest and virfilecachetest without gnutls

Fix make check without gnutls.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirCryptoHashBuf: return the length of the hash in bytes
Ján Tomko [Tue, 15 May 2018 07:58:50 +0000 (09:58 +0200)]
virCryptoHashBuf: return the length of the hash in bytes

virCryptoHashString also needs to know the size of the returned hash.
Return it if the hash conversion succeeded so the caller does not need
to access the hashinfo array.

This should make virCryptoHashString build without gnutls.
Also fixes the missing return value for the virCryptoHashBuf stub.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Suggested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agovirDomainMemoryDefParseXML: Don't leak discard
Michal Privoznik [Tue, 15 May 2018 11:49:06 +0000 (13:49 +0200)]
virDomainMemoryDefParseXML: Don't leak discard

==1589== 7 bytes in 2 blocks are definitely lost in loss record 34 of 261
==1589==    at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
==1589==    by 0x8A82794: xmlStrndup (in /usr/lib64/libxml2.so.2.9.8)
==1589==    by 0x5DD8392: virXMLPropString (virxml.c:510)
==1589==    by 0x5E12427: virDomainMemoryDefParseXML (domain_conf.c:15704)
==1589==    by 0x5E207DE: virDomainDefParseXML (domain_conf.c:20351)
==1589==    by 0x5E2184F: virDomainDefParseNode (domain_conf.c:20636)
==1589==    by 0x5E216A1: virDomainDefParse (domain_conf.c:20580)
==1589==    by 0x5E21747: virDomainDefParseFile (domain_conf.c:20606)
==1589==    by 0x112F5F: testCompareXMLToArgv (qemuxml2argvtest.c:493)
==1589==    by 0x138780: virTestRun (testutils.c:180)
==1589==    by 0x117129: mymain (qemuxml2argvtest.c:937)
==1589==    by 0x13A83C: virTestMain (testutils.c:1120)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
6 years agoqemu: hotplug: Replace qemuDomainDiskNeedRemovePR
Peter Krempa [Mon, 14 May 2018 07:30:01 +0000 (09:30 +0200)]
qemu: hotplug: Replace qemuDomainDiskNeedRemovePR

The function can be replaced by much simpler logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: storage: Store PR manager alias in the definition
Peter Krempa [Fri, 11 May 2018 14:39:21 +0000 (16:39 +0200)]
util: storage: Store PR manager alias in the definition

Rather than always re-generating the alias store it in the definition
and in the status XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoconf: domain: Add helper to check whether a domain def requires use of PR
Peter Krempa [Mon, 14 May 2018 05:53:09 +0000 (07:53 +0200)]
conf: domain: Add helper to check whether a domain def requires use of PR

Extract the lookup code so that it can be reused later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: command: Move check whether PR manager object props need to be built
Peter Krempa [Fri, 11 May 2018 14:47:49 +0000 (16:47 +0200)]
qemu: command: Move check whether PR manager object props need to be built

Move it out of the format function and let the caller decide this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: process: Change semantics of functions starting PR daemon
Peter Krempa [Fri, 11 May 2018 13:40:34 +0000 (15:40 +0200)]
qemu: process: Change semantics of functions starting PR daemon

Libvirt only manages one PR daemon. This means that we don't need to
pass the 'disk' object and also rename the functions dealing with this
so that it's obvious we only deal with the managed PR daemon.

Signed-off-by: Peter Krempa <pkrempa@redhat st.com>
6 years agoqemu: Assign managed PR path when preparing storage source
Peter Krempa [Mon, 14 May 2018 05:28:05 +0000 (07:28 +0200)]
qemu: Assign managed PR path when preparing storage source

Rather than always checking which path to use pre-assign it when
preparing storage source.

This reduces the need to pass 'vm' around too much. For later use the
path can be retrieved from the status XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: storage: Allow passing <source> also for managed PR case
Peter Krempa [Mon, 14 May 2018 05:25:43 +0000 (07:25 +0200)]
util: storage: Allow passing <source> also for managed PR case

To allow storing status information in the XML move the validation that
the 'path' is not valid for managed PR daemon case into
qemuDomainValidateStorageSource and allow parsing of the data even in
case when managed='yes'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: storage: Drop virStoragePRDefIsEnabled
Peter Krempa [Mon, 14 May 2018 05:24:25 +0000 (07:24 +0200)]
util: storage: Drop virStoragePRDefIsEnabled

The function now does not do anything useful. Replace it by the pointer
check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: storage: Drop pointless 'enabled' form PR definition
Peter Krempa [Fri, 11 May 2018 13:50:57 +0000 (15:50 +0200)]
util: storage: Drop pointless 'enabled' form PR definition

Everything can be disabled by not using the parent element. There's no
need to store this explicitly. Additionally it does not add any value
since any configuration is dropped if enabled='no' is configured.

Drop the attribute and adjust the code accordingly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: Move validation of PR manager support
Peter Krempa [Fri, 11 May 2018 12:53:54 +0000 (14:53 +0200)]
qemu: Move validation of PR manager support

Disk source definition should be validated in
qemuDomainValidateStorageSource rather than in individual generators of
command line arguments.

Change to the XML2XML test is required since now the definition is
actually validated at define time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: command: Fix comment for qemuBuildPRManagerInfoProps
Peter Krempa [Fri, 11 May 2018 12:20:12 +0000 (14:20 +0200)]
qemu: command: Fix comment for qemuBuildPRManagerInfoProps

The comment did not accurately describe the arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: alias: Allow passing alias of parent when generating PR manager alias
Peter Krempa [Fri, 11 May 2018 12:11:36 +0000 (14:11 +0200)]
qemu: alias: Allow passing alias of parent when generating PR manager alias

For use with blockdev the PR manager will be bound to a virStorageSource
rather than a virDomainDiskDef, so we will need to use the correct
alias.

Allow passing a string rather than the whole disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Fix spacing around addition operator
Peter Krempa [Thu, 10 May 2018 14:09:20 +0000 (16:09 +0200)]
qemu: hotplug: Fix spacing around addition operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agostorage_util: Introduce storageBackendDoCreateQemuImg
John Ferlan [Mon, 7 May 2018 21:28:08 +0000 (17:28 -0400)]
storage_util: Introduce storageBackendDoCreateQemuImg

Extract out command line setup and run from storageBackendCreateQemuImg
as we'll need to run it twice soon.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Introduce storageBackendCreateQemuImgSetInput
John Ferlan [Mon, 7 May 2018 19:34:26 +0000 (15:34 -0400)]
storage_util: Introduce storageBackendCreateQemuImgSetInput

Split up virStorageBackendCreateQemuImgCmdFromVol into two parts.
It's too long anyway and virStorageBackendCreateQemuImgCmdFromVol
should just handle the command line processing.

NB: Requires changing info.* into info->* references.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Move @type into _virStorageBackendQemuImgInfo
John Ferlan [Mon, 7 May 2018 19:22:35 +0000 (15:22 -0400)]
storage_util: Move @type into _virStorageBackendQemuImgInfo

We're about to split up the code a bit more, so we'll need this
to be in the local struct.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Split preallocate set in storageBackendCreateQemuImgOpts
John Ferlan [Mon, 7 May 2018 14:15:33 +0000 (10:15 -0400)]
storage_util: Split preallocate set in storageBackendCreateQemuImgOpts

The only way preallocate could be set is if the info->format was
not RAW (see storageBackendCreateQemuImgSetBacking), so let's just
extract it from the if/else surrounding the application of the
encryption options.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Split backing_fmt set in storageBackendCreateQemuImgOpts
John Ferlan [Mon, 7 May 2018 14:17:43 +0000 (10:17 -0400)]
storage_util: Split backing_fmt set in storageBackendCreateQemuImgOpts

The only way backing_fmts could be set is if the info->format was
not RAW (see storageBackendCreateQemuImgSetBacking), so let's just
extract it from the if/else surrounding the application of the
encryption options.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Remove luks distinction from secret path and alias
John Ferlan [Thu, 19 Apr 2018 14:52:03 +0000 (10:52 -0400)]
storage_util: Remove luks distinction from secret path and alias

Remove the "luks" distinction as the code is about to become more
generic and be able to support qcow encryption as well.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Move secretPath generation
John Ferlan [Wed, 18 Apr 2018 18:18:14 +0000 (14:18 -0400)]
storage_util: Move secretPath generation

Move generation of secretPath to storageBackendGenerateSecretData
and simplify a bit since we know vol->target.encryption is set plus
we have a local @enc.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Generate the qcow secret earlier
John Ferlan [Wed, 18 Apr 2018 18:08:51 +0000 (14:08 -0400)]
storage_util: Generate the qcow secret earlier

Rather than having storageBackendCreateQemuImgCheckEncryption
perform the virStorageGenerateQcowEncryption, let's just do that
earlier during storageBackendCreateQemuImg so that the check
helper is just a check helper rather doing something different
based on whether the format is qcow[2] or raw based encryption.

This fixes an issue in the storageBackendResizeQemuImg processing
for qcow encryption where if a secret was not available for a
volume, a new secret will not be generated and instead an error
message will be generated.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Rename virQEMUBuildLuksOpts
John Ferlan [Thu, 19 Apr 2018 13:47:31 +0000 (09:47 -0400)]
storage_util: Rename virQEMUBuildLuksOpts

Rename to storageBackendCreateQemuImgOpts - which is what it's doing.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Remove unnecessary check
John Ferlan [Wed, 18 Apr 2018 16:43:43 +0000 (12:43 -0400)]
storage_util: Remove unnecessary check

Commit id 'a48c71411' altered the logic a bit and didn't
remove an unnecessary check as info.encryption is true when
vol->target.encryption != NULL, so if we enter the if segment
with info.format == VIR_STORAGE_FILE_RAW && vol->target.encryption
!= NULL, then there's no way info.encryption could be false.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Cleanup usage of target.encryption
John Ferlan [Wed, 18 Apr 2018 17:02:19 +0000 (13:02 -0400)]
storage_util: Cleanup usage of target.encryption

Remove the != NULL checks, use !! for setting info.encryption.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agostorage_util: Some code cleanup
John Ferlan [Wed, 18 Apr 2018 16:23:04 +0000 (12:23 -0400)]
storage_util: Some code cleanup

Perform some code cleanup in areas that are about to be altered.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agodocs: Update news.xml with QEMU SDL OpenGL Improvement
Maciej Wolny [Fri, 11 May 2018 14:47:53 +0000 (15:47 +0100)]
docs: Update news.xml with QEMU SDL OpenGL Improvement

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
6 years agoqemu: Add gl option to SDL graphics command line
Maciej Wolny [Thu, 10 May 2018 10:53:59 +0000 (11:53 +0100)]
qemu: Add gl option to SDL graphics command line

Support OpenGL when using SDL backend via -sdl,gl=on. Add associated
tests.

NB: Usage of DO_TEST_CAPS_LATEST in qemuxml2argv doesn't work in
this case because -sdl gl is not introspectable.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Add QEMU_CAPS_SDL_GL to qemu capabilities
Maciej Wolny [Thu, 10 May 2018 10:53:58 +0000 (11:53 +0100)]
qemu: Add QEMU_CAPS_SDL_GL to qemu capabilities

Support OpenGL acceleration capability when using SDL graphics.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoconf: Add gl property to graphics of type sdl in domain config
Maciej Wolny [Thu, 10 May 2018 10:53:57 +0000 (11:53 +0100)]
conf: Add gl property to graphics of type sdl in domain config

Support OpenGL accelerated rendering when using SDL graphics in the
domain config. Add associated test and documentation.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_command: Remove outdated comment
Maciej Wolny [Thu, 10 May 2018 10:53:56 +0000 (11:53 +0100)]
qemu_command: Remove outdated comment

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_command: Move SDL command line building into helper
Maciej Wolny [Thu, 10 May 2018 10:53:55 +0000 (11:53 +0100)]
qemu_command: Move SDL command line building into helper

Create a function called `qemuBuildGraphicsSDLCommandLine` which is
called from qemuBuildGraphicsCommandLine.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoutil: fix misleading comment for virObjectLock
Daniel P. Berrangé [Fri, 11 May 2018 17:48:26 +0000 (18:48 +0100)]
util: fix misleading comment for virObjectLock

It only accepts a virObjecLockable, not a virObjecRWLockable

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agolibxl: don't set hasManagedSave when performing save
Jim Fehlig [Mon, 14 May 2018 20:45:05 +0000 (14:45 -0600)]
libxl: don't set hasManagedSave when performing save

libxlDoDomainSave() is used in both the save and managedsave code
paths but was unconditionally setting hasManagedSave to true on
success. As a result, undefine would fail after a non-managed
save/restore operation. E.g.

virsh define; virsh start
virsh save; virsh restore
virsh shutdown
virsh undefine
error: Refusing to undefine while domain managed save image exists

Modify libxlDoDomainSave() to take an additional parameter to
specify managed vs non-managed save, and change callers to use it.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agotests: Link mocks with libvirt.so
Michal Privoznik [Tue, 15 May 2018 06:58:33 +0000 (08:58 +0200)]
tests: Link mocks with libvirt.so

In a lot of our mocks (if not all of them) we use our internal
APIs (e.g. VIR_ALLOC). So far, we're relying on test binary that
links with the mock to drag in libvirt.so. Well, this works only
partially. Firstly, whatever binary we execute from tests will
fail (e.g. as Martin reported on the list ./qemucapsprobe fails
to execute qemu). Secondly, if there's a program that tries to
validate linking (like valgrind is doing) it fails because of
unresolved symbols.

Because of that we have to link our mocks with libvirt.so.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoxenconfig: xm: Fix checking for extra in parser
Filip Alac [Sat, 12 May 2018 15:45:02 +0000 (17:45 +0200)]
xenconfig: xm: Fix checking for extra in parser

Parser assumed extra was always present when root was specified.
Fixed by handling root and extra separately.

Signed-off-by: Filip Alac <filipalac@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
6 years agonews: documentation of new feature
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:18 +0000 (16:41 +0200)]
news: documentation of new feature

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agodocs: documentation for vfio-ccw passthrough
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:17 +0000 (16:41 +0200)]
docs: documentation for vfio-ccw passthrough

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: command line generation for vfio-ccw device
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:15 +0000 (16:41 +0200)]
qemu: command line generation for vfio-ccw device

Generates the QEMU command line for the vfio-ccw device.

Adds various functionality testing for vfio-ccw in libvirt:

1. Generation of QEMU command line from domain xml file
2. Generation of dump xml from domain xml file
3. Checks duplicate/invalid addresses for vfio-ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: vfio-ccw device address generation
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:14 +0000 (16:41 +0200)]
qemu: vfio-ccw device address generation

Introduces the vfio-ccw model for mediated devices and prime vfio-ccw
devices such that CCW address will be generated.

Alters the qemuxml2xmltest for testing a basic mdev device using vfio-ccw.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoutil: virhostdev: add virHostdevIsMdevDevice()
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:13 +0000 (16:41 +0200)]
util: virhostdev: add virHostdevIsMdevDevice()

Add the function virHostdevIsMdevDevice() which detects whether a
hostdev is a mediated device or not. Also, replace all existing
conditionals.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: introduce vfio-ccw capability
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:12 +0000 (16:41 +0200)]
qemu: introduce vfio-ccw capability

Let us introduce the capability vfio-ccw for supporting the basic
channel I/O passthrough, which have been introduced in QEMU 2.10. The
current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390)
as the target device.

Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED
for virtual-css-bridge. This capability is based on the
cssid-unrestricted property which exists if QEMU no longer enforces
cssid restrictions based on ccw device types.

Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so
that we are able to probe for the cssid-unrestriced property to make
sure the devices are visible to non-mcss-e enabled guests.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: introduce capability for virtual-css-bridge
Shalini Chellathurai Saroja [Mon, 7 May 2018 14:41:11 +0000 (16:41 +0200)]
qemu: introduce capability for virtual-css-bridge

Let us introduce the capability QEMU_CAPS_CCW for virtual-css-bridge
and replace QEMU_CAPS_VIRTIO_CCW with QEMU_CAPS_CCW in code segments
which identify support for ccw devices.

The virtual-css-bridge is part of the ccw support introduced in QEMU 2.7.
The QEMU_CAPS_CCW capability is based on the existence of the QEMU type.

Let us also add the capability QEMU_CAPS_CCW to the tests which
require support for ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovircrypto: Rely on GnuTLS for hash functions
Ján Tomko [Fri, 11 May 2018 14:18:17 +0000 (16:18 +0200)]
vircrypto: Rely on GnuTLS for hash functions

Ditch the use of gnulib's digest functions in favor of GnuTLS,
which might be more likely to get FIPS-certified.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoesx: Use VIR_CRYPTO_HASH_SIZE_MD5
Ján Tomko [Fri, 11 May 2018 13:50:48 +0000 (15:50 +0200)]
esx: Use VIR_CRYPTO_HASH_SIZE_MD5

Do not rely on gnulib's MD5_DIGEST_SIZE from md5.h.

Include vircrypto.h and use VIR_CRYPTO_HASH_SIZE_MD5.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoesx: use virCryptoHashBuf
Ján Tomko [Fri, 11 May 2018 14:49:32 +0000 (16:49 +0200)]
esx: use virCryptoHashBuf

Instead of using md5_buffer from gnulib directly.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce virCryptoHashBuf
Ján Tomko [Fri, 11 May 2018 14:31:10 +0000 (16:31 +0200)]
Introduce virCryptoHashBuf

A function that keeps the hash in binary form instead of converting
it to human-readable hexadecimal form.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovircrypto: provide constants for hash sizes
Ján Tomko [Fri, 11 May 2018 13:42:35 +0000 (15:42 +0200)]
vircrypto: provide constants for hash sizes

The callers needing to know the size of the resulting digest
rely on _DIGEST_SIZE constants from gnulib.

Introduce VIR_CRYPTO_HASH_SIZE_ constants to remove the dependency.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotravis: Uninstall packages before upgrade
Andrea Bolognani [Mon, 14 May 2018 07:45:10 +0000 (09:45 +0200)]
travis: Uninstall packages before upgrade

numpy (needed by cgal) started having the same issue with
linking as python, which makes upgrade and thus the entire
build fail on macOS.

Instead of playing more tricks with linking/unlinking, just
uninstall the problematic packages (and those dragging them
in) before doing anything else.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoqemu: Implement memoryBacking/discard
Michal Privoznik [Thu, 12 Apr 2018 15:16:40 +0000 (17:16 +0200)]
qemu: Implement memoryBacking/discard

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

QEMU has this new feature memory-backend-file.discard-data=yes
which is a nifty optimization. Basically, when qemu is quitting
or on memory hotplug it calls munmap() and close() on the file
that is backing the memory. However, this does not mean kernel
won't stop touching that part of memory. It still might. With
this feature enabled we tell kernel: "we don't need this memory
nor data stored in it". This makes kernel drop the memory
immediately without trying to sync memory with the mapped file.

Unfortunately, this cannot be turned on by default because we
can't be sure when users really don't care about what happens to
data after qemu dies. So it has to be opt-in. As usual, there are
three places where one can configure memory attributes. This
patch adds the feature to all of them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Introduce memoryBacking/discard
Michal Privoznik [Fri, 11 May 2018 13:08:53 +0000 (15:08 +0200)]
conf: Introduce memoryBacking/discard

QEMU has possibility to call madvise(.., MADV_REMOVE) in some
cases. Expose this feature to users by new element/attribute
discard.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Move virDomainMemtune formatting into a separate function
Michal Privoznik [Fri, 11 May 2018 12:48:59 +0000 (14:48 +0200)]
conf: Move virDomainMemtune formatting into a separate function

At the same time convert the code to use virXMLFormatElement.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD
Michal Privoznik [Fri, 20 Apr 2018 08:25:49 +0000 (10:25 +0200)]
qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD

This capability tracks if memory-backend-file has discard-data
attribute or not.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_capabilities: Introduce QEMU_CAPS_QOM_LIST_PROPERTIES
Michal Privoznik [Fri, 20 Apr 2018 08:31:54 +0000 (10:31 +0200)]
qemu_capabilities: Introduce QEMU_CAPS_QOM_LIST_PROPERTIES

This capability tracks if qemu has "qom-list-properties" monitor
command.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_monitor: Introduce qemuMonitorGetObjectProps
Michal Privoznik [Thu, 12 Apr 2018 13:04:07 +0000 (15:04 +0200)]
qemu_monitor: Introduce qemuMonitorGetObjectProps

Now that we've gotten rid of misleading names we can introduce
qemuMonitorGetObjectProps() function which queries -object
properties. Again, some parts of code can be reused.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuMonitorJSONGetDeviceProps: Separate props processing
Michal Privoznik [Fri, 20 Apr 2018 07:20:36 +0000 (09:20 +0200)]
qemuMonitorJSONGetDeviceProps: Separate props processing

The code that processes list of device properties is going to be
reused. Therefore put it into a separate function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agobhyve: start using virDomainObjCheckActive
Clementine Hayat [Sun, 13 May 2018 22:32:15 +0000 (00:32 +0200)]
bhyve: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agolxc: start using virDomainObjCheckActive
Clementine Hayat [Sun, 13 May 2018 22:32:14 +0000 (00:32 +0200)]
lxc: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: start using virDomainObjCheckActive
Clementine Hayat [Sun, 13 May 2018 22:32:13 +0000 (00:32 +0200)]
qemu: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirutil.c: do not include stdarg.h
Ján Tomko [Mon, 23 Apr 2018 15:11:50 +0000 (17:11 +0200)]
virutil.c: do not include stdarg.h

Last functions using it were moved to virfile.c in commit <bfe7721>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirutil.c: do not include ioctl.h
Ján Tomko [Mon, 23 Apr 2018 15:06:57 +0000 (17:06 +0200)]
virutil.c: do not include ioctl.h

Added by commit 61674cc, but we have started using
set_nonblocking_flag from gnulib in commit da3c4714

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agobhyve: document support for wiring guest memory
Fabian Freyer [Wed, 9 May 2018 01:01:37 +0000 (03:01 +0200)]
bhyve: document support for wiring guest memory

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
6 years agobhyve: add tests for wiring memory
Fabian Freyer [Wed, 9 May 2018 01:01:36 +0000 (03:01 +0200)]
bhyve: add tests for wiring memory

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
6 years agobhyve: add support for wiring memory
Fabian Freyer [Wed, 9 May 2018 01:01:35 +0000 (03:01 +0200)]
bhyve: add support for wiring memory

The <memoryBacking><locked/></memoryBacking> element will now pass the
wired (-S) flag to the bhyve command.

Signed-off-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
6 years agomaint: typo fix in VIR_MIGRATE_PARAM_URI
Eric Blake [Fri, 11 May 2018 20:31:21 +0000 (15:31 -0500)]
maint: typo fix in VIR_MIGRATE_PARAM_URI

s/filed/field/

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agolog: update docs for daemons to improve user understanding
Daniel P. Berrangé [Fri, 20 Apr 2018 16:52:04 +0000 (17:52 +0100)]
log: update docs for daemons to improve user understanding

Strongly recommend against use of the log_levels setting since it
creates overly verbose logs and has a serious performance impact.

Describe the log filter syntax better and mention use of shell
glob syntax. Also provide more realistic example of good settings
to use. The libvirtd example is biased towards QEMU, but when the
drivers split off each daemon can get its own more appropriate
example.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agolog: support logging using shell wildcard syntax
Daniel P. Berrangé [Fri, 20 Apr 2018 16:38:56 +0000 (17:38 +0100)]
log: support logging using shell wildcard syntax

Rather than specialcasing handling of the '*' character, use fnmatch()
to get normal shell wildcard syntax, as described in 'man glob(7)'.

To get an indication of the performance impact of using globs instead
of plain string matches, a test program was written. The list of all
260 log categories was extracted from the source. Then a typical log
filters setup was picked by creating an array of the strings "qemu",
"security", "util", "cgroup", "event", "object". Every filter string
was matched against every log category. Timing information showed that
using strstr() this took 8 microseconds, while fnmatch() took 114
microseconds.

IOW, fnmatch is 14 times slower than our existing strstr check. These
numbers show a worst case scenario that will never be hit, because it
is rare that every log category would have data output. The log category
matches are cached, so each category is only checked once no matter how
many log statements are emitted. IOW despite being slower, this will
be lost in the noise and have no consequence on real world logging
performance.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agolog: rename virLogFlags to virLogFilterFlags to match docs
Daniel P. Berrangé [Fri, 20 Apr 2018 14:46:08 +0000 (15:46 +0100)]
log: rename virLogFlags to virLogFilterFlags to match docs

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovirbuffer: Set child buffer indent properly
Michal Privoznik [Fri, 11 May 2018 12:05:53 +0000 (14:05 +0200)]
virbuffer: Set child buffer indent properly

There's this macro virBufferSetChildIndent which sets offset of
child buffer from given parent buffer. However, it is calling
virBufferAdjustIndent() which only adds adjustment instead of
calling virBufferSetIndent() which clears out any adjustment
previously set.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: replace references to yajl
Ján Tomko [Wed, 9 May 2018 14:42:43 +0000 (16:42 +0200)]
tests: replace references to yajl

Use "libvirt not compiled with JSON support" instead of mentioning
yajl specifically.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirJSONValue: remove unused 'protect' property
Ján Tomko [Thu, 10 May 2018 12:25:57 +0000 (14:25 +0200)]
virJSONValue: remove unused 'protect' property

The last usage was removed by commit <167028e>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Don't skip the first entry when the typed command share same prefix
Lin Ma [Fri, 11 May 2018 09:13:10 +0000 (17:13 +0800)]
virsh: Don't skip the first entry when the typed command share same prefix

Signed-off-by: Lin Ma <lma@suse.com>
6 years agorpc: replacing ssh_get_publickey() by ssh_get_server_publickey().
Julio Faracco [Thu, 10 May 2018 20:38:57 +0000 (17:38 -0300)]
rpc: replacing ssh_get_publickey() by ssh_get_server_publickey().

After version 0.7.5, libssh deprecated the function scope
ssh_get_publickey() and moved to ssh_get_server_publickey(). So, Libvirt
is failing to compile using this new function name.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agom4: checking if ssh_get_server_publickey() exists.
Julio Faracco [Thu, 10 May 2018 20:38:56 +0000 (17:38 -0300)]
m4: checking if ssh_get_server_publickey() exists.

This commit adds some checks inside libssh m4 checking to verify if
ssh_get_server_publickey is available. This new function scope replaces
the old ssh_get_publickey() from libssh 0.7.5 and below. Assuming that
some distros are not showing the right version of libssh. This is a
simple way to check which function is available.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoqemu: Detect pr-manager-helper capability
Michal Privoznik [Mon, 26 Mar 2018 10:27:16 +0000 (12:27 +0200)]
qemu: Detect pr-manager-helper capability

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_hotplug: Hotunplug of reservations
Michal Privoznik [Mon, 23 Apr 2018 11:51:49 +0000 (13:51 +0200)]
qemu_hotplug: Hotunplug of reservations

If we are the last one to use pr-manager object we need to remove
it and also kill the qemu-pr-helper process.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_hotplug: Hotplug of reservations
Michal Privoznik [Mon, 23 Apr 2018 11:21:03 +0000 (13:21 +0200)]
qemu_hotplug: Hotplug of reservations

When attaching a disk that requires pr-manager we might need to
plug the pr-manager object and start the pr-helper process.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Start PR daemon on domain startup
Michal Privoznik [Thu, 19 Apr 2018 08:00:36 +0000 (10:00 +0200)]
qemu: Start PR daemon on domain startup

Before we exec() qemu we have to spawn pr-helper processes for
all managed reservations (well, technically there can only one).
The only caveat there is that we should place the process into
the same namespace and cgroup as qemu (so that it shares the same
view of the system). But we can do that only after we've forked.
That means calling the setup function between fork() and exec().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Introduce pr_helper to qemu.conf
Michal Privoznik [Fri, 15 Dec 2017 09:42:40 +0000 (10:42 +0100)]
qemu: Introduce pr_helper to qemu.conf

Just like we allow users overriding path to bridge-helper
detected at compile time we can allow them to override path to
qemu-pr-helper.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_cgroup: Allow /dev/mapper/control for PR
Michal Privoznik [Tue, 10 Apr 2018 06:00:59 +0000 (08:00 +0200)]
qemu_cgroup: Allow /dev/mapper/control for PR

Just like in previous commit, qemu-pr-helper might want to open
/dev/mapper/control under certain circumstances. Therefore we
have to allow it in cgroups.

The change virdevmapper.c might look spurious but it isn't. After
6dd84f6850ca437 any path that we're allowing in deivces CGroup is
subject to virDevMapperGetTargets() inspection. And libdevmapper
returns ENXIO for the path from subject.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu_ns: Allow /dev/mapper/control for PR
Michal Privoznik [Mon, 9 Apr 2018 12:44:44 +0000 (14:44 +0200)]
qemu_ns: Allow /dev/mapper/control for PR

If qemu-pr-helper is compiled with multipath support the first
thing it does is open /dev/mapper/control. Since we're going
to be running it inside qemu namespace we need to create it
there. Unfortunately, we don't know if it was compiled with or
without multipath so we have to create it anyway.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Generate pr cmd line at startup
Michal Privoznik [Wed, 18 Apr 2018 14:55:14 +0000 (16:55 +0200)]
qemu: Generate pr cmd line at startup

For command line we need two things:

1) -object pr-manager-helper,id=$alias,path=$socketPath
2) -drive file.pr-manager=$alias

In -object pr-manager-helper we tell qemu which socket to connect
to, then in -drive file-pr-manager we just reference the object
the drive in question should use.

For managed PR helper the alias is always "pr-helper0" and socket
path "${vm->priv->libDir}/pr-helper0.sock".

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Introduce pr-manager-helper capability
Michal Privoznik [Mon, 19 Feb 2018 06:41:25 +0000 (07:41 +0100)]
qemu: Introduce pr-manager-helper capability

The capability tracks if qemu has pr-manager-helper object. At
this time don't actually detect if qemu has the capability. Not
just yet. Only after the code is written the feature will be
enabled.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemuDomainDiskChangeSupported: Deny changing reservations
Michal Privoznik [Thu, 14 Dec 2017 10:47:02 +0000 (11:47 +0100)]
qemuDomainDiskChangeSupported: Deny changing reservations

Couple of reasons for that:

a) there's no monitor command to change path where the pr-helper
connects to, or
b) there's no monitor command to introduce a new pr-helper for a
disk that already exists.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirstoragefile: Introduce virStoragePRDef
Michal Privoznik [Mon, 27 Nov 2017 10:54:33 +0000 (11:54 +0100)]
virstoragefile: Introduce virStoragePRDef

This is a definition that holds information on SCSI persistent
reservation settings. The XML part looks like this:

  <reservations enabled='yes' managed='no'>
    <source type='unix' path='/path/to/qemu-pr-helper.sock' mode='client'/>
  </reservations>

If @managed is set to 'yes' then the <source/> is not parsed.
This design was agreed on here:

https://www.redhat.com/archives/libvir-list/2017-November/msg01005.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoutil: Clean up consumers of virJSONValueArraySize
John Ferlan [Thu, 19 Apr 2018 21:29:02 +0000 (17:29 -0400)]
util: Clean up consumers of virJSONValueArraySize

Rather than have virJSONValueArraySize return a -1 when the input
is not an array and then splat an error message, let's check for
an array before calling and then change the return to be a size_t
instead of ssize_t.

That means using the helper virJSONValueIsArray as well as using a
more generic error message such as "Malformed <something> array".
In some cases we can remove stack variables and when we cannot,
those variables should be size_t not ssize_t. Alter a few references
of if (!value) to be if (value == 0) instead as well.

Some callers can already assume an array is being worked on based
on the previous call, so there's less to do.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Remove parameter 'driver' from qemuBlockJobUpdate
Roland Schulz [Thu, 10 May 2018 14:16:30 +0000 (16:16 +0200)]
qemu: Remove parameter 'driver' from qemuBlockJobUpdate

The pointer to the qemu driver is already included in domain object's
private data, so does not need to be passed as yet another parameter
when the domain object is already passed.

Also removes parameter 'driver' from functions which had it just because of
qemuBlockJobUpdate.

Signed-off-by: Roland Schulz <schullzroll@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Apply macro for current VSH_OT_ARGV "domain" options
Lin Ma [Tue, 8 May 2018 14:20:36 +0000 (22:20 +0800)]
virsh: Apply macro for current VSH_OT_ARGV "domain" options

Signed-off-by: Lin Ma <lma@suse.com>
6 years agovirsh: Create macros for VSH_OT_ARGV "domain" option
Lin Ma [Tue, 8 May 2018 14:20:35 +0000 (22:20 +0800)]
virsh: Create macros for VSH_OT_ARGV "domain" option

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>