]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agopo: minimize language it
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:33 +0000 (16:02 +0100)]
po: minimize language it

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language is
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language is

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ilo
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language ilo

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language id
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language id

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ia
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language ia

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language hu
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language hu

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language hr
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language hr

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language hi
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language hi

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language he
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language he

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language gu
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language gu

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language gl
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language gl

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ga
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language ga

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language fur
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language fur

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language fr
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language fr

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language fi
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language fi

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language fil
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:32 +0000 (16:02 +0100)]
po: minimize language fil

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language fa
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language fa

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language eu
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language eu

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language et
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language et

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language es
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language es

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language eo
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language eo

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language en_GB
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language en_GB

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language el
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language el

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language de
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language de

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language de_CH
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language de_CH

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language da
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language da

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language cy
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language cy

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language cs
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language cs

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ca
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language ca

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bs
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language bs

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language brx
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language brx

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language br
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:31 +0000 (16:02 +0100)]
po: minimize language br

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bo
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language bo

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bn
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language bn

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bn_IN
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language bn_IN

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bg
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language bg

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language be
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language be

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language bal
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language bal

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ast
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language ast

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language as
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language as

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language ar
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language ar

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language anp
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language anp

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language am
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize language af
Daniel P. Berrangé [Fri, 6 Apr 2018 15:02:30 +0000 (16:02 +0100)]
po: minimize language af

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: minimize & canonicalize translations stored in git
Daniel P. Berrangé [Wed, 4 Apr 2018 18:45:40 +0000 (19:45 +0100)]
po: minimize & canonicalize translations stored in git

Similar to the libvirt.pot, .po files contain line numbers and file
names identifying where in the source a translatable string comes from.
The source locations in the .po files are thrown away and replaced with
content from the libvirt.pot whenever msgmerge is run, so this is not
precious information that needs to be stored in git.

When msgmerge processes a .po file, it will add in any msgids from the
libvirt.pot that were not already present. Thus, if a particular msgid
currently has no translation, it can be considered redundant and again
does not need storing in git.

When msgmerge processes a .po file and can't find an exact existing
translation match, it will try todo fuzzy matching instead, marking such
entries with a "# fuzzy" comment to alert the translator to take a
look and either discard, edit or accept the match. Looking at the
existing fuzzy matches in .po files shows that the quality is awful,
with many having a completely different set of printf format specifiers
between the msgid and fuzzy msgstr entry. Fortunately when msgfmt
generates the .gmo, the fuzzy entries are all ignored anyway. The fuzzy
entries could be useful to translators if they were working on the .po
files directly from git, but Libvirt outsourced translation to the
Fedora Zanata system, so keeping fuzzy matches in git is not much help.

Finally, by default msgids are sorted based on source location. Thus, if
a bit of code with translatable text is moved from one file to another,
it may shift around in the .po file, despite the msgid not itself changing.
If the msgids were sorted alphabetically, the .po files would have
stable ordering when code is refactored.

This patch takes advantage of the above observations to canonicalize
and minimize the content stored for .po files in git. Instead of storing
the real .po files, we now store .mini.po files.

The .mini.po files are the same file format as .po files, but have no
source location comments, are sorted alphabetically, and all fuzzy
msgstrs and msgids with no translation are discarded. This cuts the size
of content in the po directory from 109MB to 19MB.

Users working from a libvirt git checkout who need the full .po files
can run "make update-po", which merges the libvirt.pot and .mini.po
file to create a .po file containing all the content previously stored
in git.

Conversely if a full .po file has been modified, for example, by
downloading new content from Zanata, the .mini.po files can be updated
by running "make update-mini-po". The resulting diffs of the .mini.po
file will clearly show the changed translations without any of the noise
that previously obscured content. Being able to see content changes
clearly actually identified a bug in the zanata python client where it
was adding bogus "fuzzy" annotations to many messages:

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

Users working from libvirt releases should not see any difference in
behaviour, since the tarballs only contain the full .po files, not the
.mini.po files.

As an added benefit, generating tarballs with "make dist", will no
longer cause creation of dirty files in git, since it won't touch the
.mini.po files, only the .po files which are no longer kept in git.

