]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
9 years agolibxl: implement virDomainGetCPUStats
Joao Martins [Fri, 13 Nov 2015 13:14:41 +0000 (13:14 +0000)]
libxl: implement virDomainGetCPUStats

Introduce support for domainGetCPUStats API call and consequently
allow us to use `virsh cpu-stats`. The latter returns a more brief
output than the one provided by`virsh vcpuinfo`.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agobhyve: monitor: do not override domain's privateData
Roman Bogorodskiy [Wed, 4 Nov 2015 15:08:00 +0000 (18:08 +0300)]
bhyve: monitor: do not override domain's privateData

Current monitor code overrides domain object's privateData, e.g.
in virBhyveProcessStart():

  vm->privateData = bhyveMonitorOpen(vm, driver);

where bhyveMonitorPtr() returns bhyveMonitorPtr.

This is not right thing to do, so make bhyveMonitorPtr
a part of the bhyveDomainObjPrivate struct and change related code
accordingly.

9 years agosyntax-check: Add prohibit_space_in_label rule
Andrea Bolognani [Mon, 2 Nov 2015 11:12:22 +0000 (12:12 +0100)]
syntax-check: Add prohibit_space_in_label rule

This guards against code such as

 cleanup :

which is happily accepted by the compiler but does not conform
to our style guidelines.

9 years agoutil: remove unnecessary needSize
Chen Hanxiao [Sat, 14 Nov 2015 06:56:06 +0000 (14:56 +0800)]
util: remove unnecessary needSize

Use toadd->use directly.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
9 years agostorage: Don't assume storage pool exists for FC/SCSI refresh thread
John Ferlan [Mon, 2 Nov 2015 22:21:11 +0000 (17:21 -0500)]
storage: Don't assume storage pool exists for FC/SCSI refresh thread

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

The virStoragePoolFCRefreshThread had passed a pointer to the pool obj
in the virStoragePoolFCRefreshInfoPtr; however, we cannot assume that
the pool exists still since we don't keep the pool lock throughout
the duration of the thread.

Therefore, instead of passing the pool obj pointer, pass the UUID of
the pool and perform a lookup.  If found, then we can perform the
refresh using the locked pool obj pointer; otherwise, we just exit
the thread since the pool is now gone.

9 years agostorage: Introduce virStoragePoolObjFindPoolByUUID
John Ferlan [Mon, 2 Nov 2015 22:15:41 +0000 (17:15 -0500)]
storage: Introduce virStoragePoolObjFindPoolByUUID

Add a new API to search the currently defined pool list for a pool with
a matching UUID and return the locked pool object pointer.

9 years agostorage: Change cbdata scsi refresh thread field name
John Ferlan [Mon, 2 Nov 2015 19:46:32 +0000 (14:46 -0500)]
storage: Change cbdata scsi refresh thread field name

Change the field name from 'name' to 'fchost_name' to better id it.

9 years agostorage: Make active boolean
John Ferlan [Mon, 2 Nov 2015 21:07:34 +0000 (16:07 -0500)]
storage: Make active boolean

Since we treat it like a boolean, let's store it that way. At least one
path had already treated as true/false anyway.

9 years agoqemu: Explain mlock limit size more in detail
Peter Krempa [Wed, 11 Nov 2015 05:44:56 +0000 (06:44 +0100)]
qemu: Explain mlock limit size more in detail

Based on Alex's explanation [1] in the recent discussion let's update
the comment explaining the memory lock limit calculation.

[1]
http://www.redhat.com/archives/libvir-list/2015-November/msg00329.html

9 years agoqemu: domain: Restructurate control flow in qemuDomainGetMlockLimitBytes
Peter Krempa [Wed, 11 Nov 2015 05:49:06 +0000 (06:49 +0100)]
qemu: domain: Restructurate control flow in qemuDomainGetMlockLimitBytes

Break early when hard limit is set so that it's not intermixed by other
logic for determining the limit.

9 years agoqemu: Fix job entry debug message
Jiri Denemark [Fri, 30 Oct 2015 08:37:14 +0000 (09:37 +0100)]
qemu: Fix job entry debug message

Logging current async job while in BeginJob is useful, but the async job
we want to start is even more interesting.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agotests: Add QEMU 2.4.0 capabilities
Jiri Denemark [Thu, 15 Oct 2015 19:56:22 +0000 (21:56 +0200)]
tests: Add QEMU 2.4.0 capabilities

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agotests: Remove qemuxmlnstest
Jiri Denemark [Tue, 20 Oct 2015 14:01:01 +0000 (16:01 +0200)]
tests: Remove qemuxmlnstest

It's just a copy&paste of qemuxml2argv test anyway. We can test most of
them (except for qemuxmlns-qemu-ns-domain.xml which fails to validate
against our schema) by qemuxml2argv test.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Fix style in qemuProcessStart
Jiri Denemark [Fri, 30 Oct 2015 17:18:10 +0000 (18:18 +0100)]
qemu: Fix style in qemuProcessStart

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agosecurity: Cleanup DAC driver
Jiri Denemark [Fri, 30 Oct 2015 09:20:37 +0000 (10:20 +0100)]
security: Cleanup DAC driver

