]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agovz: add state group to all domain stats
Nikolay Shirokovskiy [Mon, 12 Dec 2016 07:56:38 +0000 (10:56 +0300)]
vz: add state group to all domain stats

8 years agovz: add balloon group to all domain stats
Nikolay Shirokovskiy [Mon, 12 Dec 2016 07:56:37 +0000 (10:56 +0300)]
vz: add balloon group to all domain stats

8 years agovz: add vcpu group to all domain stats
Nikolay Shirokovskiy [Mon, 12 Dec 2016 07:56:36 +0000 (10:56 +0300)]
vz: add vcpu group to all domain stats

8 years agovz: add net group to all domain stats
Nikolay Shirokovskiy [Mon, 12 Dec 2016 07:56:35 +0000 (10:56 +0300)]
vz: add net group to all domain stats

8 years agovz: provide block stats for all domain stats
Nikolay Shirokovskiy [Mon, 12 Dec 2016 07:56:34 +0000 (10:56 +0300)]
vz: provide block stats for all domain stats

8 years agovz: don't show bootorder for containers
Nikolay Shirokovskiy [Thu, 29 Dec 2016 09:58:34 +0000 (12:58 +0300)]
vz: don't show bootorder for containers

Because this is invalid xml for containers. This patch almost
reverts 7eda8369, but still skips converting vz sdk bootorder
for containers to libvirt bootorder because we use boot order
in containers for quite different purpurse.

8 years agoqemu: assign USB addresses on redirdev hotplug too
Ján Tomko [Fri, 27 Jan 2017 14:26:13 +0000 (15:26 +0100)]
qemu: assign USB addresses on redirdev hotplug too

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

8 years agoAdd libvirt-go-xml and libvirt-console-proxy to downloads
Daniel P. Berrange [Thu, 26 Jan 2017 15:43:39 +0000 (15:43 +0000)]
Add libvirt-go-xml and libvirt-console-proxy to downloads

Add recently created modules to the download page list.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemuBuildChrChardevStr: Don't leak @charAlias
Michal Privoznik [Sun, 29 Jan 2017 11:15:28 +0000 (12:15 +0100)]
qemuBuildChrChardevStr: Don't leak @charAlias

==12618== 110 bytes in 10 blocks are definitely lost in loss record 269 of 295
==12618==    at 0x4C2AE5F: malloc (vg_replace_malloc.c:297)
==12618==    by 0x1CFC6DD7: vasprintf (vasprintf.c:73)
==12618==    by 0x1912B2FC: virVasprintfInternal (virstring.c:551)
==12618==    by 0x1912B411: virAsprintfInternal (virstring.c:572)
==12618==    by 0x50B1FF: qemuAliasChardevFromDevAlias (qemu_alias.c:638)
==12618==    by 0x518CCE: qemuBuildChrChardevStr (qemu_command.c:4973)
==12618==    by 0x522DA0: qemuBuildShmemBackendChrStr (qemu_command.c:8674)
==12618==    by 0x523209: qemuBuildShmemCommandLine (qemu_command.c:8789)
==12618==    by 0x526135: qemuBuildCommandLine (qemu_command.c:9843)
==12618==    by 0x48B4BA: qemuProcessCreatePretendCmd (qemu_process.c:5897)
==12618==    by 0x4378C9: testCompareXMLToArgv (qemuxml2argvtest.c:498)
==12618==    by 0x44D5A6: virTestRun (testutils.c:180)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agospec: Enable qemu driver for RHEL-7 on aarch64
Jiri Denemark [Fri, 27 Jan 2017 17:47:26 +0000 (18:47 +0100)]
spec: Enable qemu driver for RHEL-7 on aarch64

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Add better message for some invalid block I/O settings
Martin Kletzander [Tue, 24 Jan 2017 13:52:33 +0000 (14:52 +0100)]
qemu: Add better message for some invalid block I/O settings

For example when both total_bytes_sec and total_bytes_sec_max are set,
but the former gets cleaned due to new call setting, let's say,
read_bytes_sec, we end up with this weird message for the command:

 $ virsh blkdeviotune fedora vda --read-bytes-sec 3000
 error: Unable to change block I/O throttle
 error: unsupported configuration: value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set

So let's make it more descriptive.  This is how it looks after the change:

 $ virsh blkdeviotune fedora vda --read-bytes-sec 3000
 error: Unable to change block I/O throttle
 error: unsupported configuration: cannot reset 'total_bytes_sec' when 'total_bytes_sec_max' is set

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agovirsh: Use consistent naming for blkdeviotune options
Martin Kletzander [Wed, 25 Jan 2017 08:38:09 +0000 (09:38 +0100)]
virsh: Use consistent naming for blkdeviotune options

All options started with underscores, but we switched them to dashes
later on, making the style consistent.  The latest addition, however,
did not respect that, so let's change that as well.  It is tempting to
just change the name instead of adding alias, especially since nobody
ever used it, which we know thanks to the fact that it didn't work.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agovirsh: Actually make blkdeviotune --group_name work
Martin Kletzander [Wed, 25 Jan 2017 08:35:47 +0000 (09:35 +0100)]
virsh: Actually make blkdeviotune --group_name work

