]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
6 years agovshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_ARGV options
Lin Ma [Tue, 8 May 2018 14:20:34 +0000 (22:20 +0800)]
vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_ARGV options

Currently the VSH_OT_ARGV options don't support complete, But some of
VSH_OT_ARGV options are gonna support complete in upcoming patches.

Once applied the upcoming completion patches for VSH_OT_ARGV options, If
we don't ignore VSH_OT_ARGV here, The vshReadlineOptionsGenerator will
be called, Hence complete output will consist of the result by command
completer + the result by option completer, It's confusing.
e.g.
    $ virsh domstats --domain <TAB><TAB>
    --backing     --interface      --list-paused      --perf      --vcpu
    --balloon     leap42.3         --list-persistent  --raw       win10
    --block       --list-active    --list-running     sles12sp3
    --cpu-total   --list-inactive  --list-shutoff     sles15
    --enforce     --list-other     --list-transient   --state

After this patch and the upcoming completion patches:
    $ virsh domstats --domain <TAB><TAB>
    leap42.3    sles12sp3    sles15    win10

Signed-off-by: Lin Ma <lma@suse.com>
6 years agovshReadlineOptionsGenerator: Add already provided VSH_OT_ARGV options to list
Lin Ma [Tue, 8 May 2018 14:20:37 +0000 (22:20 +0800)]
vshReadlineOptionsGenerator: Add already provided VSH_OT_ARGV options to list

It's helpful for users while they type certain kind of VSH_OT_ARGV options.
e.g.

$ virsh domstats --domain sles12sp3 --d<TAB>

Signed-off-by: Lin Ma <lma@suse.com>
6 years agovirsh: Apply macro for current VSH_OT_STRING "domain" options
Lin Ma [Tue, 8 May 2018 14:20:33 +0000 (22:20 +0800)]
virsh: Apply macro for current VSH_OT_STRING "domain" options

These VSH_OT_STRING "domain" options support domain name completion now.

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

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Conditionally Ignore the first entry in list of completions
Lin Ma [Tue, 8 May 2018 14:20:31 +0000 (22:20 +0800)]
virsh: Conditionally Ignore the first entry in list of completions

The first entry in the returned array is the substitution for TEXT. It
causes unnecessary output if other commands or options share the same
prefix, e.g.

$ virsh des<TAB><TAB>
des      desc     destroy

or

$ virsh domblklist --d<TAB><TAB>
--d        --details  --domain

This patch fixes the above issue.

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Add domain name completion to 'migrate-postcopy' command
Lin Ma [Tue, 8 May 2018 14:20:30 +0000 (22:20 +0800)]
virsh: Add domain name completion to 'migrate-postcopy' command

Signed-off-by: Lin Ma <lma@suse.com>
6 years agovirsh: Move the definition of macro VIRSH_COMMON_OPT_DOMAIN_FULL to virsh.h
Lin Ma [Tue, 8 May 2018 14:20:29 +0000 (22:20 +0800)]
virsh: Move the definition of macro VIRSH_COMMON_OPT_DOMAIN_FULL to virsh.h

centralize the definition of macro VIRSH_COMMON_OPT_DOMAIN_FULL to virsh.h
to avoid unnecessary duplicated definition

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoDeprecate QEMU_CAPS_NESTING
Ján Tomko [Thu, 3 May 2018 10:14:41 +0000 (12:14 +0200)]
Deprecate QEMU_CAPS_NESTING

Unused since commit <a7424fa>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: domain: Replace qemuDomainFilePathIsHostCDROM with virFileIsCDROM
Peter Krempa [Mon, 7 May 2018 15:19:27 +0000 (17:19 +0200)]
qemu: domain: Replace qemuDomainFilePathIsHostCDROM with virFileIsCDROM

Use the new helper when checking that the VM needs to be tainted as a
host-cdrom passthrough.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agospec: Remove Group: tags
Cole Robinson [Tue, 8 May 2018 13:46:56 +0000 (09:46 -0400)]
spec: Remove Group: tags

It's only required on el5 which we don't support anymore. Everywhere
else it's not used for anything useful

