]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoAdjust backslash alignment syntax-check
Martin Kletzander [Wed, 22 Nov 2017 10:27:16 +0000 (11:27 +0100)]
Adjust backslash alignment syntax-check

We have a check for backslash alignment that checks for two blanks preceding a
backslash.  However there can be alignment done using a tabulator and in some
cases one might be enough.  There are none currently, but I found out that was
the case before. at some point.  so let's check for \t preceding the final
backslash as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Fix leak in virStringTrimOptionalNewline
Martin Kletzander [Wed, 22 Nov 2017 20:52:17 +0000 (21:52 +0100)]
util: Fix leak in virStringTrimOptionalNewline

Do not access any data if strlen() == 0.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu: command: Anotate formatting of the frontend attributes with -drive
Peter Krempa [Mon, 20 Nov 2017 16:41:55 +0000 (17:41 +0100)]
qemu: command: Anotate formatting of the frontend attributes with -drive

Explain that certain attributes formatted with -drive are in fact
attributes of the drive itself and not the storage backing it.

7 years agoqemu: command: Move formatting of disk io error policy from -drive
Peter Krempa [Mon, 20 Nov 2017 15:19:47 +0000 (16:19 +0100)]
qemu: command: Move formatting of disk io error policy from -drive

That's a disk frontend attribute. Move the code to a separate function
since it's non-trivial and call it from the frontend attribute
formatter.

7 years agoqemu: command: Move disk trhottling argument building into a separate function
Peter Krempa [Mon, 20 Nov 2017 13:59:29 +0000 (14:59 +0100)]
qemu: command: Move disk trhottling argument building into a separate function

Isolate it from the other code.

7 years agoqemu: command: Refactor logic when formatting -drive
Peter Krempa [Tue, 14 Nov 2017 13:13:01 +0000 (14:13 +0100)]
qemu: command: Refactor logic when formatting -drive

Move all logic depending on whether we are solely formatting -drive (no
-device along with it) into one block.

7 years agoqemu: command: Move around order of generating -drive arguments
Peter Krempa [Wed, 22 Nov 2017 09:36:30 +0000 (10:36 +0100)]
qemu: command: Move around order of generating -drive arguments

Move together sections which are conditionaly executed depending on
whether -device will be used together with the -drive.

7 years agoqemu: command: Move disk 'serial' into frontend parameter formatter
Peter Krempa [Tue, 14 Nov 2017 12:50:52 +0000 (13:50 +0100)]
qemu: command: Move disk 'serial' into frontend parameter formatter

Disk serial is not a property of the image but of the disk frontend.
Account for this appropriately.

7 years agotests: qemuxml2argv: Test SD card with serial number
Peter Krempa [Mon, 20 Nov 2017 11:16:53 +0000 (12:16 +0100)]
tests: qemuxml2argv: Test SD card with serial number

7 years agotests: qemuxml2xml: Run the 'disk-serial' test
Peter Krempa [Mon, 20 Nov 2017 11:14:08 +0000 (12:14 +0100)]
tests: qemuxml2xml: Run the 'disk-serial' test

7 years agoqemu: command: Split out geometry frontend attribute formatting from -drive
Peter Krempa [Wed, 1 Nov 2017 15:31:55 +0000 (16:31 +0100)]
qemu: command: Split out geometry frontend attribute formatting from -drive

Historically we've formatted a lot of the attributes of a disk (disk
geometry, etc) with -drive. Since we use -device now, they should be
formatted there. Extract them to a separate function for keeping
compatibility with SDcards which still use only -drive.

Start this by moving the geometry into a separate function.

7 years agoqemu: domain: Don't call namespace setup for storage already accessed by vm
Peter Krempa [Wed, 22 Nov 2017 15:42:53 +0000 (16:42 +0100)]
qemu: domain: Don't call namespace setup for storage already accessed by vm

When doing block commit we need to allow write for members of the
backing chain so that we can commit the data into them.

qemuDomainDiskChainElementPrepare was used for this which since commit
786d8d91b4 calls qemuDomainNamespaceSetupDisk which has very adverse
side-effects, namely it relabels the nodes to the same label it has in
the main namespace. This was messing up permissions for the commit
operation since its touching various parts of a single backing chain.

Since we are are actually not introducing new images at that point add a
flag for qemuDomainDiskChainElementPrepare which will refrain from
calling to the namespace setup function.

Calls from qemuDomainSnapshotCreateSingleDiskActive and
qemuDomainBlockCopyCommon do introduce new members all calls from
qemuDomainBlockCommit do not, so the calls are anotated accordingly.

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

7 years agovirsh: domifstat: enhance the command's help output
ZhiPeng Lu [Sat, 18 Nov 2017 07:21:57 +0000 (15:21 +0800)]
virsh: domifstat: enhance the command's help output

According to the man page <interface-device> can be specified either by
name or MAC address, adjust the command's help accordingly.

Signed-off-by:ZhiPeng Lu <lu.zhipeng@zte.com.cn>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agobuild: Fix make dist
Martin Kletzander [Tue, 21 Nov 2017 15:38:35 +0000 (16:38 +0100)]
build: Fix make dist

Since we don't pack symlinks we cannot have recursive loops in them.  Since we
need one directory to be in tests/vircaps2xmldata/linux-caches/, instead of
creating a symlink, just move the files in that directory and adjust tests.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agotools: Enable warnings for more binaries/libs
Michal Privoznik [Thu, 16 Nov 2017 13:35:12 +0000 (14:35 +0100)]
tools: Enable warnings for more binaries/libs

