]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoqemu ns: Create chardev backends more frequently
Michal Privoznik [Mon, 19 Jun 2017 15:05:31 +0000 (17:05 +0200)]
qemu ns: Create chardev backends more frequently

Currently, the only type of chardev that we create the backend
for in the namespace is type='dev'. This is not enough, other
backends might have files under /dev too. For instance channels
might have a unix socket under /dev (well, bind mounted under
/dev from a different place).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainAttachDeviceMknodRecursive: Support file mount points
Michal Privoznik [Thu, 15 Jun 2017 15:05:06 +0000 (17:05 +0200)]
qemuDomainAttachDeviceMknodRecursive: Support file mount points

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

Just like in the previous commit, when attaching a file based
device which has its source living under /dev (that is not a
device rather than a regular file), calling mknod() is no help.
We need to:

1) bind mount device to some temporary location
2) enter the namespace
3) move the mount point to desired place
4) umount it in the parent namespace from the temporary location

At the same time, the check in qemuDomainNamespaceSetupDisk makes
no longer sense. Therefore remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainCreateDeviceRecursive: Support file mount points
Michal Privoznik [Fri, 16 Jun 2017 11:49:52 +0000 (13:49 +0200)]
qemuDomainCreateDeviceRecursive: Support file mount points

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

When building a qemu namespace we might be dealing with bare
regular files. Files that live under /dev. For instance
/dev/my_awesome_disk:

  <disk type='file' device='disk'>
    <driver name='qemu' type='qcow2'/>
    <source file='/dev/my_awesome_disk'/>
    <target dev='vdc' bus='virtio'/>
  </disk>

  # qemu-img create -f qcow2 /dev/my_awesome_disk 10M

So far we were mknod()-ing them which is
obviously wrong. We need to touch the file and bind mount it to
the original:

1) touch /var/run/libvirt/qemu/fedora.dev/my_awesome_disk
2) mount --bind /dev/my_awesome_disk /var/run/libvirt/qemu/fedora.dev/my_awesome_disk

Later, when the new /dev is built and replaces original /dev the
file is going to live at expected location.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainAttachDeviceMknodHelper: Fail on unsupported file type
Michal Privoznik [Thu, 15 Jun 2017 13:50:39 +0000 (15:50 +0200)]
qemuDomainAttachDeviceMknodHelper: Fail on unsupported file type

Currently, we silently assume that file we are creating in the
namespace is either a link or a device (character or block one).
This is not always the case. Therefore instead of doing something
wrong, claim about unsupported file type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainCreateDeviceRecursive: Fail on unsupported file type
Michal Privoznik [Mon, 19 Jun 2017 08:56:20 +0000 (10:56 +0200)]
qemuDomainCreateDeviceRecursive: Fail on unsupported file type

Currently, we silently assume that file we are creating in the
namespace is either a link or a device (character or block one).
This is not always the case. Therefore instead of doing something
wrong, claim about unsupported file type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Move preserved mount points path generation into a separate function
Michal Privoznik [Thu, 15 Jun 2017 13:48:52 +0000 (15:48 +0200)]
qemu: Move preserved mount points path generation into a separate function

This function is going to be used on other places, so
instead of copying code we can just call the function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainBuildNamespace: Handle special file mount points
Michal Privoznik [Tue, 20 Jun 2017 15:35:54 +0000 (17:35 +0200)]
qemuDomainBuildNamespace: Handle special file mount points

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

In 290a00e41d I've tried to fix the process of building a
qemu namespace when dealing with file mount points. What I
haven't realized then is that we might be dealing not with just
regular files but also special files (like sockets). Indeed, try
the following:

1) socat unix-listen:/tmp/soket stdio
2) touch /dev/socket
3) mount --bind /tmp/socket /dev/socket
4) virsh start anyDomain

Problem with my previous approach is that I wasn't creating the
temporary location (where mount points under /dev are moved) for
anything but directories and regular files.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Rename and expose virDomainChrSourceDefPath
Michal Privoznik [Mon, 19 Jun 2017 14:43:25 +0000 (16:43 +0200)]
conf: Rename and expose virDomainChrSourceDefPath

It comes very handy to have source path for chardevs. We already
have such function: virDomainAuditChardevPath() but it's static
and has name not suitable for exposing. Moreover, while exposing
it change its name slightly to virDomainChrSourceDefGetPath.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: virjson: Reuse VIR_TEST_VERBOSE in testJSONCopy
Peter Krempa [Tue, 11 Jul 2017 12:40:05 +0000 (14:40 +0200)]
tests: virjson: Reuse VIR_TEST_VERBOSE in testJSONCopy

Use VIR_TEST_VERBOSE instead of calling virTestGetVerbose and
conditionally fprintf. Additionally remove redundant setting of 'ret' to
-1.

7 years agotests: Validate that JSON deflattening fixed nested json pseudo-protocol strings
Peter Krempa [Mon, 26 Jun 2017 17:42:06 +0000 (19:42 +0200)]
tests: Validate that JSON deflattening fixed nested json pseudo-protocol strings

Sheepdog and possibly others use nested objects for network server and
thus could be specified in a way that libvirt would not parse.

Validates that https://bugzilla.redhat.com/show_bug.cgi?id=1464821
is fixed properly.

7 years agoutil: storage: Always deflatten JSON pseudo-protocol objects
Peter Krempa [Tue, 11 Jul 2017 12:23:08 +0000 (14:23 +0200)]
util: storage: Always deflatten JSON pseudo-protocol objects