Function vshCommandOptStringReq() returns -1 on error and 0 on
success.  The code, however, used the 'group_name' variable only if it
returned 1 (never).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Miscellaneous Block I/O tune cleanups
Martin Kletzander [Thu, 26 Jan 2017 14:13:27 +0000 (15:13 +0100)]
qemu: Miscellaneous Block I/O tune cleanups

Well, just two.  One indentation and the usage of 'ret'.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: Only set group_name when actually requested
Martin Kletzander [Tue, 24 Jan 2017 14:50:00 +0000 (15:50 +0100)]
qemu: Only set group_name when actually requested

We were setting it based on whether it was supported and that lead to
setting it to NULL, which our JSON code caught.  However it ended up
producing the following results:

 $ virsh blkdeviotune fedora vda --total-bytes-sec-max 2000
 error: Unable to change block I/O throttle
 error: internal error: argument key 'group' must not have null value

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: storage: Fix storage xml2xml test for vstorage pool
Peter Krempa [Fri, 27 Jan 2017 09:39:53 +0000 (10:39 +0100)]
tests: storage: Fix storage xml2xml test for vstorage pool

The input and output were the same, but the output file did not
correspond to what libvirt would output.

8 years agoconfigure: Fix copy-paste error in vstorage backend check
Peter Krempa [Fri, 27 Jan 2017 09:37:56 +0000 (10:37 +0100)]
configure: Fix copy-paste error in vstorage backend check

The 'fs' backend m4 code was copied, but one of the condition were not
changed which resulted into:

configure:    Gluster: yes
configure:        ZFS: yes
configure: Virtuozzo storage: check

Make the code turn on the virtuozzo driver automatically if the tools
are found.

8 years agodomain_conf: vnc: preserve autoport value if no port was specified
Pavel Hrdina [Wed, 25 Jan 2017 16:42:07 +0000 (17:42 +0100)]
domain_conf: vnc: preserve autoport value if no port was specified

The issue is that if this graphics definition is provided:

  <graphics type='vnc' port='0'/>

it's parsed as:

  <graphics type='vnc' autoport='no'>
    <listen type='address'/>
  </graphics>

but if the resulting XML is parsed again the output is:

  <graphics type='vnc' port='-1' autoport='yes'>
    <listen type='address'/>
  </graphics>

and this should not happen.  The XML have to always remain the same
after it was already parsed by libvirt.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodoc: improve VNC/SPICE password documentation
Pavel Hrdina [Wed, 25 Jan 2017 09:49:16 +0000 (10:49 +0100)]
doc: improve VNC/SPICE password documentation

If the passwd attribute is set to empty string it disables VNC/SPICE
access to the guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agovirsh: Fix manpage typo
Nitesh Konkar [Thu, 19 Jan 2017 04:58:44 +0000 (10:28 +0530)]
virsh: Fix manpage typo

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agovirsh: Modify description for LIBVIRT_DEBUG=4 in manpage
Nitesh Konkar [Wed, 18 Jan 2017 07:05:35 +0000 (12:35 +0530)]
virsh: Modify description for LIBVIRT_DEBUG=4 in manpage

As LIBVIRT_DEBUG=4 logs only error messages and there
are no levels above it, adjusting the description in
the man page accordingly.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agovirnettlssessiontest.c: fix grammar
Nitesh Konkar [Wed, 25 Jan 2017 09:12:38 +0000 (14:42 +0530)]
virnettlssessiontest.c: fix grammar

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agoperf: Prevent enabling of already enabled perf event
Nitesh Konkar [Tue, 24 Jan 2017 09:12:03 +0000 (14:42 +0530)]
perf: Prevent enabling of already enabled perf event

Currently, on every --enable perf_event command,
a new event->fd is created and counting of perf
event counter starts from zero and previous
event->fd is lost. This patch prevents this
behaviour.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agodocs: Reword virsh manpage for --uuid --name --details options
Nitesh Konkar [Sat, 21 Jan 2017 14:38:29 +0000 (20:08 +0530)]
docs: Reword virsh manpage for --uuid --name --details options

This commit is similar to commit 0977ada8.The virsh manpage
lists options --uuid and --name as mutually exclusive if
option --details is specified when actually the option
--details is mutually exclusive and can't go with options
--uuid and/or --name. This patch rewords the virsh manpage
to state the correct meaning.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agovstorage: Fix build
Olga Krishtal [Thu, 26 Jan 2017 16:44:26 +0000 (19:44 +0300)]
vstorage: Fix build

Needed storage_util.h - missed while merging '5f07c3c07' with
commit id '479a2f16'.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agostorage: Fix build due to recent storage backend code movement
John Ferlan [Thu, 26 Jan 2017 16:43:30 +0000 (11:43 -0500)]
storage: Fix build due to recent storage backend code movement

Commit id '5f07c3c07' broke the freebsd build in the libvirt CI test
environment because the UMOUNT was not defined unless WITH_STORAGE_FS
is defined.

So remove the virStorageBackendUmountLocal from storage_util.c,h and
restore the code back in the storage_backend_fs.c and _vstorage.c
modules.