Because WARN_CFLAGS and COVERAGE_CFLAGS are not set globally, we
rely on each binary built to include WARN_CFLAGS/COVERAGE_CFLAGS.
But it is easy to forget those - e.g. libvirt_shell.la. However,
don't enable WARN_FLAGS (i.e. don't include AM_CFLAGS) for
wireshark plugin - parts of that code are generated and trigger
some warnings.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agotools: Set CFLAGS for wireshark properly
Michal Privoznik [Thu, 16 Nov 2017 13:34:31 +0000 (14:34 +0100)]
tools: Set CFLAGS for wireshark properly

We want to set CFLAGS not CPPFLAGS.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agovsh: Make self-test more robust
Michal Privoznik [Thu, 16 Nov 2017 12:38:27 +0000 (13:38 +0100)]
vsh: Make self-test more robust

There are couple of limitations when it comes to option types and
flags for the options. For instance, VSH_OT_STRING cannot have
VSH_OFLAG_REQ set (commit c7543a728). For some reason this is
checked in vshCmddefHelp() but not in vshCmddefCheckInternals().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agotests: fix typo
Nikolay Shirokovskiy [Fri, 17 Nov 2017 13:17:38 +0000 (16:17 +0300)]
tests: fix typo

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemuBuildDeviceAddressStr: Prefer default alias for PCI bus
Michal Privoznik [Tue, 14 Nov 2017 16:19:58 +0000 (17:19 +0100)]
qemuBuildDeviceAddressStr: Prefer default alias for PCI bus

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

Just like in 9324f67a572f9b32 we need to put default pci-root
alias onto the command line instead of the one provided by user.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemuBuildDriveDevStr: Prefer default alias for SATA bus
Michal Privoznik [Wed, 15 Nov 2017 14:18:43 +0000 (15:18 +0100)]
qemuBuildDriveDevStr: Prefer default alias for SATA bus

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

Just like in 9324f67a572f9b32 we need to put default sata alias
(which is hardcoded to "ide", obvious, right?) onto the command
line instead of the one provided by user.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirQEMUCapsHasPCIMultiBus: Fix @def type
Michal Privoznik [Wed, 15 Nov 2017 14:17:39 +0000 (15:17 +0100)]
virQEMUCapsHasPCIMultiBus: Fix @def type

This function only queries domain @def. It doesn't change it.
Therefore it should take const pointer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoconf,qemu: Use type-aware switches where possible
Andrea Bolognani [Wed, 8 Nov 2017 14:55:16 +0000 (15:55 +0100)]
conf,qemu: Use type-aware switches where possible

The compiler can warn us if we add a value to the
virDomainChrSerialTargetType enumeration but forget to handle
it properly in the code. Let's take advantage of that.

This commit is best viewed with 'git diff -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: add QEMU_CAPS_DEVICE_SCLPLMCONSOLE
Pino Toscano [Wed, 15 Nov 2017 17:08:44 +0000 (18:08 +0100)]
qemu: add QEMU_CAPS_DEVICE_SCLPLMCONSOLE

Add a separate capability for the sclplmconsole device, and check it
specifically instead of using QEMU_CAPS_DEVICE_SCLPCONSOLE for that too.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: rename QEMU_CAPS_SCLP_S390 to QEMU_CAPS_DEVICE_SCLPCONSOLE
Pino Toscano [Wed, 15 Nov 2017 17:05:44 +0000 (18:05 +0100)]
qemu: rename QEMU_CAPS_SCLP_S390 to QEMU_CAPS_DEVICE_SCLPCONSOLE

Give a better name to the capability for the sclpconsole device.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Add QEMU_CAPS_DEVICE_SPAPR_VTY
Andrea Bolognani [Wed, 8 Nov 2017 18:13:28 +0000 (19:13 +0100)]
qemu: Add QEMU_CAPS_DEVICE_SPAPR_VTY

Up until now we assumed the spapr-vty device would always be
present, which is not very nice. Check for its availability before
using it instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoAppArmor: add mount rules needed with additional mediation features brought by Linux...
intrigeri [Sun, 19 Nov 2017 14:57:34 +0000 (14:57 +0000)]
AppArmor: add mount rules needed with additional mediation features brought by Linux 4.14

This set of rules was proposed by Christian Boltz <apparmor@cboltz.de>
on https://bugzilla.opensuse.org/show_bug.cgi?id=1065123.

7 years agoAppArmor: add rules needed with additional mediation features brought by Linux 4.14.
intrigeri [Sun, 19 Nov 2017 14:57:33 +0000 (14:57 +0000)]
AppArmor: add rules needed with additional mediation features brought by Linux 4.14.

7 years agolibvirtd: Fix order of cleanup processing
John Ferlan [Mon, 6 Nov 2017 20:20:55 +0000 (15:20 -0500)]
libvirtd: Fix order of cleanup processing

Current cleanup processing is ad-hoc at best - it's led to a couple of
strange and hard to diagnose timing problems and crashes.

So rather than perform cleanup in a somewhat random order, let's
perform cleanup in the exact opposite order of startup.

NB: It is possible that virNetlinkEventServerStart fails and we jump
to cleanup before driversInitialized has been set. That could leave
things inconsistent; however, resolution of that possibility is perhaps
more trouble than it's worth to handle.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agolibvirtd: Alter order of virNetDaemonNew
John Ferlan [Mon, 6 Nov 2017 21:55:15 +0000 (16:55 -0500)]
libvirtd: Alter order of virNetDaemonNew

Let's be sure we can get a Daemon object before the server object.
This is a more "orderly" way to do things since the svr object would
be added to the dmn object afterwards.

7 years agolibvirtd: Move pid_file_fd setup to before run_dir
John Ferlan [Mon, 6 Nov 2017 21:51:02 +0000 (16:51 -0500)]
libvirtd: Move pid_file_fd setup to before run_dir

