Commit Graph

22507 Commits

Author SHA1 Message Date
Peter Krempa
b4be29336d conf: Refactor virDomainDiskDefMirrorParse
Now that the mirror parsing code is not crammed in the main disk parser
we can employ better coding style.
2016-04-13 08:21:38 +02:00
Peter Krempa
109fe3fea1 conf: disk: Split out parsing of disk mirror data
Changes are indentation and 'cleanup' label instead of 'error'.
2016-04-13 08:21:38 +02:00
Peter Krempa
14e4c4e465 conf: virDomainDiskDefIotuneParse: Report malformed number errors
Rest of the fields of the iotune data structure did not check for
malformed integers. Use the previously defined macro to extract them
which will simplify the code and add error reporting.
2016-04-13 08:21:38 +02:00
Peter Krempa
112ae48192 conf: virDomainDiskDefIotuneParse: simplify parsing
Since the structure was pre-initialized to 0 we don't need to set every
single member to 0 if it's not present in the XML. Additionally if we
put the name of the field into the error message the code can be
simplified using a macro to parse the members.
2016-04-13 08:21:27 +02:00
Peter Krempa
71760e90d2 conf: disk: Remove error label from virDomainDiskDefIotuneParse
Since this function isn't doing any cleanup, the label is not necessary.
2016-04-13 08:20:45 +02:00
Peter Krempa
5fce412d9a conf: disk: Extract iotune parsing into a separate func 2016-04-13 08:20:44 +02:00
Peter Krempa
65da41de14 conf: disk: Remove one unnecessary level of indentation
Also simplify the code by switching to a for loop.
2016-04-13 08:20:44 +02:00
Peter Krempa
4bbac0f9b9 conf: disk: Don't initialize fields allocated by calloc
All the fields were initialized to 0.
2016-04-13 08:20:44 +02:00
Peter Krempa
dcf02a704f util: Rename and move virStrIsPrint to virStringIsPrintable 2016-04-13 08:15:24 +02:00
Maxim Nestratov
1ee1b58fc3 vz: add Hypervisor prefix to vz and parallels Driver structures 2016-04-12 21:05:21 +03:00
Maxim Nestratov
f376069fa5 vz: remove drivername field from vzConn structure
No need to remember connection name and have corresponding
domain type to keep backward compatibility with former
'parallels' driver. It is enough to be able to accept 'parallels'
uri and domain types.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2016-04-12 21:05:05 +03:00
Maxim Nestratov
419aaf23ce vz: change the order of capabilities reported
'vz' goes first now to make clients like virt-manager choose 'vz'
instead of 'parallels'

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2016-04-12 21:04:53 +03:00
Maxim Nestratov
9e9e508993 virsh: report when vz driver is compiled
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2016-04-12 21:04:40 +03:00
Ján Tomko
4b35a7155a tests: fix xen-related tests
My commit 6879be4 moved the addition of the implicit video device
from the XML parser to the PostParse function, but did not regenerate
all the tests.
2016-04-12 14:58:43 +02:00
Nikolay Shirokovskiy
4517eb0f4e vz: fix memory leak
we don't need to allocate macstr at all as it is an array
and already has the the space it needs.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-04-12 12:44:26 +03:00
Ján Tomko
1278688921 conf: use VIR_APPEND_ELEMENT in virDomainDefAddImplicitVideo 2016-04-12 10:45:35 +02:00
Ján Tomko
1485be1784 conf: reduce indentation in virDomainDefAddImplicitVideo
Return early if there is nothing to do.
2016-04-12 10:45:35 +02:00
Ján Tomko
35e3c4a684 conf: delete useless primaryVideo variable
If we encounter a video device with primary=yes, we insert it
at def->videos[0].

There is no need to record this in a separate variable,
just check if there already is a primary video at def->videos[0].
2016-04-12 10:45:35 +02:00
Ján Tomko
b2b8fc919d conf: use insertAt instead of j
We call VIR_INSERT_ELEMENT_INPLACE either with 0 (for primary video)
or def->nvideos (for the rest).

Use a variable with more semantic name, since j is usually used
for iterating.
2016-04-12 10:45:35 +02:00
Ján Tomko
ca70db398e conf: use the iterator directly when parsing video devices
We start with both i and def->nvideos at 0 and increment both
after every successful iteration.

Use i directly, instead of passing the def->nvideos value through j.
2016-04-12 10:45:35 +02:00
Ján Tomko
6d8b6d2847 conf: also mark the implicit video as primary
Commit 119cd06 started setting the primary bool for the first
user-specified video even if user omitted the 'primary' attribute.