https://fedoraproject.org/wiki/RPMGroups

Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agospec: Remove %clean section
Igor Gnatenko [Wed, 14 Feb 2018 08:28:07 +0000 (09:28 +0100)]
spec: Remove %clean section

None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agospec: Remove BuildRoot definition
Igor Gnatenko [Tue, 13 Feb 2018 22:44:12 +0000 (23:44 +0100)]
spec: Remove BuildRoot definition

None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoxenconfig: remove my name and email from files
David Kiarie [Tue, 8 May 2018 12:40:00 +0000 (15:40 +0300)]
xenconfig: remove my name and email from files

Remove my name and email from these files

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: David Kiarie <davidkiarie4@gmail.com>
7 years agoutil: file: Fix usage of STRPREFIX in virFileIsCDROM
Peter Krempa [Mon, 7 May 2018 15:12:26 +0000 (17:12 +0200)]
util: file: Fix usage of STRPREFIX in virFileIsCDROM

STRPREFIX takes only two arguments, but the code it was adapted from
used function with 3 arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemublock: Test handling of block devices
Peter Krempa [Wed, 25 Apr 2018 13:53:18 +0000 (15:53 +0200)]
tests: qemublock: Test handling of block devices

Make sure that 'host_device' is generated for type='block'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Test handling of all cache modes
Peter Krempa [Fri, 6 Apr 2018 12:24:51 +0000 (14:24 +0200)]
tests: qemublock: Test handling of all cache modes

The test cases would correspond to the following -drive command lines:

dir-fat-cache.xml:
-drive file=fat:/var/somefiles,if=none,id=drive-dummy,readonly=on,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

file-backing_basic-cache-directsync.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

file-backing_basic-cache-none.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=none
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-unsafe.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=unsafe
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-writeback.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=writeback
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-writethrough.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=writethrough
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

network-qcow2-backing-chain-cache-unsafe.xml:
-drive file=rbd:rbdpool/rbdimg:id=testuser-rbd:auth_supported=cephx\;none:
        mon_host=host1.example.com\;host2.example.com,
        file.password-secret=node-a-s-secalias,format=qcow2,
        if=none,id=drive-dummy,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Test handling of 'unmap' and 'detect-zeroes' options
Peter Krempa [Fri, 6 Apr 2018 12:07:44 +0000 (14:07 +0200)]
tests: qemublock: Test handling of 'unmap' and 'detect-zeroes' options

The test cases would correspond to the following -drive command lines:

file-backing_basic-detect.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,detect-zeroes=on
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-backing_basic-unmap-detect.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,discard=unmap,detect-zeroes=unmap
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-backing_basic-unmap-ignore.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,discard=ignore,detect-zeroes=on
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-backing_basic-unmap.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,discard=unmap
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add test combining authentication and encryption
Peter Krempa [Mon, 19 Mar 2018 11:51:20 +0000 (12:51 +0100)]
tests: qemublock: Add test combining authentication and encryption

iscsi and rbd support authentication of the connection. Combine it with
encryption of qcow2.

The top level disk image would generate the following '-drive' cmdline:

-drive file=rbd:rbdpool/rbdimg:id=testuser-rbd:auth_supported=cephx\;none:
            mon_host=host1.example.com\;host2.example.com,
            file.password-secret=node-a-s-secalias,encrypt.format=luks,
            encrypt.key-secret=node-b-f-encalias,format=qcow2,
            if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: basic qcow2 tests
Peter Krempa [Fri, 16 Mar 2018 16:56:16 +0000 (17:56 +0100)]
tests: qemublock: basic qcow2 tests

Add tests for backing chain handling, including a very long chain which
is fully specified in the XML and an unterminated chain.

The top level disk image would generate the following '-drive':

file-qcow2-backing-chain-encryption.xml:
-drive file=/var/lib/libvirt/images/a,encrypt.format=luks,
    encrypt.key-secret=node-b-f-encalias,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-qcow2-backing-chain-noopts.xml:
-drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-qcow2-backing-chain-unterminated.xml:
-drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add test for raw luks disk format
Peter Krempa [Thu, 19 Apr 2018 14:16:44 +0000 (16:16 +0200)]
tests: qemublock: Add test for raw luks disk format