Once we have forked the daemon successfully, let's claim the pidfile
immediately rather than waiting for setup of run_dir.

7 years agonews: add vmcoreinfo feature details
Marc-André Lureau [Thu, 16 Nov 2017 16:49:39 +0000 (17:49 +0100)]
news: add vmcoreinfo feature details

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agoqemu: add vmcoreinfo support
Marc-André Lureau [Thu, 16 Nov 2017 16:49:38 +0000 (17:49 +0100)]
qemu: add vmcoreinfo support

Starting from qemu 2.11, the `-device vmcoreinfo` will create a fw_cfg
entry for a guest to store dump details, necessary to process kernel
dump with KASLR enabled and providing additional kernel details.

In essence, it is similar to -fw_cfg name=etc/vmcoreinfo,file=X but in
this case it is not backed by a file, but collected by QEMU itself.

Since the device is a singleton and shouldn't use additional hardware
resources, it is presented as a <feature> element in the libvirt
domain XML.

The device is arm/x86 only for now (targets that support fw_cfg+dma).

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1395248

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: Add resctrl-skx-twocaches test case to vircaps2xmltest
Martin Kletzander [Fri, 10 Nov 2017 13:51:40 +0000 (14:51 +0100)]
tests: Add resctrl-skx-twocaches test case to vircaps2xmltest

This doesn't add very much value for now, but future test for virresctrl will
take information from vircaps2xmldata (since it is dependent on the same info
then why duplicate it) and this particular use case helps us cover bit more of
the code regarding proper formatting and handling errors.  And one more test for
vircaps2xmltest doesn't hurt either.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Minor adjustments for test data
Martin Kletzander [Sun, 12 Nov 2017 20:01:46 +0000 (21:01 +0100)]
tests: Minor adjustments for test data

This patch modifies some not yet used test data so that the adding a test using
this data is a clean patch and not an addition of huge file with some
adjustments in small files that will be hidden in the middle of that commit.
These changes include:

- Add system dir in vircaps2xmldata/linux-caches

  Back when data for systems with resctrl support were added they had the
  /sys/fs/system directory put into a system/ subdir of the test and
  /sys/fs/resctrl in a resctrl/ subdir of that test.  However, if we also want a
  negative test for the resctrl (requesting allocation on a system that does not
  support resctrl), we need one a test case with any sensible (with cache info)
  system/ subdir and no resctrl/ one.  Easiest way is to add a
  system -> . symlink into existing test case.

- Change default group schemata for linux-resctrl and linux-resctrl-cdp

  That way we can fit some allocation in.

- Remove one cache from resctrl-skx's schemata and make some room for
  allocations

  That system already has only one cache, so that file was wrong anyway.  We
  have a version with 2 caches already (linux-resctrl-skx-twocaches), so this
  will also add variety to future tests.

- Add some empty allocation for resctrl-skx

  Just to have slightly more coverage and variety.  We can be sure nothing bad
  happens if such allocation exists in case we have that in the tests.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agotests: Remove executable bits on plain data files
Martin Kletzander [Fri, 10 Nov 2017 13:48:56 +0000 (14:48 +0100)]
tests: Remove executable bits on plain data files

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Format cache banks in capabilities with virFormatIntPretty
Martin Kletzander [Fri, 10 Nov 2017 12:19:53 +0000 (13:19 +0100)]
conf: Format cache banks in capabilities with virFormatIntPretty

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Sort cache banks in capabilities XML
Martin Kletzander [Fri, 10 Nov 2017 12:19:31 +0000 (13:19 +0100)]
conf: Sort cache banks in capabilities XML

Because the cache banks are initialized based on the order in which their
respective directories exist on the filesystem, they can appear in different
order.  This is here mainly for tests because the cache directory might have
different order of children nodes and tests would fail otherwise.  It should not
be the case with sysfs, but one can never be sure.  And this does not take
almost any extra time, mainly because it gets initialized once per driver.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Introduce virBitmapShrink
Martin Kletzander [Thu, 9 Nov 2017 15:12:33 +0000 (16:12 +0100)]
util: Introduce virBitmapShrink

Sometimes the size of the bitmap matters and it might not be guessed correctly
when parsing from some type of input.  For example virBitmapNewData() has Byte
granularity, virBitmapNewString() has nibble granularity and so on.
virBitmapParseUnlimited() can be tricked into creating huge bitmap that's not
needed (e.g.: "0-2,^99999999").  This function provides a way to shrink the
bitmap.  It is not supposed to free any memory.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Reintroduce virBitmapSubtract
Martin Kletzander [Thu, 5 Oct 2017 13:09:30 +0000 (15:09 +0200)]
util: Reintroduce virBitmapSubtract

Already introduced in the past with 9479642fd3c5, but then renamed to
virBitmapIntersect by a908e9e45eb2.  This time we'll really use it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Introduce virBitmapNewString
Martin Kletzander [Wed, 23 Aug 2017 07:12:10 +0000 (09:12 +0200)]
util: Introduce virBitmapNewString

Our bitmaps can be represented as data (raw bytes for which we have
virBitmapNewData() and virBitmapToData()), human representation (list
of numbers in a string for which we have virBitmapParse() and
virBitmapFormat()) and hexadecimal string (for which we have only
virBitmapToString()).  So let's add the missing complement for the
last one so that we can parse hexadecimal strings.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Don't output too many zeros from virBitmapToString
Martin Kletzander [Wed, 23 Aug 2017 07:09:17 +0000 (09:09 +0200)]
util: Don't output too many zeros from virBitmapToString