Now that the JSON deflattener is working sanely we can always attempt
the deflattening so that we can then parse the tree as expected.

7 years agoutil: json: Recursively deflatten objects virJSONValueObjectDeflatten
Peter Krempa [Mon, 26 Jun 2017 17:37:18 +0000 (19:37 +0200)]
util: json: Recursively deflatten objects virJSONValueObjectDeflatten

If a value of the first level object contains more objects needing
deflattening which would be wrapped in an actual object the function
would not recurse into them.

By this simple addition we can fully deflatten the objects.

7 years agoutil: json: Properly implement JSON deflattening
Peter Krempa [Tue, 27 Jun 2017 11:48:56 +0000 (13:48 +0200)]
util: json: Properly implement JSON deflattening

As it turns out sometimes users pass in an arbitrarily nested structure
e.g. for the qemu backing chains JSON pseudo protocol. This new
implementation deflattens now a single object fully even with nested
keys.

Additionally it's not necessary now to stick with the "file." prefix for
the properties.

7 years agotests: json: Add test for the deflattening function
Peter Krempa [Mon, 26 Jun 2017 16:02:35 +0000 (18:02 +0200)]
tests: json: Add test for the deflattening function

Add a few test cases to verify that the old behaviour does not break and
that new one behaves sanely.

7 years agoutil: json: Don't remove the 'file' subobject when deflattening
Peter Krempa [Mon, 26 Jun 2017 16:42:07 +0000 (18:42 +0200)]
util: json: Don't remove the 'file' subobject when deflattening

Currently the function would deflatten the object by dropping the 'file'
prefix from the attributes. This does not really scale well or adhere to
the documentation.

Until we refactor the worker to properly deflatten everything we at
least simulate it by adding the "file" wrapper object back.

7 years agoutil: Move JSON object deflattening code to json utility file
Peter Krempa [Mon, 26 Jun 2017 14:29:04 +0000 (16:29 +0200)]
util: Move JSON object deflattening code to json utility file

The code will become more universal so it makes more sense for it to
live with the rest of the JSON functions.

7 years agoutil: json: Add virJSONValueIsObject
Peter Krempa [Mon, 26 Jun 2017 09:32:35 +0000 (11:32 +0200)]
util: json: Add virJSONValueIsObject

Allows testing whether a virJSONValue is an object.

7 years agotests: Rename jsontest to virjsontest
Peter Krempa [Mon, 26 Jun 2017 14:47:26 +0000 (16:47 +0200)]
tests: Rename jsontest to virjsontest

7 years agolxc: add possibility to define init uid/gid
Cédric Bosdonnat [Tue, 6 Jun 2017 08:54:16 +0000 (10:54 +0200)]
lxc: add possibility to define init uid/gid

Users may want to run the init command of a container as a special
user / group. This is achieved by adding <inituser> and <initgroup>
elements. Note that the user can either provide a name or an ID to
specify the user / group to be used.

This commit also fixes a side effect of being able to run the command
as a non-root user: the user needs rights on the tty to allow shell
job control.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agolxc: allow user to specify command working directory
Cédric Bosdonnat [Wed, 31 May 2017 13:32:11 +0000 (15:32 +0200)]
lxc: allow user to specify command working directory

Some containers may want the application to run in a special directory.
Add <initdir> element in the domain configuration to handle this case
and use it in the lxc driver.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoutil: share code between virExec and virCommandExec
Cédric Bosdonnat [Wed, 31 May 2017 13:18:33 +0000 (15:18 +0200)]
util: share code between virExec and virCommandExec

virCommand is a version of virExec that doesn't fork, however it is
just calling execve and doesn't honors setting uid/gid and pwd.

This commit extrac those pieces from virExec() to a virExecCommon()
function that is called from both virExec() and virCommandExec().

7 years agolxc: allow defining environment variables
Cédric Bosdonnat [Tue, 30 May 2017 15:03:58 +0000 (17:03 +0200)]
lxc: allow defining environment variables

When running an application container, setting environment variables
could be important.

The newly introduced <initenv> tag in domain configuration will allow
setting environment variables to the init program.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agovirStream*All: Report error if a callback fails
Michal Privoznik [Thu, 1 Jun 2017 14:49:19 +0000 (16:49 +0200)]
virStream*All: Report error if a callback fails

All of these four functions (virStreamRecvAll, virStreamSendAll,
virStreamSparseRecvAll, virStreamSparseSendAll) take one or more
callback functions that handle various aspects of streams.
However, if any of them fails no error is reported therefore
caller does not know what went wrong.

At the same time, we silently presumed callbacks to set errno on
failure. With this change we should document it explicitly as the
error is not properly reported.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirStream*All: Preserve reported error
Michal Privoznik [Thu, 1 Jun 2017 06:40:10 +0000 (08:40 +0200)]
virStream*All: Preserve reported error

If one these four functions fail (virStreamRecvAll,
virStreamSendAll, virStreamSparseRecvAll, virStreamSparseSendAll)
the stream is aborted by calling virStreamAbort(). This is  a
public API; therefore, the first thing it does is error reset. At
that point any error that caused us to abort stream in the first
place is gone.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirStream*All: Call virStreamAbort() more frequently
Michal Privoznik [Thu, 1 Jun 2017 06:20:31 +0000 (08:20 +0200)]
virStream*All: Call virStreamAbort() more frequently

