]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agotests: Mock IOMMU groups
Andrea Bolognani [Thu, 1 Jun 2017 16:48:52 +0000 (18:48 +0200)]
tests: Mock IOMMU groups

Later on we're going to need access to information about IOMMU
groups for host devices. Implement the support in virpcimock,
and start using that mock library in a few QEMU test cases.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agotests: Update qemumemlock data
Andrea Bolognani [Thu, 1 Jun 2017 16:51:06 +0000 (18:51 +0200)]
tests: Update qemumemlock data

Use 0001:01:00.0 instead of 0000:04:02.0 as the source address
for the host device. This doesn't change anything at the moment,
but it will make a difference later on.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Clean up qemuDomainAttachHostPCIDevice()
Andrea Bolognani [Mon, 5 Jun 2017 13:29:40 +0000 (15:29 +0200)]
qemu: Clean up qemuDomainAttachHostPCIDevice()

We use hostdev->info frequently enough that having
a shorter name for it makes the code more readable.
We will also be adding even more uses later on.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoconf: Tweak virDomainPCIAddressGetNextAddr() signature
Andrea Bolognani [Mon, 29 May 2017 12:05:54 +0000 (14:05 +0200)]
conf: Tweak virDomainPCIAddressGetNextAddr() signature

Move @function after @flags to match other functions in the
same module like virDomainPCIAddressReserveNextAddr().

Also move virDomainPCIAddressReserveNextAddr() closer to
virDomainPCIAddressReserveAddr() in the header file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoconf: Make virDomainPCIAddressFlagsCompatible() private
Andrea Bolognani [Thu, 8 Jun 2017 14:03:53 +0000 (16:03 +0200)]
conf: Make virDomainPCIAddressFlagsCompatible() private

There are no external users.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoconf: Make virDomainPCIAddressSetGrow() private
Andrea Bolognani [Fri, 26 May 2017 08:27:41 +0000 (10:27 +0200)]
conf: Make virDomainPCIAddressSetGrow() private

There are no external users.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoconf: Move virDomainPCIAddressBusIsFullyReserved()
Andrea Bolognani [Thu, 29 Jun 2017 14:13:02 +0000 (16:13 +0200)]
conf: Move virDomainPCIAddressBusIsFullyReserved()

This function was private to the QEMU driver and was,
accordingly, called qemuDomainPCIBusFullyReserved().

However the function is really not QEMU-specific at
all, so it makes sense to move it closer to the
virDomainPCIAddressBus struct it operates on.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoconf: Remove obsolete comment
Andrea Bolognani [Mon, 29 May 2017 13:19:25 +0000 (15:19 +0200)]
conf: Remove obsolete comment

The virDomainDeviceInfoIsSet() function no longer exists.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agonetwork: Perform some formatting cleanup in bridge_driver
John Ferlan [Tue, 9 May 2017 19:57:48 +0000 (15:57 -0400)]
network: Perform some formatting cleanup in bridge_driver

Modify code to have two spaces between functions, follow function more
recent function formatting w/r/t args per line and function return type
and name on separate lines.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Fix up formatting in network test API's
John Ferlan [Fri, 12 May 2017 11:45:37 +0000 (07:45 -0400)]
test: Fix up formatting in network test API's

Fix some spacing/formatting in the network test driver code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: block: rename and refactor qemuBuildGlusterDriveJSON
Peter Krempa [Fri, 7 Jul 2017 16:00:04 +0000 (18:00 +0200)]
qemu: block: rename and refactor qemuBuildGlusterDriveJSON

New name is qemuBlockStorageSourceGetGlusterProps and also hardcode the
protocol name rather than calling the ToString function, since this
function can't be made universal.

7 years agoqemu: block: refactor and rename qemuBuildGlusterDriveJSONHosts
Peter Krempa [Fri, 7 Jul 2017 15:55:04 +0000 (17:55 +0200)]
qemu: block: refactor and rename qemuBuildGlusterDriveJSONHosts

New name is qemuBlockStorageSourceBuildHostsJSONSocketAddress since it
formats the JSON object in accordance with qemu's SocketAddress type.

Since the new naming in qemu uses 'inet' instead of 'tcp' add a
compatibility layer for gluster which uses the old name.