Truncate the output so that it is only as big as is needed to fit all
the bits, not all the units from the map.  This will be needed in the
future in order to properly format bitmaps for kernel's sysfs files.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Rename virBitmapDataToString to virBitmapDataFormat
Martin Kletzander [Wed, 23 Aug 2017 07:05:41 +0000 (09:05 +0200)]
util: Rename virBitmapDataToString to virBitmapDataFormat

It is literally only a wrapper around virBitmapNewData() and
virBitmapFormat(), only the naming was wrong since it was introduced.
And because we have virBitmap*String functions where the meaning of
the 'String' is constant, this might confuse someone.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Rename virBitmapString to virBitmapToString
Martin Kletzander [Tue, 22 Aug 2017 06:30:43 +0000 (08:30 +0200)]
util: Rename virBitmapString to virBitmapToString

This follows the virBitmapToData() function and, similarly to
virBitmapNewData(), we'll be able to have virBitmapNewString() later
on without name confusion.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Make prefix optional in virBitampString
Martin Kletzander [Mon, 21 Aug 2017 06:37:30 +0000 (08:37 +0200)]
util: Make prefix optional in virBitampString

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Introduce virFormatIntPretty
Martin Kletzander [Thu, 9 Nov 2017 15:19:25 +0000 (16:19 +0100)]
util: Introduce virFormatIntPretty

We can't output better memory sizes if we want to be compatible with libvirt
older than the one which introduced /memory/unit, but for new things we can just
output nicer capacity to the user if available.  And this function enables that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoOnly output initialized capabilities with VIR_TEST_DEBUG > 1
Martin Kletzander [Fri, 3 Nov 2017 16:28:10 +0000 (17:28 +0100)]
Only output initialized capabilities with VIR_TEST_DEBUG > 1

Currenty virTestInit() outputs all capabilities that it created when running
with VIR_TEST_DEBUG=1.  Since this is quite a lot of output for every call of
this function (and it is not needed until debugging a really deep-down issue)
let's just output the info when VIR_TEST_DEBUG is strictly greater than 1.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agotests: Remove pointless _CFLAGS variables
Martin Kletzander [Thu, 16 Nov 2017 13:24:46 +0000 (14:24 +0100)]
tests: Remove pointless _CFLAGS variables

If _CFLAGS for a binary is not specified it uses AM_CFLAGS.  So doing

  $binary_CFLAGS = $(AM_CFLAGS)

or

  $binary_CFLAGS = $(AM_CFLAGS) $(something_that_is_already_in_AM_CFLAGS)

is pointless.  So remove it for cleaner Makefile.am

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agobuild: Use XDR_CFLAGS in more places
Martin Kletzander [Thu, 16 Nov 2017 13:24:45 +0000 (14:24 +0100)]
build: Use XDR_CFLAGS in more places

Since update to glibc-2.26 removed the /usr/include/rpc/rpc.h we used until now,
it showed us a problem with not using XDR_CFLAGS properly.  On linux that
variable has usually -I/usr/include/tirpc because we already probe for it
properly, we just don't use it everywhere we need.  It is needed by wireshark
dissector as well as testutilsqemu.c (through includes) so the build fails with:

wireshark/src/packet-libvirt.c:33:10: fatal error: rpc/xdr.h: No such file or directory
 #include <rpc/xdr.h>
          ^~~~~~~~~~~

and

In file included from ../src/logging/log_manager.h:29:0,
                 from ../src/qemu/qemu_domain.h:40,
                 from testutilsqemu.c:11:
../src/logging/log_protocol.h:9:10: fatal error: rpc/rpc.h: No such file or directory
 #include <rpc/rpc.h>
          ^~~~~~~~~~~

Since lot of tests use testutilsqemu.c it is easier to add XDR_CFLAGS to
AM_CFLAGS than adding it to all $binary_CFLAGS.  It's just for tests and we
already have bunch of CFLAGS there anyway.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoxenconfig: fix compilation error
Jim Fehlig [Fri, 17 Nov 2017 17:35:12 +0000 (10:35 -0700)]
xenconfig: fix compilation error

Commit 03d0959a introduced a compilation error in
src/xenconfig/xen_xl.c on ARM. Found by Xen's osstest

http://logs.test-lab.xenproject.org/osstest/logs/116216/build-armhf-libvirt/6.ts-libvirt-build.log

7 years agodocs: add a page describing support guarantees for libvirt features
Daniel P. Berrange [Thu, 16 Nov 2017 17:11:55 +0000 (17:11 +0000)]
docs: add a page describing support guarantees for libvirt features

While we have collective knowledge about the support status of various
parts of libvirt, this has never been formally documented, leaving our
users to guess.

Note, this document makes one change to our previous policy. It explicitly
declares the RPC protocol of libvirtd as being a supported interface. THis
accepts the reality that we can a) never change it without breaking compat
with old libvirt.so, b) there are both rust + go impls that are written
against the RPC protocol already.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agodocs: don't use https in XML namespace URIs
Daniel P. Berrange [Fri, 27 Oct 2017 21:39:00 +0000 (22:39 +0100)]
docs: don't use https in XML namespace URIs

The XML namespace URI for the QEMU/LXC drivers must use http as the protocol
otherwise it won't match the parser's expectations.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agostorage: Resolve storage driver crash
John Ferlan [Mon, 6 Nov 2017 20:22:07 +0000 (15:22 -0500)]
storage: Resolve storage driver crash

Resolve a storage driver crash as a result of a long running
storageVolCreateXML when the virStorageVolPoolRefreshThread is
run as a result of when a storageVolUpload completed and ran the
virStoragePoolObjClearVols without checking if the creation
code was currently processing a buildVol after incrementing
the driver->asyncjob count.

The refreshThread will now check the pool asyncjob count before
attempting to pursue the pool refresh. Adjust the documentation
to describe the condition.

Crash from valgrind is as follows (with a bit of editing):