8 years agostorage: vstorage pool documentation and simple test
Olga Krishtal [Tue, 17 Jan 2017 14:10:59 +0000 (17:10 +0300)]
storage: vstorage pool documentation and simple test

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agostorage: Introduce Virtuozzo vstorage pool and volume APIs
Olga Krishtal [Tue, 17 Jan 2017 14:10:57 +0000 (17:10 +0300)]
storage: Introduce Virtuozzo vstorage pool and volume APIs

Added create/define/etc pool operations for vstorage backend.

Used the common/local pool API's from storage_util for operations
that are not specific to vstorage. In particular Refresh and Delete
Pool operations as well as all the Volume operations.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agostorage: Introduce Virtuozzo vstorage backend
Olga Krishtal [Tue, 17 Jan 2017 14:10:55 +0000 (17:10 +0300)]
storage: Introduce Virtuozzo vstorage backend

Added general definitions for vstorage pool backend including
the build options to add --with-storage-vstorage checking.
In order to use vstorage as a backend for a storage pool
vstorage tools (vstorage and vstorage-mount) need to be installed.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
8 years agostorage: Create common file/dir volume backend helpers
John Ferlan [Sat, 21 Jan 2017 14:05:41 +0000 (09:05 -0500)]
storage: Create common file/dir volume backend helpers

Move all the volume functions to storage_util to create local/common helpers
using the same naming syntax as the existing upload, download, and wipe
virStorageBackend*Local API's.

In the process of doing so, found more API's that can now become local
to storage_util. In order to distinguish between local/external - I
changed the names of the now local only ones from "virStorageBackend..."
to just "storageBackend..."

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agostorage: Create common file/dir pool backend helpers
John Ferlan [Wed, 18 Jan 2017 19:17:21 +0000 (14:17 -0500)]
storage: Create common file/dir pool backend helpers

Move some pool functions to storage_util to create local/common helpers
using the same naming syntax as the existing upload, download, and wipe
virStorageBackend*Local API's.

In the process of doing so, found a few API's that can now become local
to storage_util. In order to distinguish between local/external - I
changed the names of the now local only ones from "virStorageBackend..."
to just "storageBackend..."

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agostorage: Move the virStorageBackendFileSystem{Start|Stop} API's
John Ferlan [Sat, 21 Jan 2017 16:47:23 +0000 (11:47 -0500)]
storage: Move the virStorageBackendFileSystem{Start|Stop} API's

Just moving code around with minor adjustment to have the Stop
code combine with the Unmount code since all the Stop code did
was call the Unmount code.

8 years agoqemu: Implement mtu on interface
Michal Privoznik [Mon, 23 Jan 2017 13:33:20 +0000 (14:33 +0100)]
qemu: Implement mtu on interface

Not only we should set the MTU on the host end of the device but
also let qemu know what MTU did we set.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodomain_conf: Introduce <mtu/> to <interface/>
Michal Privoznik [Mon, 23 Jan 2017 13:32:13 +0000 (14:32 +0100)]
domain_conf: Introduce <mtu/> to <interface/>

So far we allow to set MTU for libvirt networks. However, not all
domain interfaces have to be plugged into a libvirt network and
even if they are, they might want to have a different MTU (e.g.
for testing purposes).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirDomainNetDefParseXML: s/ret/rv/
Michal Privoznik [Mon, 23 Jan 2017 11:58:23 +0000 (12:58 +0100)]
virDomainNetDefParseXML: s/ret/rv/

We use @ret to hold the actual return value of the function we
are currently in. To hold a return value of a function called we
use different variables: @rv, @rc, etc. Honour this naming
scheme in virDomainNetDefParseXML too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatnetwork.html.in: Fix #elementsNICS anchor
Michal Privoznik [Mon, 23 Jan 2017 11:24:37 +0000 (12:24 +0100)]
formatnetwork.html.in: Fix #elementsNICS anchor

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoTHREADS.txt: fix typos
Chen Hanxiao [Wed, 25 Jan 2017 06:35:42 +0000 (14:35 +0800)]
THREADS.txt: fix typos

s/wakup/wakeup

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agotests: add xlconfig tests for <timer> configurations
Jim Fehlig [Fri, 20 Jan 2017 00:19:18 +0000 (17:19 -0700)]
tests: add xlconfig tests for <timer> configurations

8 years agoxenconfig: add support for more timers
Jim Fehlig [Thu, 19 Jan 2017 23:51:05 +0000 (16:51 -0700)]
xenconfig: add support for more timers

Currently xenconfig only supports the hpet timer for HVM domains.
Include support for tsc timer for both PV and HVM domains.

8 years agolibxl: support emulate mode of tsc timer
Jim Fehlig [Thu, 19 Jan 2017 23:21:34 +0000 (16:21 -0700)]
libxl: support emulate mode of tsc timer

While at it, use members of libxl_tsc_mode enum instead of literal
int values.

8 years agolibxl: fix timer configuration
Jim Fehlig [Mon, 16 Jan 2017 22:37:40 +0000 (15:37 -0700)]
libxl: fix timer configuration