Apart from adding test data add a function which sets up fake secrets
for the test.

The top level disk image would generate the following '-drive' cmdline:

-drive file=/path/luks.img,key-secret=test1-encalias,format=luks,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add test cases for 'aio' options of 'file' storage
Peter Krempa [Mon, 19 Mar 2018 07:59:19 +0000 (08:59 +0100)]
tests: qemublock: Add test cases for 'aio' options of 'file' storage

Test that the 'aio' option is applied correctly for the 'file' protocol
backend and across the backing chain.

The top level disk image would generate the following '-drive' cmdline:

file-backing_basic-aio_threads:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,aio=threads
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-raw-aio_native:
-drive file=/path/to/i.img,format=raw,if=none,id=drive-dummy,cache=none,aio=native
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add test-case for the 'vvfat' driver in qemu
Peter Krempa [Mon, 19 Mar 2018 07:00:19 +0000 (08:00 +0100)]
tests: qemublock: Add test-case for the 'vvfat' driver in qemu

Test mapping of the 'FAT' disk format to 'vvfat' in qemu.

The top level disk image would generate the following '-drive' cmdline:

dir-fat-readonly.xml:
-drive file=fat:/var/somefiles,if=none,id=drive-dummy,readonly=on
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

dir-fat-floppy.xml
-drive file=fat:floppy:/var/somefiles,if=none,id=drive-dummy,readonly=on

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add tests for basic backing chain formats
Peter Krempa [Wed, 28 Mar 2018 08:27:14 +0000 (10:27 +0200)]
tests: qemublock: Add tests for basic backing chain formats

Formats supporting backing chain such as qed, vmdk, don't have any other
parameters than the backing store and 'qcow' has only encryption params
which will be tested extra. Add this test case so they are covered since
any further test cases will mainly care about 'qcow2' and 'raw'.

The top level disk image would generate the following '-drive' cmdline:

-drive file=/var/lib/libvirt/images/a,format=qed,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add tests for all other format without special options
Peter Krempa [Wed, 28 Mar 2018 08:11:38 +0000 (10:11 +0200)]
tests: qemublock: Add tests for all other format without special options

Similarly to the 'raw' case add tests for bochs, cloop, dmg, ploop, vdi
vhd, and vpc. Covering all supported non-backing formats.

Note that the JSON name for 'ploop' maps to 'parallels' and 'vhd' maps
to 'vhdx'.

Files added here would result in the followint configs:

file-bochs-noopts.xml:
-drive file=/path/to/i.img,format=bochs,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-cloop-noopts.xml:
-drive file=/path/to/i.img,format=cloop,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-dmg-noopts.xml:
-drive file=/path/to/i.img,format=dmg,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-ploop-noopts.xml:
-drive file=/path/to/i.img,format=ploop,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vdi-noopts.xml:
-drive file=/path/to/i.img,format=vdi,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vhd-noopts.xml:
-drive file=/path/to/i.img,format=vhd,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vpc-noopts.xml:
-drive file=/path/to/i.img,format=vpc,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add basic 'raw' file test
Peter Krempa [Wed, 28 Mar 2018 07:40:03 +0000 (09:40 +0200)]
tests: qemublock: Add basic 'raw' file test

Test the JSON props generator with a very simple 'raw' image with no
other options. The node-names for the image are 31 bytes long so that we
validate our node name detector.

The top level disk image would generate the following '-drive' cmdline:

-drive file=/var/lib/libvirt/images/i.img,format=raw,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Add testing of blockdev JSON property generator
Peter Krempa [Fri, 23 Mar 2018 08:06:40 +0000 (09:06 +0100)]
tests: qemublock: Add testing of blockdev JSON property generator

Add a test infrastructure that will allow testing the JSON object
generator used for generating data to use with blockdev-add.

The resulting disk including the backing chain is validated to conform
to the QAPI schema and the expected output files.

The first test cases make sure that libvirt will not allow nodenames
exceeding 31 chars.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain
Peter Krempa [Thu, 19 Apr 2018 13:54:18 +0000 (15:54 +0200)]
qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain

The function will be reused in the test code where we don't care much
that the gluster debug level can't be populated from the qemu config.

Set the level only when 'cfg' is passed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: domain: Export qemuDomainDeviceDefValidateDisk
Peter Krempa [Thu, 19 Apr 2018 11:44:04 +0000 (13:44 +0200)]
qemu: domain: Export qemuDomainDeviceDefValidateDisk

It will be used in the qemublocktest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Makefile: Sanitize entry for qemublocktest
Peter Krempa [Fri, 23 Mar 2018 07:16:09 +0000 (08:16 +0100)]
tests: Makefile: Sanitize entry for qemublocktest

Remove gnulib from _LDADD and move LDADDS to replace it. Also reformat
the _SOURCES so that they can be easily extended.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: qemublock: Rename variables in anticipation of new tests
Peter Krempa [Fri, 16 Mar 2018 16:11:29 +0000 (17:11 +0100)]
tests: qemublock: Rename variables in anticipation of new tests

New tests will add new data structures so rename the 'data' structure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Add support for creating 'format' layer for blockdev-add
Peter Krempa [Mon, 23 Oct 2017 10:26:10 +0000 (12:26 +0200)]
qemu: block: Add support for creating 'format' layer for blockdev-add

When using blockdev-add and friends, libvirt will need to create also
properties for the qcow2/raw/... format handler in qemu. This patch adds
the infrastructure and implements all formats known to libvirt including
all properties which are expressed at the format level in qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Always set discard for storage nodes
Peter Krempa [Thu, 19 Apr 2018 13:44:36 +0000 (15:44 +0200)]
qemu: block: Always set discard for storage nodes

Enabling discard for the storage node allows the format drivers to
discard snapshots and other things, while configuration of the format
layer actually decides whether to actually discard data on request from
the host.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Format 'read-only' attribute for JSON disk protocol
Peter Krempa [Fri, 6 Apr 2018 04:40:23 +0000 (06:40 +0200)]
qemu: block: Format 'read-only' attribute for JSON disk protocol

This will be required when doing blockdev-add to conform with the
approach qemu choses to create the disks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Format cache modes for disk storage backends
Peter Krempa [Wed, 25 Apr 2018 15:04:35 +0000 (17:04 +0200)]
qemu: block: Format cache modes for disk storage backends

When used directly with blockdev-add/-blockdev the cache mode will need
to be specified directly for every image rather than just for the disk
itself. This implements the backing options 'direct' and 'no-flush'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Validate node-names for use with qemu
Peter Krempa [Wed, 28 Mar 2018 07:04:49 +0000 (09:04 +0200)]
qemu: block: Validate node-names for use with qemu

qemu declares node-name as a 32 byte buffer and silently truncates
anything longer than that. This is unacceptable for libvirt, so we need
to make sure that we won't ever supply a node-name exceeding 31 chars.

Add a function which will do the validation and use it to validate
storage-protocol node names.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Propagate 'legacy' parameter when formatting disk backing
Peter Krempa [Thu, 22 Mar 2018 15:42:47 +0000 (16:42 +0100)]
qemu: block: Propagate 'legacy' parameter when formatting disk backing

The gluster protocol in qemu uses two styles, one of which is legacy and
not covered by the QAPI schema.

To allow using of the new style in the blockdev-add code, add a
parameter for qemuBlockStorageSourceGetBackendProps which will switch
between the two modes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Properly handle block storage in JSON generator
Peter Krempa [Tue, 24 Apr 2018 15:12:19 +0000 (17:12 +0200)]
qemu: block: Properly handle block storage in JSON generator

Block storage should actually be passed to qemu via 'host_device' or
'host_cdrom' according to the device type. There were no users of this
behaviour so we thankfully can change it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: domain: Store whether a virStorageSource is a host CDROM drive
Peter Krempa [Tue, 24 Apr 2018 14:59:00 +0000 (16:59 +0200)]
qemu: domain: Store whether a virStorageSource is a host CDROM drive