Fixes several style issues and removes "DEF" (what is it supposed to
mean anyway?) from debug messages.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agodomain-conf: reorder usb controllers so the master is first
Pavel Hrdina [Wed, 11 Nov 2015 14:20:15 +0000 (15:20 +0100)]
domain-conf: reorder usb controllers so the master is first

USB controllers can share the same 'index' which indicates, that there
is some sort of master-companion relationship.  Reorder the controllers
in XML in to place the master controller before its companions.  This is
required by QEMU to not fail with error message:

error: internal error: process exited while connecting to monitor:
2015-10-26T16:25:17.630265Z qemu-system-x86_64:
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6:
USB bus 'usb.0' not found

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agodomain-conf: cleanup controller insert function
Pavel Hrdina [Wed, 11 Nov 2015 14:18:07 +0000 (15:18 +0100)]
domain-conf: cleanup controller insert function

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agovirsh-domain: update attach-interface to support type=hostdev
Pavel Hrdina [Wed, 21 Oct 2015 10:59:41 +0000 (12:59 +0200)]
virsh-domain: update attach-interface to support type=hostdev

Adding this feature will allow users to easily attach a hostdev network
interface using PCI passthrough.

The interface can be attached using --type=hostdev and PCI address or
as --source.  This command also allows you to tell, whether the interface
should be managed.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agovirsh.pod: improve attach-interface section
Pavel Hrdina [Wed, 11 Nov 2015 14:01:37 +0000 (15:01 +0100)]
virsh.pod: improve attach-interface section

Rewrite the attach-interface section in man page to be more readable and
extendable.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agovz: support cpu time in driver's domainGetInfo
Nikolay Shirokovskiy [Wed, 28 Oct 2015 14:29:00 +0000 (17:29 +0300)]
vz: support cpu time in driver's domainGetInfo

Just straight-forward patch.
Use reference counting for privdom as stats internally could drop domain lock.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agoqemu: fix parsing of -sdl arg
Daniel P. Berrange [Tue, 10 Nov 2015 12:18:47 +0000 (12:18 +0000)]
qemu: fix parsing of -sdl arg

The previous commit

  commit 4e8993a25006bc5d7c95311d430cc01d8de63564
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Mon Nov 9 16:20:08 2015 +0000

    qemu: assume various QEMU 0.10 features are always available

Added broken handling of -sdl. Instead of duplicating existing
SDL handling code, just ensure it is invoked in the right
scenarios.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume various QEMU 0.10 features are always available
Daniel P. Berrange [Mon, 9 Nov 2015 16:20:08 +0000 (16:20 +0000)]
qemu: assume various QEMU 0.10 features are always available

The -sdl and -net ...name=XXX arguments were both introduced
in QEMU 0.10, so the QEMU driver can assume they are always
available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -vga is always available
Daniel P. Berrange [Mon, 9 Nov 2015 15:39:54 +0000 (15:39 +0000)]
qemu: assume -vga is always available

As of QEMU 0.10.0 the -vga argument was introduced, so the
QEMU driver can assume it is always available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -drive format is always available
Daniel P. Berrange [Fri, 6 Nov 2015 18:20:20 +0000 (18:20 +0000)]
qemu: assume -drive format is always available

As of QEMU 0.10.0 the -drive format= parameter was added,
so the QEMU driver can assume it is always available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -drive cache always uses v2 option names
Daniel P. Berrange [Fri, 6 Nov 2015 17:26:08 +0000 (17:26 +0000)]
qemu: assume -drive cache always uses v2 option names

As of QEMU 0.10.0, the -drive cache option stopped using
the on/off value names, so the QEMU driver can assume
use of the new value names.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume support for all migration protocols except rdma
Daniel P. Berrange [Fri, 6 Nov 2015 16:50:26 +0000 (16:50 +0000)]
qemu: assume support for all migration protocols except rdma

Since we require QEMU 0.12.0, we can assume that QEMU supports
all of the fd, tcp, unix and exec migration protocols.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume vnet-hdr feature is always available
Daniel P. Berrange [Fri, 6 Nov 2015 15:48:44 +0000 (15:48 +0000)]
qemu: assume vnet-hdr feature is always available

9 years agoqemu: really remove last traces of Xenner support
Daniel P. Berrange [Fri, 6 Nov 2015 14:44:35 +0000 (14:44 +0000)]
qemu: really remove last traces of Xenner support

We have twice previously attempted to remove Xenner
support

  commit de9be0ab4d7abe4c3ae5beaaff7ddb208921f1f1
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed Aug 22 17:29:01 2012 +0100

    Remove xenner support

  commit 92572c3d71bd08e6dd1897c7b14be9d27df608e9
  Author: Ján Tomko <jtomko@redhat.com>
  Date:   Wed Feb 18 16:33:50 2015 +0100

    Remove code handling the QEMU_CAPS_DOMID capability

This change really does remove the last traces of it
in the capabilities handling code

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -uuid is always available
Daniel P. Berrange [Fri, 6 Nov 2015 14:29:52 +0000 (14:29 +0000)]
qemu: assume -uuid is always available

The -uuid arg was added in QEMU 0.10.0, so the QEMU driver can
assume it is always available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -name is always available
Daniel P. Berrange [Fri, 6 Nov 2015 14:29:41 +0000 (14:29 +0000)]
qemu: assume -name is always available