The current logic around configuring timers in libxl based on
virDomainDef object is a bit brain dead. Unsupported timers are
silently ignored and tsc is only recognized if it is the first
timer specified.

Change the logic to reject unsupported timers and honor the tsc
timer regardless of its order when multiple timers are specified.

8 years agoconfigure: fix indentation in TLS priority result
Boris Fiuczynski [Tue, 24 Jan 2017 15:53:41 +0000 (16:53 +0100)]
configure: fix indentation in TLS priority result

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
8 years agoutil: Forbid resetting non-endpoint devices
Shivaprasad G Bhat [Mon, 23 Jan 2017 13:37:10 +0000 (19:07 +0530)]
util: Forbid resetting non-endpoint devices

It is destructive to attempt reset on a pci- or cardbus-bridge, the
host can crash.  The bridges won't contain any guest data and neither
they can be passed through using vfio/stub.  So, no point in allowing a
reset on them.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agoutil: Forbid assigning a pci-bridge to a guest
Shivaprasad G Bhat [Mon, 23 Jan 2017 13:36:29 +0000 (19:06 +0530)]
util: Forbid assigning a pci-bridge to a guest

Non-endpoint devices like pci-bridges cannot be assigned to guests.
Prevent such attempts.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agoutil: Fix typo in previous commit
John Ferlan [Sat, 21 Jan 2017 17:46:09 +0000 (12:46 -0500)]
util: Fix typo in previous commit

Should be Unlock not Lock... Bad fingers.

8 years agoutil: unlock closeCallbacks if get callbacks for connect fail
Wang King [Tue, 10 Jan 2017 06:23:49 +0000 (14:23 +0800)]
util: unlock closeCallbacks if get callbacks for connect fail

Avoid return with the closeCallbacks locked when get callbacks list for connect fail.

Signed-off-by: Wang King <king.wang@huawei.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu_domain: add timestamp in tainting of guests log
Chen Hanxiao [Fri, 20 Jan 2017 08:46:02 +0000 (16:46 +0800)]
qemu_domain: add timestamp in tainting of guests log

We lacked of timestamp in tainting of guests log,
which bring troubles for finding guest issues:
such as whether a guest powerdown caused by qemu-monitor-command
or others issues inside guests.
If we had timestamp in tainting of guests log,
it would be helpful when checking guest's /var/log/messages.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agovirDomainHostdevSubsysSCSIVHostDefParseXML: Don't leak @protocol
Michal Privoznik [Fri, 20 Jan 2017 14:52:08 +0000 (15:52 +0100)]
virDomainHostdevSubsysSCSIVHostDefParseXML: Don't leak @protocol

==24748== 12 bytes in 2 blocks are definitely lost in loss record 25 of 84
==24748==    at 0x4C2BF80: malloc (vg_replace_malloc.c:296)
==24748==    by 0x1A1E1E78: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==24748==    by 0x18D0495F: virXMLPropString (virxml.c:506)
==24748==    by 0x18D1FB3E: virDomainHostdevSubsysSCSIVHostDefParseXML (domain_conf.c:6280)
==24748==    by 0x18D20350: virDomainHostdevDefParseXMLSubsys (domain_conf.c:6450)
==24748==    by 0x18D34E7D: virDomainHostdevDefParseXML (domain_conf.c:13218)
==24748==    by 0x18D42598: virDomainDefParseXML (domain_conf.c:17745)
==24748==    by 0x18D440A9: virDomainDefParseNode (domain_conf.c:18236)
==24748==    by 0x18D43EFA: virDomainDefParse (domain_conf.c:18180)
==24748==    by 0x18D43FA0: virDomainDefParseFile (domain_conf.c:18206)
==24748==    by 0x44EDA1: testCompareDomXML2XMLFiles (testutils.c:1140)
==24748==    by 0x4365F8: testXML2XMLActive (qemuxml2xmltest.c:59)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Reset hostModelInfo in virQEMUCapsReset
Jiri Denemark [Wed, 18 Jan 2017 11:49:33 +0000 (12:49 +0100)]
qemu: Reset hostModelInfo in virQEMUCapsReset

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: set default vhost-user ifname
Michal Privoznik [Thu, 22 Dec 2016 09:33:28 +0000 (10:33 +0100)]
qemu: set default vhost-user ifname

Based on work of Mehdi Abaakouk <sileht@sileht.net>.

When parsing vhost-user interface XML and no ifname is found we
can try to fill it in in post parse callback. The way this works
is we try to make up interface name from given socket path and
then ask openvswitch whether it knows the interface.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: hotplug: Properly emit "DEVICE_DELETED" event when unplugging memory
Peter Krempa [Fri, 20 Jan 2017 13:24:35 +0000 (14:24 +0100)]
qemu: hotplug: Properly emit "DEVICE_DELETED" event when unplugging memory

The event needs to be emitted after the last monitor call, so that it's
not possible to find the device in the XML accidentally while the vm
object is unlocked.

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

8 years agobhyve: fix interface type handling for argv2xml
Roman Bogorodskiy [Fri, 6 Jan 2017 17:06:23 +0000 (21:06 +0400)]
bhyve: fix interface type handling for argv2xml