Use virFileIsCDROM to detect whether a block device is a cdrom drive and
store it in virStorageSource. This will be necessary to correctly create
the 'host_cdrom' backend in qemu when using -blockdev.

We assume that host_cdrom makes only sense when used directly as a raw
image, but if a backing chain would be put in front of it, libvirt will
use 'host_device' in that case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: file: Add helper to determine whether a path is a CDROM
Peter Krempa [Mon, 23 Apr 2018 15:41:14 +0000 (17:41 +0200)]
util: file: Add helper to determine whether a path is a CDROM

Add detection mechanism which will allow to check whether a path to a
block device is a physical CDROM drive. This will be useful once we will
need to pass it to hypervisors.

The linux implementation uses an ioctl to do the detection, while the
fallback uses a simple string prefix match.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: file: Use only one #ifdef for __linux__
Peter Krempa [Mon, 23 Apr 2018 15:10:07 +0000 (17:10 +0200)]
util: file: Use only one #ifdef for __linux__

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Add support for accessing directories via the 'vvfat' driver
Peter Krempa [Thu, 29 Mar 2018 06:44:02 +0000 (08:44 +0200)]
qemu: block: Add support for accessing directories via the 'vvfat' driver

Handle VIR_STORAGE_TYPE_DIR in qemuBlockStorageSourceGetBackendProps so
that a 'vvfat' driver is used, which emulates a FAT filesystem
containing the folders.

qemu requires us to add it as a storage layer, since a 'raw' layer is
usually put on top of it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Move virtual FAT disk validation from command line builder
Peter Krempa [Wed, 18 Apr 2018 11:22:29 +0000 (13:22 +0200)]
qemu: Move virtual FAT disk validation from command line builder

Move it to the validation callback and make it more robust. This will
also put the checks in the correct place to use with -blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutils: storage: Mark that a virStorageSource is going to be used as a floppy
Peter Krempa [Thu, 19 Apr 2018 13:31:55 +0000 (15:31 +0200)]
utils: storage: Mark that a virStorageSource is going to be used as a floppy

Add a flag denoting that a virStorageSource is going to be used as a
floppy image. This will be useful in cases where the user passes in
files which shall be exposed as an image to the guest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Handle iomode property for json 'file' driver
Peter Krempa [Tue, 5 Dec 2017 16:05:12 +0000 (17:05 +0100)]
qemu: block: Handle iomode property for json 'file' driver

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: Extract formatting of props for 'file' backend
Peter Krempa [Tue, 5 Dec 2017 16:02:28 +0000 (17:02 +0100)]
qemu: block: Extract formatting of props for 'file' backend

'file' backend in qemu supports few more options than the current
implementation. Extract it so that changes don't pollute the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: domain: Carefuly transfer configuration from disk to storage source
Peter Krempa [Fri, 23 Mar 2018 16:00:29 +0000 (17:00 +0100)]
qemu: domain: Carefuly transfer configuration from disk to storage source

Some properties don't make sense to be configured for every single layer
of the backing chain, but to avoid needing to pass the disk structure we
will copy them to the individual virStorageSource.

Zero detection is applied only for the top layer image, while caching
and iomode for all layers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: storage: Add shadow copies of few disk properties to virStorageSource
Peter Krempa [Tue, 5 Dec 2017 13:06:13 +0000 (14:06 +0100)]
util: storage: Add shadow copies of few disk properties to virStorageSource

Few things which are currently stored the virDomainDiskDef structure are
actually relevant for the storage source as well. Add the fields with a
note that they are just mirror of the values from the disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: domain: Format storage source node names into private data
Peter Krempa [Thu, 1 Mar 2018 17:39:45 +0000 (18:39 +0100)]
qemu: domain: Format storage source node names into private data

Save and restore node names if we know them or when we will be
generating them in the status XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: Properly track that backing chain members are readonly
Peter Krempa [Wed, 11 Apr 2018 13:35:02 +0000 (15:35 +0200)]
storage: Properly track that backing chain members are readonly

Everything besides the top of the chain is readonly. Track this when
parsing the XML and detecting the chain from the disk. Also fix the
state when taking snapshots.