To avoid creating a single commit 100+MB in size, each language is
minimized separately in a following commit.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: stop storing libvirt.pot in git
Daniel P. Berrangé [Wed, 4 Apr 2018 16:40:17 +0000 (17:40 +0100)]
po: stop storing libvirt.pot in git

Storing the libvirt.pot file is a bad idea because it is an
automatically generated file. Most patches will invalidate the stored
libvirt.pot file by changing line numbers or introducing/removing files
with translatable content.

Anyone working with a libvirt GIT checkout who needs the libvirt.pot is
better served creating a fresh copy with "make libvirt.pot".

libvirt.pot is still included in the release dists, so those building
from tarballs see no change in behaviour.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: add rules for integration with zanata
Daniel P. Berrangé [Wed, 4 Apr 2018 15:41:08 +0000 (16:41 +0100)]
po: add rules for integration with zanata

Add rules to handle pushing libvirt.pot to zanata, and refreshing .po
files with new content from zanata.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: remove language list from zanata configuration
Daniel P. Berrangé [Wed, 4 Apr 2018 15:43:31 +0000 (16:43 +0100)]
po: remove language list from zanata configuration

The <locales> element in zanata.xml is no longer relevant as this info
is recorded server side.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopo: provide custom make rules for po file management
Daniel P. Berrangé [Tue, 3 Apr 2018 15:39:17 +0000 (16:39 +0100)]
po: provide custom make rules for po file management

Historically we have relied on autopoint/gettextize to install a
standard po/Makefile.in.in. There is very limited scope for customizing
this and it also causes a bunch of extra stuff to be pulled into
configure.ac which potentially clashes with gnulib. Writing make rules
for po file management is no more difficult than any other rules libvirt
has, so stop using autopoint/gettextize.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Format 'write-cache' parameter for disk frontends
Peter Krempa [Wed, 4 Apr 2018 07:44:34 +0000 (09:44 +0200)]
qemu: Format 'write-cache' parameter for disk frontends

The disk cache mode translates to various frontend and backend
attributes for the qemu block layer. For the frontend device the
'writeback' parameter is used and provided as 'write-cache'. Implement
this so that we can later switch to using -blockdev where we will not
pass the cachemode directly any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: caps: Add capability for 'write-cache' parameter of disk frontends
Peter Krempa [Tue, 3 Apr 2018 17:11:22 +0000 (19:11 +0200)]
qemu: caps: Add capability for 'write-cache' parameter of disk frontends

QEMU translates the cache mode of a disk internally into 3 flags.
'write-cache' is a flag of the frontend while others are flag of the
backing storage. Add capability which will allow expressing it via the
frontend attribute.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2argv: Test formatting of 'write-cache' parameter
Peter Krempa [Wed, 4 Apr 2018 07:46:50 +0000 (09:46 +0200)]
tests: qemuxml2argv: Test formatting of 'write-cache' parameter

Prepare the tests for adding the new parameter. The parameter was
introduced in qemu-2.7.0, so add a forked version of the test case to
see that it is formatted properly.

This test is also an example how the new testing macros should be used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: domain: Add helper for translating disk cachemode to qemu flags
Peter Krempa [Wed, 4 Apr 2018 06:43:06 +0000 (08:43 +0200)]
qemu: domain: Add helper for translating disk cachemode to qemu flags

Add helper which will map values of disk cache mode to the flags which
are accepted by various parts of the qemu block layer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2argv: Add infrastructure for testing with real qemuCaps
Peter Krempa [Wed, 4 Apr 2018 07:42:36 +0000 (09:42 +0200)]
tests: qemuxml2argv: Add infrastructure for testing with real qemuCaps

Allow testing of XML->argv conversion with using a real capability map
as used in the qemucapabilitiestest. This allows specifying the required
qemu version with the test rather than having to enumerate all the
required capabilities or allows to use the newest capabilities present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2argv: Add infrastructure to pass output file suffix
Peter Krempa [Tue, 17 Apr 2018 14:17:53 +0000 (16:17 +0200)]
tests: qemuxml2argv: Add infrastructure to pass output file suffix