7 years agoqemu: block: Refactor and rename qemuGetDriveSourceProps
Peter Krempa [Fri, 7 Jul 2017 15:37:42 +0000 (17:37 +0200)]
qemu: block: Refactor and rename qemuGetDriveSourceProps

Rename it to qemuBlockStorageSourceGetBackendProps and refactor it to
return the JSON object instead of filling a pointer since now it's
always expected to return data.

7 years agoqemu: Move qemuGetDriveSourceProps to qemu_block
Peter Krempa [Fri, 7 Jul 2017 14:29:01 +0000 (16:29 +0200)]
qemu: Move qemuGetDriveSourceProps to qemu_block

Pure code movement except for the tweaks necessary for cross-usage.

7 years agoqemu: command: Call qemuGetDriveSourceProps only if necessary
Peter Krempa [Fri, 7 Jul 2017 12:41:25 +0000 (14:41 +0200)]
qemu: command: Call qemuGetDriveSourceProps only if necessary

Add logic which will call qemuGetDriveSourceProps only in cases where we
need the JSON representation. This will allow qemuGetDriveSourceProps to
generate the JSON representation for all possible disk sources.

7 years agoqemu: command: Remove default port numbers for NBD and GLUSTER
Peter Krempa [Fri, 7 Jul 2017 14:11:56 +0000 (16:11 +0200)]
qemu: command: Remove default port numbers for NBD and GLUSTER

The command line generators for the protocols above hardcoded a default
port number. Since we now always assign it when parsing the source
definition, this ad-hoc code is not required any more.

7 years agoconf: Pre-fill default ports when parsing network disk sources
Peter Krempa [Mon, 10 Jul 2017 11:41:43 +0000 (13:41 +0200)]
conf: Pre-fill default ports when parsing network disk sources

Fill them in right away rather than having to figure out at runtime
whether they are necessary or not.

virStorageSourceNetworkDefaultPort does not need to be exported any
more.

7 years agoutil: storage: Fill in default ports for gluster and iscsi
Peter Krempa [Fri, 7 Jul 2017 13:26:22 +0000 (15:26 +0200)]
util: storage: Fill in default ports for gluster and iscsi

Our documentation provides them, so the helper should return them.

7 years agoutil: Extract helper to retrieve default port for network protocol
Peter Krempa [Fri, 7 Jul 2017 13:21:04 +0000 (15:21 +0200)]
util: Extract helper to retrieve default port for network protocol

Make the stuff hardcoded in qemu a global helper so that other parts of
the code can determine the default port too.

7 years agoqemu: command: Set port number only for TCP transport
Peter Krempa [Fri, 7 Jul 2017 13:29:07 +0000 (15:29 +0200)]
qemu: command: Set port number only for TCP transport

Setting port number for protocols using UNIX transport does not make
sense. Move the setter code to the appropriate block.

7 years agosecret: Rename variable in virSecretObjListAdd
John Ferlan [Wed, 31 May 2017 18:54:27 +0000 (14:54 -0400)]
secret: Rename variable in virSecretObjListAdd

Rename @def to @objdef - it'll make future patches easier.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agosecret: Alter FindByUUID to expect the formatted uuidstr
John Ferlan [Fri, 21 Apr 2017 15:43:37 +0000 (11:43 -0400)]
secret: Alter FindByUUID to expect the formatted uuidstr

Since we're storing a virUUIDFormat'd string in our Hash Table, let's
modify the Lookup API to receive a formatted string as well.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agosecret: Whitespace modification for secret_driver
John Ferlan [Wed, 26 Apr 2017 13:33:22 +0000 (09:33 -0400)]
secret: Whitespace modification for secret_driver

Ensure two empty lines between functions.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoRevert "Prevent more compiler optimization of mockable functions"
Daniel P. Berrange [Wed, 12 Jul 2017 10:07:17 +0000 (11:07 +0100)]
Revert "Prevent more compiler optimization of mockable functions"

This reverts commit e4b980c853d2114b25fa805a84ea288384416221.

When a binary links against a .a archive (as opposed to a shared library),
any symbols which are marked as 'weak' get silently dropped. As a result
when the binary later runs, those 'weak' functions have an address of
0x0 and thus crash when run.

