]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agoutil: move virNetDevLinkDump to virnetlink.c
Laine Stump [Mon, 13 Jun 2016 11:59:12 +0000 (07:59 -0400)]
util: move virNetDevLinkDump to virnetlink.c

virNetDevLinkDump should have been in virnetlink.c, but that file
didn't exist yet when the function was created. It didn't really
matter until now - I found that having virnetlink.h included by
virnetdev.h caused build problems when trying to #include virnetdev.h
in a .c file in src/conf (due to missing directory in -I). Rather than
fix that to further institutionalize the incorrect placement of this
one function, this patch moves the function.

8 years agospec: distribute admin API within libvirt-client package
Erik Skultety [Fri, 24 Jun 2016 17:50:10 +0000 (19:50 +0200)]
spec: distribute admin API within libvirt-client package

With respect to to the following thread
https://www.redhat.com/archives/libvir-list/2016-June/msg01822.html, until we
introduce a new rpm package '-libs' that would allow us to drop daemon's
dependency on the client package, distribute admin API related stuff within
the client package (since it's the best analogy to the virsh client).

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoexamples: admin: Add some examples for the new admin APIs
Erik Skultety [Sun, 15 May 2016 14:04:51 +0000 (16:04 +0200)]
examples: admin: Add some examples for the new admin APIs

Some of the examples make use of asprintf and strtol functions (to keep
things simple) which are prohibited to use within our code (enforced by
syntax-check). Therefore besides adding some examples, this patch also updates
cfg.mk to exclude examples directory from asprintf and strtol rules, as well as
updates .gitignore to exclude all the new admin binaries created in the
'examples' dir.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoadmin: enable both admin API functionality and tarball distribution
Erik Skultety [Fri, 24 Jun 2016 17:27:09 +0000 (19:27 +0200)]
admin: enable both admin API functionality and tarball distribution

This patch enables admin socket creation in daemon's code, bumps the library
version in libvirt_admin_public.syms, and performs all necessary modifications
to our makefiles so that admin API can finally be included in the tarball,
and eventually become part of an rpm package (a patch later in this series).

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovz: always pass graphics address to sdk
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:45 +0000 (17:05 +0300)]
vz: always pass graphics address to sdk

We need this because apply graphics functions is used on
update too. Also in case of NULL address resolve it to default
instead of error.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: support vnc password
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:44 +0000 (17:05 +0300)]
vz: support vnc password

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: remove exlicitly setting zeros in dumping graphics
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:43 +0000 (17:05 +0300)]
vz: remove exlicitly setting zeros in dumping graphics

Allocation will do this job. Also we don't use the explicit setting
in other places.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: support attach/detach/update/ of graphics device
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:42 +0000 (17:05 +0300)]
vz: support attach/detach/update/ of graphics device

Move graphic device config to post parse. This way we
detect error on early stage and leverage checking on detach too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: move getting container video devices out from vnc code
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:41 +0000 (17:05 +0300)]
vz: move getting container video devices out from vnc code

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: trustGuestRxFilters fixes
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:40 +0000 (17:05 +0300)]
vz: trustGuestRxFilters fixes

First we need to always set value to vz sdk parameter so
we can leverage setting code for device updates. This patch
resolves tristate default to off implicitly. This is easier
then extract default value from vz sdk itself. First current
default is off too, second this approach is already taken
for 'net->linkstate'.

Second dump this option in domain xml.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: fix minor type safey issues with net union usage
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:39 +0000 (17:05 +0300)]
vz: fix minor type safey issues with net union usage

Fix net->data usage accordingly to type field.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: fix updating to no gateways
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:38 +0000 (17:05 +0300)]
vz: fix updating to no gateways

Current code that pass gateways to vz sdk is not suitable for
updates. If update has no gateways while we had them before
we need to pass "" for vz sdk gateways to reset old value.

The code definitely deserves its own function.