To allow having more than one output file in the qemuxml2argvtest add a
suffix member to the testInfo struct which will allow testing the same
XML file with multiple capabilities files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemu: Add helper code to lookup latest capability file
Peter Krempa [Wed, 18 Apr 2018 08:47:31 +0000 (10:47 +0200)]
tests: qemu: Add helper code to lookup latest capability file

The helper iterates the directory with files for the capability test and
looks up the most recent one for the given architecture. This will allow
testing against the newest qemu capabilities so that we can catch
regressions in behaviour more easily.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agocheck scripts: handle unintialized driver vars in check-driverimpls.pl
Nikolay Shirokovskiy [Wed, 18 Apr 2018 14:17:37 +0000 (17:17 +0300)]
check scripts: handle unintialized driver vars in check-driverimpls.pl

Current script confuses on lines like this:

static virHypervisorDriver parallelsHypervisorDriver;

It interprets next lines as if there is open brace.

Let's filter this case from matches.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agovz: build fix
Nikolay Shirokovskiy [Wed, 18 Apr 2018 13:37:27 +0000 (16:37 +0300)]
vz: build fix

Broken by [1] commit - trailing comma instead of semicolon. Fortunately
the issue did not get sneak in released 4.2 version. Note that uriSchemes
for parallelsConnectDriver should not be allocated on stack.

[1] 8e4f9a27: "driver: declare supported URI schemes in virConnectDriver struct"

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonews: Xen: announce support for setting CPU features
Jim Fehlig [Wed, 18 Apr 2018 03:20:42 +0000 (21:20 -0600)]
news: Xen: announce support for setting CPU features

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoqemu: driver: Fix error message in qemuDomainBlockCommit
Peter Krempa [Wed, 18 Apr 2018 10:44:50 +0000 (12:44 +0200)]
qemu: driver: Fix error message in qemuDomainBlockCommit

When qemu does not support changing of the backing store string, we'd
reaport that block pull is not supported instead of block commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Disk 'shared' state is not guest ABI
Peter Krempa [Tue, 10 Apr 2018 15:05:20 +0000 (17:05 +0200)]
conf: Disk 'shared' state is not guest ABI

Drop the checking of 'shared' from the ABI stability check. This
property controls whether the hypervisor allows concurrent access to the
same file, but this fact does not influence guest ABI.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Move 'driverName' back to disk definition structure
Peter Krempa [Tue, 10 Apr 2018 14:57:22 +0000 (16:57 +0200)]
conf: Move 'driverName' back to disk definition structure

Currently it is not used in backing chains and does not seem that we
will need to use it so return it back to the disk definition. Thankfully
most accesses are done via the accessors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf, qemu: Replace access to disk driver name with accessors
Peter Krempa [Tue, 10 Apr 2018 14:51:47 +0000 (16:51 +0200)]
conf, qemu: Replace access to disk driver name with accessors

Replace direct usage of disk->src->driverName with the existing
accessors. The parser code where we assign the driver from XML is
intentionally not fixed to save an allocation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: Move disk driver name validation into disk validation callback
Peter Krempa [Tue, 10 Apr 2018 14:38:22 +0000 (16:38 +0200)]
qemu: Move disk driver name validation into disk validation callback

There were two places where we'd check this independently. Move it to
the disk definition validation callback. This also fixes possible use of
NULL in a printf for network storage.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Make argument of virDomainDiskGetDriver const
Peter Krempa [Tue, 10 Apr 2018 14:41:54 +0000 (16:41 +0200)]
conf: Make argument of virDomainDiskGetDriver const

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Reindent virDomainObjCheckActive
Jiri Denemark [Wed, 18 Apr 2018 09:40:37 +0000 (11:40 +0200)]
conf: Reindent virDomainObjCheckActive

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: cpu: fix "full" CPU to include all "reported" CPU features
Nikolay Shirokovskiy [Wed, 11 Apr 2018 08:57:32 +0000 (11:57 +0300)]
qemu: cpu: fix "full" CPU to include all "reported" CPU features

On Core i5 650 x86_64 kvm guest fail to start with error [1] for next cpu config:

  <cpu mode='host-model' check='partial'>
    <model fallback='allow'/>
    <feature policy='require' name='x2apic'/>
  </cpu>