When generating a domain XML from native command (i.e. via
the connectDomainXMLFromNative call), we should use
interface type 'bridge' rather than 'ethernet' because we only
support bridges at this point.

As we don't have bridge name explicitly specified on the command line,
just use 'virbr0' as a default.

8 years agonss: Remove RES_USE_INET6 usage
Andrea Bolognani [Wed, 18 Jan 2017 17:30:18 +0000 (18:30 +0100)]
nss: Remove RES_USE_INET6 usage

The recent deprecation in glibc (commit b76e065991ec) means the
module will fail to build entirely:

  nss/libvirt_nss.c: In function '_nss_libvirt_gethostbyname_r':
  nss/libvirt_nss.c:363:13: error: RES_USE_INET6 is deprecated [-Werror]
     int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This resolver option was removed shortly after being introduced,
and application using it are already broken anyway.

8 years agostorage: avoid use of undefined GLUSTER_CLI variable
Daniel P. Berrange [Thu, 19 Jan 2017 10:27:11 +0000 (10:27 +0000)]
storage: avoid use of undefined GLUSTER_CLI variable

Previous commit tried to change configure logic such that the
GLUSTER_CLI parameter would always be set:

  commit 9e97c8c0f0f3921d06bac2b92cd094a41373f748
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Mon Jan 9 15:56:12 2017 +0100

    storage: gluster: Remove build-time dependency on the 'gluster' cli tool

This missed the fact that the AC_PATH_PROG call was itself inside an 'if'
conditional that would not be called in with_storage_gluster was false. As
a result, GLUSTER_CLI was still conditionally defined.

Just kill the GLUSTER_CLI parameter and AC_PATH_PROG call entirely and pass a
bare "gluster" string to virFindFileInPath instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: catch failure of drive_add
Daniel P. Berrange [Tue, 17 Jan 2017 16:14:11 +0000 (16:14 +0000)]
qemu: catch failure of drive_add

Previously when QEMU failed "drive_add" due to an error opening
a file it would report

  "could not open disk image"

These days though, QEMU reports

  "Could not open '/tmp/virtd-test_e3hnhh5/disk1.qcow2': Permission denied"

which we were not detecting as an error condition.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agostorage: sheepdog: Split out functions required for tests
Peter Krempa [Mon, 16 Jan 2017 12:41:18 +0000 (13:41 +0100)]
storage: sheepdog: Split out functions required for tests

Separate the headers so that functions only required for testing of the
sheepdog backend are separated into their own file.

8 years agostorage: scsi: Remove private constants from header
Peter Krempa [Fri, 13 Jan 2017 16:52:41 +0000 (17:52 +0100)]
storage: scsi: Remove private constants from header

They are used only in the SCSI backend driver so there's no need to
pollute the headers.

8 years agostorage: scsi: Fix build if SCSI backend is disabled but iSCSI is enabled
Peter Krempa [Fri, 13 Jan 2017 16:48:00 +0000 (17:48 +0100)]
storage: scsi: Fix build if SCSI backend is disabled but iSCSI is enabled

The iSCSI backend driver was using stuff from the SCSI driver without
making sure that it's compiled in. Move the common code into the
storage_util.c since it does not contain any specific code.

8 years agostorage: fs: Compile file backends even if filesystem support is disabled
Peter Krempa [Fri, 13 Jan 2017 15:59:30 +0000 (16:59 +0100)]
storage: fs: Compile file backends even if filesystem support is disabled

The file backend code was mistakenly put into #if WITH_STORAGE_FS. This
is not necessary since all the backends just access files on disk, and
thus the code for WITH_STORAGE_DIR is sufficient to compile everything.

8 years agostorage: Split utility functions from storage_backend.(ch)
Peter Krempa [Wed, 11 Jan 2017 17:04:15 +0000 (18:04 +0100)]
storage: Split utility functions from storage_backend.(ch)

The file became a garbage dump for all kinds of utility functions over
time. Move them to a separate file so that the files can become a clean
interface for the storage backends.

8 years agostorage: Remove common code from specific driver backend
Peter Krempa [Thu, 12 Jan 2017 12:25:45 +0000 (13:25 +0100)]
storage: Remove common code from specific driver backend

The storage driver helper functions that deal with parted were put into
the disk backend code but are used commonly across.

8 years agotests: fix compilation of shunloadtest
Jim Fehlig [Mon, 16 Jan 2017 17:58:00 +0000 (10:58 -0700)]
tests: fix compilation of shunloadtest

While local builds succeed fine, a build worker building in a
chroot environment is encountering the following error with
libvirt 3.0.0 release candidates