Drop checks that skip setting gateways if network address
is not set. Such a configuration is possible in vz sdk.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: dump route info in domain xml
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:37 +0000 (17:05 +0300)]
vz: dump route info in domain xml

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: dump ip addresses to domain xml
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:36 +0000 (17:05 +0300)]
vz: dump ip addresses to domain xml

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: give nice report if network device not found
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:35 +0000 (17:05 +0300)]
vz: give nice report if network device not found

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: fix memory leaks in attach/detach functions
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:34 +0000 (17:05 +0300)]
vz: fix memory leaks in attach/detach functions

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: move disks checks to device post parse
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:33 +0000 (17:05 +0300)]
vz: move disks checks to device post parse

And reformat so that we don't have lengthy lines. Also simplify
some checks.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: leverage disks parameters check on disks updates too
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:32 +0000 (17:05 +0300)]
vz: leverage disks parameters check on disks updates too

This is as easy as moving disks checks from domain post
parse callback to device post parse callback.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agovz: add device updates
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:31 +0000 (17:05 +0300)]
vz: add device updates

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: reuse edit config frame in for attach/detach functions
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:30 +0000 (17:05 +0300)]
vz: reuse edit config frame in for attach/detach functions

Attach/detach functions for disk/net are quite trivial and
typically call a few functions in begin/end edit frame. Having
in mind update function too adding configuring for another
device (like graphics) will introduce 3 trivial functions more.
Let's replace current approach by attach/detach functions for
device.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: make prlsdkGetDisk more generic
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:29 +0000 (17:05 +0300)]
vz: make prlsdkGetDisk more generic

Current implementation works with hard disks only. This patch
adds support for any disk device (cdroms and hdds right now).

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
8 years agovz: remove disk cache mode hunk
Nikolay Shirokovskiy [Wed, 20 Apr 2016 14:05:28 +0000 (17:05 +0300)]
vz: remove disk cache mode hunk

This code was added as a part of huge patch that moves driver
from working with prlctl to vz sdk so there is no good explanation
why this is done this way. The problem that it is not correct.
vz sdk cache mode parameter affects all domain disks while this hunk
resets its on every disk to a new value.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agocpu_map.xml: add cmt/mbm feature to x86
Qiaowei Ren [Fri, 24 Jun 2016 00:44:50 +0000 (08:44 +0800)]
cpu_map.xml: add cmt/mbm feature to x86

Some Intel processor families (e.g. the Intel Xeon processor E5 v3
family) introduced some PQos (Platform Qos) features, including CMT
(Cache Monitoring technology) and MBM (Memory Bandwidth Monitoring),
to monitor or control shared resource. This patch add them into x86
part of cpu_map.xml to be used for applications based on libvirt to
get cpu capabilities. For example, Nova in OpenStack schedules guests
based on the CPU features that the host has.

Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
8 years agocpu: Consolidate ARM drivers
Jiri Denemark [Fri, 24 Jun 2016 16:21:50 +0000 (18:21 +0200)]
cpu: Consolidate ARM drivers

Both ARM and AArch64 drivers are exactly the same (modulo function
names). Let's use just one driver for all ARM architectures.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoutil: fix build in virNetDevTapGetRealDeviceName
Roman Bogorodskiy [Fri, 24 Jun 2016 18:41:43 +0000 (21:41 +0300)]
util: fix build in virNetDevTapGetRealDeviceName

Commit e81de04c switched virNetDevTapGetRealDeviceName() to use
virDirOpen() instead of opendir(), however it mistakenly dropped
DIR *dirp declaration, so restore that to fix build.

8 years agostorage: Introduce virStoragePoolObjBuildTempFilePath
John Ferlan [Tue, 21 Jun 2016 22:17:51 +0000 (18:17 -0400)]
storage: Introduce virStoragePoolObjBuildTempFilePath

Create a function to return a temporary file path to be used in a mkostemp
type call using the path to the stateDir + pool->def->name + vol->name

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoPromote storage pool refresh lifecycle event to top level event
Daniel P. Berrange [Fri, 24 Jun 2016 16:35:51 +0000 (17:35 +0100)]
Promote storage pool refresh lifecycle event to top level event

The VIR_STORAGE_POOL_EVENT_REFRESHED constant does not
reflect any change in the lifecycle of the storage pool.