The problem is in full CPU calculation in virQEMUCapsInitHostCPUModel.
It is supposed to include features emulated by qemu and missed on host. Some of
such features may be not included however.

For Core i5 650  host CPU is detected as Westmere and reported CPU as
SandyBridge. x2apic is missed on host and provided by installed qemu. The
feature is not mentioned in reported CPU features explicitly because SandyBridge
model include it. As a result full CPU does not include x2apic too.

Solution is to expand guest cpu features before updating fullCPU features.

[1] error: the CPU is incompatible with host CPU: \
       Host CPU does not provide required features: x2apic

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agocputest: New test for Intel Core i5-650
Nikolay Shirokovskiy [Wed, 11 Apr 2018 08:57:31 +0000 (11:57 +0300)]
cputest: New test for Intel Core i5-650

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agovz: start using virDomainObjCheckActive
Clementine Hayat [Tue, 17 Apr 2018 22:13:34 +0000 (22:13 +0000)]
vz: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agouml: start using virDomainObjCheckActive
Clementine Hayat [Tue, 17 Apr 2018 22:13:33 +0000 (22:13 +0000)]
uml: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoopenvz: start using virDomainObjCheckActive
Clementine Hayat [Tue, 17 Apr 2018 22:13:32 +0000 (22:13 +0000)]
openvz: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agolibxl: start using virDomainObjCheckActive
Clementine Hayat [Tue, 17 Apr 2018 22:13:29 +0000 (22:13 +0000)]
libxl: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agotest: start using virDomainObjCheckActive
Clementine Hayat [Tue, 17 Apr 2018 22:13:28 +0000 (22:13 +0000)]
test: start using virDomainObjCheckActive

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoAdd function that raises error if domain is not active
Clementine Hayat [Tue, 17 Apr 2018 22:13:26 +0000 (22:13 +0000)]
Add function that raises error if domain is not active

Add a function named virDomainObjCheckIsActive in src/conf/domain_conf.c.
It calls virDomainObjIsActive, raises error if necessary and returns.

There is a lot of occurence of this pattern and it will save 3 lines on
each call.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agocfg.mk: Introduce syntax-check rule to prefer VIR_CLASS_NEW
Michal Privoznik [Fri, 13 Apr 2018 14:41:17 +0000 (16:41 +0200)]
cfg.mk: Introduce syntax-check rule to prefer VIR_CLASS_NEW

Now that we have macro that does some checks lets forbid raw
usage of virClassNew() in favor of VIR_CLASS_NEW().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agovirobject: Check if @parent is the first member in class
Michal Privoznik [Tue, 17 Apr 2018 15:52:03 +0000 (17:52 +0200)]
virobject: Check if @parent is the first member in class

Our virObject code relies heavily on the fact that the first
member of the class struct is type of virObject (or some
derivation of if). Let's check for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agovirobject: Introduce VIR_CLASS_NEW() macro
Michal Privoznik [Tue, 17 Apr 2018 15:42:33 +0000 (17:42 +0200)]
virobject: Introduce VIR_CLASS_NEW() macro

So far we are repeating the following lines over and over:

  if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                             "virSomeObject",
                             sizeof(virSomeObject),
                             virSomeObjectDispose)))
      return -1;

While this works, it is impossible to do some checking. Firstly,
the class name (the 2nd argument) doesn't match the name in the
code in all cases (the 3rd argument). Secondly, the current style
is needlessly verbose. This commit turns example into following:

  if (!(VIR_CLASS_NEW(virSomeObject,
                      virClassForObject)))
      return -1;

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agosrc: Unify virObject member name
Michal Privoznik [Fri, 13 Apr 2018 11:51:23 +0000 (13:51 +0200)]
src: Unify virObject member name

Whenever we declare a new object the first member of the struct
has to be virObject (or any other member of that family). Now, up
until now we did not care about the name of the struct member.
But lets unify it so that we can do some checks at compile time
later.

The unified name is 'parent'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agodatatypes: Rename @parent to @parentName in virNodeDevice
Michal Privoznik [Fri, 13 Apr 2018 11:42:16 +0000 (13:42 +0200)]
datatypes: Rename @parent to @parentName in virNodeDevice