The -name arg was added in QEMU 0.9.1, so the QEMU driver can
assume it is always available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -drive argument is always available
Daniel P. Berrange [Fri, 6 Nov 2015 14:28:57 +0000 (14:28 +0000)]
qemu: assume -drive argument is always available

As of QEMU 0.9.1 the -drive argument can be used to configure
all disks, so the QEMU driver can assume it is always available
and drop support for -hda/-cdrom/etc.

Many of the tests need updating because a great many were
running without CAPS_DRIVE set, so using the -hda legacy
syntax.

Fixing the tests uncovered a bug in the argv -> xml
convertor which failed to handle disk with if=floppy.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: handle floppy disk bus when parsing command line argv
Daniel P. Berrange [Mon, 9 Nov 2015 13:26:09 +0000 (13:26 +0000)]
qemu: handle floppy disk bus when parsing command line argv

The QEMU argv -> virDomainDef conversion code was not handling
-drive arguments using the floppy bus. This caused them to be
added as hard disks instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: handle USB bus in qemuAssignDeviceDiskAliasFixed()
Daniel P. Berrange [Mon, 9 Nov 2015 13:25:21 +0000 (13:25 +0000)]
qemu: handle USB bus in qemuAssignDeviceDiskAliasFixed()

The qemuAssignDeviceDiskAliasFixed() method was missing handling
for the USB disk bus type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -no-reboot is always available
Daniel P. Berrange [Thu, 5 Nov 2015 12:17:50 +0000 (12:17 +0000)]
qemu: assume -no-reboot is always available

The -no-reboot arg was added in QEMU 0.9.0, so the QEMU driver
can now assume it is always present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume 'info chardev' is always available
Daniel P. Berrange [Thu, 5 Nov 2015 11:00:17 +0000 (11:00 +0000)]
qemu: assume 'info chardev' is always available

As of QEMU 0.11.0 the 'info chardev' monitor command can be
used to report on allocated chardev paths, so we can drop
support for parsing QEMU stderr to locate the PTY paths.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: assume -vnc arg always takes a ':'
Daniel P. Berrange [Thu, 5 Nov 2015 11:56:47 +0000 (11:56 +0000)]
qemu: assume -vnc arg always takes a ':'

As of QEMU 0.9.0 the -vnc option accepts a ':' to separate port
from listen address, so the QEMU driver can assume that support
for listen addresses is always available.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: remove all support for kQEMU
Daniel P. Berrange [Thu, 5 Nov 2015 11:49:40 +0000 (11:49 +0000)]
qemu: remove all support for kQEMU

The kQEMU accelerator was deleted in QEMU 0.12, so we no
longer need to support it in the QEMU driver.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: mandate QEMU version 0.12.0 or newer
Daniel P. Berrange [Thu, 5 Nov 2015 10:51:48 +0000 (10:51 +0000)]
qemu: mandate QEMU version 0.12.0 or newer

Check the QEMU version and refuse to work with QEMU versions
older than 0.12.0. This is approximately the vintage of QEMU
that is available in RHEL-6 era distros.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails
Peter Krempa [Mon, 9 Nov 2015 12:44:29 +0000 (13:44 +0100)]
qemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails

Check the return value of virCommandSetMaxMemLock when hotplugging VFIO
PCI hostdevs and reject the hotplug if the memory limit can't be set.

9 years agoqemu: hotplug: Fix mlock limit handling on memory hotplug
Peter Krempa [Fri, 6 Nov 2015 15:39:31 +0000 (16:39 +0100)]
qemu: hotplug: Fix mlock limit handling on memory hotplug

If mlock is required either due to use of VFIO hostdevs or due to the
fact that it's enabled it needs to be tweaked prior to adding new memory
or after removing a module. Add a helper to determine when it's
necessary and reuse it both on hotplug and hotunplug.

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

9 years agoqemu: Extract logic to determine the mlock limit size for VFIO
Peter Krempa [Fri, 6 Nov 2015 14:51:33 +0000 (15:51 +0100)]
qemu: Extract logic to determine the mlock limit size for VFIO

New function qemuDomainGetMlockLimitBytes will now handle the
calculation so that it unifies the logic to one place and allows later
reuse.

9 years agoconf: Make @def const in virDomainDefGetMemoryInitial
Peter Krempa [Thu, 8 Oct 2015 04:44:30 +0000 (06:44 +0200)]
conf: Make @def const in virDomainDefGetMemoryInitial

Keep const correctness and allow to use this function in cases where
@def is const in the caller.

9 years agotests: redo test argv file line wrapping
Daniel P. Berrange [Fri, 6 Nov 2015 13:20:06 +0000 (13:20 +0000)]
tests: redo test argv file line wrapping

Back in

  commit bd6c46fa0cfe275c24debc1152cfc5206c04b59b
  Author: Juerg Haefliger <juerg.haefliger@hp.com>
  Date:   Mon Jan 31 06:42:57 2011 -0500

    tests: handle backspace-newline pairs in test input files

all the test argv files were line wrapped so that the args
were less than 80 characters.