It should thus not be part of the storage pool lifecycle
event set, but rather be a top level event in its own
right. Thus we introduce VIR_STORAGE_POOL_EVENT_ID_REFRESH
to replace it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoutil: Add 'luks' to the FileTypeInfo
John Ferlan [Tue, 21 Jun 2016 16:59:54 +0000 (12:59 -0400)]
util: Add 'luks' to the FileTypeInfo

Add the ability to detect a luks encrypted device.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Modify the FileTypeInfo to add a version size
John Ferlan [Tue, 21 Jun 2016 17:47:21 +0000 (13:47 -0400)]
util: Modify the FileTypeInfo to add a version size

The version field historically has been a 4 byte data; however, an upcoming
new type will use a 2 byte version.  So let's adjust for that now.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Introduce virReadBufInt16LE and virReadBufInt16BE
John Ferlan [Tue, 21 Jun 2016 16:57:30 +0000 (12:57 -0400)]
util: Introduce virReadBufInt16LE and virReadBufInt16BE

In order to read 16 bits of data in the native format and convert add
the 16 bit macros to match existing 32 and 64 bit code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Remove authdef from secret setup
John Ferlan [Thu, 2 Jun 2016 18:27:08 +0000 (14:27 -0400)]
qemu: Remove authdef from secret setup

Rather than pass authdef, pass the 'authdef->username' and the
'&authdef->secdef'

Note that a username may be NULL.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Change protocol parameter for secret setup
John Ferlan [Thu, 2 Jun 2016 18:15:54 +0000 (14:15 -0400)]
qemu: Change protocol parameter for secret setup

Rather than assume/pass the protocol to the qemuDomainSecretPlainSetup
and qemuDomainSecretAESSetup, set and pass the secretUsageType based
on the src->protocol type. This will eventually be used by the
virSecretGetSecretString call

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoDocument to not rely on virConnectGetMaxVcpus API
Shivaprasad G Bhat [Fri, 24 Jun 2016 15:04:34 +0000 (20:34 +0530)]
Document to not rely on virConnectGetMaxVcpus API

The API virConnectGetMaxVcpus doesn't really reflect the actual usable number
of cpus as the maximum limits can be different for kvm and/or qemu. So update
the documentation to use virConnectGetDomainCapabilities() instead.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agoqemu: check the kvm host cpu max limits in virConnectGetDomainCapabilities
Shivaprasad G Bhat [Fri, 24 Jun 2016 15:04:13 +0000 (20:34 +0530)]
qemu: check the kvm host cpu max limits in virConnectGetDomainCapabilities

The qemu limit and host limit both should be considered for
the domain vcpu max limits.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agoqemu: Make qemuBuildSecretInfoProps global
John Ferlan [Wed, 22 Jun 2016 10:11:59 +0000 (06:11 -0400)]
qemu: Make qemuBuildSecretInfoProps global

Need to create the object for a hotplug disk

8 years agoqemu: Remove type from qemuBuildSecretInfoProps
John Ferlan [Wed, 22 Jun 2016 10:10:59 +0000 (06:10 -0400)]
qemu: Remove type from qemuBuildSecretInfoProps

It's just a constant "secret" string anyway

8 years agoRename kvmGetMaxVCPUs() to virHostCPUGetKVMMaxVCPUs()
Shivaprasad G Bhat [Fri, 24 Jun 2016 15:03:13 +0000 (20:33 +0530)]
Rename kvmGetMaxVCPUs() to virHostCPUGetKVMMaxVCPUs()

This kvmGetMaxVCPUs() needs to be used at two different places
so move it to utils with appropriate name and mark it as private
global now.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agoadd help document relevant to default mapping of credentials to machines
yuelongguang [Thu, 16 Jun 2016 11:20:24 +0000 (19:20 +0800)]
add help document relevant to default mapping of credentials to machines

* src/util/virauthconfig.c

8 years agoconf: Allow disks with identical WWN or serial
Peter Krempa [Fri, 24 Jun 2016 15:01:27 +0000 (17:01 +0200)]
conf: Allow disks with identical WWN or serial