Our documentation to the virStreamRecvAll, virStreamSendAll,
virStreamSparseRecvAll, and virStreamSparseSendAll functions
indicates that if these functions fail, then virStreamAbort is
called. But that is not necessarily true. For instance all of
these functions allocate a buffer to work with. If the allocation
fails, no virStreamAbort() is called despite -1 being returned.
It's the same story with argument sanity checks and a lot of
other checks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agofdstream: Report error from the I/O thread
Michal Privoznik [Mon, 29 May 2017 14:29:36 +0000 (16:29 +0200)]
fdstream: Report error from the I/O thread

Problem with our error reporting is that the error object is a
thread local variable. That means if there's an error reported
within the I/O thread it gets logged and everything, but later
when the event loop aborts the stream it doesn't see the original
error. So we are left with some generic error. We can do better
if we copy the error message between the threads.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirfdstream: Check for thread error more frequently
Michal Privoznik [Mon, 29 May 2017 14:29:11 +0000 (16:29 +0200)]
virfdstream: Check for thread error more frequently

When the I/O thread quits (e.g. due to an I/O error, lseek()
error, whatever), any subsequent virFDStream API should return
error too. Moreover, when invoking stream event callback, we must
set the VIR_STREAM_EVENT_ERROR flag so that the callback knows
something bad happened.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Rename SupportsChardev to IsPlatformDevice
Cole Robinson [Mon, 26 Jun 2017 18:01:53 +0000 (14:01 -0400)]
qemu: Rename SupportsChardev to IsPlatformDevice

This is only used in qemu_command.c, so move it, and clarify that
it's really about identifying if the serial config is a platform
device or not.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: command: support -chardev for platform devices
Cole Robinson [Mon, 26 Jun 2017 18:01:52 +0000 (14:01 -0400)]
qemu: command: support -chardev for platform devices

Some qemu arch/machine types have built in platform devices that
are always implicitly available. For platform serial devices, the
current code assumes that only old style -serial config can be
used for these devices.

Apparently though since -chardev was introduced, we can use -chardev
in these cases, like this:

  -chardev pty,id=foo
  -serial chardev:foo

Since -chardev enables all sorts of modern features, use this method
for platform devices.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: caps: blacklist QEMU_CAPS_CHARDEV
Cole Robinson [Mon, 26 Jun 2017 17:13:00 +0000 (13:13 -0400)]
qemu: caps: blacklist QEMU_CAPS_CHARDEV

Every qemu version we support has QEMU_CAPS_CHARDEV, so stop
explicitly tracking it and blacklist it like we've done for many
other feature flags.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agotests: qemuxml2argv: Add some QEMU_CAPS_CHARDEV annotations
Cole Robinson [Mon, 26 Jun 2017 17:02:57 +0000 (13:02 -0400)]
tests: qemuxml2argv: Add some QEMU_CAPS_CHARDEV annotations

Several tests are intending to test some serial/console related
bits but aren't setting QEMU_CAPS_CHARDEV. This will soon be enabled
unconditionally so let's add it ahead of time.

* q35-virt-manager-basic: Intended to test a virt-manager q35 config,
    which will include a serial/console device
* console-compat*: console/serial XML compat handling
* bios: Needs a serial device for sgabios CLI

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agotests: qemuxml2argv: Drop old style serial testing
Cole Robinson [Mon, 26 Jun 2017 16:57:56 +0000 (12:57 -0400)]
tests: qemuxml2argv: Drop old style serial testing

These tests are exercising old style -serial command lines. That
code will soon be removed, so drop these tests.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agotests: qemuxml2argv: drop redundant serial testing
Cole Robinson [Mon, 26 Jun 2017 16:46:16 +0000 (12:46 -0400)]
tests: qemuxml2argv: drop redundant serial testing

Several cases have incidental <serial> or <console> XML which aren't
the features being tested for. Upcoming changes will cause some
churn here, so instead drop these bits now.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: command: always use -chardev for monitor config
Cole Robinson [Mon, 26 Jun 2017 14:40:39 +0000 (10:40 -0400)]
qemu: command: always use -chardev for monitor config

AFAIK there aren't any cases where we will/should hit the old code
path for our supported qemu versions, so drop the old code.

Massive test suite churn follows

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: command: Drop some QEMU_CAPS_CHARDEV checks
Cole Robinson [Mon, 26 Jun 2017 14:42:20 +0000 (10:42 -0400)]
qemu: command: Drop some QEMU_CAPS_CHARDEV checks

AFAIK there aren't any cases where we should fail these checks with
supported qemu versions, so just drop them.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: command: Remove old style -parallel building
Cole Robinson [Mon, 26 Jun 2017 14:26:28 +0000 (10:26 -0400)]
qemu: command: Remove old style -parallel building

AFAIK there aren't any qemu arch/machine types with platform parallel
devices that would require old style -parallel config, so we shouldn't
ever need this nowadays.

Remove a now redundant test

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agotests: qemuxml2argv: Add an aarch64 pci-serial test
Cole Robinson [Mon, 26 Jun 2017 16:10:49 +0000 (12:10 -0400)]
tests: qemuxml2argv: Add an aarch64 pci-serial test

This demonstrates that the previous qemu caps changes will use
-chardev for pci-serial on aarch64 machvirt

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: caps: Tweak arm conditional in SupportsChardev
Cole Robinson [Mon, 26 Jun 2017 15:41:30 +0000 (11:41 -0400)]
qemu: caps: Tweak arm conditional in SupportsChardev