==21309== Invalid read of size 8
==21309==    at 0x153E47AF: storageBackendUpdateVolTargetInfo
==21309==    by 0x153E4C30: virStorageBackendUpdateVolInfo
==21309==    by 0x153E52DE: virStorageBackendVolRefreshLocal
==21309==    by 0x153DE29E: storageVolCreateXML
==21309==    by 0x562035B: virStorageVolCreateXML
==21309==    by 0x147366: remoteDispatchStorageVolCreateXML
...
==21309==  Address 0x2590a720 is 64 bytes inside a block of size 336 free'd
==21309==    at 0x4C2F2BB: free
==21309==    by 0x54CB9FA: virFree
==21309==    by 0x55BC800: virStorageVolDefFree
==21309==    by 0x55BF1D8: virStoragePoolObjClearVols
==21309==    by 0x153D967E: virStorageVolPoolRefreshThread
...
==21309==  Block was alloc'd at
==21309==    at 0x4C300A5: calloc
==21309==    by 0x54CB483: virAlloc
==21309==    by 0x55BDC1F: virStorageVolDefParseXML
==21309==    by 0x55BDC1F: virStorageVolDefParseNode
==21309==    by 0x55BE5A4: virStorageVolDefParse
==21309==    by 0x153DDFF1: storageVolCreateXML
==21309==    by 0x562035B: virStorageVolCreateXML
==21309==    by 0x147366: remoteDispatchStorageVolCreateXML
...

7 years agoqemu: taint domain if virDomainQemuAgentCommand API is used
Pavel Hrdina [Tue, 14 Nov 2017 16:28:48 +0000 (17:28 +0100)]
qemu: taint domain if virDomainQemuAgentCommand API is used

This is similar to the virDomainQemuMonitorCommand API, it can change
the domain state in a way that libvirt may not understand.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agovirsh: fixing wrong datatype of 'set-lifcycle-action' command options.
Julio Faracco [Thu, 16 Nov 2017 03:01:54 +0000 (01:01 -0200)]
virsh: fixing wrong datatype of 'set-lifcycle-action' command options.

The 'set-lifcycle-action' is throwing a weird error after executing it with
the '--help' option. The command output is showing the options 'type' and
'action' are as optional, but they aren't. Both are required.

virsh # set-lifecycle-action --help
...
  SYNOPSIS
    set-lifecycle-action <domain> [--type <string>] [--action <string>] ...
...
  OPTIONS
    [--domain] <string>  domain name, id or uuid
error: internal error: bad options in command: 'set-lifecycle-action'

After applying this patch, both arguments are required now.

virsh # set-lifecycle-action --help
...
  SYNOPSIS
    set-lifecycle-action <domain> <type> <action> [--config] ...

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

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
7 years agodaemon: virtlockd: Call virNetDaemonGetServer regardless of post exec
Erik Skultety [Tue, 14 Nov 2017 13:35:51 +0000 (14:35 +0100)]
daemon: virtlockd: Call virNetDaemonGetServer regardless of post exec

We need to call it anyway, so the else branch is redundant here.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agodaemon: virtlogd: Drop the server shortcut ref pointer
Erik Skultety [Tue, 14 Nov 2017 13:32:16 +0000 (14:32 +0100)]
daemon: virtlogd: Drop the server shortcut ref pointer

We put the server into a hash table as we do with the other daemons,
there is no compelling reason why it should have another pointer
dedicated just to the server. Besides, the locking daemon doesn't have
it and virtlogd is essentially a copy paste of virtlockd.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agohooks: Fix a wrong description
Chen Hanxiao [Wed, 15 Nov 2017 07:51:40 +0000 (15:51 +0800)]
hooks: Fix a wrong description

In the definition of virHookQemuOpType and virHookNetworkOpType,
we should use 'stopped' rather than 'shutdown'.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
7 years agonews: Update for configuration of HPT resizing
Andrea Bolognani [Mon, 6 Nov 2017 15:53:36 +0000 (16:53 +0100)]
news: Update for configuration of HPT resizing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agodocs: Document configuration of HPT resizing
Andrea Bolognani [Mon, 6 Nov 2017 15:40:09 +0000 (16:40 +0100)]
docs: Document configuration of HPT resizing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Add tests for configuration of HPT resizing
Andrea Bolognani [Mon, 6 Nov 2017 15:39:58 +0000 (16:39 +0100)]
tests: Add tests for configuration of HPT resizing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Enable configuration of HPT resizing for pSeries guests
Andrea Bolognani [Mon, 6 Nov 2017 15:39:40 +0000 (16:39 +0100)]
qemu: Enable configuration of HPT resizing for pSeries guests

Most of the time it's okay to leave this up to negotiation between
the guest and the host, but in some situations it can be useful to
manually decide the behavior, especially to enforce its availability.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovircapstest: Avoid (im)possible strcmp call with NULL argument
Jiri Denemark [Mon, 13 Nov 2017 21:22:07 +0000 (22:22 +0100)]
vircapstest: Avoid (im)possible strcmp call with NULL argument

Some compilers may get confused and decide we are calling strcmp with
NULL argument from test_virCapsDomainDataLookupLXC. Although this does
not really happen since the call is guarded with
(data->machinetype != expect_machinetype), using STRNEQ_NULLABLE is
easier to understand, less fragile, and doing so makes sure strcmp is
never called with NULL argument.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agonews: add entries for specifying distance between vNUMA cells
Jim Fehlig [Fri, 10 Nov 2017 22:01:00 +0000 (15:01 -0700)]
news: add entries for specifying distance between vNUMA cells

