]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoqemu: Remove old qemuDomainDeviceDefValidateControllerPCI()
Andrea Bolognani [Tue, 20 Feb 2018 14:59:25 +0000 (15:59 +0100)]
qemu: Remove old qemuDomainDeviceDefValidateControllerPCI()

We've implemented all existing checks, and more, in the new
function, so we can finally drop the old one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controllers (QEMU capabilities)
Andrea Bolognani [Wed, 21 Feb 2018 09:18:19 +0000 (10:18 +0100)]
qemu: Validate PCI controllers (QEMU capabilities)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (chassis and port)
Andrea Bolognani [Tue, 20 Feb 2018 14:24:29 +0000 (15:24 +0100)]
qemu: Validate PCI controller options (chassis and port)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (chassisNr)
Andrea Bolognani [Tue, 20 Feb 2018 14:21:11 +0000 (15:21 +0100)]
qemu: Validate PCI controller options (chassisNr)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (numaNode)
Andrea Bolognani [Wed, 21 Feb 2018 09:17:56 +0000 (10:17 +0100)]
qemu: Validate PCI controller options (numaNode)

This change catches an invalid use of the option in our
test suite.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (busNr)
Andrea Bolognani [Tue, 20 Feb 2018 14:12:37 +0000 (15:12 +0100)]
qemu: Validate PCI controller options (busNr)

This change catches an invalid use of the option in our
test suite.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (pcihole64)
Andrea Bolognani [Tue, 20 Feb 2018 14:07:15 +0000 (15:07 +0100)]
qemu: Validate PCI controller options (pcihole64)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (targetIndex)
Andrea Bolognani [Tue, 20 Feb 2018 14:01:05 +0000 (15:01 +0100)]
qemu: Validate PCI controller options (targetIndex)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (index)
Andrea Bolognani [Tue, 20 Feb 2018 13:38:19 +0000 (14:38 +0100)]
qemu: Validate PCI controller options (index)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (modelName)
Andrea Bolognani [Tue, 20 Feb 2018 13:47:55 +0000 (14:47 +0100)]
qemu: Validate PCI controller options (modelName)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Create new qemuDomainDeviceDefValidateControllerPCI()
Andrea Bolognani [Tue, 20 Feb 2018 13:26:01 +0000 (14:26 +0100)]
qemu: Create new qemuDomainDeviceDefValidateControllerPCI()

The existing function is renamed and called from the new one, so
that even while we're in the process of implementing new checks
all the existing ones will be performed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoremote: simplify condition
Ján Tomko [Thu, 8 Mar 2018 16:34:56 +0000 (17:34 +0100)]
remote: simplify condition

In remoteConnectOpen, conn->uri cannot be NULL in the second
part of the OR expression due to short-circuit evaluation.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoqemu: simplify condition
Ján Tomko [Thu, 8 Mar 2018 16:34:34 +0000 (17:34 +0100)]
qemu: simplify condition

In qemuMigrationSrcRun, we already checked for non-NULL mig
and then dereferenced it. It's only possible for mig to be
NULL in the error section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoapparmor: add ro rule for sasl GSSAPI plugin on /etc/gss/mech.d/
Christian Ehrhardt [Wed, 7 Mar 2018 10:02:23 +0000 (11:02 +0100)]
apparmor: add ro rule for sasl GSSAPI plugin on /etc/gss/mech.d/

If a system has sasl GSSAPI plugin available qemu with sasl support will
try to read /etc/gss/mech.d/.

It is required to allow that to let the modules fully work and it should
be safe to do so as it only registers/configures plugins but has no secrets.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Jamie Strandboge <jamie@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
7 years agovirsh: use logical or for boolean values
Ján Tomko [Tue, 6 Mar 2018 13:13:55 +0000 (14:13 +0100)]
virsh: use logical or for boolean values

Bitwise or just looks wrong here.
Introduced by <commit 69e0cd3>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovirsh-edit: remove unreachable break
Ján Tomko [Tue, 6 Mar 2018 13:01:17 +0000 (14:01 +0100)]
virsh-edit: remove unreachable break

Introduced by <commit 1bb1de8>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoopenvz: pass sizeof to snprintf
Ján Tomko [Tue, 6 Mar 2018 12:56:31 +0000 (13:56 +0100)]
openvz: pass sizeof to snprintf

The size argument accounts for the nul-byte to terminate
the string. Use sizeof and remove the pointless assignment.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agonwfilter: remove pointless assignment
Ján Tomko [Tue, 6 Mar 2018 12:43:35 +0000 (13:43 +0100)]
nwfilter: remove pointless assignment