[  162s] shunloadtest.o: In function `main':
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:110: undefined reference to `dlopen'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:114: undefined reference to `dlsym'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:133: undefined reference to `dlclose'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:111: undefined reference to `dlerror'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:115: undefined reference to `dlerror'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:116: undefined reference to `dlclose'

Fix by appending DLOPEN_LIBS to shunloadtest_LDADD.

8 years agodocs: Add news.xml entry for pool --uuid and --name adjustments
John Ferlan [Wed, 18 Jan 2017 14:16:35 +0000 (09:16 -0500)]
docs: Add news.xml entry for pool --uuid and --name adjustments

8 years agovirsh: pool-list: allow both --uuid and --name in one cmd
Chen Hanxiao [Fri, 6 Jan 2017 14:42:53 +0000 (22:42 +0800)]
virsh: pool-list: allow both --uuid and --name in one cmd

This patch will allow --uuid and --name in one cmd.
The pool's UUID and name will be printed side by side.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agovirsh: pool-list: introduce --name for printing pool's name only
Chen Hanxiao [Fri, 6 Jan 2017 14:42:52 +0000 (22:42 +0800)]
virsh: pool-list: introduce --name for printing pool's name only

This patch will introduce option --name.
If specified, only name of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agovirsh: pool-list: introduce --uuid for printing pool's UUID only
Chen Hanxiao [Fri, 6 Jan 2017 14:42:51 +0000 (22:42 +0800)]
virsh: pool-list: introduce --uuid for printing pool's UUID only

This patch will introduce option --uuid.
If specified, only UUID of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agonodedev: Fabric name must not be required for fc_host capability
Boris Fiuczynski [Mon, 16 Jan 2017 13:27:34 +0000 (14:27 +0100)]
nodedev: Fabric name must not be required for fc_host capability

fabric_name is one of many fc_host attributes in Linux that is optional
and left to the low-level driver to decide if it is implemented.
The zfcp device driver does not provide a fabric name for an fcp host.

This patch removes the requirement for a fabric name by making it optional.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
8 years agoutil: add file exists check in virReadFCHost
Boris Fiuczynski [Mon, 16 Jan 2017 13:27:33 +0000 (14:27 +0100)]
util: add file exists check in virReadFCHost

File open errors are prevented by a file exists check before
virFileReadAll is called since all callers of the virReadFCHost
method handle errors themselves based on the NULL return anyway.
Also included is a minor spelling correction in a comment.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
8 years agodisk: Fixup error handling path for devmapper when part_separator='yes'
John Ferlan [Tue, 15 Nov 2016 19:37:01 +0000 (14:37 -0500)]
disk: Fixup error handling path for devmapper when part_separator='yes'

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

If libvirt_parthelper is erroneously told to append the partition
separator 'p' onto the generated output for a disk pool using device
mapper that has 'user_friendly_names' set to true, then the error
recovery path will fail to find volume resulting in the pool being
in an unusable state.

So, augment the documentation to provide the better hint that the
part_separator='yes' should be set when user_friendly_names are not
being used. Additionally, once we're in the error path where the
returned name doesn't match the expected partition name try to see
if the reason is because the 'p' was erroneosly added. If so alter
the about to be removed vol->target.path so that the DiskDeleteVol
code can find the partition that was created and remove it.

8 years agostorage: Allow probe of volume capacity for BLOCK type
John Ferlan [Tue, 6 Dec 2016 23:37:46 +0000 (18:37 -0500)]
storage: Allow probe of volume capacity for BLOCK type

If the voldef type is VIR_STORAGE_VOL_BLOCK, then as long as the
format is known, let's allow the probe to happen - gets a truer value
and the same probe/update would be allowed for the same volume defined
in a domain.

8 years agostorage: Fix virStorageBackendUpdateVolTargetInfo type check
John Ferlan [Tue, 6 Dec 2016 11:17:20 +0000 (06:17 -0500)]
storage: Fix virStorageBackendUpdateVolTargetInfo type check

For volume processing in virStorageBackendUpdateVolTargetInfo to get
the capacity commit id 'a760ba3a7' added the ability to probe a volume
that didn't list a target format. Unfortunately, the code used the
virStorageSource  (e.g. target->type - virStorageType) rather than
virStorageVolDef (e.g. vol->type - virStorageVolType) in order to
make the comparison. As it turns out target->type for a volume is
not filled in at all for a voldef as the code relies on vol->type.
Ironically the result is that only VIR_STORAGE_VOL_BLOCK's would get
their capacity updated.

This patch will adjust the code to check the "vol->type" field instead
as an argument. This way for a voldef, the correct comparison is made.

Additionally for a backingStore, the 'type' field is never filled in;
however, since we know that the provided path is a location at which
the backing store can be accessed on the local filesystem thus just
pass VIR_STORAGE_VOL_FILE in order to satisfy the adjusted voltype
check. Whether it's a FILE or a BLOCK only matters if we're trying to
get more data based on the target->format.

8 years agoPost-release version bump to 3.1.0
Michal Privoznik [Wed, 18 Jan 2017 10:53:56 +0000 (11:53 +0100)]
Post-release version bump to 3.1.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agotests: Distribute qemuhotplugtestcpus
Michal Privoznik [Wed, 18 Jan 2017 10:42:59 +0000 (11:42 +0100)]
tests: Distribute qemuhotplugtestcpus

Starting from a245abce436f4f333 another set of tests for
qemuhotplugtest has been introduced. This time for vcpu hotplug.
However, the test data (which live in qemuhotplugtestcpus dir)
are not being distributed properly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agospec: Depend on the gluster command line tool
Peter Krempa [Tue, 10 Jan 2017 17:08:44 +0000 (18:08 +0100)]
spec: Depend on the gluster command line tool

The gluster command line tool that is used to lookup storage pool
sources moved from the gluster-client package to gluster-cli.

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

8 years agostorage: gluster: Remove build-time dependency on the 'gluster' cli tool
Peter Krempa [Mon, 9 Jan 2017 14:56:12 +0000 (15:56 +0100)]
storage: gluster: Remove build-time dependency on the 'gluster' cli tool

The tool is used for pool discovery. Since we call an external binary we
don't really need to compile out the code that uses it. We can check
whether it exists at runtime.

8 years agostorage: gluster: Report error if no volumes were found in pool lookup
Peter Krempa [Tue, 10 Jan 2017 17:35:03 +0000 (18:35 +0100)]
storage: gluster: Report error if no volumes were found in pool lookup

Similarly to the 'netfs' pool, return an error if the host does not have
any volumes.

8 years agostorage: Fix error reporting when looking up storage pool sources
Peter Krempa [Tue, 10 Jan 2017 17:29:54 +0000 (18:29 +0100)]
storage: Fix error reporting when looking up storage pool sources

In commit 4090e15399 we went back from reporting no errors if no storage
pools were found on a given host to reporting a bad error. And only in
cases when gluster was not installed.

Report a less bad error in case there are no volumes. Also report the
error when gluster is installed but no volumes were found, since
virStorageBackendFindGlusterPoolSources would return success in that
case.

8 years agotests: hotplug: Test CPU hotplug with ppc64 data
Peter Krempa [Fri, 9 Dec 2016 15:52:16 +0000 (16:52 +0100)]
tests: hotplug: Test CPU hotplug with ppc64 data

Add a positive test and few negative tests.

8 years agotests: hotplug: Add test data for legacy cpu hotplug
Peter Krempa [Fri, 9 Dec 2016 14:54:54 +0000 (15:54 +0100)]
tests: hotplug: Add test data for legacy cpu hotplug

Test that the old approach generates correct commands.

8 years agotests: hotplug: Add test infrastructure for testing qemu CPU hotplug code
Peter Krempa [Sun, 4 Dec 2016 18:08:25 +0000 (19:08 +0100)]
tests: hotplug: Add test infrastructure for testing qemu CPU hotplug code

The cpu hotplug operation is rather complex so the testing code needs to
provide quite lot of data and monitor conversations to successfully test
it. The code mainly tests the selection of cpus according to the target
count request.

8 years agotests: qemu: Add helper to load full monitor conversation from file
Peter Krempa [Wed, 30 Nov 2016 13:43:50 +0000 (14:43 +0100)]
tests: qemu: Add helper to load full monitor conversation from file

Similar to the existing qemuMonitorTestNewFromFile the *Full version
will allow to check both commands and supply responses for a better
monitor testing.

8 years agotests: qemu: monitor: Add helpers to test full command syntax
Peter Krempa [Fri, 25 Nov 2016 09:43:23 +0000 (10:43 +0100)]
tests: qemu: monitor: Add helpers to test full command syntax

Add test monitor infrastructure that will test the commands verbatim
rather than trying to do any smart handling.

8 years agotests: qemumonitor: Propagate better error messages
Peter Krempa [Thu, 1 Dec 2016 08:22:44 +0000 (09:22 +0100)]
tests: qemumonitor: Propagate better error messages

8 years agoqemu: Move cpu hotplug code into qemu_hotplug.c
Peter Krempa [Thu, 24 Nov 2016 15:56:56 +0000 (16:56 +0100)]
qemu: Move cpu hotplug code into qemu_hotplug.c

Move all the worker code into the appropriate file. This will also allow
testing of cpu hotplug.

8 years agoqemu: Prepare for reuse of qemuDomainSetVcpusLive
Peter Krempa [Wed, 9 Nov 2016 14:03:34 +0000 (15:03 +0100)]
qemu: Prepare for reuse of qemuDomainSetVcpusLive

Extract the call to qemuDomainSelectHotplugVcpuEntities outside of
qemuDomainSetVcpusLive and decide whether to hotplug or unplug the
entities specified by the cpumap using a boolean flag.

This will allow to use qemuDomainSetVcpusLive in cases where we prepare
the list of vcpus to enable or disable by other means.

8 years agotests: qemu: Document qemuMonitorTestNewFromFile
Peter Krempa [Wed, 30 Nov 2016 08:58:12 +0000 (09:58 +0100)]
tests: qemu: Document qemuMonitorTestNewFromFile

8 years agoutil: json: Add helper to reformat JSON strings
Peter Krempa [Wed, 30 Nov 2016 09:46:57 +0000 (10:46 +0100)]
util: json: Add helper to reformat JSON strings

For use in test cases it will be helpful to allow reformatting JSON
strings. Add a wrapper on top of the parser and formatter to achieve
this.

8 years agoqemu: monitor: More strict checking of 'query-cpus' if hotplug is supported
Peter Krempa [Sun, 4 Dec 2016 17:53:03 +0000 (18:53 +0100)]
qemu: monitor: More strict checking of 'query-cpus' if hotplug is supported

In cases where CPU hotplug is supported by qemu force the monitor to
reject invalid or broken responses to 'query-cpus'. It's expected that
the command returns usable data in such case.

8 years agonews: Fix xml dump of autogenerated websocket
Nikolay Shirokovskiy [Wed, 18 Jan 2017 07:21:44 +0000 (10:21 +0300)]
news: Fix xml dump of autogenerated websocket

8 years agoRelease of libvirt-3.0.0
Daniel Veillard [Tue, 17 Jan 2017 18:07:00 +0000 (19:07 +0100)]
Release of libvirt-3.0.0

8 years agotests: fix QED disk test in xlconfigtest
Jim Fehlig [Mon, 16 Jan 2017 18:31:42 +0000 (11:31 -0700)]
tests: fix QED disk test in xlconfigtest

When LIBXL_HAVE_QED is defined, xlconfigtest fails

 9) Xen XL-2-XML Format disk-qed  ... command line: config parsing error
 in disk specification: no vdev specified in
 `target=/var/lib/libvirt/images/XenGuest2,format=qed,backendtype=qdisk,vdev=hda,access=rw'