This happened with virtlogd and virtlockd because they don't link to
libvirt.so, but instead just libvirt_util.a and libvirt_rpc.a. The
virRandomBits symbols was weak and so left out of the virtlogd &
virtlockd binaries, despite being required by virHashTable functions.

Various other binaries like libvirt_lxc, libvirt_iohelper, etc also
link directly to .a files instead of libvirt.so, so are potentially
at risk of dropping symbols leading to a later runtime crash.

This is normal linker behaviour because a weak symbol is not treated
as undefined, so nothing forces it to be pulled in from the .a You
have to force the linker to pull in weak symbols using -u$SYMNAME
which is not a practical approach.

This risk is silent bad linkage that affects runtime behaviour is
not acceptable for a fix that was merely trying to fix the test
suite. So stop using __weak__ again.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRevert "internal: don't use weak symbols for Win32 platform"
Daniel P. Berrange [Wed, 12 Jul 2017 10:07:05 +0000 (11:07 +0100)]
Revert "internal: don't use weak symbols for Win32 platform"

This reverts commit b9473d8b11d79c8990dcbba13bbf7d4051288a1e.

7 years agoutil: Don't leak linksrc in vircgroup
Martin Kletzander [Tue, 11 Jul 2017 08:46:52 +0000 (10:46 +0200)]
util: Don't leak linksrc in vircgroup

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agotests: add virjsondata to EXTRA_DIST
Daniel P. Berrange [Thu, 13 Jul 2017 09:46:38 +0000 (10:46 +0100)]
tests: add virjsondata to EXTRA_DIST

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: Update host-model CPUs on reconnect
Jiri Denemark [Tue, 11 Jul 2017 12:16:40 +0000 (14:16 +0200)]
qemu: Update host-model CPUs on reconnect

When libvirt starts a new QEMU domain, it replaces host-model CPUs with
the appropriate custom CPU definition. However, when reconnecting to a
domain started by older libvirt (< 2.3), the domain would still have a
host-model CPU in its active definition.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Move qemuProcessReconnect to the end of qemu_process.c
Jiri Denemark [Tue, 11 Jul 2017 13:53:58 +0000 (15:53 +0200)]
qemu: Move qemuProcessReconnect to the end of qemu_process.c

qemuProcessReconnect will need to call additional functions which were
originally defined further in qemu_process.c.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Export virQEMUCapsGuestIsNative
Jiri Denemark [Tue, 11 Jul 2017 13:15:01 +0000 (15:15 +0200)]
qemu: Export virQEMUCapsGuestIsNative

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemuProcessUpdateLiveGuestCPU
Jiri Denemark [Tue, 11 Jul 2017 11:51:17 +0000 (13:51 +0200)]
qemu: Add qemuProcessUpdateLiveGuestCPU

Separated from qemuProcessUpdateAndVerifyCPU to handle updating of an
active guest CPU definition according to live data from QEMU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Rename qemuProcessUpdateLiveGuestCPU
Jiri Denemark [Tue, 11 Jul 2017 11:30:09 +0000 (13:30 +0200)]
qemu: Rename qemuProcessUpdateLiveGuestCPU

In addition to updating a guest CPU definition the function verifies
that all required features are provided to the guest. Let's make it
obvious by calling it qemuProcessUpdateAndVerifyCPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemuProcessVerifyCPU
Jiri Denemark [Tue, 11 Jul 2017 11:26:12 +0000 (13:26 +0200)]
qemu: Add qemuProcessVerifyCPU

Separated from qemuProcessUpdateLiveGuestCPU. The function makes sure
a guest CPU provides all features required by a domain definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemuProcessFetchGuestCPU
Jiri Denemark [Tue, 11 Jul 2017 11:18:45 +0000 (13:18 +0200)]
qemu: Add qemuProcessFetchGuestCPU

Separated from qemuProcessUpdateLiveGuestCPU. Its purpose is to fetch
guest CPU data from a running QEMU process. The data can later be used
to verify and update the active guest CPU definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agocpu_x86: Properly disable unknown CPU features
Jiri Denemark [Mon, 19 Jun 2017 11:18:52 +0000 (13:18 +0200)]
cpu_x86: Properly disable unknown CPU features