Changing a parameter passed by value has no effect.

Introduced by <commit 3f74b2eb>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agomaint: use parentheses after if
Ján Tomko [Tue, 6 Mar 2018 12:06:56 +0000 (13:06 +0100)]
maint: use parentheses after if

Some instances of ARCH_IS_PPC64 did not use them.

Introduced by commits da636d8 and ef08a54

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agorpc: switch virtlockd and virtlogd to use single-threaded dispatch
Daniel P. Berrangé [Tue, 6 Mar 2018 17:12:20 +0000 (17:12 +0000)]
rpc: switch virtlockd and virtlogd to use single-threaded dispatch

Currently both virtlogd and virtlockd use a single worker thread for
dispatching RPC messages. Even this is overkill and their RPC message
handling callbacks all run in short, finite time and so blocking the
main loop is not an issue like you'd see in libvirtd with long running
QEMU commands.

By setting max_workers==0, we can turn off the worker thread and run
these daemons single threaded. This in turn fixes a serious problem in
the virtlockd daemon whereby it loses all fcntl() locks at re-exec due
to multiple threads existing. fcntl() locks only get preserved if the
process is single threaded at time of exec().

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: avoid crashing in pre-exec if no workers are present
Daniel P. Berrangé [Tue, 6 Mar 2018 17:56:57 +0000 (17:56 +0000)]
rpc: avoid crashing in pre-exec if no workers are present

If max_workers is set to zero, then the worker thread pool won't be
created, so when serializing state for pre-exec we must set various
parameters to zero.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: invoke the message dispatch callback with client unlocked
Daniel P. Berrangé [Tue, 6 Mar 2018 17:05:16 +0000 (17:05 +0000)]
rpc: invoke the message dispatch callback with client unlocked

Currently if the virNetServer instance is created with max_workers==0 to
request a non-threaded dispatch process, we deadlock during dispatch

  #0  0x00007fb845f6f42d in __lll_lock_wait () from /lib64/libpthread.so.0
  #1  0x00007fb845f681d3 in pthread_mutex_lock () from /lib64/libpthread.so.0
  #2  0x000055a6628bb305 in virMutexLock (m=<optimized out>) at util/virthread.c:89
  #3  0x000055a6628a984b in virObjectLock (anyobj=<optimized out>) at util/virobject.c:435
  #4  0x000055a66286fcde in virNetServerClientIsAuthenticated (client=client@entry=0x55a663a7b960)
      at rpc/virnetserverclient.c:1565
  #5  0x000055a66286cc17 in virNetServerProgramDispatchCall (msg=0x55a663a7bc50, client=0x55a663a7b960,
      server=0x55a663a77550, prog=0x55a663a78020) at rpc/virnetserverprogram.c:407
  #6  virNetServerProgramDispatch (prog=prog@entry=0x55a663a78020, server=server@entry=0x55a663a77550,
      client=client@entry=0x55a663a7b960, msg=msg@entry=0x55a663a7bc50) at rpc/virnetserverprogram.c:307
  #7  0x000055a662871d56 in virNetServerProcessMsg (msg=0x55a663a7bc50, prog=0x55a663a78020, client=0x55a663a7b960,
      srv=0x55a663a77550) at rpc/virnetserver.c:148
  #8  virNetServerDispatchNewMessage (client=0x55a663a7b960, msg=0x55a663a7bc50, opaque=0x55a663a77550)
      at rpc/virnetserver.c:227
  #9  0x000055a66286e4c0 in virNetServerClientDispatchRead (client=client@entry=0x55a663a7b960)
      at rpc/virnetserverclient.c:1322
  #10 0x000055a66286e813 in virNetServerClientDispatchEvent (sock=<optimized out>, events=1, opaque=0x55a663a7b960)
      at rpc/virnetserverclient.c:1507
  #11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=<optimized out>)
      at util/vireventpoll.c:508
  #12 virEventPollRunOnce () at util/vireventpoll.c:657
  #13 0x000055a6628982f1 in virEventRunDefaultImpl () at util/virevent.c:327
  #14 0x000055a6628716d5 in virNetDaemonRun (dmn=0x55a663a771b0) at rpc/virnetdaemon.c:858
  #15 0x000055a662864c1d in main (argc=<optimized out>,
  #argv=0x7ffd105b4838) at logging/log_daemon.c:1235

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: simplify calling convention of virNetServerClientDispatchFunc
Daniel P. Berrangé [Tue, 6 Mar 2018 16:44:34 +0000 (16:44 +0000)]
rpc: simplify calling convention of virNetServerClientDispatchFunc