FAILED

As per the xl-disk-configuration(5) man page, target= must come
last in the disk specification when specified by name:

When this parameter is specified by name, ie with the target=
syntax in the configuration file, it consumes the whole rest of the
DISKSPEC including trailing whitespaces.  Therefore in that case
it must come last.

Change tests/xlconfigdata/test-disk-qed.cfg to adhere to this
restriction.

8 years agosecurity: SELinux: fix the transaction model's list append
Erik Skultety [Tue, 17 Jan 2017 11:22:14 +0000 (12:22 +0100)]
security: SELinux: fix the transaction model's list append

The problem is in the way how the list item is created prior to
appending it to the transaction list - the @path argument is just a
shallow copy instead of deep copy of the hostdev device's path.
Unfortunately, the hostdev devices from which the @path is extracted, in
order to add them into the transaction list, are only temporary and
freed before the buildup of the qemu namespace, thus making the @path
attribute in the transaction list NULL, causing 'permission denied' or
'double free' or 'unknown cause' errors.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agosecurity: DAC: fix the transaction model's list append
Erik Skultety [Tue, 17 Jan 2017 11:21:27 +0000 (12:21 +0100)]
security: DAC: fix the transaction model's list append

The problem is in the way how the list item is created prior to
appending it to the transaction list - the @path attribute is just a
shallow copy instead of deep copy of the hostdev device's path.
Unfortunately, the hostdev devices from which the @path is extracted, in
order to add them into the transaction list, are only temporary and
freed before the buildup of the qemu namespace, thus making the @path
attribute in the transaction list NULL, causing 'permission denied' or
'double free' or 'unknown cause' errors.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoqemu: Don't leak hostCPUModelInfo in virQEMUCaps
Jiri Denemark [Tue, 17 Jan 2017 13:34:23 +0000 (14:34 +0100)]
qemu: Don't leak hostCPUModelInfo in virQEMUCaps

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Actually unshare() iff running as root
Michal Privoznik [Tue, 17 Jan 2017 11:15:16 +0000 (12:15 +0100)]
qemu: Actually unshare() iff running as root

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