CPU features unknown to a hypervisor will not be present in dataDisabled
even though the features won't naturally be enabled because.
Thus any features we asked for which are not in dataEnabled should be
considered disabled.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: Don't update CPU when checking ABI stability
Jiri Denemark [Tue, 27 Jun 2017 13:06:10 +0000 (15:06 +0200)]
qemu: Don't update CPU when checking ABI stability

When checking ABI stability between two domain definitions, we first
make migratable copies of them. However, we also asked for the guest CPU
to be updated, even though the updated CPU is supposed to be already
included in the original definitions. Moreover, if we do this on the
destination host during migration, we're potentially updating the
definition with according to an incompatible host CPU.

While updating the CPU when checking ABI stability doesn't make any
sense, it actually just worked because updating the CPU doesn't do
anything for custom CPUs (only host-model CPUs are affected) and we
updated both definitions in the same way.

Less then a year ago commit v2.3.0-rc1~42 stopped updating the CPU in
the definition we got internally and only the user supplied definition
was updated. However, the same commit started updating host-model CPUs
to custom CPUs which are not affected by the request to update the CPU.
So it still seemed to work right, unless a user upgraded libvirt 2.2.0
to a newer version while there were some domains with host-model CPUs
running on the host. Such domains couldn't be migrated with a user
supplied XML since libvirt would complain:

    Target CPU mode custom does not match source host-model

The fix is pretty straightforward, we just need to stop updating the CPU
when checking ABI stability.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAvoid hidden cgroup mount points
Juan Hernandez [Thu, 6 Jul 2017 15:03:31 +0000 (17:03 +0200)]
Avoid hidden cgroup mount points

Currently the scan of the /proc/mounts file used to find cgroup mount
points doesn't take into account that mount points may hidden by other
mount points. For, example in certain Kubernetes environments the
/proc/mounts contains the following lines:

  cgroup /sys/fs/cgroup/net_prio,net_cls cgroup ...
  tmpfs /sys/fs/cgroup tmpfs ...
  cgroup /sys/fs/cgroup/net_cls,net_prio cgroup ...

In this particular environment the first mount point is hidden by the
second one. The correct mount point is the third one, but libvirt will
never process it because it only checks the first mount point for each
controller (net_cls in this case). So libvirt will try to use the first
mount point, which doesn't actually exist, and the complete detection
process will fail.

To avoid that issue this patch changes the virCgroupDetectMountsFromFile
function so that when there are duplicates it takes the information from
the last line in /proc/mounts. This requires removing the previous
explicit condition to skip duplicates, and adding code to free the
memory used by the processing of duplicated lines.

Related-To: https://bugzilla.redhat.com/1468214
Related-To: https://github.com/kubevirt/libvirt/issues/4
Signed-off-by: Juan Hernandez <jhernand@redhat.com>
7 years agonews: qemu platform serial devices now use -chardev
Cole Robinson [Mon, 10 Jul 2017 21:36:11 +0000 (17:36 -0400)]
news: qemu platform serial devices now use -chardev

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemu: process: Remove unused qemuCaps
Cole Robinson [Mon, 10 Jul 2017 21:30:03 +0000 (17:30 -0400)]
qemu: process: Remove unused qemuCaps

After 426dc5eb2 qemuCaps and virDomainDefPtr are unused here,
remove it from the call stack

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
7 years agoqemuDomainGetPreservedMountPath: rename @mount
Michal Privoznik [Wed, 12 Jul 2017 08:01:25 +0000 (10:01 +0200)]
qemuDomainGetPreservedMountPath: rename @mount

Obviously, old gcc-s ale sad when a variable shares the name with
a function. And we do have such variable (added in 4d8a914be0):
@mount. Rename it to @mountpoint so that compiler's happy again.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Provide non-linux stub for qemuDomainAttachDeviceMknodRecursive
Michal Privoznik [Tue, 11 Jul 2017 16:00:08 +0000 (18:00 +0200)]
qemu: Provide non-linux stub for qemuDomainAttachDeviceMknodRecursive