The way the line wrapping was done turns out to be quite
undesirable, because it often leaves multiple parameters
on the same line. If we later need to add or remove
individual parameters, then it leaves us having to redo
line wrapping.

This commit changes the line wrapping so that every
single "-param value" is one its own new line. If the
"value" is still too long, then we break on ',' or ':'
or ' ' as needed.

This means that when we come to add / remove parameters
from the test files line, the patch diffs will only
ever show a single line added/removed which will greatly
simplify review work.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agovirnetdev: Use virNetDevSetupControl in virNetDevSendEthtoolIoctl
John Ferlan [Wed, 4 Nov 2015 15:48:24 +0000 (10:48 -0500)]
virnetdev: Use virNetDevSetupControl in virNetDevSendEthtoolIoctl

Use virNetDevSetupControl instead of open coding using socket(AF_LOCAL...)
and clearing virIfreq.

By using virNetDevSetupControl, the socket is then opened using
AF_PACKET which requires being privileged (effectively root) in
order to complete successfully.  Since that's now a requirement,
then the ioctl(SIOCETHTOOL) should not fail with EPERM, thus it
is removed from the filtered listed of failure codes.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirnetdev: Check for root in virNetDevGetFeatures
John Ferlan [Wed, 4 Nov 2015 15:26:16 +0000 (10:26 -0500)]
virnetdev: Check for root in virNetDevGetFeatures

Since the SIOCETHTOOL ioctl only works for privileged daemons, if called
when not root, then virNetDevGetFeatures will VIR_DEBUG a message and
return 0 as if the functions were not available for the architecture.
This effectively returns an empty bitmap indicating no features available.

Introduced by commit id 'c9027d8f4'

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirnetdev: Fix function comments for virNetDevGetFeatures
John Ferlan [Fri, 6 Nov 2015 14:44:37 +0000 (09:44 -0500)]
virnetdev: Fix function comments for virNetDevGetFeatures

In commit id 'c9027d8f4' when updating the posted patch to generate
a bitmap instead of an array of named feature bits, adjustment of
the args was missed

9 years agovirnetdev: Document reasons for ignoring some SIOCETHTOOL errno values
John Ferlan [Fri, 6 Nov 2015 15:06:11 +0000 (10:06 -0500)]
virnetdev: Document reasons for ignoring some SIOCETHTOOL errno values

Recently reverted commit id '6f2a0198' showed a need to add extra
comments when dealing with filtering of potential "non-issues".

Scanning through upstream patch postings indicates early on the
reasons for the filtering of specific ioctl failures were provided;
however, when converted from causing an error to VIR_DEBUG's the
reasons were missing. A future read/change of the code incorrectly
assumed they could or should be removed.

9 years agoRevert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl"
Daniel P. Berrange [Tue, 3 Nov 2015 14:17:42 +0000 (14:17 +0000)]
Revert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl"

This reverts commit 6f2a0198e913c91a2ef8b99db79b7d3cc5396957.

This commit removed error reporting from virNetDevSendEthtoolIoctl
pushing responsibility onto the callers. This is wrong, however,
since virNetDevSendEthtoolIoctl calls virNetDevSetupControl
which can still report errors. So as a result virNetDevSendEthtoolIoctl
may or may not report errors depending on which bit of it fails, and as
a result callers now overwrite some errors.

It also introduced a regression causing unprivileged libvirtd to
spew error messages to the console due to inability to query the
NIC features, an error which was previously ignored.

virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted

Looking back at the original posting I see no explanation of why
thsi refactoring was needed, so reverting the clearly broken
error reporting logic looks like the best option.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: migration: Actually error out on unsupported migration flag
Peter Krempa [Thu, 5 Nov 2015 14:23:37 +0000 (15:23 +0100)]
qemu: migration: Actually error out on unsupported migration flag

The code reported that a migration flag is unsupported but didn't jump
to the error label. Probably an oversight in commit f88af9dc that
introduced the flag checking.

9 years agoqemu: migration: Properly parse memory hotplug migration flag
Peter Krempa [Thu, 5 Nov 2015 14:20:21 +0000 (15:20 +0100)]
qemu: migration: Properly parse memory hotplug migration flag

Since the flag was not enabled when 'eating' the migration cookie,
libvirt reported a bogus error when memory hotplug was enabled:

 unsupported migration cookie feature memory-hotplug

The error was ignored though due to a bug in the code so it slipped
through testing.

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

9 years agonetwork: Remove extraneous ATTRIBUTE_NONNULL for virNetDevWaitDadFinish
John Ferlan [Wed, 4 Nov 2015 22:47:42 +0000 (17:47 -0500)]
network: Remove extraneous ATTRIBUTE_NONNULL for virNetDevWaitDadFinish

Commit id '0f7436ca' added virNetDevWaitDadFinish using ATTRIBUTE_NONNULL
for both arguments, although one is a non-null argument. A Coverity build
balks at that.

9 years agovirnetdev: Check correct return value for virNetDevFeatureAvailable
John Ferlan [Tue, 3 Nov 2015 22:01:25 +0000 (17:01 -0500)]
virnetdev: Check correct return value for virNetDevFeatureAvailable

Rather than "if (virNetDevFeatureAvailable(ifname, &cmd))" change the
success criteria to "if (virNetDevFeatureAvailable(ifname, &cmd) == 1)".