Currently virNetServerClientDispatchFunc implementations are only
responsible for free'ing the "msg" parameter upon success. Simplify the
calling convention by making it their unconditional responsibility to
free the "msg", and close the client if desired.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: push ref acquisition into RPC dispatch function
Daniel P. Berrangé [Tue, 6 Mar 2018 16:07:35 +0000 (16:07 +0000)]
rpc: push ref acquisition into RPC dispatch function

There's no reason why the virNetServerClientDispatchRead method needs to
acquire an extra reference on the "client" object. An extra reference is
only needed if the registered dispatch callback is going to keep hold of
the "client" for work in the background. Thus we can push reference
acquisition into virNetServerDispatchNewMessage.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: Sync packages with libvirt-jenkins-ci
Andrea Bolognani [Wed, 28 Feb 2018 13:40:45 +0000 (14:40 +0100)]
travis: Sync packages with libvirt-jenkins-ci

Make sure we install the same packages lcitool would install on
the CentOS CI so that we have consistent results. The package
list is current as of libvirt-jenkins-ci commit ad84090b6f96.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Remove virQEMUCapsProcessProps()
Andrea Bolognani [Tue, 6 Mar 2018 13:44:49 +0000 (14:44 +0100)]
qemu: Remove virQEMUCapsProcessProps()

This function was introduced in commit 41f5c2ca2776 as a way
to probe the same property for multiple devices at once.

Although the resulting representation is very compact, it
doesn't provide any extra features compared to the existing
virQEMUCapsProcessStringFlags() mechanism, which is already
used for pretty much all device properties.

Drop the custom function and datatypes and start using the
standard ones instead.

Note that, in theory, the end result is not identical
because we're no longer probing properties for

  virtio-serial-pci
  virtio-9p-pci
  virtio-rng-pci
  virtio-input-host-pci
  virtio-keyboard-pci
  virtio-mouse-pci
  virtio-tablet-pci

However, chances of any of those devices being compiled
into a QEMU binary where

  virtio-balloon-pci
  virtio-blk-pci
  virtio-scsi-pci
  virtio-net-pci
  virtio-gpu-pci

are compiled out are slim enough that it doesn't make any
difference in practice, as the lack of test suite churn
shows.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Ignore subsequent attempts to probe device properties
Andrea Bolognani [Tue, 6 Mar 2018 12:43:26 +0000 (13:43 +0100)]
qemu: Ignore subsequent attempts to probe device properties

In some cases, we are probing multiple devices for the same
property and setting the corresponding capability if it's
found on any of the devices: when that happens, we can quit
early after finding the first property and avoiding a bunch
of string comparisons.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Take full advantage of conditional device property probing
Andrea Bolognani [Tue, 6 Mar 2018 12:49:39 +0000 (13:49 +0100)]
qemu: Take full advantage of conditional device property probing

Commit 4ae59411fa3f introduced the ability to make probing for
device properties conditional on a capability being set, but
didn't extend the use of this feature to existing devices.

This commit does the last bit of work, which results in a lot
of pointless QMP chatter no longer happening and our test suite
shrinking a fair bit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Fix memory leak in qemuConnectGetAllDomainStats error path
John Ferlan [Wed, 7 Mar 2018 14:43:30 +0000 (09:43 -0500)]
qemu: Fix memory leak in qemuConnectGetAllDomainStats error path

If we return -1 on VIR_ALLOC_N failure, we leaked @vms, so
goto cleanup instead.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Replace virDomainDiskSourceEncryptionParse by an XPath query
Peter Krempa [Tue, 6 Mar 2018 13:24:49 +0000 (14:24 +0100)]
conf: Replace virDomainDiskSourceEncryptionParse by an XPath query

Remove the rather bulky function in favor of an XPath query.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Sanitize parsing of disk encryption XMLs
Peter Krempa [Tue, 6 Mar 2018 13:17:59 +0000 (14:17 +0100)]
util: storage: Sanitize parsing of disk encryption XMLs

Pass in the XPath context as we do in all other places rather than
allocating a new one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storageencryption: Refactor cleanup section in virStorageEncryptionParseXML
Peter Krempa [Tue, 6 Mar 2018 13:57:17 +0000 (14:57 +0100)]
util: storageencryption: Refactor cleanup section in virStorageEncryptionParseXML