Add two new entries under new features for 3.10.0. One
advertising support for specifying distance between vNUMA cells
and another advertising Xen's support for vNUMA configuration.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoqemu: Properly report errors from qemuDomainFixupCPUs
Jiri Denemark [Mon, 13 Nov 2017 15:49:47 +0000 (16:49 +0100)]
qemu: Properly report errors from qemuDomainFixupCPUs

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoconf: Fix message when maximum vCPU count is less than current
Peter Krempa [Fri, 3 Nov 2017 08:31:30 +0000 (09:31 +0100)]
conf: Fix message when maximum vCPU count is less than current

Reword the message and drop the numbers (which were reversed) from it
so that it actually makes sense.

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

7 years agoqemu: process: Setup disk secrets when preparing disks
Peter Krempa [Wed, 8 Nov 2017 20:11:47 +0000 (21:11 +0100)]
qemu: process: Setup disk secrets when preparing disks

Setup everything related to disks in one place rather than calling in
from various places.

The change to ordering of the setup steps is necessary since secrets
need the master key to be present.

7 years agoqemu: domain: Don't allocate storage source private data if not needed
Peter Krempa [Thu, 9 Nov 2017 11:54:43 +0000 (12:54 +0100)]
qemu: domain: Don't allocate storage source private data if not needed

7 years agoqemu: Tolerate storage source private data being NULL
Peter Krempa [Thu, 9 Nov 2017 11:51:25 +0000 (12:51 +0100)]
qemu: Tolerate storage source private data being NULL