The called helper returns -1 on failure, 0 on not found, and 1 on found.
Thus a failure was setting bits.

Introduced by commit ac3ed20 which changed the helper's return
values without adjusting its callers

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: add /usr/lib to AC_PATH_PROG for qemu-bridge-helper
Michel Normand [Wed, 4 Nov 2015 09:01:24 +0000 (10:01 +0100)]
qemu: add /usr/lib to AC_PATH_PROG for qemu-bridge-helper

For openSUSE the qemu-bridge-helper is installed in /usr/lib
So libvirt has to search it in this directory.

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
9 years agostorage: On 'buildVol' failure don't delete the volume
John Ferlan [Thu, 8 Oct 2015 20:44:02 +0000 (16:44 -0400)]
storage: On 'buildVol' failure don't delete the volume

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

Commit id 'fdda3760' only managed a symptom where it was possible to
create a file in a pool without libvirt's knowledge, so it was reverted.

The real fix is to have all the createVol API's which actually create
a volume (disk, logical, zfs) and the buildVol API's which handle the
real creation of some volume file (fs, rbd, sheepdog) manage deleting
any volume which they create when there is some sort of error in
processing the volume.

This way the onus isn't left up to the storage_driver to determine whether
the buildVol failure was due to some failure as a result of adjustments
made to the volume after creation such as getting sizes, changing ownership,
changing volume protections, etc. or simple a failure in creation.

Without needing to consider that the volume has to be removed, the
buildVol failure path only needs to remove the volume from the pool.
This way if a creation failed due to duplicate name, libvirt wouldn't
remove a volume that it didn't create in the pool target.

9 years agoRevert "storage: Prior to creating a volume, refresh the pool"
John Ferlan [Thu, 8 Oct 2015 20:47:30 +0000 (16:47 -0400)]
Revert "storage: Prior to creating a volume, refresh the pool"

This reverts commit fdda37608a6e22406fbdfe4ac0c573a96a8d0417.

This commit only manages a symptom of finding a buildRet failure
where a volume was not listed in the pool, but someone created the
volume outside of libvirt in the pool being managed by libvirt.

9 years agostorage: Pull volume removal from pool in storageVolDeleteInternal
John Ferlan [Thu, 8 Oct 2015 20:33:16 +0000 (16:33 -0400)]
storage: Pull volume removal from pool in storageVolDeleteInternal

Create a helper function to remove volume from the pool.

9 years agostorage: Cleanup failures in virStorageBackendCreateRaw
John Ferlan [Thu, 8 Oct 2015 20:00:41 +0000 (16:00 -0400)]
storage: Cleanup failures in virStorageBackendCreateRaw

After successfully returning from virFileOpenAs, if subsequent calls fail,
then we need to remove the file since our caller expects that failures after
creation will remove the created file.

9 years agostorage: Cleanup failures virStorageBackendCreateExecCommand
John Ferlan [Tue, 3 Nov 2015 16:30:23 +0000 (11:30 -0500)]
storage: Cleanup failures virStorageBackendCreateExecCommand

After a successful qemu-img/qcow-create of the backing file, if we
fail to stat the file, change it owner/group, or mode, then the
cleanup path should remove the file.

9 years agostorage: Fix setting mode in virStorageBackendCreateExecCommand
John Ferlan [Wed, 14 Oct 2015 13:56:14 +0000 (09:56 -0400)]
storage: Fix setting mode in virStorageBackendCreateExecCommand

Currently the code does not handle the NFS root squash environment
properly since if the file gets created, then the subsequent chmod
will fail in a root squash environment where we're creating a file
in the pool with qemu tools, such as seen via:

   $ virsh vol-create-from $pool $file.xml file.img --inputpool $pool

assuming $file.xml is creating a file of "<format type='qcow2'"> from
an existing file.img in the pool of "<format type='raw'>".

This patch will utilize the virCommandSetUmask when creating the file
in the NETFS pool. The virCommandSetUmask API was added in commit id
'0e1a1a8c4', which was after the original code was developed in commit
id 'e1f27784' to attempt to handle the root squash environment.

Also, rather than blindly attempting to chmod, check to see if the
st_mode bits from the stat match what we're trying to set and only
make the chmod if they don't.

Also, a slight adjustment to the fallback algorithm to move the
virCommandSetUID/virCommandSetGID inside the if (!filecreated) since
they're only useful if we need to attempt to create the file again.

9 years agoRemove new lines from log messages
Jiri Denemark [Tue, 27 Oct 2015 18:14:01 +0000 (19:14 +0100)]
Remove new lines from log messages

VIR_DEBUG and VIR_WARN will automatically add a new line to the message,
having "\n" at the end or at the beginning of the message results in
empty lines.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Fix memory leak in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:40:42 +0000 (14:40 +0200)]
qemu: Fix memory leak in qemuProcessStart

nodeset should be freed in both success and failure paths.

While tmppath is freed immediately after it's consumed, moving it from
error to cleanup label is a bit more consistent and robust.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Introduce cleanup label in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:30:52 +0000 (14:30 +0200)]
qemu: Introduce cleanup label in qemuProcessStart