The function used the 'cleanup' label only in error cases. This patch
makes the code pass the cleanup label in every case and removes few
unnecessary VIR_FREEs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Replace virDomainDiskSourceAuthParse by an XPath query
Peter Krempa [Tue, 6 Mar 2018 13:24:49 +0000 (14:24 +0100)]
conf: Replace virDomainDiskSourceAuthParse by an XPath query

Remove the rather bulky function in favor of an XPath query.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Sanitize parsing of disk auth XMLs
Peter Krempa [Tue, 6 Mar 2018 13:17:59 +0000 (14:17 +0100)]
util: storage: Sanitize parsing of disk auth XMLs

Pass in the XPath context as we do in all other places rather than
allocating a new one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Simplify error handling in virStorageAuthDefParseXML
Peter Krempa [Tue, 6 Mar 2018 13:03:27 +0000 (14:03 +0100)]
util: storage: Simplify error handling in virStorageAuthDefParseXML

Unify the cleanup and error paths and simplify the code flow by removing
some unnecessary variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agovirt-aa-helper: resolve yet to be created paths
Christian Ehrhardt [Thu, 1 Mar 2018 13:58:39 +0000 (14:58 +0100)]
virt-aa-helper: resolve yet to be created paths

In certain cases a xml contains paths that do not yet exist, but
are valid as qemu will create them later on - for example
vhostuser mode=server sockets.

In any such cases so far the check to virFileExists failed and due to
that the paths stayed non-resolved in regard to symlinks.

But for apparmor those non-resolved rules are non functional as they
are evaluated after resolving any symlinks.

Therefore for non-existent files and partially non-existent paths
resolve as much as possible to get valid rules.

Example:
   <interface type='vhostuser'>
       <model type='virtio'/>
       <source type='unix' path='/var/run/symlinknet' mode='server'/>
   </interface>

Got rendered as:
  "/var/run/symlinknet" rw,

But correct with "/var/run" being a symlink to "/run" is:
  "/run/symlinknet" rw,

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: mdev: Treat the 'name' sysfs attribute as optional
Erik Skultety [Mon, 5 Mar 2018 14:43:45 +0000 (15:43 +0100)]
util: mdev: Treat the 'name' sysfs attribute as optional

When commit 3545cbef moved the sysfs attribute reading logic from
_udev.c module to virmdev.c, it had to replace our udev read wrappers
with the ones available from virfile.c. The problem is that the original
logic worked correctly with udev read wrappers which don't return an
error code for a missing attribute, virfile.c readers however - not so
much. Therefore add another parameter to the macro, so we can again
accept the fact that optional attributes may be missing.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: report a nicer error when USB is disabled
Ján Tomko [Thu, 14 Sep 2017 07:13:20 +0000 (09:13 +0200)]
qemu: report a nicer error when USB is disabled

If the user tries to define a domain that has

  <controller type='usb' model='none'/>

and also some USB devices, we report an error:
  error: internal error: No free USB ports

Which is technically still correct for a domain with no USB ports.

Change it to:

USB is disabled for this domain, but USB devices are present in the domain XML

https://bugzilla.redhat.com/show_bug.cgi?id=1347550
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoqemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs
Michal Privoznik [Mon, 5 Mar 2018 09:13:29 +0000 (10:13 +0100)]
qemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs

When trying to destroy a domain (e.g. because we've seen EOF on
the monitor) we try to acquire QEMU_JOB_DESTROY. However, if
max_queued is set in qemu.conf this may fail and since our code
doesn't count on that we will still report domain as active even
though the qemu process is long gone. More specifically, if we've
seen EOF on the monitor, qemuProcessHandleMonitorEOF() is called
which sends MONITOR_EOF job to the event worker pool and
unregisters monitor from the event loop. The worker pool calls
processMonitorEOFEvent() which tries to set job which may fail
due to the limit as described above.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agonews: add logging of guest crash information on S390
Bjoern Walk [Tue, 27 Feb 2018 09:32:57 +0000 (10:32 +0100)]
news: add logging of guest crash information on S390

Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: log the crash information for S390
Bjoern Walk [Tue, 27 Feb 2018 09:32:56 +0000 (10:32 +0100)]
qemu: log the crash information for S390

Since QEMU 2.12 commit id '4ada99ade' guest crash information for
S390 is available in the QEMU monitor, e.g.:

  {
    "timestamp": {
        "seconds": 1518004739,
        "microseconds": 552563
    },
    "event": "GUEST_PANICKED",
    "data": {
        "action": "pause",
        "info": {
            "core": 0,
            "psw-addr": 1102832,
            "reason": "disabled-wait",
            "psw-mask": 562956395872256,
            "type": "s390"
        }
    }
  }

