Commit Graph

23428 Commits

Author SHA1 Message Date
Nikolay Shirokovskiy
91ee31d19e 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>
2016-06-25 22:56:02 +03:00
Nikolay Shirokovskiy
511f6ab5ba 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>
2016-06-25 22:56:02 +03:00
Nikolay Shirokovskiy
307eb644ed vz: add device updates
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2016-06-25 22:56:02 +03:00
Nikolay Shirokovskiy
0f38187b68 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>
2016-06-25 22:56:01 +03:00
Nikolay Shirokovskiy
f6e13453e7 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>
2016-06-25 22:56:01 +03:00
Nikolay Shirokovskiy
2e6ff2da75 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>
2016-06-25 22:56:01 +03:00
Qiaowei Ren
f294b83ee6 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>
2016-06-25 00:23:58 +02:00
Jiri Denemark
e2ddc811ab 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>
2016-06-25 00:02:30 +02:00
Roman Bogorodskiy
b5447e78b2 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.
2016-06-24 21:41:43 +03:00
John Ferlan
01f4a4a070 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>
2016-06-24 13:42:38 -04:00
Daniel P. Berrange
0330848207 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>
2016-06-24 18:26:11 +01:00
John Ferlan
318ebb36f1 util: Add 'luks' to the FileTypeInfo
Add the ability to detect a luks encrypted device.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-06-24 13:23:02 -04:00
John Ferlan
ea0ef33d05 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>
2016-06-24 13:23:02 -04:00
John Ferlan
cc1c7af2b3 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>
2016-06-24 13:23:02 -04:00
John Ferlan
8be83eef60 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>
2016-06-24 13:23:02 -04:00
John Ferlan
23c5f1b0a1 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>
2016-06-24 13:23:02 -04:00
Shivaprasad G Bhat
e6806d7938 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>
2016-06-24 19:20:14 +02:00
Shivaprasad G Bhat
8dbb347816 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>
2016-06-24 19:14:43 +02:00
John Ferlan
c6910bd4c7 qemu: Make qemuBuildSecretInfoProps global
Need to create the object for a hotplug disk
2016-06-24 13:04:38 -04:00
John Ferlan
c8c3484b46 qemu: Remove type from qemuBuildSecretInfoProps
It's just a constant "secret" string anyway
2016-06-24 13:04:38 -04:00
Shivaprasad G Bhat
b95965c4f8 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>
2016-06-24 18:52:21 +02:00
yuelongguang
969b27d84c add help document relevant to default mapping of credentials to machines
* src/util/virauthconfig.c
2016-06-24 16:36:54 +01:00
Peter Krempa
5da28cc306 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
2016-06-24 17:29:00 +02:00
Ján Tomko
b7200d7236 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.
2016-06-24 16:41:57 +02:00
Ján Tomko
9beb299554 openvz: do not open-code STRSKIP
Remove one more use of STREQLEN with strlen as its argument.
2016-06-24 16:30:55 +02:00
Ján Tomko
83066f99a9 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.
2016-06-24 16:30:55 +02:00
Ján Tomko
0f79480b9f Replace some uses STREQLEN with STRPREFIX
Do not call it with a magic constant matching the length
of the pattern.
2016-06-24 16:30:55 +02:00
John Ferlan
13c34f811d 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.
2016-06-24 10:22:59 -04:00
Shivaprasad G Bhat
99c2dfb8aa 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>
2016-06-24 14:59:04 +02:00
Ján Tomko
290f2adf46 virStorageBackendISCSIGetHostNumber: correctly use virDirOpen
Incorrect conflict resolution in my commit e81de04c1 broke this.
2016-06-24 14:51:35 +02:00
Ján Tomko
32d0a57812 Prohibit opendir in syntax-check
Prefer virDirOpen.
2016-06-24 14:20:57 +02:00
Ján Tomko
994b024624 Use virDirOpenQuiet
Remove all the remaining usage of opendir.
2016-06-24 14:20:57 +02:00
Ján Tomko
7a5df06e10 Introduce virDirOpenQuiet
A helper function that does not report any errors.
2016-06-24 14:20:57 +02:00
Ján Tomko
42b4a37d68 Use virDirOpenIfExists
Use it instead of opendir everywhere we need to check for ENOENT.
2016-06-24 14:20:57 +02:00
Ján Tomko
941ccbc174 Add virDirOpenIfExists
Just like virDirOpen, but it returns 0 without reporting an error
on ENOENT.
2016-06-24 14:20:57 +02:00
Ján Tomko
e81de04c10 Use virDirOpen
Switch from opendir to virDirOpen everywhere we need to report an error.
2016-06-24 14:20:57 +02:00
Ján Tomko
f0ced7086a Introduce virDirOpen
A helper that calls opendir and reports an error if it fails.
2016-06-24 14:20:57 +02:00
Cole Robinson
bdb868101b storage: Fix coverity warning
After commit e808d3f227 cbdata is always available here, so the
check is pointless
2016-06-24 07:31:47 -04:00
Martin Kletzander
428d2dfdb8 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>
2016-06-24 11:14:51 +02:00
Ján Tomko
16d77fc6b5 openvz: split single-line if
Put the 'continue' statement on a separate line.
2016-06-24 10:36:12 +02:00
Andrea Bolognani
3bf9d35bf6 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.
2016-06-24 10:17:59 +02:00
Andrea Bolognani
177ecaa598 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.
2016-06-24 10:17:59 +02:00
Andrea Bolognani
210acdb1a5 qemu: Add architecture checks to qemuDomainMachineIsVirt()
Remove all external architecture checks that have been
made redundant by this change.
2016-06-24 10:17:59 +02:00
Andrea Bolognani
0969b5051b 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.
2016-06-24 10:17:59 +02:00
Martin Pietsch
d0bef64334 Add support for VirtualBox 5 2016-06-24 09:26:06 +02:00
Ján Tomko
541bd183f7 Rename virNetClient*AddrString
Add SASL at the end to make the format obvious.
2016-06-23 22:31:20 +02:00
Ján Tomko
eaf7ff3873 Rename virNetServerClient*AddrString
Add SASL at the end to make the format obvious.
2016-06-23 22:23:21 +02:00
Ján Tomko
ea537e7b36 Add SASL to virNetSocket{Local,Remote}AddrString
Rename them to virNetSocket{Local,Remote}AddrStringSASL
to make their format more obvious.
2016-06-23 22:23:21 +02:00
Ján Tomko
dbce70b243 virNetSocket: rename AddrStr to AddrStrSASL
Make it more obvious that these are in the SASL format.
2016-06-23 22:23:21 +02:00
Ján Tomko
42362c9166 virnetsockettest: fix error messages 2016-06-23 22:23:21 +02:00