Remove code duplication by moving common cleanup code in a dedicated
label.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Rename ret variable in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:26:46 +0000 (14:26 +0200)]
qemu: Rename ret variable in qemuProcessStart

Generally, we use "ret" variable for storing the value we are going to
return at the and of a function, but this is not the case in
qemuProcessStart. Let's rename "ret" as "rv".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Rename cleanup label in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:24:51 +0000 (14:24 +0200)]
qemu: Rename cleanup label in qemuProcessStart

Current "cleanup" label is only used in error path, thus it should
rather be called "error".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Use correct type when calling qemuPrepareNVRAM
Jiri Denemark [Tue, 20 Oct 2015 08:11:26 +0000 (10:11 +0200)]
qemu: Use correct type when calling qemuPrepareNVRAM

qemuProcessStart was passing char * migrateFrom as the third argument to
qemuPrepareNVRAM. We should explicitly convert the pointer to bool which
is what the function expects.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoPost-release version bump to 1.2.22
Jiri Denemark [Wed, 4 Nov 2015 12:09:03 +0000 (13:09 +0100)]
Post-release version bump to 1.2.22

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoRelease of libvirt-1.2.21
Daniel Veillard [Wed, 4 Nov 2015 02:59:12 +0000 (10:59 +0800)]
Release of libvirt-1.2.21