All other cases where the top image is changed already preserve the
readonly state from the original image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoDeprecate QEMU_CAPS_TDF
Ján Tomko [Thu, 3 May 2018 10:12:29 +0000 (12:12 +0200)]
Deprecate QEMU_CAPS_TDF

This capability is unused since we stopped parsing -help output.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoDeprecate QEMU_CAPS_NO_KVM_PIT
Ján Tomko [Thu, 3 May 2018 08:38:42 +0000 (10:38 +0200)]
Deprecate QEMU_CAPS_NO_KVM_PIT

The -no-kvm-pit-reinjection option has been deprecated since
its introduction in QEMU 1.3. See commit <1569fa1>.

Drop the capability since all the QEMUs we support allow tuning
the kvm-pit properties via -global.

Also add the QEMU_CAPS_KVM_PIT_TICK_POLICY to the clock-catchup
tests, since expecting it to succeed with QEMU that does not
have kvm-pit makes no sense.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuBuildMachineCommandLine: use a switch for virDomainVirtType
Ján Tomko [Thu, 3 May 2018 08:05:51 +0000 (10:05 +0200)]
qemuBuildMachineCommandLine: use a switch for virDomainVirtType

Enumerate all the cases and use virReportEnumRangeError.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: remove qemuBuildObsoleteAccelArg
Ján Tomko [Thu, 3 May 2018 08:05:27 +0000 (10:05 +0200)]
qemu: remove qemuBuildObsoleteAccelArg

Since we started assuming QEMU_CAPS_MACHINE_OPT in
commit <69420756>, this function can only be reached
for unsupported virt types.

Replace the call with a virReportError.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: remove qemu-img help scraping
Ján Tomko [Tue, 17 Apr 2018 21:00:33 +0000 (23:00 +0200)]
storage: remove qemu-img help scraping

We have been checking whether qemu-img supports the -o compat
option by scraping the -help output.

Since we require QEMU 1.5.0 now and this option was introduced in 1.1,
assume we support it and ditch the help parsing code along with the
extra qemu-img invocation.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: assume FMT_COMPAT for qemu-img tests
Ján Tomko [Tue, 17 Apr 2018 21:32:23 +0000 (23:32 +0200)]
tests: assume FMT_COMPAT for qemu-img tests

No point in testing outdated command lines.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: delete most qemu-img test cases assuming FMT_OPTIONS
Ján Tomko [Tue, 17 Apr 2018 21:25:45 +0000 (23:25 +0200)]
tests: delete most qemu-img test cases assuming FMT_OPTIONS

We have two leftover "capabilites" for qemu-img:
QEMU_IMG_BACKING_FORMAT_OPTIONS
QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT

The former says we are able to specify the backing format via -o
(which has been the case for a long time now) and the second one
says we can use -o compat to specify the qcow2 version.

Since we require QEMU 1.5.0, we can always assume -o compat,
which was introduced in QEMU 1.1.

Drop the test cases using FMT_OPTIONS which have a FMT_COMPAT
counterpart to prepare for deprecating FMT_OPTIONS (and these flags)
completely.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agolxc: convert to typesafe virConf accessors in lxc_native.c
Prafullkumar Tale [Fri, 4 May 2018 13:16:51 +0000 (18:46 +0530)]
lxc: convert to typesafe virConf accessors in lxc_native.c

Signed-off-by: Prafullkumar Tale <talep158@gmail.com>
7 years agovirsh: Simplify control flow for 'qemu-agent-command' command
Lin Ma [Fri, 4 May 2018 09:28:52 +0000 (17:28 +0800)]
virsh: Simplify control flow for 'qemu-agent-command' command

Signed-off-by: Lin Ma <lma@suse.com>
7 years agovirsh: Simplify control flow for 'desc' command
Lin Ma [Fri, 4 May 2018 09:28:51 +0000 (17:28 +0800)]
virsh: Simplify control flow for 'desc' command

Just like the commit 8941c800, It does the similar thing.

Signed-off-by: Lin Ma <lma@suse.com>
7 years agovirsh: Error out while domain not found for 'event' command
Lin Ma [Fri, 4 May 2018 09:28:49 +0000 (17:28 +0800)]
virsh: Error out while domain not found for 'event' command