In some cases it does not make sense to pursue that the private data
will be allocated (especially when we don't need to put anything in it).

Ensure that the code works without it.

This also fixes few crashes pointed out in
https://bugzilla.redhat.com/show_bug.cgi?id=1510323

7 years agoqemu: parse: Allocate disk definition with private data
Peter Krempa [Wed, 8 Nov 2017 19:44:35 +0000 (20:44 +0100)]
qemu: parse: Allocate disk definition with private data

Use virDomainDiskDefNew instead of VIR_ALLOC in
qemuParseCommandLineDisk.

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

7 years agoqemu: block: Don't leak server JSON object from protocol generators
Peter Krempa [Thu, 9 Nov 2017 09:29:53 +0000 (10:29 +0100)]
qemu: block: Don't leak server JSON object from protocol generators

If creation of the main JSON object containing the storage portion of a
virStorageSource would fail but we'd allocate the server structure we'd
leak it. Found by coverity.

7 years agoqemu: block: Break out early on invalid storage sources
Peter Krempa [Thu, 9 Nov 2017 09:13:26 +0000 (10:13 +0100)]
qemu: block: Break out early on invalid storage sources

Return NULL right away in qemuBlockStorageSourceGetBackendProps when an
invalid storage source is presented so that virJSONValueObjectAdd isn't
called with a NULL argument.

Found by coverity.

7 years agoconf: Properly parse <backingStore/>
Peter Krempa [Wed, 8 Nov 2017 14:42:51 +0000 (15:42 +0100)]
conf: Properly parse <backingStore/>

The terminator would not be parsed properly since the XPath selector was
looking for an populated element, and also the code did not bother
assigning the terminating virStorageSourcePtr to the backingStore
property of the parent.

Some tests would catch it if there wasn't bigger fallout from the change
to backing store termination in a693fdba0111. Fix them properly now.

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

7 years agoRevert "virNetDevSupportBandwidth: Enable QoS for vhostuser"
Michal Privoznik [Fri, 10 Nov 2017 15:16:52 +0000 (16:16 +0100)]
Revert "virNetDevSupportBandwidth: Enable QoS for vhostuser"

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

This reverts commit bc8a99ef06417a2303ccab455f9f045e2a617916.

The vhostuser is not a TAP. Therefore our QoS code is not able to
set any bandwidth. I don't really understand what I was thinking.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agolibxlxml2domconfigtest: add test for vNUMA config
Wim ten Have [Fri, 10 Nov 2017 20:03:16 +0000 (13:03 -0700)]
libxlxml2domconfigtest: add test for vNUMA config

Add tests to ensure the libxl_domain_config generator properly
handles vNUMA configuration.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
7 years agoxlconfigtest: add tests for vNUMA configuration
Wim ten Have [Fri, 10 Nov 2017 19:12:34 +0000 (12:12 -0700)]
xlconfigtest: add tests for vNUMA configuration

Add tests for conversion of domXML vNUMA config to/from
xen-xl native vNUMA config.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
7 years agolibxl: vnuma support
Wim ten Have [Thu, 2 Nov 2017 15:47:22 +0000 (16:47 +0100)]
libxl: vnuma support

This patch generates a NUMA distance-aware libxl description from the
information extracted from a NUMA distance-aware libvirt XML file.

By default, if no NUMA node distance information is supplied in the
libvirt XML file, this patch uses the distances 10 for local and 20
for remote nodes/sockets.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
7 years agoxenconfig: add domxml conversions for xen-xl
Wim ten Have [Thu, 2 Nov 2017 15:47:21 +0000 (16:47 +0100)]
xenconfig: add domxml conversions for xen-xl

This patch converts NUMA configurations between the Xen libxl
configuration file format and libvirt's XML format.

XML HVM domain on a 4 node (2 cores/socket) configuration:

  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='10'/>
          <sibling id='1' value='21'/>
          <sibling id='2' value='31'/>
          <sibling id='3' value='21'/>
        </distances>
      </cell>
      <cell id='1' cpus='2-3' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='21'/>
          <sibling id='1' value='10'/>
          <sibling id='2' value='21'/>
          <sibling id='3' value='31'/>
        </distances>
      </cell>
      <cell id='2' cpus='3-4' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='31'/>
          <sibling id='1' value='21'/>
          <sibling id='2' value='10'/>
          <sibling id='3' value='21'/>
        </distances>
      </cell>
      <cell id='3' cpus='5-6' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='21'/>
          <sibling id='1' value='31'/>
          <sibling id='2' value='21'/>
          <sibling id='3' value='10'/>
        </distances>
      </cell>
    </numa>
  </cpu>

Xen xl.cfg domain configuration:

  vnuma = [["pnode=0","size=2048","vcpus=0-1","vdistances=10,21,31,21"],
           ["pnode=1","size=2048","vcpus=2-3","vdistances=21,10,21,31"],
           ["pnode=2","size=2048","vcpus=4-5","vdistances=31,21,10,21"],
           ["pnode=3","size=2048","vcpus=6-7","vdistances=21,31,21,10"]]

If there is no XML <distances> description amongst the <cell> data the
conversion schema from xml to native will generate 10 for local and 20
for all remote instances.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
7 years agonuma: describe siblings distances within cells
Wim ten Have [Thu, 2 Nov 2017 15:47:20 +0000 (16:47 +0100)]
numa: describe siblings distances within cells

Add support for describing NUMA distances in a domain's <numa> <cell>
XML description.

Below is an example of a 4 node setup:

  <cpu>
    <numa>
      <cell id='0' cpus='0-3' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='10'/>
          <sibling id='1' value='21'/>
          <sibling id='2' value='31'/>
          <sibling id='3' value='21'/>
        </distances>
      </cell>
      <cell id='1' cpus='4-7' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='21'/>
          <sibling id='1' value='10'/>
          <sibling id='2' value='21'/>
          <sibling id='3' value='31'/>
        </distances>
      </cell>
      <cell id='2' cpus='8-11' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='31'/>
          <sibling id='1' value='21'/>
          <sibling id='2' value='10'/>
          <sibling id='3' value='21'/>
        </distances>
      <cell id='3' cpus='12-15' memory='2097152' unit='KiB'>
        <distances>
          <sibling id='0' value='21'/>
          <sibling id='1' value='31'/>
          <sibling id='2' value='21'/>
          <sibling id='3' value='10'/>
        </distances>
      </cell>
    </numa>
  </cpu>

A <cell> defines a NUMA node. <distances> describes the NUMA distance
from the <cell> to the other NUMA nodes (the <sibling>s).  For example,
in above XML description, the distance between NUMA node0 <cell id='0'
...> and NUMA node2 <sibling id='2' ...> is 31.

Valid distance values are '10 <= value <= 255'.  A distance value of 10
represents the distance to the node itself.  A distance value of 20
represents the default value for remote nodes but other values are
possible depending on the physical topology of the system.

When distances are not fully described, any missing sibling distance
values will default to 10 for local nodes and 20 for remote nodes.

If distance is given for A -> B, then we default B -> A to the same
value instead of 20.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
7 years agoremote: Set *neventCallbacks to zero at DEREG_CB
xinhua.Cao [Sat, 11 Nov 2017 08:30:41 +0000 (16:30 +0800)]
remote: Set *neventCallbacks to zero at DEREG_CB

To avoid the chance that the loop is run twice, set the neventCallbacks
to zero after VIR_FREE(eventCallbacks) was called.

7 years agotests: fix TTY check in virTestUseTerminalColors()
Pino Toscano [Thu, 9 Nov 2017 12:31:03 +0000 (13:31 +0100)]
tests: fix TTY check in virTestUseTerminalColors()

Since colors would be used when writing to stdout, then check that
stdout is a TTY, instead of stdin.

This avoids the usage of terminal color codes when the output is
directed to file.

7 years agoqemuBuildDriveDevStr: Prefer default aliases for IDE bus
Michal Privoznik [Thu, 9 Nov 2017 12:34:43 +0000 (13:34 +0100)]
qemuBuildDriveDevStr: Prefer default aliases for IDE bus

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

When testing user aliases it was discovered that for 440fx
machine type which has default IDE bus builtin, domain cannot
start if IDE controller has the user provided alias. This is
because for 440fx we don't put the IDE controller onto the
command line (since it is builtin) and therefore any device that
is plugged onto the bus must use the default alias.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agonuma: avoid failure in nodememstats on non-NUMA systems
Viktor Mihajlovski [Fri, 22 Sep 2017 14:12:23 +0000 (16:12 +0200)]
numa: avoid failure in nodememstats on non-NUMA systems

libvirt reports a fake NUMA topology in virConnectGetCapabilities
even if built without numactl support. The fake NUMA topology consists
of a single cell representing the host's cpu and memory resources.
Currently this is the case for ARM and s390[x] RPM builds.

A client iterating over NUMA cells obtained via virConnectGetCapabilities
and invoking virNodeGetMemoryStats on them will see an internal failure
"NUMA isn't available on this host" from virNumaGetMaxNode. An example
for such a client is VDSM.

Since the intention seems to be that libvirt always reports at least
a single cell it is necessary to return "fake" node memory statistics
matching the previously reported fake cell in case NUMA isn't supported
on the system.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
7 years agonews: Update for vbox 5.2 support
Dawid Zamirski [Tue, 7 Nov 2017 22:44:31 +0000 (17:44 -0500)]
news: Update for vbox 5.2 support

7 years agovbox: Add support for 5.2.x
Dawid Zamirski [Tue, 7 Nov 2017 22:36:34 +0000 (17:36 -0500)]
vbox: Add support for 5.2.x

Simply add the 5.2 SDK header to the existing unified framework. No
other special handling is needed as there's no API break between
existing 5.1 and the just added 5.2.

7 years agovbox: Add vbox 5.2 CAPI header file.
Dawid Zamirski [Tue, 7 Nov 2017 22:22:08 +0000 (17:22 -0500)]
vbox: Add vbox 5.2 CAPI header file.

Extracted from 5.2 SDK and reindented with cppi

7 years agovirconf: properly set the end of content
Jim Fehlig [Tue, 7 Nov 2017 21:20:44 +0000 (14:20 -0700)]
virconf: properly set the end of content

There was a recent report of the xen-xl converter not handling
config files missing an ending newline

https://www.redhat.com/archives/libvir-list/2017-October/msg01353.html

Commit 3cc2a9e0 fixed a similar problem when parsing content of a
file but missed parsing in-memory content. But AFAICT, the better
fix is to properly set the end of the content when initializing the
virConfParserCtxt in virConfParse().

This commit reverts the part of 3cc2a9e0 that appends a newline to
files missing it, and fixes setting the end of content when
initializing virConfParserCtxt. A test is also added to check
parsing in-memory content missing an ending newline.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoconf: Fix type for @liveStatus in virDomainObjListLoadAllConfigs
Peter Krempa [Wed, 8 Nov 2017 14:17:33 +0000 (15:17 +0100)]
conf: Fix type for @liveStatus in virDomainObjListLoadAllConfigs

Use bool instead of an int.

7 years agoqemu-ns: Detect /dev/* mount point duplicates even better
Michal Privoznik [Wed, 8 Nov 2017 14:20:10 +0000 (15:20 +0100)]
qemu-ns: Detect /dev/* mount point duplicates even better

In 4f1570720218302 I've tried to make duplicates detection for
nested /dev mount better. However, I've missed the obvious case
when there are two same mount points. For instance if:

  # mount --bind /dev/blah /dev/blah
  # mount --bind /dev/blah /dev/blah

Yeah, very unlikely (in qemu driver world) but possible.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: storage: Fix parsing of IPv6 portal address for iSCSI
Peter Krempa [Tue, 7 Nov 2017 15:20:23 +0000 (16:20 +0100)]
util: storage: Fix parsing of IPv6 portal address for iSCSI

Split on the last colon and avoid parsing port if the split remainder
contains the closing square bracket, so that IPv6 addresses are
interpreted correctly.

7 years agotests: Add caps for QEMU 2.10.0 on ppc64
Andrea Bolognani [Fri, 3 Nov 2017 16:26:30 +0000 (17:26 +0100)]
tests: Add caps for QEMU 2.10.0 on ppc64

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Rename ppc64le caps to ppc64
Andrea Bolognani [Mon, 6 Nov 2017 11:40:24 +0000 (12:40 +0100)]
tests: Rename ppc64le caps to ppc64

The architecture itself is called ppc64, and it can run both in big
endian and little endian mode - the latter is known as ppc64le.

From the (virtual) hardware point of view, ppc64 is a more accurate
name so it should be used here.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Add caps for QEMU 2.10.0 on aarch64 (GICv3)
Andrea Bolognani [Mon, 6 Nov 2017 11:23:35 +0000 (12:23 +0100)]
tests: Add caps for QEMU 2.10.0 on aarch64 (GICv3)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Add caps for QEMU 2.10.0 on aarch64 (GICv2)
Andrea Bolognani [Mon, 6 Nov 2017 11:23:22 +0000 (12:23 +0100)]
tests: Add caps for QEMU 2.10.0 on aarch64 (GICv2)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agonews: Document predictable file names for memory-backend-file
Michal Privoznik [Tue, 24 Oct 2017 09:59:29 +0000 (11:59 +0200)]
news: Document predictable file names for memory-backend-file

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Use predictable file names for memory-backend-file
Michal Privoznik [Tue, 7 Nov 2017 14:20:12 +0000 (15:20 +0100)]
qemu: Use predictable file names for memory-backend-file

In some cases management application needs to allocate memory for
qemu upfront and then just let qemu use that. Since we don't want
to expose path for memory-backend-file anywhere in the domain
XML, we can generate predictable paths. In this case:

  $memoryBackingDir/libvirt/qemu/$shortName/$alias

where $shortName is result of virDomainDefGetShortName().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Destroy whole memory tree
Michal Privoznik [Tue, 7 Nov 2017 15:03:40 +0000 (16:03 +0100)]
qemu: Destroy whole memory tree

When removing path where huge pages are call virFileDeleteTree
instead of plain rmdir(). The reason is that in the near future
there's going to be more in the path than just files - some
subdirs. Therefore plain rmdir() is not going to be enough.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Rename qemuProcessBuildDestroyHugepagesPath
Michal Privoznik [Tue, 7 Nov 2017 14:19:43 +0000 (15:19 +0100)]
qemu: Rename qemuProcessBuildDestroyHugepagesPath

At the same time, move its internals into a separate function so
that they can be reused.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Set alias for memory cell in qemuBuildMemoryCellBackendStr
Michal Privoznik [Tue, 7 Nov 2017 14:12:33 +0000 (15:12 +0100)]
qemu: Set alias for memory cell in qemuBuildMemoryCellBackendStr

Very soon qemuBuildMemoryBackendStr() is going to use memory cell
aliases. Therefore set one. At the same time, move it a bit
further - if virAsprintf() fails, there's no point in setting
rest of the members.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agodocs: Document autoport behavior in the vbox driver
Dawid Zamirski [Tue, 7 Nov 2017 21:36:48 +0000 (16:36 -0500)]
docs: Document autoport behavior in the vbox driver

7 years agodocs: Update vbox driver documentation.
Dawid Zamirski [Tue, 7 Nov 2017 21:36:47 +0000 (16:36 -0500)]
docs: Update vbox driver documentation.

* libvirt no longer supports vbox <= 3.x
* update XML definition sample to show how to attach disks to VBOX's SAS
  controller and how to change IDE controller model.
* update XML to show how to create RDP display with autoport.