However this was done before the addition of the implicit device.
This broke startup of transient qemu domains with no <video>:
https://bugzilla.redhat.com/show_bug.cgi?id=1325757

Move this default to virDomainDefPostParseInternal,
after the addition of the implicit video device, to catch the implicit
video as well.
2016-04-12 10:45:35 +02:00
Ján Tomko
6879be484c conf: move default video addition after XML parsing
Separate parsing of the XML from auto-generating the device.
2016-04-12 10:45:35 +02:00
Andrea Bolognani
2af7abfc74 cfg.mk: Use single quotes wherever possible
Being consistent is nice, especially when it comes to defining our
regular expression, where using single quotes instead of double
quotes allows us to leave out a few backslashes.

Changing this required altering a few error messages.

The only remaining use of double quotes is one where they are
actually required for the check to work.
2016-04-12 10:30:10 +02:00
Andrea Bolognani
e595089484 cfg.mk: Remove spurious whitespace 2016-04-12 10:30:10 +02:00
Andrea Bolognani
c81f058bd0 util: Fix 'exempt from syntax-check' comment 2016-04-12 10:30:10 +02:00
Nikolay Shirokovskiy
ad584cbb6c vz: implement memory setting functions
Quite straigthforward as vz sdk memory setting function makes
just what we want to that is set "amount of physical memory
allocated to a domain".