Signed-off-by: Lin Ma <lma@suse.com>
7 years agovirsh: Error out while domain not found for 'qemu-monitor-event' command
Lin Ma [Fri, 4 May 2018 09:28:48 +0000 (17:28 +0800)]
virsh: Error out while domain not found for 'qemu-monitor-event' command

Signed-off-by: Lin Ma <lma@suse.com>
7 years agoconf: Clean up object referencing for Add and Remove
John Ferlan [Mon, 23 Apr 2018 14:40:48 +0000 (10:40 -0400)]
conf: Clean up object referencing for Add and Remove

When adding a new object to the domain object list, there should
have been 2 virObjectRef calls made one for each list into which
the object was placed to match the 2 virObjectUnref calls that
would occur during Remove as part of virHashRemoveEntry when
virObjectFreeHashData is called when the element is removed from
the hash table as set up in virDomainObjListNew.

Some drivers (libxl, lxc, qemu, and vz) handled this inconsistency
by calling virObjectRef upon successful return from virDomainObjListAdd
in order to use virDomainObjEndAPI when done with the returned @vm.
While others (bhyve, openvz, test, and vmware) handled this via only
calling virObjectUnlock upon successful return from virDomainObjListAdd.

This patch will "unify" the approach to use virDomainObjEndAPI
for any @vm successfully returned from virDomainObjListAdd.

Because list removal is so tightly coupled with list addition,
this patch fixes the list removal algorithm to return the object
as entered - "locked and reffed".  This way, the callers can then
decide how to uniformly handle add/remove success and failure.
This removes the onus on the caller to "specially handle" the
@vm during removal processing.

The Add/Remove logic allows for some logic simplification such
as in libxl where we can Remove the @vm directly rather than
needing to set a @remove_dom boolean and removing after the
libxlDomainObjEndJob completes as the @vm is locked/reffed.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agolibxl: Add refcnt for args->conn during migration
John Ferlan [Mon, 23 Apr 2018 15:58:54 +0000 (11:58 -0400)]
libxl: Add refcnt for args->conn during migration

Since the @dconn reference via args->conn will be used via a thread
or callback, let's make sure memory associated with it isn't free'd
unexpectedly before we use it. The Unref will be done when the object
is Dispose'd.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agolibxl: Add refcnt for args->vm during migration
John Ferlan [Mon, 23 Apr 2018 15:53:16 +0000 (11:53 -0400)]
libxl: Add refcnt for args->vm during migration

When adding the @vm to the @args for usage during a thread or
callback, let's add the reference to it at the time of adding to
ensure nothing else deletes it. The corresponding Unref is then
added to the Dispose function.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoconf: Move and use virDomainObjListRemoveLocked
John Ferlan [Fri, 9 Mar 2018 19:12:55 +0000 (14:12 -0500)]
conf: Move and use virDomainObjListRemoveLocked

Rather than open code within virDomainObjListRemove, just call
the *Locked function.

Additionally, add comments to virDomainObjListRemove to describe
the usage model.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoconf: Use virDomainObjListFindBy*Locked for virDomainObjListAdd
John Ferlan [Fri, 9 Mar 2018 12:37:14 +0000 (07:37 -0500)]
conf: Use virDomainObjListFindBy*Locked for virDomainObjListAdd

Use the FindBy{UUID|Name}Locked helpers which will return a locked
and ref counted object rather than the direct virHashLookup and
virObjectLock of the returned object. We'll need to temporarily
virObjectUnref when we assign a new domain @def, but that will
change shortly when virDomainObjListAddObjLocked returns the
correct reference counted object.

Use the virDomainObjEndAPI in the error path to Unref/Unlock for
the corresponding Unref/Unlock of either the FindBy* return or
the virDomainObjNew since both return a reffed/locked object.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoconf: Split FindBy{UUID|Name} into locked helpers
John Ferlan [Fri, 9 Mar 2018 12:09:20 +0000 (07:09 -0500)]
conf: Split FindBy{UUID|Name} into locked helpers