* docs/news.html.in libvirt.spec.in: Updated for the release
* po/*.po*: regenerated

9 years agoutil: set max wait for IPv6 DAD to 20 seconds
Laine Stump [Thu, 29 Oct 2015 18:09:59 +0000 (14:09 -0400)]
util: set max wait for IPv6 DAD to 20 seconds

This was originally set to 5 seconds, but times of 5.5 to 7 seconds
were experienced. Since it's an arbitrary number intended to prevent
an infinite hang, having it a bit too high won't hurt anything, and 20
seconds looks to be adequate (i.e. I think/hope we don't need to make
it tunable in libvirtd.conf)

9 years agoutil: set error if DAD is not finished
Luyao Huang [Thu, 29 Oct 2015 09:47:33 +0000 (17:47 +0800)]
util: set error if DAD is not finished

If DAD not finished in 5 seconds, user will get an
unknown error like this:

 # virsh net-start ipv6
 error: Failed to start network ipv6
 error: An error occurred, but the cause is unknown

Call virReportError to set an error.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agowireshark: Install to generic plugin directory
Michal Privoznik [Tue, 27 Oct 2015 13:02:19 +0000 (14:02 +0100)]
wireshark: Install to generic plugin directory

There has been a report on the list [1] that we are not
installing the wireshark dissector into the correct plugin
directory. And in fact we are not. The problem is, the plugin
directory path is constructed at compile time. However, it's
dependent on the wireshark version, e.g.

  /usr/lib/wireshark/plugins/1.12.6

This is rather unfortunate, because if libvirt RPMs were built
with one version, but installed on a system with newer one, the
plugins are not really loaded. This problem lead fedora packagers
to unify plugin path to:

  /usr/lib/wireshark/plugins/

Cool! But this was enabled just in wireshark-1.12.6-4. Therefore,
we must require at least that version.

And while at it, on some distributions, the wireshark.pc file
already has a variable that defines where plugin dir is. Use that
if possible.

1: https://www.redhat.com/archives/libvirt-users/2015-October/msg00063.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoFix virNetDevWaitDadFinish stub
Roman Bogorodskiy [Thu, 29 Oct 2015 04:20:16 +0000 (07:20 +0300)]
Fix virNetDevWaitDadFinish stub

Build on non-Linux fails because the virNetDevWaitDadFinish() stub
has unused parameters. Fix by adding appropriate ATTRIBUTE_UNUSED
for these parameters.

Pushing under build-breaker rule.

9 years agonetwork: wait for DAD to finish for bridge IPv6 addresses
Maxim Perevedentsev [Tue, 20 Oct 2015 15:44:18 +0000 (18:44 +0300)]
network: wait for DAD to finish for bridge IPv6 addresses

commit db488c79 assumed that dnsmasq would complete IPv6 DAD before
daemonizing, but in reality it doesn't wait, which creates problems
when libvirt's bridge driver sets the matching "dummy tap device" to
IFF_DOWN prior to DAD completing.

This patch waits for DAD completion by periodically polling the kernel
using netlink to check whether there are any IPv6 addresses assigned
to bridge which have a 'tentative' state (if there are any in this
state, then DAD hasn't yet finished). After DAD is finished, execution
continues. To avoid an endless hang in case something was wrong with
the kernel's DAD, we wait a maximum of 5 seconds.

9 years agonetlink: add support for multi-part netlink messages.
Maxim Perevedentsev [Tue, 20 Oct 2015 15:44:19 +0000 (18:44 +0300)]
netlink: add support for multi-part netlink messages.

Such messages do not have NLMSG_ERROR or NLMSG_DONE type
but they are valid responses. We test 'multi-partness'
by looking for NLM_F_MULTI flag.

9 years agoqemu: Use live autoNodeset when numatune placement is auto
Luyao Huang [Mon, 12 Oct 2015 09:28:15 +0000 (17:28 +0800)]
qemu: Use live autoNodeset when numatune placement is auto

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

Commit id '9deb96f' removed the code to fetch the nodeset from the
CpusetMems cgroup for a running vm in favor of using the return from
virDomainNumatuneFormatNodeset introduced by commit id '43b67f2e7'.
However, that API will return the value of the passed 'auto_nodeset'
when placement is VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO, which happens
to be NULL.

Since commit id 'c74d58ad' started using priv->autoNodeset in order
to manage the auto placement value during qemuProcessStart, it should
be passed along in order to return the correct value if the domain
requests the auto placement.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agorbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided
Wido den Hollander [Tue, 27 Oct 2015 14:16:34 +0000 (15:16 +0100)]
rbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided

When a RBD volume has snapshots it can not be removed.

This patch introduces a new flag to force volume removal,
VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS.

With this flag any existing snapshots will be removed prior to
removing the volume.

No existing mechanism in libvirt allowed us to pass such information,
so that's why a new flag was introduced.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
9 years agoutil: implement virProcessGetStartTime on GNU/kFreeBSD
Pino Toscano [Thu, 15 Oct 2015 11:50:42 +0000 (13:50 +0200)]
util: implement virProcessGetStartTime on GNU/kFreeBSD

Use the virProcessGetStartTime implementation also when only the kernel
is FreeBSD, such as on GNU/kFreeBSD.

9 years agobhyve: implement domainGetOSType
Roman Bogorodskiy [Tue, 20 Oct 2015 17:32:42 +0000 (20:32 +0300)]
bhyve: implement domainGetOSType

9 years agovirsh-domain: use correct base for virStrToLong_ui
Pavel Hrdina [Wed, 21 Oct 2015 10:43:29 +0000 (12:43 +0200)]
virsh-domain: use correct base for virStrToLong_ui

While parsing device addresses we should use correct base and don't
count on auto-detect.  For example, PCI address uses hex numbers, but
each number starting with 0 will be auto-detected as octal number and
that's wrong.  Another wrong use-case is for PCI address if for example
bus is 10, than it's incorrectly parsed as decimal number.

PCI and CCW addresses have all values as hex numbers, IDE and SCSI
addresses are in decimal numbers.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agolibvirt-domain: fix the error reporting when use the localhost as target uri
Luyao Huang [Tue, 27 Oct 2015 08:54:01 +0000 (16:54 +0800)]
libvirt-domain: fix the error reporting when use the localhost as target uri

Remove the extra %s in error message when call virReportInvalidArg().

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolibvirt-domain: fix no error report when p2p migrate fail
Luyao Huang [Tue, 27 Oct 2015 08:54:00 +0000 (16:54 +0800)]
libvirt-domain: fix no error report when p2p migrate fail

After commit a26669d7, we only jump to error when
virDomainMigrateUnmanagedParams return a value less than -1.
this will make the migrate result always be success even we
meet some problem.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: fix migration flags undefinesource cannot work
Luyao Huang [Tue, 27 Oct 2015 08:53:59 +0000 (16:53 +0800)]
qemu: fix migration flags undefinesource cannot work

In commit f41be296, we moved vm->persistent check into
qemuDomainRemoveInactive, but we didn't change the vm->persistent
before call qemuDomainRemoveInactive in some place before and just
call it to remove the inactive vm.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Add serial target type to ABI stability check
Luyao Huang [Wed, 21 Oct 2015 07:14:03 +0000 (15:14 +0800)]
conf: Add serial target type to ABI stability check

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

There is no ABI check for serial target type attribute, just
add it.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolock_daemon: Switch to wrapper locking functions
Michal Privoznik [Wed, 7 Oct 2015 11:36:43 +0000 (13:36 +0200)]
lock_daemon: Switch to wrapper locking functions

Lets use wrapper functions virLockDaemonLock and
virLockDaemonUnlock instead of virMutexLock and virMutexUnlock.
This has no functional impact, but it's easier to read (at least
for me).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()
Andrea Bolognani [Mon, 26 Oct 2015 11:09:33 +0000 (12:09 +0100)]
qemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()

This calls the PCI-, USB- and SCSI-specific functions just
like qemuHostdev{Prepare,ReAttach}DomainDevices() already do,
and was the missing piece for the qemuHostdev API to nicely
mirror the virHostdev API.

Update qemuProcessReconnect() to use the new function.

9 years agoqemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:26:30 +0000 (14:26 +0200)]
qemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()

Adopt the same names used for virHostdevUpdateActive*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:12:48 +0000 (14:12 +0200)]
qemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()

Adopt the same names used for virHostdevReAttach*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:10:16 +0000 (14:10 +0200)]
qemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()

Adopt the same names used for virHostdevPrepare*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agohostdev: Rename virHostdevUpdateDomainActiveDevices()
Andrea Bolognani [Mon, 26 Oct 2015 10:59:41 +0000 (11:59 +0100)]
hostdev: Rename virHostdevUpdateDomainActiveDevices()

The new name, virHostdevUpdateActiveDomainDevices(), follows the
same naming conventions used by the rest of the module.

No functional changes.

9 years agotests: Remove unused nodeinfo test data
Andrea Bolognani [Wed, 7 Oct 2015 12:04:53 +0000 (14:04 +0200)]
tests: Remove unused nodeinfo test data

A bunch of files that we don't currently parse, and are very
unlikely to ever start parsing, made their way into the nodeinfo
test data. Get rid of them.

9 years agovirsh: Display an error when passing count <= 0 to setvcpus
Luyao Huang [Thu, 22 Oct 2015 03:27:35 +0000 (11:27 +0800)]
virsh: Display an error when passing count <= 0 to setvcpus

The number of vCPUs for a guest must be between 1 and the
maximum value configured in the domain XML. This commit
introduces checks to make sure that passing count <= 0
results in an error.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Fix error message to use correct parameter
John Ferlan [Tue, 20 Oct 2015 17:16:16 +0000 (13:16 -0400)]
conf: Fix error message to use correct parameter

Fix a cut-n-paste error from commit id '35eecdde' where the previous
check for max_sectors seems to have been copied, but the error message
parameter not updated to be ioeventfd

9 years agoutil: Produce friendlier error message to user
Luyao Huang [Wed, 21 Oct 2015 04:13:41 +0000 (12:13 +0800)]
util: Produce friendlier error message to user

Commit id '1c24cfe9' added error messages for virNumaSetPagePoolSize;
however, virNumaGetHugePageInfo also uses virNumaGetHugePageInfoPath
in order to build the path, but it never checked upon return if
the built path exists which could lead to an error message as follows:

$ virsh freepages 0 1
error: Failed to open file
    '/sys/devices/system/node/node0/hugepages/hugepages-1kB/free_hugepages':
    No such file or directory

Rather than add the same message for the other two callers, adjust
the virNumaGetHugePageInfoPath in order not only build the path, but
also check if the built path exists.  If the path does not exist,
then generate the error message and return failure.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: Adjust error paths for virNumaSetPagePoolSize
Luyao Huang [Wed, 21 Oct 2015 04:13:40 +0000 (12:13 +0800)]
util: Adjust error paths for virNumaSetPagePoolSize

Commit id '1c24cfe9' added new checks and error messaes for failure
scenarios. Let's adjust those error messages to after the call to
virNumaGetHugePageInfoPath in order to provide a more specific error
message depending on node and page_size

After this patch:
 # virsh allocpages --pagesize 2047 --pagecount 1 --cellno 0
 error: operation failed: page size 2047 is not available on node 0

 # virsh allocpages --pagesize 2047 --pagecount 1
 error: operation failed: page size 2047 is not available

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: split the virNumaGetHugePageInfoPath into separate function
Luyao Huang [Wed, 21 Oct 2015 04:13:39 +0000 (12:13 +0800)]
util: split the virNumaGetHugePageInfoPath into separate function

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

Refactor helper virNumaGetHugePageInfoPath to handle returning a directory
path when passed a page_size of 0 and suffix == NULL into a new helper
virNumaGetHugePageInfoDir which will only be called when a directory
path is expected to be returned. This solves the issue where the helper
was called with page_size == 0 expecting a file path in return, but
instead got a directory path and failed in virFileReadAll with:

    error : virFileReadAll:1358 : Failed to read file
                '/sys/devices/system/node/node0/hugepages/': Is a directory

Since virNumaGetPages API expects to return a directory by passing
page_size == 0 and suffix == NULL, it will now call the new helper.
Callers to virNumaGetHugePageInfoPath expect to return a file path
which could then be used in the call to virFileReadAll.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoAvoid using !STREQ and !STRNEQ
Ishmanpreet Kaur Khera [Tue, 20 Oct 2015 16:15:12 +0000 (21:45 +0530)]
Avoid using !STREQ and !STRNEQ

We have macros for both positive and negative string matching.
Therefore there is no need to use !STREQ or !STRNEQ. At the same
time as we are dropping this, new syntax-check rule is
introduced to make sure we won't introduce it again.

Signed-off-by: Ishmanpreet Kaur Khera <khera.ishman@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoNEWS: Fix XSLT stylesheet
Andrea Bolognani [Tue, 13 Oct 2015 07:44:13 +0000 (09:44 +0200)]
NEWS: Fix XSLT stylesheet

This has been broken for a looong time - in fact, we've been
shipping a mostly-empty NEWS file for at least the past two years.

Including the html namespace and using it for matching elements,
like hacking1.xsl and hacking2.xsl were already doing, makes the
NEWS file useful again.

Add a note explaining that the release list has been split up
by year as well.

9 years agoNEWS: Split releases by year
Andrea Bolognani [Thu, 15 Oct 2015 09:19:28 +0000 (11:19 +0200)]
NEWS: Split releases by year

Update cfg.mk to ignore the split files during
syntax-check (thanks Martin).

9 years agovz: implement some domain API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement some domain API calls

The following functions are implemented:

vzDomainIsUpdated, vzDomainGetVcpusFlags and vzDomainGetMaxVcpus.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement API calls of nodeGetxxx family
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement API calls of nodeGetxxx family

The following functions were implemented:

 vzNodeGetCPUStats, vzNodeGetMemoryStats,
 vzNodeGetCellsFreeMemory and vzNodeGetFreeMemory.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement connectGetMaxVcpus API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement connectGetMaxVcpus API calls

Because we have no limitation for maximal number of vcpus in containers
we report as maximum 1028 just for the sake of common sence.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>