'useflags' is introduced for non flag function implementation.
We can't just use combination of flags like "live | config" or
we fail for inactive domains. Other combinations have drawbacks
too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-04-11 20:00:01 +03:00
Nikolay Shirokovskiy
3fbb7dba33 vz: factor out config update flags checks
Actually this is not pure refactoring. Part of common code is
replaced with virDomainObjUpdateModificationImpact and this
a good replacement. It includes removed check of inactive
domain and active flags set. Additionally we resolve
current flag in accordance with current state of domain.
Thus it becames possible to attach/detach devices for
inactive domains if this flag is set.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-04-11 19:58:30 +03:00
Pavel Hrdina
1d9d0c9397 domain_conf: fix graphics parsing
Commit dc98a5bc refactored the code a lot and forget about checking if
listen attribute is specified.  This ensures that listen attribute and
first listen element are compared only if both exist.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-11 13:50:55 +02:00
Cole Robinson
cdced0128a virtlogd: Fix a couple minor memory leaks
https://bugzilla.redhat.com/show_bug.cgi?id=1303885
2016-04-11 07:32:57 -04:00
Pavel Hrdina
d713a6b120 build: add GCC 6.0 -Wlogical-op workaround
fdstream.c: In function 'virFDStreamWrite':
fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op]
        if (errno == EAGAIN || errno == EWOULDBLOCK) {
                            ^~

Fedora rawhide now uses gcc 6.0 and there is a bug with -Wlogical-op
producing false warnings.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602

Use GCC pragma push/pop and ignore -Wlogical-op for GCC that supports
push/pop pragma and also has this bug.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-11 12:09:14 +02:00
Pavel Hrdina
7fb81831fc build: cleanup GCC < 4.6 -Wlogical-op workaround
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-11 12:09:11 +02:00
Martin Kletzander
16b41728b5 qemu: Free priv->machineName
Commit c3bd0019c0 forgot to cleanup after itself.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-04-11 11:46:09 +02:00
Peter Krempa
a46aad791c qemu: agent: Fix incorrect and weird debug/warning log entries
Replace the nonsensical debug statement by adding the expected event
code into the existing debug statement.

Since the monitor code always notifies the agent on guest
reboot/shutdown even if that was not initiated by the agent the warning
emitted later is bogus and pollutes the logs in such cases. Delete it
and keep just the original debug message where this info can be
inferred.
2016-04-11 09:48:13 +02:00
Andrea Bolognani
5143429303 host-validate: Be more careful when checking for cgroup support
Simply checking whether the cgroup name appears somewhere inside
/proc/self/cgroup is enough most of the time, but there are some
corner cases that require a more mindful parsing.
2016-04-11 09:36:28 +02:00
Andrea Bolognani
ccf58bd72a configure: Fix check for --with-login-shell on Windows
The check is supposed to stop users from trying to compile
virt-login-shell on Windows by erroring out during the
configure phase; however, there are two flaws in it:

  * the value of "x$with_win" is compared to "yes" instead
    of "xyes" (note the "x" in the first string)

  * "test" is not being used, so the script will actually
    try to run a command called "x$with_win" instead of
    performing string comparison

This patch fixes both issues.
2016-04-11 09:02:49 +02:00
Erik Skultety
799ced1f80 po: Really fix po/POTFILES.in ordering
Commit e72667bd tried to fix the incorrect file ordering in po/POTFILES.in
except it didn't, since the sort was run using locale en_US instead of
using locale C which is the default in libvirt. So this patch hopefully fixes
it for good.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2016-04-10 19:35:59 +02:00
Erik Skultety
e72667bddf po: fix POTFILES.in file ordering
When it comes to a situation that a new translatable file needs to be added
into the list of files, an automatically generated patch is proposed during
syntax-check. However, the diff was made against a sorted list of files and
the same sorted list of files + the new file that actually needs to be added
into the list. Since we do not keep POTFILES sorted, the proposed patch thus
can't be applied...most of the time - depending on the context.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2016-04-10 10:43:56 +02:00
Roman Bogorodskiy
acb63aaf41 qemu: fix build without gnutls installed
Move including of gnutls/gnutls.h in qemu/qemu_domain.c under the
"ifdef WITH_GNUTLS" check because otherwise it fails like this:

  CC       qemu/libvirt_driver_qemu_impl_la-qemu_domain.lo
qemu/qemu_domain.c:50:10: fatal error: 'gnutls/gnutls.h' file not found

in case if gnutls is not installed on the system.
2016-04-09 22:04:40 +03:00
Roman Bogorodskiy
ec5b9331c4 nss: properly include syms files to dist
Explicitly add Linux and BSD syms files for nss to EXTRA_DIST
instead of using the LIBVIRT_NSS_SYMBOL_FILE variable, because its value
will point to either Linux or BSD syms file, but we need to ship both.
2016-04-09 08:27:50 +03:00
Roman Bogorodskiy
7572a3e2ec nss: fix typo in configure help string
Servie -> Service
2016-04-09 07:52:33 +03:00
Pavel Hrdina
0159b38324 domain_conf: cleanup error paths for graphics parser
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:50:48 +02:00
Pavel Hrdina
537d32a2fd domain_conf: split graphics xml parser into multiple functions
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:36:27 +02:00
Pavel Hrdina
dc98a5bc59 domain_conf: cleanup virDomainGraphicsListensParseXML
Refactor the listen parser to use only one loop.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:36:27 +02:00
Pavel Hrdina
ffce6090f6 domain_conf: introduce virDomainGraphicsListensParseXML
Move code, that parses graphics listens, to its own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:36:27 +02:00
Pavel Hrdina
f037a955a7 docs: rewrite graphics XML documentation
This cleanups the documentation, reformat some of the paragraphs to use
<p> instead of </br> and rewrites the listen part to be more extendable.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:36:27 +02:00
Pavel Hrdina
71ea10851d tests: remove unwanted VIR_FREE of spice and vnc default listen
After the test and qemu_process refactor now we can benefit from default
listen address for spice and vnc in tests.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-08 17:36:27 +02:00
Andrea Bolognani
19b6709da8 docs: Remove unused div.body CSS rule
The 'body' CSS class is not used anywhere in the HTML files,
so we can get rid of the definition as well.
2016-04-08 17:31:19 +02:00
Peter Krempa
a3510e33d3 util: netdev: Don't crash in virNetDevSetIPAddress if @peer is NULL
VIR_SOCKET_ADDR_VALID dereferences the pointer, thus if we pass NULL
into virNetDevSetIPAddress it crashes. Regression introduced by
b3d069872c.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325120
2016-04-08 14:28:11 +02:00
Ján Tomko
f06ca25d23 qemu: support virt-2.6 machine type on arm
Some places already check for "virt-" prefix as well as plain "virt".
virQEMUCapsHasPCIMultiBus did not, resulting in multiple PCI devices
having assigned the same unnumbered "pci" alias.

Add a test for the "virt-2.6" machine type which also omits the
<model type='virtio'/> in <interface>, to check if
qemuDomainDefaultNetModel works too.

https://bugzilla.redhat.com/show_bug.cgi?id=1325085
2016-04-08 14:15:51 +02:00
Andrea Bolognani
f854c559b9 host-validate: Be more careful when checking for cgroup mounts
The existing code is built on the assumption that no cgroup
name can appear as part of another cgroup name; moreover, cgroups
are expected to always be listed in a specific order.

If that's not the case, eg. 'cpuacct' is listed before 'cpu', the
algorithm fails to detect the cgroup mount point.

Rewrite it to get rid of such assumptions.
2016-04-08 13:06:23 +02:00