Let's log this information into the domain log file, e.g.:

    2018-02-08 13:11:26.075+0000: panic s390: core='0' psw-mask='0x0002000180000000' psw-addr='0x000000000010f146' reason='disabled-wait'

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Add capabilities for QEMU 2.11.0 on s390x
Shalini Chellathurai Saroja [Mon, 26 Feb 2018 10:20:18 +0000 (11:20 +0100)]
tests: Add capabilities for QEMU 2.11.0 on s390x

Let us introduce the xml and reply files for QEMU 2.11.0 on s390x.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agotests: force use of "NORMAL" TLS priority in test suite
Daniel P. Berrangé [Mon, 5 Mar 2018 12:46:16 +0000 (12:46 +0000)]
tests: force use of "NORMAL" TLS priority in test suite

When generating certificates we rely on GNUTLS' built-in default setup
for the ciphers used in the certs. We then currently run with the distro
specific TLS priority setup which can be much stronger, to the extent
that the certificates we generate are considered untrustworthy. We don't
care about the quality of the ciphers we use in the test suite, so just
force the priority to "NORMAL" which should ensure our certs are
accepted by GNUTLS.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Fix comparison assignment in qemuDomainUpdateDeviceLive
Erik Skultety [Tue, 6 Mar 2018 08:20:58 +0000 (09:20 +0100)]
qemu: Fix comparison assignment in qemuDomainUpdateDeviceLive

Fix this common typo and assign a value rather than implicitly
type-casted comparison result. Introduced by commit b6a264e855.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agocfg.mak: ignore trailing whitespace in gnulib local patches
Daniel P. Berrangé [Mon, 5 Mar 2018 18:46:24 +0000 (18:46 +0000)]
cfg.mak: ignore trailing whitespace in gnulib local patches

The diff files in gnulib/local may well contain trailing whitespace.
They are simply diff's of gnulib code which should not be modified to
follow libvirt style rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agognulib: temporary hacks to deal with glibc libio.h removal
Daniel P. Berrangé [Mon, 5 Mar 2018 17:20:03 +0000 (17:20 +0000)]
gnulib: temporary hacks to deal with glibc libio.h removal

GLibc deprecated libio.h in 2.27 and has removed it in current
code that will become 2.28. The latter is now in Fedora rawhide
and this change breaks gnulib which mistakenly still relies on
these ancient symbols. Add a local hack for gnulib until a
proper fix is available upstream.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agognulib: update to latest upstream changeset
Daniel P. Berrangé [Mon, 5 Mar 2018 16:47:31 +0000 (16:47 +0000)]
gnulib: update to latest upstream changeset

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split vmx driver build rules into vmx/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split vmx driver build rules into vmx/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split util build rules into util/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split util build rules into util/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split RPC build rules into rpc/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split RPC build rules into rpc/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split admin driver build rules into admin/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split admin driver build rules into admin/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split lock daemon build rules into locking/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split lock daemon build rules into locking/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split logging daemon build rules into logging/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split logging daemon build rules into logging/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split access driver build rules into access/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split access driver build rules into access/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split security driver build rules into security/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split security driver build rules into security/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split CPU build rules into cpu/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split CPU build rules into cpu/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split XML conf build rules into conf/Makefile.inc.am
Daniel P. Berrangé [Fri, 23 Feb 2018 16:33:19 +0000 (16:33 +0000)]
make: split XML conf build rules into conf/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split remote driver & daemon build rules into remote/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split remote driver & daemon build rules into remote/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split storage driver build rules into storage/Makefile.inc.am
Daniel P. Berrangé [Tue, 27 Feb 2018 11:30:54 +0000 (11:30 +0000)]
make: split storage driver build rules into storage/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split secret driver build rules into secret/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split secret driver build rules into secret/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split nodedev driver build rules into node_device/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split nodedev driver build rules into node_device/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split nwfilter driver build rules into nwfilter/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split nwfilter driver build rules into nwfilter/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split network driver build rules into network/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split network driver build rules into network/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split interface driver build rules into interface/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split interface driver build rules into interface/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake sure libvirt is linked first
Jan Palus [Mon, 5 Mar 2018 15:39:48 +0000 (16:39 +0100)]
make sure libvirt is linked first

so it's not affected by flags that might be passed in $(*_LIBS) like
-L/usr/lib which might result in linking against system library and
requiring incorrect version of private symbols