Disallowing them broke a use case of testing multipath configurations
for storage. Originally this was added as it was impossible to
use certain /dev/disk-by... links but the disks worked properly.

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

8 years agobuild: increase xz compression level
Ján Tomko [Mon, 20 Jun 2016 15:46:05 +0000 (17:46 +0200)]
build: increase xz compression level

Increase the default compression level to 9 from 6.

This also increases decompression memory requirements
from 9 MB to 65 MB.

Also turn on verbosity.

8 years agoopenvz: do not open-code STRSKIP
Ján Tomko [Fri, 24 Jun 2016 12:35:08 +0000 (14:35 +0200)]
openvz: do not open-code STRSKIP

Remove one more use of STREQLEN with strlen as its argument.

8 years agoFix error detection in virStorageBackendISCSIGetHostNumber
Ján Tomko [Tue, 21 Jun 2016 13:13:41 +0000 (15:13 +0200)]
Fix error detection in virStorageBackendISCSIGetHostNumber

In the unlikely case the iSCSI session path exists, but does not
contain an entry starting with "target", we would silently use
an initialized value.

Rewrite the function to correctly report errors.

8 years agoReplace some uses STREQLEN with STRPREFIX
Ján Tomko [Fri, 24 Jun 2016 08:37:04 +0000 (10:37 +0200)]
Replace some uses STREQLEN with STRPREFIX

Do not call it with a magic constant matching the length
of the pattern.

8 years agodocs: Fix whitespace in output
John Ferlan [Fri, 24 Jun 2016 14:16:18 +0000 (10:16 -0400)]
docs: Fix whitespace in output

Many moons ago, commit id '8d7800a55' adjusted the format of the output
to add a space on the HEADER and the DATA... the docs weren't updated to
reflect that... This makes that adjustment.

8 years agoqemu: Check for VFIO too where legacy passthrough is checked
Shivaprasad G Bhat [Wed, 15 Jun 2016 09:57:14 +0000 (09:57 +0000)]
qemu: Check for VFIO too where legacy passthrough is checked

On PPC the legacy passthrough is not supported and only
VFIO is supported. So, the checks at places to confirm if the
host is passthrough capable checks only legacy, fix it. This
is seen at only one place now.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
8 years agovirStorageBackendISCSIGetHostNumber: correctly use virDirOpen
Ján Tomko [Fri, 24 Jun 2016 12:51:35 +0000 (14:51 +0200)]
virStorageBackendISCSIGetHostNumber: correctly use virDirOpen

Incorrect conflict resolution in my commit e81de04c1 broke this.

8 years agoProhibit opendir in syntax-check
Ján Tomko [Tue, 21 Jun 2016 14:53:42 +0000 (16:53 +0200)]
Prohibit opendir in syntax-check

Prefer virDirOpen.

8 years agoUse virDirOpenQuiet
Ján Tomko [Tue, 21 Jun 2016 14:52:37 +0000 (16:52 +0200)]
Use virDirOpenQuiet

Remove all the remaining usage of opendir.

8 years agoIntroduce virDirOpenQuiet
Ján Tomko [Tue, 21 Jun 2016 14:52:11 +0000 (16:52 +0200)]
Introduce virDirOpenQuiet

A helper function that does not report any errors.

8 years agoUse virDirOpenIfExists
Ján Tomko [Tue, 21 Jun 2016 14:47:24 +0000 (16:47 +0200)]
Use virDirOpenIfExists

Use it instead of opendir everywhere we need to check for ENOENT.

8 years agoAdd virDirOpenIfExists
Ján Tomko [Tue, 21 Jun 2016 14:43:16 +0000 (16:43 +0200)]
Add virDirOpenIfExists

Just like virDirOpen, but it returns 0 without reporting an error
on ENOENT.

8 years agoUse virDirOpen
Ján Tomko [Tue, 21 Jun 2016 14:34:08 +0000 (16:34 +0200)]
Use virDirOpen

Switch from opendir to virDirOpen everywhere we need to report an error.

