]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agoutil: Remove need for ret in virPCIGetPhysicalFunction
John Ferlan [Tue, 17 May 2016 14:38:47 +0000 (10:38 -0400)]
util: Remove need for ret in virPCIGetPhysicalFunction

Since the callers only ever expect 0 or -1, let's just return that directly

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Fix error path for virPCIGetVirtualFunctions
John Ferlan [Tue, 17 May 2016 14:31:16 +0000 (10:31 -0400)]
util: Fix error path for virPCIGetVirtualFunctions

If we get to the error: label and clear out the *virtual_functions[]
pointers and then return w/ error to the caller - the caller has it's
own cleanup of the same array in the out: label which is keyed off the
value of num_virt_fns, which wasn't reset to 0 in the called function
leading to a possible problem.

Just clear the value (found by Coverity)

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agotests: nodeinfotest: Remove virSaveLastError() usage
Cole Robinson [Thu, 19 May 2016 19:25:10 +0000 (15:25 -0400)]
tests: nodeinfotest: Remove virSaveLastError() usage

It's overkill here, we can use virGetLast* instead

8 years agoMore usage of virGetLastErrorMessage
Jovanka Gulicoska [Thu, 19 May 2016 19:10:19 +0000 (21:10 +0200)]
More usage of virGetLastErrorMessage

Convert to virGetLastErrorMessage() in the rest of the code

8 years agotests: More usage of virGetLastErrorMessage()
Jovanka Gulicoska [Thu, 19 May 2016 19:10:18 +0000 (21:10 +0200)]
tests: More usage of virGetLastErrorMessage()

Use virGetLastErrorMessage() instead of virGetLastError() in tests

8 years agotests: Add forgotten backslash
Michal Privoznik [Thu, 19 May 2016 16:50:52 +0000 (18:50 +0200)]
tests: Add forgotten backslash

