]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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.

8 years agoReport auto convergence throttle rate in migration stats
Jiri Denemark [Tue, 21 Jun 2016 11:40:33 +0000 (13:40 +0200)]
Report auto convergence throttle rate in migration stats

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Implement auto convergence migration parameters
Jiri Denemark [Tue, 21 Jun 2016 08:06:29 +0000 (10:06 +0200)]
qemu: Implement auto convergence migration parameters

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Add support for cpu throttling parameters
Jiri Denemark [Mon, 20 Jun 2016 15:10:32 +0000 (17:10 +0200)]
qemu: Add support for cpu throttling parameters

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Introduce qemuMigrationSetParams
Jiri Denemark [Mon, 20 Jun 2016 14:27:07 +0000 (16:27 +0200)]
qemu: Introduce qemuMigrationSetParams

Several places in the code update qemuMonitorMigrationParams structure
and qemuMigrationSetParams is then used to set them all at once.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoAdd auto convergence migration parameters
Jiri Denemark [Mon, 20 Jun 2016 13:45:59 +0000 (15:45 +0200)]
Add auto convergence migration parameters

They can be used to tune auto-convergence algorithm (which is enabled
with VIR_MIGRATE_AUTO_CONVERGE).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotest: Rework qemuMonitorJSONGetMigrationParams test
Jiri Denemark [Mon, 20 Jun 2016 15:07:55 +0000 (17:07 +0200)]
test: Rework qemuMonitorJSONGetMigrationParams test

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Rework qemuMonitorJSONSetMigrationParams
Jiri Denemark [Mon, 20 Jun 2016 14:55:07 +0000 (16:55 +0200)]
qemu: Rework qemuMonitorJSONSetMigrationParams

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Rework qemuMonitorJSONGetMigrationParams
Jiri Denemark [Mon, 20 Jun 2016 14:54:24 +0000 (16:54 +0200)]
qemu: Rework qemuMonitorJSONGetMigrationParams

We should not require any parameters to be present. After all we have
the *_set bools to express that some parameters were not set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Rename qemuMonitorMigrationCompression
Jiri Denemark [Mon, 20 Jun 2016 13:47:46 +0000 (15:47 +0200)]
qemu: Rename qemuMonitorMigrationCompression

qemuMonitorMigrationParams is a better name for a structure which
contains various migration parameters. While doing that, we should use
full names for individual parameters.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Decouple migration parameters from compression settings
Jiri Denemark [Mon, 20 Jun 2016 13:47:28 +0000 (15:47 +0200)]
qemu: Decouple migration parameters from compression settings

Compression parameters are not the only migration parameters.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Make qemuMonitorSetMigrationCompression saner
Jiri Denemark [Mon, 20 Jun 2016 13:51:13 +0000 (15:51 +0200)]
qemu: Make qemuMonitorSetMigrationCompression saner

Checking whether the function has anything to do is better done in the
function rather then requiring callers to do that.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoconf: Simplify conditions in CPU parser/formatter
Jiri Denemark [Mon, 22 Jun 2015 08:27:05 +0000 (10:27 +0200)]
conf: Simplify conditions in CPU parser/formatter

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemucapsprobe: Don't put empty line at EOF
Jiri Denemark [Fri, 10 Jun 2016 15:15:25 +0000 (17:15 +0200)]
qemucapsprobe: Don't put empty line at EOF

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoconf: Remove redundant free in virCPUDefFree
Jiri Denemark [Fri, 17 Jun 2016 07:40:32 +0000 (09:40 +0200)]
conf: Remove redundant free in virCPUDefFree

vendor_id is (and always was) already freed in virCPUDefFreeModel.

This effectively reverts commit fb49ffc3.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Fix reference leak in qemuDomainDefPostParse
Jiri Denemark [Wed, 15 Jun 2016 10:47:07 +0000 (12:47 +0200)]
qemu: Fix reference leak in qemuDomainDefPostParse

The function gets a reference on virQEMUDriverConfig which needs to be
released before returning.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Hide virQEMUCapsNewForBinary
Jiri Denemark [Wed, 15 Jun 2016 07:23:27 +0000 (09:23 +0200)]
qemu: Hide virQEMUCapsNewForBinary

Since virQEMUCapsNewForBinaryInternal was introduced,
virQEMUCapsNewForBinary is no longer used outside qemu_capabilities.c.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Implement virDomainSetGuestVcpus
Peter Krempa [Mon, 20 Jun 2016 10:26:26 +0000 (12:26 +0200)]
qemu: Implement virDomainSetGuestVcpus

Allow modification of specific vCPU states via the guest agent.

8 years agoqemu: Implement virDomainGetGuestVcpus
Peter Krempa [Mon, 20 Jun 2016 08:56:36 +0000 (10:56 +0200)]
qemu: Implement virDomainGetGuestVcpus

Allow gathering available vcpu ids, their state and offlinability via
the qemu guest agent. The maximum id was chosen arbitrarily and ought
to be enough for everybody.

8 years agoqemu: agent: Make setting of vcpus more robust
Peter Krempa [Mon, 20 Jun 2016 12:15:50 +0000 (14:15 +0200)]
qemu: agent: Make setting of vcpus more robust

Documentation for the "guest-set-vcpus" command describes a proper
algorithm how to set vcpus. This patch makes the following changes:

- state of cpus that has not changed is not updated
- if the command was partially successful the command is re-tried with
  the rest of the arguments to get a proper error message
- code is more robust against malicious guest agent
- fix testsuite to the new semantics

8 years agovirsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus
Peter Krempa [Mon, 20 Jun 2016 07:57:53 +0000 (09:57 +0200)]
virsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus

Add a straightforward implementation for using the new APIs.

8 years agolib: Add API to set individual vcpu usage in the guest via guest agent
Peter Krempa [Mon, 20 Jun 2016 07:16:47 +0000 (09:16 +0200)]
lib: Add API to set individual vcpu usage in the guest via guest agent

To allow finer-grained control of vcpu state using guest agent this API
can be used to individually set the state of the vCPU.

This will allow to better control NUMA enabled guests and/or test
various vCPU configurations.

8 years agolib: Add API to query guest vcpu info using guest agent
Peter Krempa [Thu, 16 Jun 2016 17:15:45 +0000 (19:15 +0200)]
lib: Add API to query guest vcpu info using guest agent

Add a rather universal API implemented via typed params that will allow
to query the guest agent for the state and possibly other aspects of
guest vcpus.