8 years agoIntroduce virDirOpen
Ján Tomko [Tue, 21 Jun 2016 14:33:36 +0000 (16:33 +0200)]
Introduce virDirOpen

A helper that calls opendir and reports an error if it fails.

8 years agostorage: Fix coverity warning
Cole Robinson [Thu, 23 Jun 2016 22:40:00 +0000 (18:40 -0400)]
storage: Fix coverity warning

After commit e808d3f227 cbdata is always available here, so the
check is pointless

8 years agoDon't allow raneming domains to empty strings
Martin Kletzander [Wed, 22 Jun 2016 15:27:46 +0000 (17:27 +0200)]
Don't allow raneming domains to empty strings

It may cause unwanted behaviour (of course, is there any wanted one for
that case?) so we should rather disable the possibility of doing so.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoopenvz: split single-line if
Ján Tomko [Fri, 24 Jun 2016 08:36:12 +0000 (10:36 +0200)]
openvz: split single-line if

Put the 'continue' statement on a separate line.

8 years agoqemu: Use stricter checks in virQEMUCapsFillDomainDeviceDiskCaps()
Andrea Bolognani [Thu, 23 Jun 2016 08:24:43 +0000 (10:24 +0200)]
qemu: Use stricter checks in virQEMUCapsFillDomainDeviceDiskCaps()

Unfortunately, we can't just call qemuDomainMachineIsPSeries()
here, because we don't have a virDomainDef instance; that said,
the open-coded check should match said function as closely as
possible.

8 years agoqemu: Introduce qemuDomainMachineIsPSeries()
Andrea Bolognani [Thu, 23 Jun 2016 08:19:05 +0000 (10:19 +0200)]
qemu: Introduce qemuDomainMachineIsPSeries()

This new function checks for both the architecture and the
machine type, so we can use it instead of writing the same
checks over and over again.

8 years agoqemu: Add architecture checks to qemuDomainMachineIsVirt()
Andrea Bolognani [Wed, 22 Jun 2016 16:55:37 +0000 (18:55 +0200)]
qemu: Add architecture checks to qemuDomainMachineIsVirt()

Remove all external architecture checks that have been
made redundant by this change.

8 years agoqemu: Remove redundant arguments to qemuBuildSerialChrDeviceStr()
Andrea Bolognani [Thu, 23 Jun 2016 08:07:44 +0000 (10:07 +0200)]
qemu: Remove redundant arguments to qemuBuildSerialChrDeviceStr()

Since we're already passing the full virDomainDef, it doesn't
make sense to also pass def->os.arch and def->os.machine as
separate arguments.

8 years agoAdd support for VirtualBox 5
Martin Pietsch [Sun, 19 Jun 2016 11:54:23 +0000 (13:54 +0200)]
Add support for VirtualBox 5

8 years agoRename virNetClient*AddrString
Ján Tomko [Thu, 23 Jun 2016 20:31:20 +0000 (22:31 +0200)]
Rename virNetClient*AddrString

Add SASL at the end to make the format obvious.

8 years agoRename virNetServerClient*AddrString
Ján Tomko [Mon, 20 Jun 2016 14:04:49 +0000 (16:04 +0200)]
Rename virNetServerClient*AddrString

Add SASL at the end to make the format obvious.

8 years agoAdd SASL to virNetSocket{Local,Remote}AddrString
Ján Tomko [Mon, 20 Jun 2016 14:01:50 +0000 (16:01 +0200)]
Add SASL to virNetSocket{Local,Remote}AddrString

Rename them to virNetSocket{Local,Remote}AddrStringSASL
to make their format more obvious.

8 years agovirNetSocket: rename AddrStr to AddrStrSASL
Ján Tomko [Mon, 20 Jun 2016 13:55:55 +0000 (15:55 +0200)]
virNetSocket: rename AddrStr to AddrStrSASL

Make it more obvious that these are in the SASL format.

8 years agovirnetsockettest: fix error messages
Ján Tomko [Mon, 20 Jun 2016 13:52:55 +0000 (15:52 +0200)]
virnetsockettest: fix error messages