While introducing virtestmock.la, I've forgotten to add '\' at
the end of one line leaving our Makefile.am mangled. Fortunately,
the only thing that comes after is '$(NULL)' so nothing is
terribly broken.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolxc: use job functions in lxcDomain* functions that perform modify actions.
Katerina Koukiou [Mon, 16 May 2016 21:36:54 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomain* functions that perform modify actions.

Use the recently added job functions and unlock the virDomainObj while
performing the respective modify operation.
This commit affects lxcDomain{DestroyFlags, Reboot, SetBlkioParameters,
SetMemoryParameters, SetMetadata, SetSchedulerParameterFlags, ShutdownFlags}

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: use job functions in lxcDomain* functions that do query operations.
Katerina Koukiou [Mon, 16 May 2016 21:36:53 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomain* functions that do query operations.

This commit affects lxcDomain{InterfaceStats, MemoryStats, BlockStats,
BlockStatsFlags}

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: add job functions in lxcDomainSetAutostart
Katerina Koukiou [Mon, 16 May 2016 21:36:52 +0000 (00:36 +0300)]
lxc: add job functions in lxcDomainSetAutostart

This operation isn't necessarily time consuming, but need to
wait in the queue of modify jobs.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: use job functions in lxcDomain{AttachDeviceFlags, DetachDeviceFlags, UpdateDevic...
Katerina Koukiou [Mon, 16 May 2016 21:36:51 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomain{AttachDeviceFlags, DetachDeviceFlags, UpdateDeviceFlags}

These operations aren't necessarily time consuming, but need to
wait in the queue of modify jobs.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: use job functions in lxcDomain{Suspend, Resume}
Katerina Koukiou [Mon, 16 May 2016 21:36:50 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomain{Suspend, Resume}

These operations aren't necessarily time consuming, but need to
wait in the queue of modify jobs.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: use job functions in lxcDomainSetMemoryFlags
Katerina Koukiou [Mon, 16 May 2016 21:36:49 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomainSetMemoryFlags

Large balloon operation can be time consuming.  Use the recently
added job functions and unlock the virDomainObj while ballooning.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: use job functions in lxcDomain{CreateXMLWithFiles, CreateWithFiles}
Katerina Koukiou [Mon, 16 May 2016 21:36:48 +0000 (00:36 +0300)]
lxc: use job functions in lxcDomain{CreateXMLWithFiles, CreateWithFiles}

Creating a large domain could potentially be time consuming.  Use the
recently added job functions and unlock the virDomainObj while
the create operation is in progress.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agolxc: Add job support to lxc driver
Katerina Koukiou [Mon, 16 May 2016 21:36:47 +0000 (00:36 +0300)]
lxc: Add job support to lxc driver

Follows the pattern used in the libxl driver for managing multiple,
simultaneous jobs within the driver.

Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>
8 years agoqemu: bulk stats: Don't access possibly blocked storage
Peter Krempa [Wed, 18 May 2016 12:58:25 +0000 (14:58 +0200)]
qemu: bulk stats: Don't access possibly blocked storage

If the stats for a block device can't be acquired from qemu we've
fallen back to loading them from the file on the disk in libvirt.

If qemu is not cooperating due to being stuck on an inaccessible NFS
share we would then attempt to read the files and get stuck too with
the VM object locked. All other APIs would eventually get stuck waiting
on the VM lock.

Avoid this problem by skipping the block stats if the VM is online but
the monitor did not provide any stats.

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

8 years agoqemu: driver: Separate bulk stats worker for block devices
Peter Krempa [Wed, 18 May 2016 12:40:10 +0000 (14:40 +0200)]
qemu: driver: Separate bulk stats worker for block devices

Extract the fallback path that reloads the stats from disk into a
separate function.

8 years agoqemu: driver: Remove unnecessary flag in qemuDomainGetStatsBlock
Peter Krempa [Wed, 18 May 2016 12:17:07 +0000 (14:17 +0200)]
qemu: driver: Remove unnecessary flag in qemuDomainGetStatsBlock

'abbreviated' was true if 'stats' were NULL

8 years agoperf: add support to perf event for MBM
Qiaowei Ren [Fri, 13 May 2016 04:26:07 +0000 (12:26 +0800)]
perf: add support to perf event for MBM

Some Intel processor families (e.g. the Intel Xeon processor E5 v3
family) introduced some RDT (Resource Director Technology) features
to monitor or control shared resource. Among these features, MBM
(Memory Bandwidth Monitoring), which is build on the CMT (Cache
Monitoring Technology) infrastructure, provides OS/VMM a way to
monitor bandwidth from one level of cache to another.

With current perf framework, this patch adds support to perf event
for MBM.

Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
8 years agoSeparate virDomainDefParseBootOptions
Ján Tomko [Wed, 11 May 2016 12:17:44 +0000 (14:17 +0200)]
Separate virDomainDefParseBootOptions

Split out parsing of most of the <os> subelements into a separate
function.

8 years agovz: cleanup: define vz format of uuids
Nikolay Shirokovskiy [Wed, 18 May 2016 08:11:08 +0000 (11:11 +0300)]
vz: cleanup: define vz format of uuids

vz puts uuids into curly braces. Simply introduce new contstant to reflect this
and get rid of magic +2 in code.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: implement p2p migration
Nikolay Shirokovskiy [Wed, 18 May 2016 08:11:07 +0000 (11:11 +0300)]
vz: implement p2p migration

Peer to peer migration is implemented just as in managed case. Basically
it is copy paste from managed case but with all the branches that are not
applied to vz removed.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: implement managed migration
Nikolay Shirokovskiy [Wed, 18 May 2016 08:11:06 +0000 (11:11 +0300)]
vz: implement managed migration

The newest version of migration protocol - version 3 with parameters is implemented.
Supported flags is VIR_MIGRATE_PAUSED only. Supported parameters are
VIR_MIGRATE_PARAM_URI and VIR_MIGRATE_PARAM_DEST_NAME. VIR_MIGRATE_PARAM_DEST_XML
is in VZ_MIGRATION_PARAMETERS for technical onyl reasons.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: fix const correctness case
Nikolay Shirokovskiy [Wed, 18 May 2016 08:11:05 +0000 (11:11 +0300)]
vz: fix const correctness case

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: save session uuid on login
Nikolay Shirokovskiy [Wed, 18 May 2016 08:11:04 +0000 (11:11 +0300)]
vz: save session uuid on login

This session uuid acts as authN token for different multihost vz operations one
of which is migration. Unfortunately we can't get it from server at any time
thus we need to save it at login.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovirt-admin: Introduce commands srv-clients-info and srv-clients-set
Erik Skultety [Sat, 9 Apr 2016 16:49:44 +0000 (18:49 +0200)]
virt-admin: Introduce commands srv-clients-info and srv-clients-set

Finally wire-up virAdmServer{Get,Set}ClientLimits APIs into virt-admin client.
Update the virt-admin's man page accordingly.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoadmin: Introduce virAdmServerSetClientLimits
Erik Skultety [Mon, 4 Apr 2016 12:24:52 +0000 (14:24 +0200)]
admin: Introduce virAdmServerSetClientLimits

Opposite operation to virAdmServerGetClientLimits. Understandably though,
setting values for current number of clients connected or still waiting
for authentication does not make sense, since changes to these values are event
dependent, i.e. a client connects - counter is increased. Thus only the limits
to maximum clients connected and waiting for authentication can be set. Should
a request for other controls to be set arrive (provided such a setting will
be first introduced to the config), the set of configuration controls can be
later expanded (thanks to typed params). This patch also introduces a
constraint that the maximum number of clients waiting for authentication has to
be less than the overall maximum number of clients connected and any attempt to
violate this constraint will be denied.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoadmin: Introduce virAdmServerGetClientLimits
Erik Skultety [Mon, 4 Apr 2016 08:28:22 +0000 (10:28 +0200)]
admin: Introduce virAdmServerGetClientLimits

Enable retrieval of the number of maximum clients connected to all sockets
combined, as well as the number of maximum clients waiting for authentication,
in order to be successfully connected. These are the attributes configurable
through libvirtd.conf, however, it could be handy to not only know values for
these limits, but also the values for the current number of clients
connected and number of clients currently waiting for authentication which are
changing dynamically. This API does both, retrieves the limits as well as the
current dynamic values.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoadmin: Introduce some public constants related to server's client limits
Erik Skultety [Wed, 11 May 2016 10:05:15 +0000 (12:05 +0200)]
admin: Introduce some public constants related to server's client limits

In order for typed params validation to pass on daemon side, we should
encourage users to use our exported constants with typed params to diminish
to avoid any potential problems related to argument validity.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovirnetserver: Introduce server's client-related limits getters
Erik Skultety [Sat, 9 Apr 2016 17:07:11 +0000 (19:07 +0200)]
virnetserver: Introduce server's client-related limits getters

Add some trivial getters for client related attributes to virnetserver before
any admin method can be introduced.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoqemu_cgroup: allow access to /dev/dri for virtio-vga
Ján Tomko [Thu, 19 May 2016 07:29:17 +0000 (09:29 +0200)]
qemu_cgroup: allow access to /dev/dri for virtio-vga

QEMU needs access to the /dev/dri/render* device for
virgl to work.

Allow access to all /dev/dri/* devices for domains with
<video>
  <model type='virtio' heads='1' primary='yes'>
    <acceleration accel3d='yes'/>
  </model>
</video>

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

8 years agoqemu: address: Remove QEMU_CAPS_DEVICE usage
Cole Robinson [Sat, 14 May 2016 20:36:16 +0000 (16:36 -0400)]
qemu: address: Remove QEMU_CAPS_DEVICE usage

All qemu versions we support have QEMU_CAPS_DEVICE, so checking
for it is redundant. Remove the usage.

The code diff isn't clear, but all that code is just inindented
with no other change.

Test cases that hit qemuDomainAssignAddresses but don't have
infrastructure for specifying qemuCaps values see lots of
churn, since now PCI addresses are in the XML output.

8 years agotests: qemuargv2xmltest: Drop disk for s390 aes tests
Cole Robinson [Sat, 14 May 2016 21:28:44 +0000 (17:28 -0400)]
tests: qemuargv2xmltest: Drop disk for s390 aes tests

Upcoming patches are going to make the disk portion of these
test cases fail. In order to make it work, we would need to
extend the qemuargv2xml test infrastructure to handle qemuCaps.
This is worthwhile to do at some point but isn't critical.

Instead just drop the offending portion, which isn't even the
target of the test cases anyways

8 years agoqemu: Call virDomainDefPostParse via CONFIG hotplug
Cole Robinson [Sat, 14 May 2016 19:14:44 +0000 (15:14 -0400)]
qemu: Call virDomainDefPostParse via CONFIG hotplug

hotplug APIs with the AFFECT_CONFIG flag are essentially replicating
'insert <device> into XML document, and redefine XML'. Thinking of
it this way, it's natural that we call virDomainDefPostParse after
manually editing the XML here.

Not only does doing so allow us to drop a bunch of open coded calls
to qemuDomainAssignAddresses, but it also means we are going through
the standard channels for XML validation and potentially catching
errors in user submitted XML.

8 years agoqemu: Assign device addresses in PostParse
Cole Robinson [Sat, 14 May 2016 18:52:45 +0000 (14:52 -0400)]
qemu: Assign device addresses in PostParse

This wires up qemuDomainAssignAddresses into the new
virDomainDefAssignAddressesCallback, so it's always triggered
via virDomainDefPostParse. We are essentially doing this already
with open coded calls sprinkled about.

qemu argv parse output changes slightly since previously it wasn't
hitting qemuDomainAssignAddresses.

8 years agodomain: Add virDomainDefAssignAddressesCallback
Cole Robinson [Sat, 14 May 2016 18:47:23 +0000 (14:47 -0400)]
domain: Add virDomainDefAssignAddressesCallback

This will be called at the end of virDomainDefPostParse to
allow hypervisor drivers to fill in device addresses.

8 years agoRevert "qemu_hotplug: fix checking graphics ports"
Pavel Hrdina [Mon, 16 May 2016 10:59:12 +0000 (12:59 +0200)]
Revert "qemu_hotplug: fix checking graphics ports"

This reverts commit 1ccc7fbff34ea44e5b0cf01a359d127a4c62a695.

We cannot check ports if autoport is set because we set ports to 0 while
parsing device XML.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agovz: drop prlsdkDomainHasSnapshots
Nikolay Shirokovskiy [Mon, 2 May 2016 09:33:08 +0000 (12:33 +0300)]
vz: drop prlsdkDomainHasSnapshots

Let's use introduced domain snapshots infrastructure instead.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: add domain snapshots functionality
Nikolay Shirokovskiy [Mon, 2 May 2016 09:33:07 +0000 (12:33 +0300)]
vz: add domain snapshots functionality

This solution does not keep snapshots cache because vz sdk lacks good support
for snapshot related events.

Libvirt and vz sdk has different approach to snapshot ids. vz sdk always
auto generate them while libvirt has ability to specify id by user.
Thus I have no other choice rather than simply ignore ids set by user
or generated by libvirt.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agoiscsi: Remove initiatoriqn from virISCSIScanTargets
John Ferlan [Fri, 13 May 2016 15:38:45 +0000 (11:38 -0400)]
iscsi: Remove initiatoriqn from virISCSIScanTargets

No longer necessary to have it, so remove it.

8 years agoutil: Remove disabling of autologin for iscsi-targets
Fritz Elfert [Fri, 13 May 2016 15:19:09 +0000 (11:19 -0400)]
util: Remove disabling of autologin for iscsi-targets

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

Instead of disabling auto-login of all scsi targets (even those
that do not "belong" to libvirt), use iscsiadm's "--op nonpersistent"
during discovery of iSCSI targets (e.g. "iscsiadm --mode discovery
--type sendtargets") in order to avoid the node database being altered
which led to the need for the "large hammer" approach taken by
commit id '3c12b654'.

This commit removes the virISCSITargetAutologin adjustment (eg. the setting
of node.startup to "manual"). The iscsiadm command has supported this mode
of operation as of commit id 'ad873767' to open-iscsi.

8 years agoiscsi: Add exit status checking for virISCSIGetSession
John Ferlan [Fri, 13 May 2016 17:25:30 +0000 (13:25 -0400)]
iscsi: Add exit status checking for virISCSIGetSession

Utilize the exit status parameter for virCommandRunRegex in order to
check the return error from the 'iscsiadm --mode session' command.
Without this enabled, if there are no sessions running then virCommandRun
would have displayed an error such as:

    2016-05-13 15:17:15.165+0000: 10920: error : virCommandWait:2553 :
               internal error: Child process (iscsiadm --mode session)
               unexpected exit status 21: iscsiadm: No active sessions.

It is possible that for certain paths (when probe is true) we only care
whether it's running or not to make certain decisions.  Spitting out
the error for those paths is unnecessary.

If we do have a situation where probe = false and there's an error,
then display the error from iscsiadm if it's there.

8 years agoutil: Add exitstatus parameter to virCommandRunRegex
John Ferlan [Fri, 13 May 2016 16:36:39 +0000 (12:36 -0400)]
util: Add exitstatus parameter to virCommandRunRegex

Rather than have virCommandRun just spit out the error, allow callers
to decide to pass the exitstatus so the caller can make intelligent
decisions based on the error.

8 years agotests: Try different usable GIC versions
Andrea Bolognani [Tue, 10 May 2016 10:36:10 +0000 (12:36 +0200)]
tests: Try different usable GIC versions

The only case where the hardware capabilities influence the result
is when no <gic/> element was provided.

The test programs now ensure both that the correct GIC version is
picked in that case, and that hardware capabilities are not taken
into account when the user has already picked a GIC version.

8 years agotests: Prepare to have different usable GIC versions
Andrea Bolognani [Tue, 10 May 2016 09:35:43 +0000 (11:35 +0200)]
tests: Prepare to have different usable GIC versions

Now that we choose the GIC version based on hardware features when
no <gic/> element has been provided, we need a way to fake the GIC
capabilities of the host.

Update the qemuxml2argv and qemuxml2xml tests to allow this.

8 years agoqemu: Add virQEMUCapsSetGICCapabilities()
Andrea Bolognani [Tue, 10 May 2016 08:50:34 +0000 (10:50 +0200)]
qemu: Add virQEMUCapsSetGICCapabilities()

For use in the test suite.

8 years agoqemu: Automatically choose usable GIC version
Andrea Bolognani [Mon, 9 May 2016 13:38:55 +0000 (15:38 +0200)]
qemu: Automatically choose usable GIC version

When the <gic/> element in not present in the domain XML, use the
domain capabilities to figure out what GIC version is usable and
choose that one automatically.

This allows guests to be created on hardware that only supports
GIC v3 without having to update virt-manager and similar tools.

Keep using the default GIC version if the <gic/> element has been
added to the domain XML but no version has been specified, as not
to break existing guests.

8 years agoqemu: Add virQEMUCapsSupportsGICVersion()
Andrea Bolognani [Mon, 16 May 2016 11:23:01 +0000 (13:23 +0200)]
qemu: Add virQEMUCapsSupportsGICVersion()

This utility function extracts some of the logic from
virQEMUCapsFillDomainFeatureGICCaps() so that it can be used
in a different context.

8 years agoChange return value of VIR_APPEND*INPLACE* to void
Jiri Denemark [Tue, 17 May 2016 10:59:43 +0000 (12:59 +0200)]
Change return value of VIR_APPEND*INPLACE* to void

The INPLACE variants of the VIR_APPEND macros cannot fail and they are
inherently quiet.

8 years agoRemove virDomainRNGInsert
Jiri Denemark [Tue, 17 May 2016 11:08:34 +0000 (13:08 +0200)]
Remove virDomainRNGInsert

It was just a useless wrapper around VIR_APPEND_ELEMENT*.

8 years agoxlconfigtest: add test case for type=vif in xl format
Chunyan Liu [Tue, 17 May 2016 09:34:46 +0000 (17:34 +0800)]
xlconfigtest: add test case for type=vif in xl format

Signed-off-by: Chunyan Liu <cyliu@suse.com>
8 years agoxenFormatNet: correct `type=netfront' to 'type=vif' to match libxl
Chunyan Liu [Tue, 17 May 2016 09:34:45 +0000 (17:34 +0800)]
xenFormatNet: correct `type=netfront' to 'type=vif' to match libxl

According to current xl.cfg docs and xl codes, it uses type=vif
instead of type=netfront.

Currently after domxml-to-native, libvirt xml model=netfront will be
converted to xl type=netfront. This has no problem before, xen codes
for a long time just check type=ioemu, if not, set type to _VIF.

Since libxl uses parse_nic_config to avoid duplicate codes, it
compares 'type=vif' and 'type=ioemu' for valid parameters, others
are considered as invalid, thus we have problem with type=netfront
in xl config file.
 #xl create sles12gm-hvm.orig
 Parsing config from sles12gm-hvm.orig
 Invalid parameter `type'.

Correct the conversion in libvirt, so that it matchs libxl codes
and also xl.cfg.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
8 years agoextract XEN_CONFIG_FORMAT_XM/XL to xen_common.h
Chunyan Liu [Tue, 17 May 2016 09:34:44 +0000 (17:34 +0800)]
extract XEN_CONFIG_FORMAT_XM/XL to xen_common.h

Unify XEN_CONFIG_FORMAT_x and LIBXL_CONFIG_FORMAT_x to
XEN_CONFIG_FORMAT_x, and move to xen_common.h.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
8 years agobhyve: implement virConnectIsSecure
Fabian Freyer [Tue, 17 May 2016 12:49:21 +0000 (14:49 +0200)]
bhyve: implement virConnectIsSecure

Trivially return 1, since bhyve is considered a local connection that
should not be vulnerable to eavesdropping.

8 years agobhyve: Implement virConnectIsEncrypted
Fabian Freyer [Tue, 17 May 2016 12:49:20 +0000 (14:49 +0200)]
bhyve: Implement virConnectIsEncrypted

Being a local connection, bhyve does not support encryption. Therefore
trivially return 0.

8 years agospec: Remove %defattr usage
Cole Robinson [Sun, 15 May 2016 21:31:42 +0000 (17:31 -0400)]
spec: Remove %defattr usage

It was only needed for rpm versions that are much older than our
minimally supported distro

Some more details here: https://fedorahosted.org/fpc/ticket/77

8 years agoRevert "vz: handle sourceless cdroms"
Maxim Nestratov [Tue, 17 May 2016 12:11:35 +0000 (15:11 +0300)]
Revert "vz: handle sourceless cdroms"

This reverts commit 071fe092.
It was committed by a mistake and correct patch was committed
earlier as baad90fb.

8 years agoqemu: hotplug: Report error if we hit tray status timeout
Cole Robinson [Mon, 2 May 2016 23:07:34 +0000 (19:07 -0400)]
qemu: hotplug: Report error if we hit tray status timeout

If we exceed the timeout waiting for the tray status to change,
we don't report an error. Fix it

8 years agodocs: formatdomain: document virtio-mmio device addresses
Cole Robinson [Sun, 15 May 2016 21:58:19 +0000 (17:58 -0400)]
docs: formatdomain: document virtio-mmio device addresses

8 years agoadmin: include: Rename argument dmn to conn in virAdmConnectListServers
Erik Skultety [Tue, 17 May 2016 10:39:02 +0000 (12:39 +0200)]
admin: include: Rename argument dmn to conn in virAdmConnectListServers

This is just a trivial cosmetic change, throughout all the APIs the argument
is called conn as from 'connection', having 'dmn' at just this single place
might look odd, so better change it now when the interface is still explicitly
disabled and we still have the ability to alter the signatures and public
names before officially enabling it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovz: make error path code idiomatic
Nikolay Shirokovskiy [Fri, 8 Apr 2016 07:41:36 +0000 (10:41 +0300)]
vz: make error path code idiomatic

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: fix template ct creation
Mikhail Feoktistov [Fri, 8 Apr 2016 07:41:35 +0000 (10:41 +0300)]
vz: fix template ct creation

First we don't need to add disk in this case. Second flag should
be skipped.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: fix error message for readonly fs
Nikolay Shirokovskiy [Fri, 8 Apr 2016 07:41:34 +0000 (10:41 +0300)]
vz: fix error message for readonly fs

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: handle sourceless cdroms
Mikhail Feoktistov [Fri, 8 Apr 2016 07:41:33 +0000 (10:41 +0300)]
vz: handle sourceless cdroms

SDK handles empty cdroms all right. We just need to
pass "" instead of NULL (not setting is good too).

However we can get problems here. Disk detaching treats source
as ids. Fortunately disk detaching is not supported for cdroms
yet and for hard disks we can not get empty source - this is prohibitited
by xml parsing code.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: fix vzCheckUnsupportedDisks format checks for cdroms
Nikolay Shirokovskiy [Fri, 8 Apr 2016 07:41:32 +0000 (10:41 +0300)]
vz: fix vzCheckUnsupportedDisks format checks for cdroms

Current version of the function does not check format of cdroms at all.
At the same time prlsdkGetDiskInfo give hints that cdroms always
have format VIR_STORAGE_FILE_RAW. So fix vzCheckUnsupportedDisks.

About structure of checks. As we don't have means to store format
in SDK we always have only one format in every situation. So instead
of setting boolean let's get allowed format instead and finally compare
it to the requested. This structure of checks seems stable to me
because we have only one format in every situation.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: remove check for auto file format for disks
Nikolay Shirokovskiy [Fri, 8 Apr 2016 07:41:31 +0000 (10:41 +0300)]
vz: remove check for auto file format for disks

VIR_STORAGE_FILE_AUTO can not be set from xml description.
At the same time we don't set disks format to this value
as for example qemu does. Thus this we can never get this
value in format.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agodomain_conf: cleanup virDomainGraphicsListenDefParseXML
Pavel Hrdina [Mon, 2 May 2016 12:49:38 +0000 (14:49 +0200)]
domain_conf: cleanup virDomainGraphicsListenDefParseXML

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agographics: make address attribute for listen type='address' optional
Pavel Hrdina [Mon, 9 May 2016 13:50:54 +0000 (15:50 +0200)]
graphics: make address attribute for listen type='address' optional

We support omitting listen attribute of graphics element so we should
also support omitting address attribute of listen element.  This patch
also updates libvirt to always add a listen element into domain XML
except for VNC graphics if socket attribute is specified.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodomain_conf: parse listen attribute while parsing listen elements
Pavel Hrdina [Fri, 6 May 2016 12:54:59 +0000 (14:54 +0200)]
domain_conf: parse listen attribute while parsing listen elements

Move the compatibility code out of virDomainGraphicsListensParseXML()
into virDomainGraphicsListenDefParseXML().  This also fixes a small
inconsistency between the code and error message itself.

Before this patch we would search first listen element that is
type='address' to validate listen and address attributes. After this
patch we always take the first listen element regardless of the type.

This shouldn't break anything since all drivers supports only one
listen.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agographics: don't parse listens if socket attribute is present
Pavel Hrdina [Fri, 29 Apr 2016 10:19:03 +0000 (12:19 +0200)]
graphics: don't parse listens if socket attribute is present

If socket attribute is present we start VNC that listens only on that
unix socket.  This makes the parser behave the same way as we actually
use the socket attribute.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoconf: Allow all volume modes for disk type='lun' sources
Peter Krempa [Wed, 11 May 2016 08:25:24 +0000 (10:25 +0200)]
conf: Allow all volume modes for disk type='lun' sources

Commit 82ba41108acd0f3f made possible to use direct mapped iSCSI
volumes in qemu as disk sources but didn't remove the define time check.

Rework the check by simplifying the condition and allow any volumes to
be used with disk type='lun'.

8 years agoqemu: Drop QEMU_CAPS_VIRTIO_BLK_SG_IO
Andrea Bolognani [Mon, 16 May 2016 08:29:57 +0000 (10:29 +0200)]
qemu: Drop QEMU_CAPS_VIRTIO_BLK_SG_IO

The only QEMU versions that don't have such capability are <0.11,
which we no longer support anyway

8 years agoqemu: Drop QEMU_CAPS_CPU_HOST
Andrea Bolognani [Mon, 16 May 2016 08:08:29 +0000 (10:08 +0200)]
qemu: Drop QEMU_CAPS_CPU_HOST

The only QEMU versions that don't have such capability are <0.11,
which we no longer support anyway

8 years agoqemu: Drop QEMU_CAPS_PCI_ROMBAR
Andrea Bolognani [Mon, 16 May 2016 07:51:42 +0000 (09:51 +0200)]
qemu: Drop QEMU_CAPS_PCI_ROMBAR

The only QEMU versions that don't have such capability are <0.12,
which we no longer support anyway.

Additionally, this solves the issue of some QEMU binaries being
reported as not having such capability just because they lacked
the {kvm-}pci-assign QMP object.

8 years agolibxl: Free migration cookie
John Ferlan [Mon, 16 May 2016 12:20:46 +0000 (08:20 -0400)]
libxl: Free migration cookie

Commit id 'f9edcfa4' added cookie manipulation for libxl; however, some
cookie crumb cleanup was missed. Found by Coverity.

In libxlDomainMigrationBegin, the cookie is allocated and baked; however,
the mig ingredients weren't cleaned up.

In libxlDomainMigrationPrepare, when the 'mig' cookie is added to the
args, set the 'mig = NULL'; otherwise, other failure paths between when
the code ate the cookie data and when it was added to args would fail
to clean up the crumbs.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: More qemu_monitor_json cleanups
John Ferlan [Mon, 16 May 2016 11:47:26 +0000 (07:47 -0400)]
qemu:  More qemu_monitor_json cleanups

Recent adjustments to the code produced a litany of coverity false
positives, but only because the "standard" procedure of setting a
variable to NULL after it was assigned to something else and keeping
the *Free/*FREE call in the cleanup path wasn't kept. So this patch
makes those adjustments (assign variable to NULL and remove the if
'ret < 0' condition to clean it up).

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agobhyve: implement virConnectIsAlive
Fabian Freyer [Fri, 13 May 2016 19:22:57 +0000 (21:22 +0200)]
bhyve: implement virConnectIsAlive

bhyve connections are local, and a "connection will be classed as alive
if it is [...] local".

8 years agoqemu: command: Use -name guest= if available
Cole Robinson [Fri, 22 Apr 2016 22:39:09 +0000 (18:39 -0400)]
qemu: command: Use -name guest= if available

-name guest= is the explicit parameter for passing a VM name. Using
it is required to allow a VM with an '=' in the name

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

8 years agoqemu: command: escape commas in chardev socket path
Cole Robinson [Fri, 22 Apr 2016 22:27:44 +0000 (18:27 -0400)]
qemu: command: escape commas in chardev socket path

After this, a default virt-manager VM will startup with a comma
in the VM name:

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

8 years agoqemu: command: escape commas in VNC socket path
Cole Robinson [Sun, 8 May 2016 18:33:50 +0000 (14:33 -0400)]
qemu: command: escape commas in VNC socket path

This path can be dependent on the VM libdir, which contains its name

8 years agoqemu: command: escape commas in secret master path
Cole Robinson [Fri, 22 Apr 2016 22:22:05 +0000 (18:22 -0400)]
qemu: command: escape commas in secret master path

Need to convert the local function to virBuffer usage, so we
can use qemuBufferEscapeComma

8 years agoqemu: command: escape commas in VM name
Cole Robinson [Fri, 22 Apr 2016 14:40:57 +0000 (10:40 -0400)]
qemu: command: escape commas in VM name

This isn't sufficient on its own, since the VM name is used for things
like monitor paths, which we don't escape yet

8 years agoqemu: command: Add qemuBufferEscapeComma
Cole Robinson [Sun, 8 May 2016 18:22:13 +0000 (14:22 -0400)]
qemu: command: Add qemuBufferEscapeComma

Centralize the magic invocation for escaping commas on the qemu
command line, and document it a bit

8 years agoqemu: alias: Remove QEMU_CAPS_DEVICE
Cole Robinson [Sun, 15 May 2016 21:24:54 +0000 (17:24 -0400)]
qemu: alias: Remove QEMU_CAPS_DEVICE

QEMU_CAPS_DEVICE is always set nowadays, so drop code that depends
on not-DEVICE

8 years agoadmin: Fix passing an incorrect readonly attribute to virNetServerServiceNew
Erik Skultety [Sat, 14 May 2016 17:10:39 +0000 (19:10 +0200)]
admin: Fix passing an incorrect readonly attribute to virNetServerServiceNew

When registering admin UNIX socket, a new service is created for it. This
service is incorrectly initialized to be readonly, which is later inherited by
all clients connected to the socket. In libvirt-admin's case there currently
isn't any use for the attribute anyway, but since the socket has root-only
access permissions, the least we can do is to make every admin client
connected to it report readonly as false.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agocpu: Properly report errors when parsing CPU map XML
Jiri Denemark [Fri, 13 May 2016 16:27:09 +0000 (18:27 +0200)]
cpu: Properly report errors when parsing CPU map XML

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Check vendor early
Jiri Denemark [Thu, 12 May 2016 14:02:09 +0000 (16:02 +0200)]
cpu_x86: Check vendor early

When searching for the best CPU model for CPUID data we can easily
ignore models with non-matching vendor before spending time on CPUID
data to virCPUDef conversion.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Don't ignore parsing errors in x86ModelLoad
Jiri Denemark [Thu, 12 May 2016 13:34:27 +0000 (15:34 +0200)]
cpu_x86: Don't ignore parsing errors in x86ModelLoad

CPU map XML is our internal data file, it makes no sense to tolerate any
errors in it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Don't ignore parsing errors in x86FeatureLoad
Jiri Denemark [Thu, 12 May 2016 13:30:45 +0000 (15:30 +0200)]
cpu_x86: Don't ignore parsing errors in x86FeatureLoad

CPU map XML is our internal data file, it makes no sense to tolerate any
errors in it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Don't ignore parsing errors in x86VendorLoad
Jiri Denemark [Thu, 12 May 2016 13:29:49 +0000 (15:29 +0200)]
cpu_x86: Don't ignore parsing errors in x86VendorLoad

CPU map XML is our internal data file, it makes no sense to tolerate any
errors in it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Simplify insertions into a linked list
Jiri Denemark [Thu, 12 May 2016 13:18:26 +0000 (15:18 +0200)]
cpu_x86: Simplify insertions into a linked list

The next pointer is initialized to NULL, overwriting to with another
NULL doesn't hurt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Remove comparisons to NULL
Jiri Denemark [Thu, 12 May 2016 13:06:25 +0000 (15:06 +0200)]
cpu_x86: Remove comparisons to NULL

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Use for loop in x86Decode
Jiri Denemark [Thu, 12 May 2016 12:53:31 +0000 (14:53 +0200)]
cpu_x86: Use for loop in x86Decode

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename cleanup labels
Jiri Denemark [Thu, 12 May 2016 12:52:26 +0000 (14:52 +0200)]
cpu_x86: Rename cleanup labels

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Compare CPU candidates in a separate function
Jiri Denemark [Thu, 12 May 2016 12:50:17 +0000 (14:50 +0200)]
cpu_x86: Compare CPU candidates in a separate function

Splitting the comparison into a separate function makes the code cleaner
and easier to update in the future.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename struct virCPUx86DataIterator
Jiri Denemark [Wed, 11 May 2016 10:39:15 +0000 (12:39 +0200)]
cpu_x86: Rename struct virCPUx86DataIterator

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename enum compare_result
Jiri Denemark [Wed, 11 May 2016 10:36:43 +0000 (12:36 +0200)]
cpu_x86: Rename enum compare_result

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename struct x86_map
Jiri Denemark [Wed, 11 May 2016 10:30:04 +0000 (12:30 +0200)]
cpu_x86: Rename struct x86_map

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename struct x86_model
Jiri Denemark [Wed, 11 May 2016 10:03:48 +0000 (12:03 +0200)]
cpu_x86: Rename struct x86_model

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename struct x86_kvm_feature
Jiri Denemark [Wed, 11 May 2016 09:59:29 +0000 (11:59 +0200)]
cpu_x86: Rename struct x86_kvm_feature

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename struct x86_feature
Jiri Denemark [Wed, 11 May 2016 09:56:14 +0000 (11:56 +0200)]
cpu_x86: Rename struct x86_feature

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>