The way we create devices under /dev is highly linux specific.
For instance we do mknod(), mount(), umount(), etc. Some
platforms are even missing some of these functions. Then again,
as declared in qemuDomainNamespaceAvailable(): namespaces are
linux only. Therefore, to avoid obfuscating the code by trying to
make it compile on weird platforms, just provide a non-linux stub
for qemuDomainAttachDeviceMknodRecursive(). At the same time,
qemuDomainAttachDeviceMknodHelper() which actually calls the
non-existent functions is moved under ifdef __linux__ block since
its only caller is in that block too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: Fix qemuDomainGetBlockInfo allocation value setting
John Ferlan [Thu, 6 Jul 2017 18:08:38 +0000 (14:08 -0400)]
qemu: Fix qemuDomainGetBlockInfo allocation value setting

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

Commit id 'b9b1aa639' was supposed to add logic to set the allocation
for sparse files when wr_highest_offset was zero; however, an unconditional
setting was done just prior. For block devices, this means allocation is
always returning 0 since 'actual-size' will be zero.

Remove the unconditional setting and add the note about it being possible
to still be zero for block devices. As soon as the guest starts writing to
the volume, the allocation value will then be obtainable from qemu via
the wr_highest_offset.

7 years agoqemu: Support only raw volumes in qemuDomainBlockPeek
Peter Krempa [Fri, 12 May 2017 14:00:27 +0000 (16:00 +0200)]
qemu: Support only raw volumes in qemuDomainBlockPeek

The API documents that it peeks into the VM disk. We can't do that
currently for non raw images so report an error.

7 years agoqemu: Use storage driver APIs in qemuDomainBlockPeek
Peter Krempa [Fri, 12 May 2017 13:33:33 +0000 (15:33 +0200)]
qemu: Use storage driver APIs in qemuDomainBlockPeek

Refactor the access to storage driver usage along with
qemuDomainStorageFileInit which ensures that we access the file with
correct DAC uid/gid.

7 years agostorage: Make virStorageFileReadHeader more universal
Peter Krempa [Fri, 12 May 2017 11:57:25 +0000 (13:57 +0200)]
storage: Make virStorageFileReadHeader more universal

Allow specifying offset to read an arbitrary position in the file. This
warrants a rename to virStorageFileRead.

7 years agostorage: Split out virStorageSource accessors to separate file
Peter Krempa [Wed, 21 Jun 2017 11:18:53 +0000 (13:18 +0200)]
storage: Split out virStorageSource accessors to separate file

The helper methods for actually accessing the storage objects don't
really belong to the main storage driver implementation file. Split them
out.

7 years agotests: storage: Fully register storage driver
Peter Krempa [Thu, 11 May 2017 14:50:04 +0000 (16:50 +0200)]
tests: storage: Fully register storage driver

Use the full storage driver registration method that also fails if one
of the storage backends is not present. This makes the test fail if a
submodule fails registration, which is useful for testing.

Additionally return EXIT_FAILURE as usual in tests rather than -1.

7 years agointernal: don't use weak symbols for Win32 platform
Daniel P. Berrange [Tue, 11 Jul 2017 14:24:06 +0000 (15:24 +0100)]
internal: don't use weak symbols for Win32 platform

The Win32 platform will fail to link if you use weak symbols
because it is incompatible with exporting symbols in a DLL:

Cannot export virRandomGenerateWWN: symbol wrong type (2 vs 3)

We only need weak symbols for our test suite to do LD_PRELOAD
and this doesn't work on Win32, so we can just drop the hack
for Win32

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: improve error message for bounds check
Daniel P. Berrange [Thu, 11 May 2017 10:20:59 +0000 (11:20 +0100)]
rpc: improve error message for bounds check

If we exceed a fixed limit in RPC code we get a horrible message
like this, if the parameter type is a 'string', because we forgot
to initialize the error message type field:

  $ virsh snapshot-list ostack1
  error: too many remote undefineds: 1329 > 1024

It would also be useful to know which RPC call and field was
exceeded. So this patch makes us report:

  $ virsh snapshot-list ostack1
  error: too many remote undefineds: 1329 > 1024,
  in parameter 'names' for 'virDomainSnapshotListNames'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: handle missing bind host/service on chardev hotplug