8 years agoIntroduce virNetServerClientRemoteAddrStringURI
Ján Tomko [Mon, 20 Jun 2016 13:51:18 +0000 (15:51 +0200)]
Introduce virNetServerClientRemoteAddrStringURI

Use it in virNetServerClientGetInfo to switch back to using
the URI-format (separated by ':') instead of the SASL format
(separated by ';').

Also use it in the error message reported by virNetServerAddClient.

8 years agoIntroduce virNetSocketRemoteAddrStringURI
Ján Tomko [Mon, 20 Jun 2016 13:48:47 +0000 (15:48 +0200)]
Introduce virNetSocketRemoteAddrStringURI

It will return the socket address and port in a URI-like
format: [::1]:1234
Add a test case to virnetsockettest.

8 years agoRevert "virnetsocket: Provide socket address format in a more standard form"
Ján Tomko [Mon, 20 Jun 2016 13:22:44 +0000 (15:22 +0200)]
Revert "virnetsocket: Provide socket address format in a more standard form"

This partially reverts commit 9b45c9f049a7e9b6c1abfa6988b63b760714e169.

It changed the default format of socket address from the one SASL
requires, but did not adjust all the callers.

It also removed the test coverage for it.

Revert most of the changes except the virSocketAddrFormatFull support
for URI-formatted strings.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1345743 while
reverting the format used by virt-admin's client-info command from
the URI one to the SASL one.

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

8 years agoDo not skip files starting with a dot in leases directory
Ján Tomko [Tue, 21 Jun 2016 15:43:11 +0000 (17:43 +0200)]
Do not skip files starting with a dot in leases directory

'.' and '..' are skipped by virDirRead already.

8 years agoAllow configs to start with a dot
Ján Tomko [Tue, 21 Jun 2016 15:40:37 +0000 (17:40 +0200)]
Allow configs to start with a dot

This fixes the disappearance of domains and networks starting with a
dot.

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

8 years agoDo not skip hidden entries when looking for a stable path
Ján Tomko [Tue, 21 Jun 2016 15:36:33 +0000 (17:36 +0200)]
Do not skip hidden entries when looking for a stable path

The device names are unlikely to start with a dot.
'.' and '..' are already skipped by virDirRead.

8 years agoDo not ignore hidden files in /sys and /proc
Ján Tomko [Tue, 21 Jun 2016 15:29:47 +0000 (17:29 +0200)]
Do not ignore hidden files in /sys and /proc

The directories we iterate over are unlikely to contain any entries
starting with a dot, other than '.' and '..' which is already skipped
by virDirRead.

8 years agoFix comment in virStorageBackendFileSystemRefresh
Ján Tomko [Tue, 21 Jun 2016 15:27:27 +0000 (17:27 +0200)]
Fix comment in virStorageBackendFileSystemRefresh

'.' and '..' are now skipped by virDirRead, there's no need to mention
them in the comment.

8 years agoDo not check for '.' and '..' after virDirRead
Ján Tomko [Tue, 21 Jun 2016 15:25:58 +0000 (17:25 +0200)]
Do not check for '.' and '..' after virDirRead

It skips those directory entries.

8 years agoSkip '.' and '..' in virDirRead
Ján Tomko [Tue, 21 Jun 2016 15:23:41 +0000 (17:23 +0200)]
Skip '.' and '..' in virDirRead

All of the callers either skip these explicitly, skip all entries
starting with a dot or match the entry name against stricter patterns.

8 years agoIntroduce VIR_DIR_CLOSE
Ján Tomko [Tue, 21 Jun 2016 10:40:29 +0000 (12:40 +0200)]
Introduce VIR_DIR_CLOSE

Introduce a helper that only calls closedir if DIR* is non-NULL
and sets it to NULL afterwards.

8 years agoDo not check the return value of closedir
Ján Tomko [Tue, 21 Jun 2016 11:20:48 +0000 (13:20 +0200)]
Do not check the return value of closedir

The only possible error is EBADFD.
Since we only use the directory stream returned by opendir,
this should never happen.