Signed-off-by: Jan Palus <atler@pld-linux.org>
7 years agoconf: Assign explicit value to VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
Andrea Bolognani [Fri, 2 Mar 2018 14:26:14 +0000 (15:26 +0100)]
conf: Assign explicit value to VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE

Pretty much any reasonable compiler would do this automatically,
but there's no harm in being explicit about it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoPost-release version bump to 4.2.0
Daniel P. Berrangé [Mon, 5 Mar 2018 15:02:51 +0000 (15:02 +0000)]
Post-release version bump to 4.2.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: force install of python2 into $PATH on macOS
Daniel P. Berrangé [Mon, 5 Mar 2018 10:13:12 +0000 (10:13 +0000)]
travis: force install of python2 into $PATH on macOS

The homebrew formula's ignored Python PEP-0394 recommendations and
changed the plain python binary in /usr/local/bin to point to Python 3
instead of Python 2. Python 2 is not even installed into a location that
is in $PATH by default anymore. The homebrew packages print a message
to stderr claiming to provide a way to fix this

[quote]
  This formula installs a python2 executable to /usr/local/opt/python@2/bin

  If you wish to have this formula's python executable in your PATH then add

  the following to ~/.bash_profile:

    export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"
[/quote]

When trying to update $PATH are suggested we find out this message is a
lie and /usr/local/opt/python@2 does not even exist, instead Python
seems to end up in /usr/local/Cellar/python@2/2.7.14_1

Rather than hardcoding this version specific directory in our travis
config, we change to run "brew link --force python@2", to make it create
symlinks in /usr/local/bin for the python2 binary.

The original change triggering this problem was

  https://github.com/Homebrew/homebrew-core/pull/24604#issue-171653084

There are countless bug reports against homebrew-core that are closed
without fixes, so it seems they are determined to ignore the Python
PEP 0394 recommendations on this.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoconf: set postParseFailed even without ALLOW_POST_PARSE_FAIL
Ján Tomko [Fri, 2 Mar 2018 14:12:49 +0000 (15:12 +0100)]
conf: set postParseFailed even without ALLOW_POST_PARSE_FAIL

We allow the postParse callbacks to fail for some reasons (missing
emulator binary) when parsing the configs from /etc/libvirt.
In that case, def->postParseFailed is set to true and the post
parse callbacks are re-executed on domain startup.

However this bool was only set when virDomainDefPostParse was called
with the ALLOW_POST_PARSE_FAIL flag set. If the callback failed
again on domain startup, the bool would be reset and subsequent
startups would not attempt to reexecute the callback.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: use switch for adapterType
Ján Tomko [Fri, 23 Feb 2018 14:01:06 +0000 (15:01 +0100)]
vboxDumpNetwork: use switch for adapterType

Also return an error when VIR_STRDUP fails.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: use VIR_STEAL_PTR instead of VIR_STRDUP
Ján Tomko [Fri, 23 Feb 2018 13:52:24 +0000 (14:52 +0100)]
vboxDumpNetwork: use VIR_STEAL_PTR instead of VIR_STRDUP

We can steal the strings instead of creating more copies.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: use a switch for attachmentType
Ján Tomko [Fri, 23 Feb 2018 13:41:03 +0000 (14:41 +0100)]
vboxDumpNetwork: use a switch for attachmentType

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: Use a single utf8 temp variable
Ján Tomko [Fri, 23 Feb 2018 13:34:09 +0000 (14:34 +0100)]
vboxDumpNetwork: Use a single utf8 temp variable

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: Use a single utf16 variable
Ján Tomko [Fri, 23 Feb 2018 13:18:10 +0000 (14:18 +0100)]
vboxDumpNetwork: Use a single utf16 variable

There is a pattern of using two temporary utf16/utf8 variables
for every value we get from VirtualBox and put in the domain
definition right away.

Reuse the same variable name to improve the chances of getting
the function on one screen.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: use virMacAddrParseHex
Ján Tomko [Fri, 23 Feb 2018 13:31:50 +0000 (14:31 +0100)]
vboxDumpNetwork: use virMacAddrParseHex

Use the virMacAddrParse helper that does not require colon-separated
values instead of using extra code to format it that way.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetworks: do not allocate def->nets upfront
Ján Tomko [Fri, 23 Feb 2018 12:51:24 +0000 (13:51 +0100)]
vboxDumpNetworks: do not allocate def->nets upfront

Use VIR_APPEND_ELEMENT instead and change the return type
to int to catch allocation errors.