Rather than try to whitelist all device configs that can't use
-chardev, blacklist the only one that really can't, which is the
default serial/console target type=isa case.

ISA specifically isn't a valid config for arm/aarch64, but we've
always implicitly treated it to mean 'default platform device'.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoUse unsigned timeout in cmdMigrateSetMaxDowntime
Scott Garfinkle [Tue, 27 Jun 2017 15:19:40 +0000 (10:19 -0500)]
Use unsigned timeout in cmdMigrateSetMaxDowntime

While looking to implement a migrate-getmaxdowntime command (coming),
I noticed that the setmaxdowntime is incorrectly looking at its
parameter as a signed longlong. Not sure how that got past gcc, but
here's a simple patch to make the command line parsing and the parameter to
the worker functions all have the correct (unsigned) type.

Signed-off-by: Scott Garfinkle <seg@us.ibm.com>
7 years agodocs: add entry for Ravada to apps page
Francesc Guasch [Thu, 6 Jul 2017 05:28:31 +0000 (07:28 +0200)]
docs: add entry for Ravada to apps page

7 years agodocs: Properly quote self uri in search.php
Martin Kletzander [Mon, 10 Jul 2017 09:47:49 +0000 (11:47 +0200)]
docs: Properly quote self uri in search.php

This removes the classical XSS vulnerability of using unquoted
PHP_SELF.

Reported-by: John Lightsey <john@nixnuts.net>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu: domain: Use vcpu 'node-id' property and pass it back to qemu
Peter Krempa [Tue, 27 Jun 2017 14:04:38 +0000 (16:04 +0200)]
qemu: domain: Use vcpu 'node-id' property and pass it back to qemu

vcpu properties gathered from query-hotpluggable cpus need to be passed
back to qemu. As qemu did not use the node-id property until now and
libvirt forgot to pass it back properly (it was parsed but not passed
around) we did not honor this.

This patch adds node-id to the structures where it was missing and
passes it around as necessary.

The test data was generated with a VM with following config:
    <numa>
      <cell id='0' cpus='0,2,4,6' memory='512000' unit='KiB'/>
      <cell id='1' cpus='1,3,5,7' memory='512000' unit='KiB'/>
    </numa>

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

7 years agoconfigure: fix typo in nss error message
Pino Toscano [Fri, 7 Jul 2017 15:37:29 +0000 (17:37 +0200)]
configure: fix typo in nss error message

This error message refers to the lack of network, not to yajl.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
7 years agotools: virsh: domdisplay command is not freeing the domain pointer
Julio Faracco [Fri, 7 Jul 2017 21:35:33 +0000 (18:35 -0300)]
tools: virsh: domdisplay command is not freeing the domain pointer

The command 'domdisplay' is not freeing the domain pointer properly in
cleanup section. See the error below:

virsh # domdisplay WINDOWS7
vnc://127.0.0.1:0

virsh # quit

error: One or more references were leaked after disconnect from the hypervisor

Valgrind report:

==29168== 66 (56 direct, 10 indirect) bytes in 1 blocks are definitely lost in loss record 154 of 239
==29168==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29168==    by 0x5505324: virAllocVar (viralloc.c:560)
==29168==    by 0x555A61B: virObjectNew (virobject.c:199)
==29168==    by 0x561F367: virGetDomain (datatypes.c:284)
==29168==    by 0x5680979: get_nonnull_domain (remote_driver.c:8143)
==29168==    by 0x5680979: remoteDomainLookupByName (remote_client_bodies.h:3047)
==29168==    by 0x5623D9A: virDomainLookupByName (libvirt-domain.c:425)
==29168==    by 0x160480: virshLookupDomainInternal (virsh-util.c:59)
==29168==    by 0x160547: virshCommandOptDomainBy (virsh-util.c:98)
==29168==    by 0x13D3A9: cmdDomDisplay (virsh-domain.c:10963)
==29168==    by 0x165680: vshCommandRun (vsh.c:1327)
==29168==    by 0x12E320: main (virsh.c:953)

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agotests: virstringtest: adding tests to virStrToDouble()
Julio Faracco [Sun, 9 Jul 2017 23:05:55 +0000 (20:05 -0300)]
tests: virstringtest: adding tests to virStrToDouble()

There are no occurrences of tests related to Strings and Double numbers
inside virstringtest.c. This commit introduces some tests to validate the
conversion. The test does not include locale changes yet.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agonews: Update news for new Hyper-V APIs
Sri Ramanujam [Tue, 27 Jun 2017 19:13:28 +0000 (15:13 -0400)]
news: Update news for new Hyper-V APIs

7 years agohyperv: Add support for virDomainSetMemory
Sri Ramanujam [Tue, 27 Jun 2017 19:13:27 +0000 (15:13 -0400)]
hyperv: Add support for virDomainSetMemory

Introduces support for virDomainSetMemory. This also serves an an
example for how to use the new method invocation API with a more
complicated method, this time including an EPR and embedded param.

7 years agohyperv: support virDomainSendKey
Sri Ramanujam [Tue, 27 Jun 2017 19:13:26 +0000 (15:13 -0400)]
hyperv: support virDomainSendKey

This commit adds support for virDomainSendKey. It also serves as an
example of how to use the new method invocation APIs with a single
"simple" type parameter.

7 years agohyperv: add hypervInvokeMethod
Sri Ramanujam [Tue, 27 Jun 2017 19:13:25 +0000 (15:13 -0400)]
hyperv: add hypervInvokeMethod