8 years agoDo not save errno in virUSBDeviceSearch
Ján Tomko [Tue, 21 Jun 2016 11:19:19 +0000 (13:19 +0200)]
Do not save errno in virUSBDeviceSearch

The virUSBDeviceFind* callers do not check errno after calling
this function.

8 years agotests: utils: Fail XML file comparison if input file doesn't exist
Peter Krempa [Thu, 23 Jun 2016 13:22:06 +0000 (15:22 +0200)]
tests: utils: Fail XML file comparison if input file doesn't exist

In cases where we expect parse failure of the test input file the
testsuite can't differentiate if the parser failed when parsing or when
opening the file. Add a call to virFileExists and error out on missing
input files.

Missing output files are partially expected when regenerating test
output.

8 years agotests: genericxml2xml: Fix test file name
Peter Krempa [Thu, 23 Jun 2016 13:13:49 +0000 (15:13 +0200)]
tests: genericxml2xml: Fix test file name

Commit b1fc6a7b added a test file but used a different name in the
actual test.

8 years agoqemu: Add new secret info type
John Ferlan [Wed, 8 Jun 2016 16:51:20 +0000 (12:51 -0400)]
qemu: Add new secret info type

Add 'encinfo' to the extended disk structure. This will contain the
encryption secret (if present).

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Introduce virSecretLookupFormatSecret
John Ferlan [Mon, 13 Jun 2016 23:40:34 +0000 (19:40 -0400)]
util: Introduce virSecretLookupFormatSecret

Add utility to format the virSecretLookupTypeDefPtr in XML

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Move and rename virStorageAuthDefParseSecret
John Ferlan [Mon, 13 Jun 2016 20:23:42 +0000 (16:23 -0400)]
util: Move and rename virStorageAuthDefParseSecret

Move to virsecret.c and rename to virSecretLookupParseSecret. Also convert
to usage xmlNodePtr and virXMLPropString rather than virXPathString.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agosecret: Move virStorageSecretType and rename
John Ferlan [Sat, 28 May 2016 12:43:23 +0000 (08:43 -0400)]
secret: Move virStorageSecretType and rename

Move the enum into a new src/util/virsecret.h, rename it to be
virSecretLookupType. Add a src/util/virsecret.h in order to perform
a couple of simple operations on the secret XML and virSecretLookupTypeDef
for clearing and copying.

This includes quite a bit of collateral damage, but the goal is to remove
the "virStorage*" and replace with the virSecretLookupType so that it's
easier to to add new lookups that aren't necessarily storage pool related.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agostorage: Remove redundant refreshPool check
Cole Robinson [Thu, 23 Jun 2016 00:28:09 +0000 (20:28 -0400)]
storage: Remove redundant refreshPool check

Every driver provides a refreshPool impl, and many other critical
places in the code unconditionally call it without checking if
it exists, so this check is pointless

8 years agoqemu: command: Error on accel2d
Cole Robinson [Fri, 20 May 2016 00:02:08 +0000 (20:02 -0400)]
qemu: command: Error on accel2d

qemu doesn't have any accel2d support wired up. Explicitly error
if a user tries it out, or typos the accel3d option

8 years agoqemu: command: Error on accel3d with non-virtio
Cole Robinson [Thu, 19 May 2016 23:58:05 +0000 (19:58 -0400)]
qemu: command: Error on accel3d with non-virtio

We should be raising an error if accel3d is present for any
non-virtio video as well, incase someone tries it for say 'qxl'

8 years agoqemu: make monitor command API available during async jobs
Nikolay Shirokovskiy [Wed, 22 Jun 2016 13:17:50 +0000 (16:17 +0300)]
qemu: make monitor command API available during async jobs

  One can not issue monitor commands manually during async calls thru
designated API while this could be useful for testing/debugging purposes.
qemuDomainQemuMonitorCommand uses job of type QEMU_JOB_MODIFY and any async
call disable parallel execution of this type of job. The only state that is
changed is taint variable. AFAIU the only place we can mess is resetting
taint flag in qemuProcessStop routine under some async job. But this can not
happen thanx to both virDomainObjIsActive check in qemuDomainQemuMonitorCommand
and resetting active status in qemuProcessStop before taint flag.

  Change job type to QEMU_JOB_QUERY and thus make the API call available for