This removes the need to figure out the adapter count
upfront.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetworks: delete pointless comment
Ján Tomko [Fri, 23 Feb 2018 12:47:25 +0000 (13:47 +0100)]
vboxDumpNetworks: delete pointless comment

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: allocate the network too
Ján Tomko [Fri, 23 Feb 2018 12:45:21 +0000 (13:45 +0100)]
vboxDumpNetwork: allocate the network too

Move the allocation from vboxDumpNetworks inside vboxDumpNetwork.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetworks: reduce indentation level
Ján Tomko [Fri, 23 Feb 2018 12:19:25 +0000 (13:19 +0100)]
vboxDumpNetworks: reduce indentation level

The 'enabled' bool is initialized to false, there is no need to nest the
conditions.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: re-introduce this function
Ján Tomko [Fri, 23 Feb 2018 11:15:38 +0000 (12:15 +0100)]
vboxDumpNetwork: re-introduce this function

Split out per-adapter code from vboxDumpNetworks.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: rename to vboxDumpNetworks
Ján Tomko [Fri, 23 Feb 2018 11:10:06 +0000 (12:10 +0100)]
vboxDumpNetwork: rename to vboxDumpNetworks

Free up 'vboxDumpNetwork' for dumping single network.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpNetwork: add temp variable for current network
Ján Tomko [Fri, 23 Feb 2018 11:06:18 +0000 (12:06 +0100)]
vboxDumpNetwork: add temp variable for current network

Instead of using def->nets every time, use a temporary pointer.
This will allow splitting out the per-adapter code.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpSharedFolders: return a value
Ján Tomko [Wed, 31 Jan 2018 15:11:18 +0000 (16:11 +0100)]
vboxDumpSharedFolders: return a value

The allocation errors in this function are already handled by jumping
to a cleanup label.

Change the return type from void to int and return -1 on error.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpSharedFolders: remove pointless comment
Ján Tomko [Wed, 31 Jan 2018 15:39:25 +0000 (16:39 +0100)]
vboxDumpSharedFolders: remove pointless comment

Now that the functions are separate, we no longer need comment
separators.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovboxDumpSharedFolders: rename non-standard label
Ján Tomko [Wed, 31 Jan 2018 15:37:16 +0000 (16:37 +0100)]
vboxDumpSharedFolders: rename non-standard label

s/sharedFoldersCleanup/cleanup/

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoAUTHORS: Add myself to the list of committers
Nikolay Shirokovskiy [Mon, 5 Mar 2018 10:45:16 +0000 (13:45 +0300)]
AUTHORS: Add myself to the list of committers

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
7 years agoRelease of libvirt 4.1.0
Daniel Veillard [Mon, 5 Mar 2018 09:02:19 +0000 (10:02 +0100)]
Release of libvirt 4.1.0