Create helpers virDomainObjListFindByUUIDLocked and
virDomainObjListFindByNameLocked to avoid the need
to lock the domain object list leaving that task
for the caller.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agotests: domaincapstest: Fix after iothreads addition
Cole Robinson [Thu, 3 May 2018 21:30:53 +0000 (17:30 -0400)]
tests: domaincapstest: Fix after iothreads addition

Introduced in 8525b9694. Some files weren't updated. I'm just
guessing on the bhyve ones

Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agodomain_capabilities: Report <vmcoreinfo> support
Cole Robinson [Tue, 17 Apr 2018 17:54:28 +0000 (13:54 -0400)]
domain_capabilities: Report <vmcoreinfo> support

Report <features><vmcoreinfo supported='yes'/> if the guest config
accepts <features><vmcoreinfo state='on'/>

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoconf: Add a comment warning about boolean feature XML
Cole Robinson [Tue, 17 Apr 2018 16:44:56 +0000 (12:44 -0400)]
conf: Add a comment warning about boolean feature XML

This is the old style and we really shouldn't be adding any more
examples like this. Add a comment to warn devs away

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoconf: format/parse <vmcoreinfo> as tristate
Cole Robinson [Tue, 17 Apr 2018 16:34:31 +0000 (12:34 -0400)]
conf: format/parse <vmcoreinfo> as tristate

<features><vmcoreinfo/> is a bare boolean XML property. We don't really
use this format anymore and instead prefer tristate <X state=on|off/>
since it's required for modeling on/off/default. If for example future
qemu started enabling vmcoreinfo by default we wouldn't have any way
for the user to turn this off.

Convert it to tristate. For writing XML this is semanticly the same,
<vmcoreinfo/> is processed as <vmcoreinfo state='on'/>.

For apps reading guest XML this is technically an API change,
as they might misinterpret <vmcoreinfo state='off'/>, however this
has only been present in libvirt since 3.10.0 and I don't think any
apps are dependent on this yet

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: Add I/O thread support info into domain capabilities
Martin Kletzander [Thu, 19 Oct 2017 12:19:38 +0000 (14:19 +0200)]
qemu: Add I/O thread support info into domain capabilities

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoxenconfig/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
xenconfig/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agovz/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
vz/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agovmx/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
vmx/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agouml/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
uml/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agotest/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
test/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agostorage/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
storage/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agosecurity/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
security/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agorpc/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
rpc/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agoqemu/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
qemu/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agophyp/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
phyp/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agonwfilter/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
nwfilter/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agonetwork/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
network/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agolxc/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:34 +0000 (14:42 +0200)]
lxc/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agohyperv/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:33 +0000 (14:42 +0200)]
hyperv/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agoesx/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:33 +0000 (14:42 +0200)]
esx/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agoaccess/: Remove spaces after casts
Martin Kletzander [Wed, 25 Apr 2018 12:42:33 +0000 (14:42 +0200)]
access/: Remove spaces after casts

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 years agotests: Drop DO_TEST_LINUX()
Andrea Bolognani [Wed, 2 May 2018 15:37:59 +0000 (17:37 +0200)]
tests: Drop DO_TEST_LINUX()

Now that mocking NUMA information works on FreeBSD, there are
no longer any test cases that need to be restricted to Linux
only.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotests: Extend NUMA mocking
Andrea Bolognani [Wed, 2 May 2018 15:35:21 +0000 (17:35 +0200)]
tests: Extend NUMA mocking

While the current amount of mocking works just fine on most of
our target platforms, it somehow causes issues when using Clang
on FreeBSD.

Work around the issue by mocking a couple more functions. It's
not pretty, but it makes qemuxml2argvtest pass on FreeBSD at
long last.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotests: Build virpcimock on FreeBSD too
Andrea Bolognani [Mon, 30 Apr 2018 14:04:39 +0000 (16:04 +0200)]
tests: Build virpcimock on FreeBSD too

There are only a couple remaining issues preventing it from
working on FreeBSD. Let's fix them.

With the mocking in place, qemumemlocktest and qemuxml2xmltest
can finally succeed on FreeBSD.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>