most of async jobs.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
8 years agoprohibit-duplicate-header: print file name and line
Ján Tomko [Wed, 22 Jun 2016 20:27:43 +0000 (22:27 +0200)]
prohibit-duplicate-header: print file name and line

This way :make syntax-check in ViM will point you at the offending line.

8 years agosyntax-check: rewrite prohibit-duplicate-header in perl
Ján Tomko [Wed, 15 Jun 2016 16:01:24 +0000 (18:01 +0200)]
syntax-check: rewrite prohibit-duplicate-header in perl

Invoke the script only once instead of once for every file.

8 years agoAllow virDomain(SG)etGuestVcpus on read-write connection only
Peter Krempa [Thu, 23 Jun 2016 07:02:29 +0000 (09:02 +0200)]
Allow virDomain(SG)etGuestVcpus on read-write connection only

Guest agent interaction is considered privileged.

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

8 years agoDo not ignore perl scripts in build-aux
Ján Tomko [Fri, 17 Jun 2016 17:31:42 +0000 (19:31 +0200)]
Do not ignore perl scripts in build-aux

Also remove the duplicate build-aux entry from .gitignore.

8 years agoAdd newDomain parameter to qemuDomainAssignAddresses
Ján Tomko [Thu, 16 Jun 2016 15:15:53 +0000 (17:15 +0200)]
Add newDomain parameter to qemuDomainAssignAddresses

Pass 'true' if we are not dealing with a migration.

8 years agoAdd a USB hub to controller order test
Ján Tomko [Fri, 17 Jun 2016 14:50:36 +0000 (16:50 +0200)]
Add a USB hub to controller order test

The test has too many USB devices.

8 years agoconf: Remove dead console compat formatting
Cole Robinson [Wed, 22 Jun 2016 18:07:03 +0000 (14:07 -0400)]
conf: Remove dead console compat formatting

This code was attempting to handle some implicit <console> XML
formatting for manually assembled DomainDef, since previously the
console<->serial compat copying was only done at XML parse time.

Nowadays it's done via virDomainDefPostParse ->
virDomainDefAddConsoleCompat, which all manual DomainDef builders
already call, so we can drop this workaround.

8 years agolibxl: use serial device for console when targetType is serial
Jim Fehlig [Wed, 22 Jun 2016 02:25:23 +0000 (20:25 -0600)]
libxl: use serial device for console when targetType is serial

When domXML contains only <console type='pty'> and no corresponding
<serial>, the console is "stolen" [1] and used as the first <serial>
device. When this "stolen" console is accessed from the libxl driver
(in libxlConsoleCallback and libxlDomainOpenConsole), check if the
targetType is VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL, and use the
"stolen" device in def->serials[0] instead. Prior to this change,
creating a domain with input XML containing only a <console> device
and subsequently attempting to access its console with
'virsh console' would fail

error: internal error: character device <null> is not using a PTY

[1] See comments associated with virDomainDefAddConsoleCompat() in
    $LIBVIRT-SRC/src/conf/domain_conf.c:

8 years agoUse for instead of code duplication when parsing USB port
Ján Tomko [Thu, 16 Jun 2016 13:23:23 +0000 (15:23 +0200)]
Use for instead of code duplication when parsing USB port

We are done if the string ends and move to another nesting
level if we find a dot.

8 years agoSplit out USB port parsing
Ján Tomko [Thu, 16 Jun 2016 13:00:27 +0000 (15:00 +0200)]
Split out USB port parsing

Make rewriting it easier.

8 years agoAdd a test for long USB port paths
Ján Tomko [Wed, 20 Apr 2016 13:03:57 +0000 (15:03 +0200)]
Add a test for long USB port paths

We support up to four levels of nested USB devices in the guest.

Add a test for a domain using all four and a negative test for a domain
using five.