In next patches this name will be needed for a different memeber.
Also, it makes sense to rename the variable because it does not
contain reference to parent device, just its name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotests: Compile and link virmocklibxl with libxml
Michal Privoznik [Wed, 18 Apr 2018 07:40:20 +0000 (09:40 +0200)]
tests: Compile and link virmocklibxl with libxml

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirmocklibxl.c: Fix include of virfile.h
Michal Privoznik [Wed, 18 Apr 2018 07:37:09 +0000 (09:37 +0200)]
virmocklibxl.c: Fix include of virfile.h

Firstly, this isn't supposed to be in angle brackets because it's
not a system header file (not that gcc distinguishes these two,
it's just guide for us developers).

Secondly, no need to use util/ path prefix because CFLAGS already
contain -I$(srcdir)/util.

The include is needed because virmocklibxl is mocking
virFileMakePath() and even when VIR_MOCK_IMPL_RET_ARGS() does
forward declaration to shut up compiler we need real
virFileMakePath() declaration so that when it changes compiler
catches mismatching declarations.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agotests: add test case for CPUID in xenconfig driver
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:27 +0000 (03:03 +0200)]
tests: add test case for CPUID in xenconfig driver

Check conversion of "cpuid" setting, check all supported policy settings
("1", "0", "x"). Also, check interaction with "nestedhvm" - should not
be included as "vmx=1" in "cpuid" setting.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoxenconfig: add CPUID handling to domXML <-> xl.cfg conversion
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:26 +0000 (03:03 +0200)]
xenconfig: add CPUID handling to domXML <-> xl.cfg conversion

Only "libxl" format supported for now. Special care needed around
vmx/svm, because those two are translated into "nestedhvm" setting.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotests: check CPU features handling in libxl driver
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:25 +0000 (03:03 +0200)]
tests: check CPU features handling in libxl driver

Test enabling/disabling individual CPU features and also setting
nested HVM support, which is also controlled by CPU features node.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agolibxl: add support for CPUID features policy
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:24 +0000 (03:03 +0200)]
libxl: add support for CPUID features policy

Convert CPU features policy into libxl cpuid policy settings. Use new
("libxl") syntax, which allow to enable/disable specific bits, using
host CPU as a base. For this reason, only "host-passthrough" mode is
accepted.
Libxl do not have distinction between "force" and "required" policy
(there is only "force") and also between "forbid" and "disable" (there
is only "disable"). So, merge them appropriately. If anything, "require"
and "forbid" should be enforced outside of specific driver.
Nested HVM (vmx and svm features) is handled separately, so exclude it
from translation.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoxenconfig: do not override def->cpu if already set elsewhere
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:23 +0000 (03:03 +0200)]
xenconfig: do not override def->cpu if already set elsewhere

This will help with adding cpuid support.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agolibxl: do not enable nested HVM unless global nested_hvm option enabled
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:22 +0000 (03:03 +0200)]
libxl: do not enable nested HVM unless global nested_hvm option enabled

Introduce global libxl option for enabling nested HVM feature, similar
to kvm module parameter. This will prevent enabling experimental feature
by mere presence of <cpu mode='host-passthrough'> element in domain
config, unless explicitly enabled. <cpu mode='host-passthrough'> element
may be used to configure other features, like NUMA, or CPUID.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
7 years agolibxl: warn about ignored CPU mode=custom
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:21 +0000 (03:03 +0200)]
libxl: warn about ignored CPU mode=custom

When support for mode=custom will be added in the future, semantics of
current config will change. Reduce the surprise by emitting a warning.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agolibxl: pass driver config to libxlMakeDomBuildInfo
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:20 +0000 (03:03 +0200)]
libxl: pass driver config to libxlMakeDomBuildInfo

Preparation for global nestedhvm configuration - libxlMakeDomBuildInfo
needs access to libxlDriverConfig.
No functional change.

Adjusting tests require slightly more mockup functions, because of
libxlDriverConfigNew() call.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
7 years agolibxl: fix libxlDriverConfigDispose for partially constructed object
Marek Marczykowski-Górecki [Thu, 12 Apr 2018 01:03:19 +0000 (03:03 +0200)]
libxl: fix libxlDriverConfigDispose for partially constructed object