While all the code that deals with qemu namespaces correctly
detects whether we are running as root (and turn into NO-OP for
qemu:///session) the actual unshare() call is not guarded with
such check. Therefore any attempt to start a domain under
qemu:///session shall fail as unshare() is reserved for root.

The fix consists of moving unshare() call (for which we have a
wrapper called virProcessSetupPrivateMountNS) into
qemuDomainBuildNamespace() where the proper check is performed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
8 years agoRevert "perf: Add cache_l1d perf event support"
Daniel P. Berrange [Mon, 16 Jan 2017 16:54:34 +0000 (16:54 +0000)]
Revert "perf: Add cache_l1d perf event support"

This reverts commit ae16c95f1bb5591c27676c5de8d383e5612c3568.

8 years agonews: document events changes and lxc fix
Daniel P. Berrange [Wed, 11 Jan 2017 16:32:59 +0000 (16:32 +0000)]
news: document events changes and lxc fix

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agonews: Add support for guest CPU configuration on s390
Jiri Denemark [Fri, 13 Jan 2017 16:25:33 +0000 (17:25 +0100)]
news: Add support for guest CPU configuration on s390

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agostorage: Alter error message in probe/empty checks
John Ferlan [Fri, 13 Jan 2017 12:33:02 +0000 (07:33 -0500)]
storage: Alter error message in probe/empty checks

For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to
avoid using the virsh like --overwrite syntax. Additionally provide
a different error message when not writing the label to avoid confusion.

8 years agostorage: Clean up return value checking
John Ferlan [Fri, 13 Jan 2017 12:34:03 +0000 (07:34 -0500)]
storage: Clean up return value checking

Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after
calling virStorageBackendBLKIDFindPart, just allow the switch statement
handle setting ret = -2.