Ján Tomko [Fri, 19 May 2017 10:56:48 +0000 (12:56 +0200)]
qemu: handle missing bind host/service on chardev hotplug

On domain startup, bind host or bind service can be omitted
and we will format a working command line.

Extend this to hotplug as well and specify the service to QEMU
even if the host is missing.

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

7 years agoqemuDomainSetInterfaceParameters: use the temporary params variable
Ján Tomko [Fri, 26 May 2017 06:30:40 +0000 (08:30 +0200)]
qemuDomainSetInterfaceParameters: use the temporary params variable

We have a temporary pointer to the currently processed parameter.
Use it to save three bytes per use.

7 years agoqemuDomainSetSchedulerParametersFlags: use the value_ul variable
Ján Tomko [Fri, 26 May 2017 06:30:35 +0000 (08:30 +0200)]
qemuDomainSetSchedulerParametersFlags: use the value_ul variable

We assign the unsigned long value of the currently processed
parameter to a temporary value_ul variable. Use it consistently
in all cases.

7 years agoPrevent more compiler optimization of mockable functions
Daniel P. Berrange [Wed, 5 Jul 2017 10:46:28 +0000 (11:46 +0100)]
Prevent more compiler optimization of mockable functions

Currently all mockable functions are annotated with the 'noinline'
attribute. This is insufficient to guarantee that a function can
be reliably mocked with an LD_PRELOAD. The C language spec allows
the compiler to assume there is only a single implementation of
each function. It can thus do things like propagating constant
return values into the caller at compile time, or creating
multiple specialized copies of the function body each optimized
for a different caller. To prevent these optimizations we must
also set the 'noclone' and 'weak' attributes.

This fixes the test suite when libvirt.so is built with CLang
with optimization enabled.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRemove incorrectly used TODO macro
Daniel P. Berrange [Wed, 5 Jul 2017 10:24:48 +0000 (11:24 +0100)]
Remove incorrectly used TODO macro

The TODO macro expands to an fprintf() call and is used in several
places in the Xen driver. Anything that wishes to print such debug
messages should use the logging macros. In this case though, all the
places in the Xen driver should have been raising a formal libvirt
error instead. Add proper error handling and delete the TODO macro
to prevent future misuse.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRemove network constants out of internal.h
Daniel P. Berrange [Wed, 5 Jul 2017 10:19:43 +0000 (11:19 +0100)]
Remove network constants out of internal.h

The HOST_NAME_MAX, INET_ADDRSTRLEN and VIR_LOOPBACK_IPV4_ADDR
constants are only used by a handful of files, so are better
kept in virsocketaddr.h or the source file that uses them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRequire use of GCC 4.4 or CLang compilers
Daniel P. Berrange [Wed, 5 Jul 2017 09:35:32 +0000 (10:35 +0100)]
Require use of GCC 4.4 or CLang compilers

We only ever test libvirt with GCC or CLang which provides a
GCC compatible compilation environment. Between them, these
compilers cover every important operating system platform,
even Windows.

Mandate their use to make it explicit that we don't care about
compilers like Microsoft VCC or other UNIX vendor C compilers.

GCC 4.4 was picked as the baseline, since RHEL-6 ships 4.4.7
and that lets us remove a large set of checks. There is a slight
issue that CLang reports itself as GCC 4.2, so we must also check
if __clang__ is defined. We could check a particular CLang version
too, but that would require someone to figure out a suitable min
version which is fun because OS-X reports totally different CLang
version numbers from CLang builds on Linux/BSD

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRemove duplicate define of __GNUC_PREREQ
Daniel P. Berrange [Wed, 5 Jul 2017 09:59:53 +0000 (10:59 +0100)]
Remove duplicate define of __GNUC_PREREQ

Back in this commit:

  commit b436a8ae5ccb04f8cf893d882d52ab5efc713307
  Author: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
  Date:   Thu Jun 9 00:50:35 2016 +0000

    gnulib: add getopt module

config-post.h was modified to define __GNUC_PREREQ, but the
original definition was never removed from internal.h, and
that is now dead code since config.h is always the first file
included.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
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>