libxlDriverConfigNew() use libxlDriverConfigDispose() for cleanup in
case of errors. Do not call libxlLoggerFree() on not allocated logger
(NULL).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Escape commas for qemuBuildDomainLoaderCommandLine
Sukrit Bhatnagar [Mon, 16 Apr 2018 22:56:26 +0000 (04:26 +0530)]
qemu: Escape commas for qemuBuildDomainLoaderCommandLine

Add comma escaping for loader->path and loader->nvram.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Escape commas for qemuBuildGraphicsVNCCommandLine
Sukrit Bhatnagar [Mon, 16 Apr 2018 22:56:25 +0000 (04:26 +0530)]
qemu: Escape commas for qemuBuildGraphicsVNCCommandLine

Add comma escaping for cfg->vncTLSx509certdir.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Escape commas for qemuBuildFSStr and qemuBuildFSDevStr
Sukrit Bhatnagar [Mon, 16 Apr 2018 22:56:24 +0000 (04:26 +0530)]
qemu: Escape commas for qemuBuildFSStr and qemuBuildFSDevStr

Add comma escaping for fs->src->path and fs->dst.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Escape commas for qemuBuildDriveDevStr
Sukrit Bhatnagar [Mon, 16 Apr 2018 22:56:23 +0000 (04:26 +0530)]
qemu: Escape commas for qemuBuildDriveDevStr

Add comma escaping for disk->vendor and disk->product when being
built for the command line (and not from hotplug).

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Escape commas for qemuBuildRomStr
Sukrit Bhatnagar [Mon, 16 Apr 2018 22:56:22 +0000 (04:26 +0530)]
qemu: Escape commas for qemuBuildRomStr

Add comma escaping for info->romfile.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovmware: Failures in cache info init are non-fatal
Rainer Müller [Sat, 14 Apr 2018 09:25:43 +0000 (11:25 +0200)]
vmware: Failures in cache info init are non-fatal

This is also not fatal on other drivers.

Signed-off-by: Rainer Müller <raimue@codingfarm.de>
7 years agovmware: Fix initialization of VMware Fusion
Rainer Müller [Sat, 14 Apr 2018 09:25:42 +0000 (11:25 +0200)]
vmware: Fix initialization of VMware Fusion

The vmware driver wants to execute vmware-vmx from the same directory in
which vmrun was found. However, on VMware Fusion 10 vmrun at
/Applications/VMware Fusion.app/Contents/Public/vmrun is a symlink
pointing to ../Library/vmrun. vmware-vmx cannot be found, as
it is not in PATH, but only in this Library directory.

Therefore, follow the vmrun symlink and use the resulting path. Then the
assumption that vmware-vmx is right next to it will still work.

Signed-off-by: Rainer Müller <raimue@codingfarm.de>
7 years agoqemu: refresh vcpu halted state only via query-cpus-fast
Viktor Mihajlovski [Wed, 4 Apr 2018 14:45:07 +0000 (16:45 +0200)]
qemu: refresh vcpu halted state only via query-cpus-fast

In order to not affect running VMs, refreshing the halted state
is only performed if QEMU supports the query-cpus-fast QAPI.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: add testcase for s390 query-cpus-fast
Viktor Mihajlovski [Wed, 4 Apr 2018 14:45:06 +0000 (16:45 +0200)]
tests: add testcase for s390 query-cpus-fast

The s390 testcase verifies that the s390-specific cpu-state
field is correctly mapped to the halted property.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: add architecture-specific CPU info handling
Viktor Mihajlovski [Wed, 4 Apr 2018 14:45:05 +0000 (16:45 +0200)]
qemu: add architecture-specific CPU info handling

Extract architecture specific data from query-cpus[-fast] if
available. A new function qemuMonitorJSONExtractCPUArchInfo()
can then call architecture-specific extraction handlers.

Initially, there's a handler for s390 cpu info to
set the halted property depending on the s390 cpu state
returned by QEMU. With this it's still possible to report
the halted condition even when using query-cpus-fast.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>