This commit adds support for invoking methods on remote objects
via hypervInvokeMethod.

7 years agohyperv: Generate object property type information
Sri Ramanujam [Tue, 27 Jun 2017 19:13:24 +0000 (15:13 -0400)]
hyperv: Generate object property type information

Update the generator to generate basic property type information for
each CIM object representation. Right now, it generates arrays of
hypervCimType structs:

struct _hypervCimType {
    const char *name;
    const char *type;
    bool isArray;
};

7 years agohyperv: Functions to work with invocation parameters
Sri Ramanujam [Tue, 27 Jun 2017 19:13:23 +0000 (15:13 -0400)]
hyperv: Functions to work with invocation parameters

This commit introduces functionality for creating and working with
invoke parameters. This commit does not include any code for serializing
and actually performing the method invocations; it merely defines the
functions and API for using invocation parameters in driver code.

HYPERV_DEFAULT_PARAM_COUNT was chosen because almost no method
invocations have more than 4 parameters.

Functions added:
* hypervInitInvokeParamsList
* hypervFreeInvokeParams
* hypervAddSimpleParam
* hypervAddEprParam
* hypervCreateEmbeddedParam
* hypervSetEmbeddedProperty
* hypervAddEmbeddedParam
* hypervFreeEmbeddedParam

7 years agoqemu: domain: Add missing newline to last element in status XML formatter
Peter Krempa [Fri, 7 Jul 2017 12:27:50 +0000 (14:27 +0200)]
qemu: domain: Add missing newline to last element in status XML formatter

Commit f9758109a7 did not put a newline after the element it added.

7 years agodocs: add entry to download table listing the Rust language binding
Daniel P. Berrange [Mon, 3 Jul 2017 15:57:36 +0000 (16:57 +0100)]
docs: add entry to download table listing the Rust language binding

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoImprove logging of shutdown inhibitor
Daniel P. Berrange [Fri, 23 Jun 2017 15:21:50 +0000 (16:21 +0100)]
Improve logging of shutdown inhibitor

The log category for virnetdaemon.c was mistakenly set
to rpc.netserver. Some useful info about the inhibitor
file descriptor was also never logged.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoFix conditional check for DBus
Daniel P. Berrange [Fri, 23 Jun 2017 15:20:11 +0000 (16:20 +0100)]
Fix conditional check for DBus

The DBus conditional was renamed way back:

  commit da77f04ed5fa0731d50b947be8c739bdbf8121ad
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Thu Sep 20 15:05:39 2012 +0100

    Convert HAVE_DBUS to WITH_DBUS

but the shutdown inhibit code was not updated. Thus libvirt
was never inhibiting shutdown by a logged in user when VMs
are running.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoPost-release version bump to 3.6.0
John Ferlan [Wed, 5 Jul 2017 10:34:08 +0000 (06:34 -0400)]
Post-release version bump to 3.6.0

7 years agoRelease of libvirt-3.5.0
Daniel Veillard [Tue, 4 Jul 2017 20:48:41 +0000 (22:48 +0200)]
Release of libvirt-3.5.0