- docs/news.xml : updated for release
- po/*.po*: regenerated

Signed-off-by: Daniel Veillard<veillard@redhat.com>
7 years agotests: introduce qemucapsfixreplies helper
Pavel Hrdina [Thu, 1 Mar 2018 14:25:05 +0000 (15:25 +0100)]
tests: introduce qemucapsfixreplies helper

Sometimes we don't regenerate QEMU capabilities replies using QEMU
binary but we simply add a new entry manually.  In that case you need
to manually fix all the replies ids.  This helper will do that for you.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agonews: Update release notes
Michal Privoznik [Thu, 1 Mar 2018 13:48:34 +0000 (14:48 +0100)]
news: Update release notes

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agosrc: Fix checking for clang
Andrea Bolognani [Thu, 1 Mar 2018 16:32:08 +0000 (17:32 +0100)]
src: Fix checking for clang

The check was trying to use the shell variable $CC instead of
the make variable $(CC); it also interpreted grep's return code
wrong: 1 means the provided pattern was *not* matched. As a
result, pdwtags was never run, not even when building with gcc.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoconf: Fix crash in virDomainDefCompatibleDevice
John Ferlan [Thu, 1 Mar 2018 12:08:32 +0000 (07:08 -0500)]
conf: Fix crash in virDomainDefCompatibleDevice

Commit id 'edae027c' blindly assumed that the passed @oldDev
parameter would not be NULL when calling virDomainDeviceGetInfo;
however, commit id 'b6a264e8' passed NULL for AttachDevice
callers under the premise that there wouldn't be a device
to check/update against.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotravis: test upstart/systemd init script handling
Daniel P. Berrangé [Fri, 23 Feb 2018 10:58:27 +0000 (10:58 +0000)]
travis: test upstart/systemd init script handling

Enable testing of both the upstart and systemd init script handling.
We test a different one in each scenario. Even though trusty only
cares about upstart, it is fine for us to test rules that install
systemd, since we're not actually running these scripts for real.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: test "make install" and "make dist" on macOS
Daniel P. Berrangé [Wed, 28 Feb 2018 12:27:38 +0000 (12:27 +0000)]
travis: test "make install" and "make dist" on macOS

We can't use "make distcheck" on macOS because many unit tests fail. We
can still get coverage of some of the things "distcheck" validates, by
running the "install" and "dist" targets. This is particularly useful
because many conditional features are disabled on macOS, and this helps
make sure we can still successfully install & dist when these bits are
disabled.

The default script is getting unreadable since it is all on one long
line. Rather than adding further conditional clauses to it, we make
use of the travis matrix config override for the script.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: run "make distcheck" instead of just "make check"
Daniel P. Berrangé [Thu, 22 Feb 2018 14:14:17 +0000 (14:14 +0000)]
travis: run "make distcheck" instead of just "make check"

Running "make distcheck" includes the "make check", and "make dist"
targets. It ensures that we have CLEANFILES and uninstall rules setup
correctly, as well as validating VPATH builds succeed.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: drop precise distro jobs
Daniel P. Berrangé [Wed, 28 Feb 2018 10:38:23 +0000 (10:38 +0000)]
travis: drop precise distro jobs

The precise distro is marked deprecated in travis and will be dropped
entirely in 2 months time.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: skip pdwtags when building with CLang
Daniel P. Berrangé [Wed, 28 Feb 2018 14:38:20 +0000 (14:38 +0000)]
make: skip pdwtags when building with CLang

When building with CLang the structs that are emitted by pdwtags appear
in a completely different order than with GCC, which causes the
comparison against expected data to fail.

Ideally the test would not be sensitive to the ordering, because even
future GCC could cause changes, but that's not easy to fix. So for now
just skip the test when using clang.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agodocs: remove legacy XHTML <!DOCTYPE> declaration
Daniel P. Berrangé [Wed, 28 Feb 2018 17:42:47 +0000 (17:42 +0000)]
docs: remove legacy XHTML <!DOCTYPE> declaration

We have switched the docs to using the HTML5 doctype declaration in

  commit b1c81567c7172bc9dcd701cf46ea3f87725d62c7
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed Jul 26 18:01:25 2017 +0100

    docs: switch to using HTML5 doctype declaration

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agovshCommandOpt: Do more checking if skipChecks is set
Michal Privoznik [Wed, 28 Feb 2018 09:09:56 +0000 (10:09 +0100)]
vshCommandOpt: Do more checking if skipChecks is set

Currently if cmd->skipChecks is set (done only from completers)
some basic checks are skipped because we're working over
partially parsed command. See a26ff63ae4 for more detailed
explanation. Anyway, the referenced commit was too aggressive in
disabling checks and effectively returned success even in clear
case of failure. For instance:

  # domif-getlink --interface <TAB><TAB>

causes virshDomainInterfaceCompleter() to be called, which calls
virshDomainGetXML() which eventually calls
vshCommandOptStringReq(.., name = "domain"); The --domain
argument is required for the command and if not present -1 should
be returned to tell the caller the argument was not found. Well,
zero is returned meaning the argument was not found but it's not
required either.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovz: fix ref/unref of domain obj in vzDomainRevertToSnapshot
Nikolay Shirokovskiy [Wed, 28 Feb 2018 06:31:49 +0000 (09:31 +0300)]
vz: fix ref/unref of domain obj in vzDomainRevertToSnapshot

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
7 years agovirsh: fixing segfault by pool autocompleter function.
Julio Faracco [Wed, 28 Feb 2018 01:17:54 +0000 (22:17 -0300)]
virsh: fixing segfault by pool autocompleter function.

The commands which requires a pool to perform any action for a volume is
throwing a segfault when you pass the volume name before a pool name or
without the argument '--pool'.

An example that works:
virsh # vol-list loops-pool
 Name                 Path
-------------------------------------------------------------------
 loop0                /mnt/loop0

virsh # vol-info --pool loops-pool lo<TAB>

An example that does not work:
virsh # vol-list loops-pool
 Name                 Path
-------------------------------------------------------------------
 loop0                /mnt/loop0

virsh # vol-info lo<TAB>
Segmentation Fault

The example 'vol-info' can be executed as 'vol-info loop0 --pool
loops-pool'. So, this commit fixes this problem when the arguments are
inverted and avoids the segfault.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>