* docs/news.xml: update
* po/*.po* : regenerated

7 years agolib: Remove misplaced and redundant comments
Peter Krempa [Fri, 12 May 2017 13:34:29 +0000 (15:34 +0200)]
lib: Remove misplaced and redundant comments

It's obvious that unsigned long long is 64 bit and also our web page
generator would misplace the comment after the return value due to the
way it's parsing them.

7 years agonews: CPU add migration fix into Bug fixes
Pavel Hrdina [Mon, 3 Jul 2017 14:28:00 +0000 (16:28 +0200)]
news: CPU add migration fix into Bug fixes

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agonews: Update for 3.5.0 release
Andrea Bolognani [Mon, 3 Jul 2017 12:15:32 +0000 (14:15 +0200)]
news: Update for 3.5.0 release

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agonews: Add CAT capability information into improvements
Martin Kletzander [Wed, 28 Jun 2017 07:50:20 +0000 (09:50 +0200)]
news: Add CAT capability information into improvements

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agonews: Add live coalesce settings to new features
Martin Kletzander [Wed, 28 Jun 2017 07:46:59 +0000 (09:46 +0200)]
news: Add live coalesce settings to new features

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agovz: nseclabels member is moved to virDomainChrSourceDef struct
Mikhail Feoktistov [Thu, 29 Jun 2017 10:17:36 +0000 (06:17 -0400)]
vz: nseclabels member is moved to virDomainChrSourceDef struct

7 years agovz: add argument xmlopt for virDomainDefCheckABIStability call
Mikhail Feoktistov [Thu, 29 Jun 2017 10:17:35 +0000 (06:17 -0400)]
vz: add argument xmlopt for virDomainDefCheckABIStability call

7 years agodocs: Document bhyve's vgaconf support
Roman Bogorodskiy [Wed, 28 Jun 2017 16:23:52 +0000 (20:23 +0400)]
docs: Document bhyve's vgaconf support

 - Add a news entry
 - Update driver's page with information about the new
   vgaconf attribute and provide usage example; while here,
   fix a grammar mistake

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agodocs: news: Add entries for my recent changes
Peter Krempa [Wed, 28 Jun 2017 07:22:57 +0000 (09:22 +0200)]
docs: news: Add entries for my recent changes

7 years agoutil: netdevbridge: Refactor error handling in virNetDevBridgeCreate
Peter Krempa [Wed, 28 Jun 2017 12:14:53 +0000 (14:14 +0200)]
util: netdevbridge: Refactor error handling in virNetDevBridgeCreate

Replace the switch statement with a simpler if statement. This also
removes the fallthrough path that coverity was complaining about.

7 years agohotplug: Create helper to remove vport
John Ferlan [Wed, 28 Jun 2017 10:56:47 +0000 (06:56 -0400)]
hotplug: Create helper to remove vport

Combine and "clean up" a bit two places that are removing the vport

7 years agonodedev: Add check for NULL obj before call Unlock
John Ferlan [Wed, 28 Jun 2017 10:54:05 +0000 (06:54 -0400)]
nodedev: Add check for NULL obj before call Unlock

Commit id '95ea171b' was a bit too aggressive in removing the if (obj)
check since cleanup is reachable after Unlock and obj = NULL.

7 years agoqemu: hotplug: Disallow modification of vcpu 0 in inactive config
Peter Krempa [Wed, 28 Jun 2017 08:42:49 +0000 (10:42 +0200)]
qemu: hotplug: Disallow modification of vcpu 0 in inactive config

vcpu 0 must be always enabled and non-hotpluggable, thus you can't
modify it using the vcpu hotplug APIs. Disallow it so that users can't
create invalid configurations.

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

7 years agoman: Fix documentation errors about the paths of the config files
Lily Zhu [Wed, 28 Jun 2017 06:00:48 +0000 (14:00 +0800)]
man: Fix documentation errors about the paths of the config files

The default conf files, for example libvirtd.conf, virtlockd.conf, and
virtlogd.conf, should be located under the directory "/etc/libvirt" when
root as root, rather than "/etc". When run as non-root, the configuration
files should be located under "$XDG_CONFIG_HOME/libvirt/", rather than
"XDG_CONFIG_HOME".

Signed-off-by: Lily Zhu <lizhu@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agodocs: Add callback-related info to virStream{Abort,Finish}
Martin Kletzander [Tue, 20 Jun 2017 13:36:48 +0000 (15:36 +0200)]
docs: Add callback-related info to virStream{Abort,Finish}

When one has a non-blocking stream and aborts or finishes it without
removing the callback, any event loop invocation will trigger that
callback, but it cannot be removed any more.  We cannot remove the
callback automatically from virStream{Abort,Finish} functions due to
forward-compatibility.  So let's at least document this behaviour,
because it is not easy to find out the reason for.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agovirsh: Fix --help problem for domxml-to-native DOMAIN COMMAND
Daniel Liu [Tue, 27 Jun 2017 15:54:50 +0000 (11:54 -0400)]
virsh: Fix --help problem for domxml-to-native DOMAIN COMMAND

Resolves a bug in domxml-to-native command option, so that the
following command displays the help information correctly:
'virsh domxml-to-native --help'.

Signed-off-by: Daniel Liu <srwx4096@gmail.com>
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agobhyve: add vga configuration for video driver
Roman Bogorodskiy [Tue, 9 May 2017 10:48:30 +0000 (14:48 +0400)]
bhyve: add vga configuration for video driver

Add support for vgaconf driver configuration. In domain xml it looks like
this:

  <video>
    <driver vgaconf='io|on|off'>
    <model .../>
  </video>

It was added with bhyve gop video in mind to allow users control how the
video device is exposed to the guest, specifically, how VGA I/O is
handled.

One can refer to the bhyve manual page to get more detailed description
of the possible VGA configuration options:

https://www.freebsd.org/cgi/man.cgi?query=bhyve&manpath=FreeBSD+12-current

The relevant part could be found using the 'vgaconf' keyword.

Also, add some tests for this new feature.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoRevert "qemu: Support chardevs with ARM virt machines"
Cole Robinson [Mon, 26 Jun 2017 14:48:33 +0000 (10:48 -0400)]
Revert "qemu: Support chardevs with ARM virt machines"

This reverts commit 70c9b44270f75bfb7a5701d81aa49380d139e8f0.

This commit breaks existing aarch64 machvirt configs with:

    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

Which fails with:

error: Failed to start domain fedora25-aarch64
error: internal error: process exited while connecting to monitor:
2017-06-26T13:55:34.726293Z qemu-system-aarch64: -chardev pty,id=charserial0:
char device redirected to /dev/pts/5 (label charserial0)
2017-06-26T13:55:34.782121Z qemu-system-aarch64: -device
isa-serial,chardev=charserial0,id=serial0: No 'ISA' bus found for device
'isa-serial'

7 years agoconf: Copy loadparm in virDomainDeviceInfoCopy()
Andrea Bolognani [Mon, 26 Jun 2017 17:13:28 +0000 (19:13 +0200)]
conf: Copy loadparm in virDomainDeviceInfoCopy()

Commit 54fa1b44afc8 added virDomainDeviceInfo::loadparm
and updated virDomainDeviceInfoClear() accordingly, but
omitted the necessary virDomainDeviceInfoCopy() changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoHACKING: Drop from the git repository
Andrea Bolognani [Mon, 26 Jun 2017 06:45:44 +0000 (08:45 +0200)]
HACKING: Drop from the git repository

Despite being a generated file, HACKING has been tracked in
the git repository along with actual source files. As far as
I'm aware, it's the only generated file for which that happens.

Times and times again, people[1] have committed changes to
the source file without refreshing the generated copy at the
same time.

The rationale for tracking the generated file is to help out
people who just cloned the git repository looking to contribue;
however, README-hacking already contains enough information to
get perspective contributors to a place where they can simply
look at docs/hacking.html instead.

[1] Mostly me, to be honest

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoREADME: Remove 'git send-email' mention
Andrea Bolognani [Mon, 26 Jun 2017 08:48:20 +0000 (10:48 +0200)]
README: Remove 'git send-email' mention

The use of 'git send-email' is described in detail in the
contributor guidelines (docs/hacking.html), which are
mentioned in docs/contribute.html, the non-local version
of which is in turn mentioned in README.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoREADME: Various minor style tweaks
Andrea Bolognani [Mon, 26 Jun 2017 09:01:03 +0000 (11:01 +0200)]
README: Various minor style tweaks

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agodocs: Point to hacking.html from contribute.html
Andrea Bolognani [Mon, 26 Jun 2017 08:39:02 +0000 (10:39 +0200)]
docs: Point to hacking.html from contribute.html

People looking to help out should really go through the
contributor guidelines when getting started, so the more
documents point to them the better.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Avoid fd leak on incoming tunneled migration
Jiri Denemark [Mon, 19 Jun 2017 15:00:28 +0000 (17:00 +0200)]
qemu: Avoid fd leak on incoming tunneled migration

While qemuProcessIncomingDefNew takes an fd argument and stores it in
qemuProcessIncomingDef structure, the caller is still responsible for
closing the file descriptor.

Introduced by commit v1.2.21-140-ge7c6f4575.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoREADME: Remove unnecessary empty line
Andrea Bolognani [Mon, 26 Jun 2017 08:14:38 +0000 (10:14 +0200)]
README: Remove unnecessary empty line

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoutil: Extract locale-related fixes into separate functions
Martin Kletzander [Thu, 22 Jun 2017 12:36:53 +0000 (14:36 +0200)]
util: Extract locale-related fixes into separate functions

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoHACKING: Refresh after changes to source file
Andrea Bolognani [Mon, 26 Jun 2017 06:34:56 +0000 (08:34 +0200)]
HACKING: Refresh after changes to source file

Commit 79c1900fc1eb changed docs/hacking.html.in, but *of
course* I forgot once again to update the text-only version
of the file at the same time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agohacking: Improve 'git send-email' documentation
Andrea Bolognani [Thu, 15 Jun 2017 03:25:31 +0000 (11:25 +0800)]
hacking: Improve 'git send-email' documentation

For the benefit of first time contributors, we point out that 'git
send-email' might have to be installed separately; however, we omit
the fact that some configuration will likely be needed before it
can successfully deliver patches to the mailing list.

Some minor tweaks to the existing contents are included as well.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuMonitorTextAddDrive: Fail on unrecognized disk format
Michal Privoznik [Thu, 15 Jun 2017 13:46:32 +0000 (15:46 +0200)]
qemuMonitorTextAddDrive: Fail on unrecognized disk format

Since qemu commit 3ef6c40ad0b it can fail if trying to hotplug a
disk that is not qcow2 despite us saying it is. We need to error
out in that case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoevents: Avoid double free possibility on remote call failure
John Ferlan [Wed, 14 Jun 2017 11:32:15 +0000 (07:32 -0400)]
events: Avoid double free possibility on remote call failure

If a remote call fails during event registration (more than likely from
a network failure or remote libvirtd restart timed just right), then when
calling the virObjectEventStateDeregisterID we don't want to call the
registered @freecb function because that breaks our contract that we
would only call it after succesfully returning.  If the @freecb routine
were called, it could result in a double free from properly coded
applications that free their opaque data on failure to register, as seen
in the following details:

    Program terminated with signal 6, Aborted.
    #0  0x00007fc45cba15d7 in raise
    #1  0x00007fc45cba2cc8 in abort
    #2  0x00007fc45cbe12f7 in __libc_message
    #3  0x00007fc45cbe86d3 in _int_free
    #4  0x00007fc45d8d292c in PyDict_Fini
    #5  0x00007fc45d94f46a in Py_Finalize
    #6  0x00007fc45d960735 in Py_Main
    #7  0x00007fc45cb8daf5 in __libc_start_main
    #8  0x0000000000400721 in _start

The double dereference of 'pyobj_cbData' is triggered in the following way:

    (1) libvirt_virConnectDomainEventRegisterAny is invoked.
    (2) the event is successfully added to the event callback list
        (virDomainEventStateRegisterClient in
        remoteConnectDomainEventRegisterAny returns 1 which means ok).
    (3) when function remoteConnectDomainEventRegisterAny is hit,
        network connection disconnected coincidently (or libvirtd is
        restarted) in the context of function 'call' then the connection
        is lost and the function 'call' failed, the branch
        virObjectEventStateDeregisterID is therefore taken.
    (4) 'pyobj_conn' is dereferenced the 1st time in
        libvirt_virConnectDomainEventFreeFunc.
    (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the
         2nd time in libvirt_virConnectDomainEventRegisterAny.
    (6) the double free error is triggered.

Resolve this by adding a @doFreeCb boolean in order to avoid calling the
freeCb in virObjectEventStateDeregisterID for any remote call failure in
a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls,
the passed value would be true indicating they should run the freecb if it
exists; whereas, it's false for the remote call failure path.

Patch based on the investigation and initial patch posted by
fangying <fangying1@huawei.com>.

7 years agoqemu: Support chardevs with ARM virt machines
Christoffer Dall [Wed, 7 Jun 2017 21:13:30 +0000 (23:13 +0200)]
qemu: Support chardevs with ARM virt machines

The function to check if -chardev is supported by QEMU was written a
long time ago, where adding chardevs did not make sense on the fixed ARM
platforms.  Since then, we now have a general purpose virt platform,
which should support plugging in any device over PCIe which is supported
in a similar fashion on x86.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agovirsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND
Daniel Liu [Fri, 2 Jun 2017 15:04:52 +0000 (11:04 -0400)]
virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND

The option allows someone to run domain-to-native on already existing
domain without the need of supplying their XML.  It is basically
wrapper around 'virsh dumpxml  | virsh domxml-to-native /dev/stdin'.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=835476
Signed-off-by: Daniel Liu <srwx4096@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Force reading of meta data to get encryption capacity value
John Ferlan [Thu, 15 Jun 2017 18:32:43 +0000 (14:32 -0400)]
util: Force reading of meta data to get encryption capacity value

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

As it turns out the volume create, build, and refresh path was not peeking
at the meta data, so immediately after a create operation the value displayed
for capacity was still incorrect. However, if a pool refresh was done the
correct value was fetched as a result of a meta data peek.

The reason is it seems historically if the file type is RAW then peeking
at the file just took the physical value for the capacity. However, since
we know if it's an encrypted file, then peeking at the meta data will be
required in order to get a true capacity value.

So check for encryption in the source and if present, use the meta data
in order to fill in the capacity value and set the payload_offset.

7 years agotests: hotplug: Test disks with duplicate WWNs
Peter Krempa [Fri, 23 Jun 2017 12:11:25 +0000 (14:11 +0200)]
tests: hotplug: Test disks with duplicate WWNs

7 years agoRevert "qemu: Check duplicate WWNs also for hotplugged disks"
Peter Krempa [Wed, 21 Jun 2017 09:44:59 +0000 (11:44 +0200)]
Revert "qemu: Check duplicate WWNs also for hotplugged disks"

Similarly to commit 5da28cc3069b573f54f0bcaf8eb75476bcfdc6e9 this check
actually does not make sense since duplicate WWNs are used e.g. when
multipathing disks.

This reverts commit 780fe4e4baf7e2f10f65ba1a34f9274fc547cad2.

7 years agovirNetDevOpenvswitchInterfaceStats: Be more forgiving when fetching stats
Michal Privoznik [Wed, 14 Jun 2017 13:23:29 +0000 (15:23 +0200)]
virNetDevOpenvswitchInterfaceStats: Be more forgiving when fetching stats

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

When fetching stats for a vhost-user type of interface, we run
couple of ovs-vsctl commands and parse their output. However, not
all stats exist at all times, for instance "rx_dropped" or
"tx_errors" can be missing. Thing is, we ask for a bulk of
statistics and if one of them is missing an error is reported
instead of returning the rest. Since we ignore errors, we fail to
set statistics. Fix this by asking for each piece alone.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: Introduce virObjectGetLockableObj
John Ferlan [Wed, 29 Mar 2017 20:21:31 +0000 (16:21 -0400)]
util: Introduce virObjectGetLockableObj

Split out the object fetch in virObject{Lock|Unlock} into a helper

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Formatting cleanups to virobject API
John Ferlan [Tue, 28 Mar 2017 19:09:55 +0000 (15:09 -0400)]
util: Formatting cleanups to virobject API

Alter to use more recent formatting guidelines

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Move locale.h include from virutil to virstring
Martin Kletzander [Thu, 22 Jun 2017 11:34:38 +0000 (13:34 +0200)]
util: Move locale.h include from virutil to virstring

Commit 5c54d29aaeb7 forgot to do that when moving the only function
using it and it broke the build on some platforms.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agosecurity: Don't skip relabel for all chardevs
Michal Privoznik [Thu, 22 Jun 2017 11:51:58 +0000 (13:51 +0200)]
security: Don't skip relabel for all chardevs

Our commit e13e8808f9 was way too generic. Currently, virtlogd is
used only for chardevs type of file and nothing else. True, we
must not relabel the path in this case, but we have to in all
other cases. For instance, if you want to have a physical console
attached to your guest:

    <console type='dev'>
      <source path='/dev/ttyS0'/>
      <target type='virtio' port='1'/>
    </console>

Starting such domain fails because qemu doesn't have access to
/dev/ttyS0 because we haven't relabelled the path.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: fix locale problem with virStrToDouble().
Julio Faracco [Wed, 21 Jun 2017 17:08:29 +0000 (14:08 -0300)]
util: fix locale problem with virStrToDouble().

This commit fixes a locale problem with locales that use comma as a mantissa
separator. Example: 12.34 en_US = 12,34 pt_BR. Since strtod() is a non-safe
function, virStrToDouble() will have problems to parse double numbers from
kernel settings and other double numbers from static files (XMLs, JSONs, etc).

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

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agoutil: moving virDoubleToStr() from virutil to virstring.
Julio Faracco [Wed, 21 Jun 2017 17:08:28 +0000 (14:08 -0300)]
util: moving virDoubleToStr() from virutil to virstring.

The function virDoubleToStr() is defined in virutil.* and virStrToDouble() is
defined in virstring.*. Joining both functions into the same file makes more
sense.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agotests: virstoragetest: fix --without-yajl
Cole Robinson [Wed, 21 Jun 2017 12:55:58 +0000 (08:55 -0400)]
tests: virstoragetest: fix --without-yajl

Recently added JSON tests should be skipped if compiled --without-yajl

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