]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
5 years agoqemu: don't access vmdef within qemu_agent.c
Jonathon Jongsma [Fri, 10 Jan 2020 23:32:13 +0000 (17:32 -0600)] 
qemu: don't access vmdef within qemu_agent.c

In order to avoid holding an agent job and a normal job at the same
time, we want to avoid accessing the domain's definition while holding
the agent job. To achieve this, qemuAgentGetFSInfo() only returns the
raw information from the agent query to the caller. The caller can then
release the agent job and then proceed to look up the disk alias from
the vm definition. This necessitates moving a few helper functions to
qemu_driver.c and exposing the agent data structure (qemuAgentFSInfo) in
the header.

In addition, because the agent function no longer returns the looked-up
disk alias, we can't test the alias within qemuagenttest.  Instead we
simply test that we parse and return the raw agent data correctly.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Don't store disk alias in qemuAgentDiskInfo
Jonathon Jongsma [Fri, 10 Jan 2020 23:32:12 +0000 (17:32 -0600)] 
qemu: Don't store disk alias in qemuAgentDiskInfo

The qemuAgentDiskInfo structure is filled with information received from
the agent command response, except for the 'alias' field, which is
retrieved from the vm definition. Limit this structure only to data that
was received from the agent message.

This is another intermediate step in moving the responsibility for
searching the vmdef from qemu_agent.c to qemu_driver.c so that we can
avoid holding an agent job and a normal job at the same time.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: store complete agent filesystem information
Jonathon Jongsma [Fri, 10 Jan 2020 23:32:11 +0000 (17:32 -0600)] 
qemu: store complete agent filesystem information

In an effort to avoid holding both an agent and normal job at the same
time, we shouldn't access the vm definition from within qemu_agent.c
(i.e. while the agent job is being held). In preparation, we need to
store the full filesystem disk information in qemuAgentDiskInfo.  In a
following commit, we can pass this information back to the caller and
the caller can search the vm definition to match the filsystem disk to
an alias.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: rename qemuAgentGetFSInfoInternalDisk()
Jonathon Jongsma [Fri, 10 Jan 2020 23:32:10 +0000 (17:32 -0600)] 
qemu: rename qemuAgentGetFSInfoInternalDisk()

The function name doesn't give a good idea of what the function does.
Rename to qemuAgentGetFSInfoFillDisks() to make it more obvious than it
is filling in the disk information in the fsinfo struct.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: add host CPU data files for validating die_id
Daniel P. Berrangé [Mon, 16 Dec 2019 18:08:24 +0000 (18:08 +0000)] 
tests: add host CPU data files for validating die_id

Only Cascadelake-AP CPUs appear to report "die_id" values != 0 on Linux
right now - AMD EPYC's don't report "die_id" (at least with Fedora 31
kernel). Lacking access to Cascadelake-AP CPUs, this test data was from
a Fedora 31 QEMU guest launched with

 -cpu qemu64 -smp sockets=2,dies=3,cores=2,threads=1

Ideally we'd replace this data with some from a real machine reporting
"die_id", to ensure we're not mislead by QEMU's impl.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agohostcpu: add support for reporting die_id in NUMA topology
Daniel P. Berrangé [Mon, 16 Dec 2019 18:10:29 +0000 (18:10 +0000)] 
hostcpu: add support for reporting die_id in NUMA topology

Update the host CPU code to report the die_id in the NUMA topology
capabilities. On systems with multiple dies, this fixes the bug
where CPU cores can't be distinguished:

 <cpus num='12'>
   <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
   <cpu id='1' socket_id='0' core_id='1' siblings='1'/>
   <cpu id='2' socket_id='0' core_id='0' siblings='2'/>
   <cpu id='3' socket_id='0' core_id='1' siblings='3'/>
 </cpus>

Notice how core_id is repeated within the scope of the same socket_id.

It now reports

 <cpus num='12'>
   <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
   <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
   <cpu id='2' socket_id='0' die_id='1' core_id='0' siblings='2'/>
   <cpu id='3' socket_id='0' die_id='1' core_id='1' siblings='3'/>
 </cpus>

So core_id is now unique within a (socket_id, die_id) pair.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: add support for specifying CPU "dies" topology parameter
Daniel P. Berrangé [Mon, 16 Dec 2019 15:28:09 +0000 (15:28 +0000)] 
qemu: add support for specifying CPU "dies" topology parameter

QEMU since 4.1.0 supports the "dies" parameter for -smp

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: remove unused virCapabilitiesSetHostCPU method
Daniel P. Berrangé [Wed, 18 Dec 2019 15:51:18 +0000 (15:51 +0000)] 
conf: remove unused virCapabilitiesSetHostCPU method

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add support for specifying CPU "dies" parameter
Daniel P. Berrangé [Mon, 16 Dec 2019 11:16:51 +0000 (11:16 +0000)] 
conf: add support for specifying CPU "dies" parameter

Recently CPU hardware vendors have started to support a new structure
inside the CPU package topology known as a "die". Thus the hierarchy
is now:

  sockets > dies > cores > threads

This adds support for "dies" in the XML parser, with the value
defaulting to 1 if not specified for backwards compatibility.

For example a system with 64 logical CPUs might report

   <topology sockets="4" dies="2" cores="4" threads="2"/>

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Don't emit SUSPENDED_POSTCOPY event on destination
Jiri Denemark [Wed, 15 Jan 2020 14:24:55 +0000 (15:24 +0100)] 
qemu: Don't emit SUSPENDED_POSTCOPY event on destination

When pause-before-switchover QEMU capability is enabled, we get STOP
event before MIGRATION event with postcopy-active state. To properly
handle post-copy migration and emit correct events commit
v4.10.0-rc1-4-geca9d21e6c added a hack to
qemuProcessHandleMigrationStatus which translates the paused state
reason to VIR_DOMAIN_PAUSED_POSTCOPY and emits
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event when migration state changes
to post-copy.

However, the code was effective on both sides of migration resulting in
a confusing VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event on the destination
host, where entering post-copy mode is already properly advertised by
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirchrdev: Drop needless 'cleanup' label in virChrdevLockFileCreate()
Michal Privoznik [Wed, 8 Jan 2020 08:18:32 +0000 (09:18 +0100)] 
virchrdev: Drop needless 'cleanup' label in virChrdevLockFileCreate()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirchrdev: Use more g_autofree and VIR_AUTOCLOSE
Michal Privoznik [Wed, 8 Jan 2020 08:18:31 +0000 (09:18 +0100)] 
virchrdev: Use more g_autofree and VIR_AUTOCLOSE

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirchrdev: Don't leak mutex if virChrdevAlloc() fails
Michal Privoznik [Wed, 8 Jan 2020 08:18:30 +0000 (09:18 +0100)] 
virchrdev: Don't leak mutex if virChrdevAlloc() fails

This is only a theoretical leak, but in virChrdevAlloc() we
initialize a mutex and if creating a hash table fails,
then virChrdevFree() is called which because of incorrect check
doesn't deinit the mutex.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirchrdev: Don't leak @dev member of virChrdevHashEntry struct
Michal Privoznik [Wed, 8 Jan 2020 08:18:29 +0000 (09:18 +0100)] 
virchrdev: Don't leak @dev member of virChrdevHashEntry struct

When opening a console to a domain, we put a tuple of {path,
virStreamPtr} into a hash table that's private to the domain.
This is to ensure only one client at most has the console stream
open. Later, when the console is closed, the tuple is removed
from the hash table and freed. Except, @path won't be freed.

==234102== 60 bytes in 5 blocks are definitely lost in loss record 436 of 651
==234102==    at 0x4836753: malloc (vg_replace_malloc.c:307)
==234102==    by 0x5549110: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
==234102==    by 0x5562D1E: g_strdup (in /usr/lib64/libglib-2.0.so.0.6000.6)
==234102==    by 0x4A5A917: virChrdevOpen (virchrdev.c:412)
==234102==    by 0x17B64645: qemuDomainOpenConsole (qemu_driver.c:17309)
==234102==    by 0x4BC8031: virDomainOpenConsole (libvirt-domain.c:9662)
==234102==    by 0x13F854: remoteDispatchDomainOpenConsole (remote_daemon_dispatch_stubs.h:9211)
==234102==    by 0x13F72F: remoteDispatchDomainOpenConsoleHelper (remote_daemon_dispatch_stubs.h:9178)
==234102==    by 0x4AB0685: virNetServerProgramDispatchCall (virnetserverprogram.c:430)
==234102==    by 0x4AB01F0: virNetServerProgramDispatch (virnetserverprogram.c:302)
==234102==    by 0x4AB700B: virNetServerProcessMsg (virnetserver.c:136)
==234102==    by 0x4AB70CB: virNetServerHandleJob (virnetserver.c:153)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agogitpublish: add a subject prefix
Daniel P. Berrangé [Thu, 16 Jan 2020 12:35:15 +0000 (12:35 +0000)] 
gitpublish: add a subject prefix

Now that we removed the subject prefix tag from the mailman config
we should set 'libvirt' as the subject when sending patches.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Stop domain on failed restore
Michal Privoznik [Mon, 13 Jan 2020 10:07:53 +0000 (11:07 +0100)] 
qemu: Stop domain on failed restore

When resuming a domain from a save file, we read the domain XML
from the file, add it onto our internal list of domains, start
the qemu process, let it load the incoming migration stream and
resume its vCPUs afterwards. If anything goes wrong, the domain
object is removed from the list of domains and error is returned
to the caller. However, the qemu process might be left behind -
if resuming vCPUs fails (e.g. because qemu is unable to acquire
write lock on a disk) then due to a bug the qemu process is not
killed but the domain object is removed from the list.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1718707
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: Use g_autoptr() for qemuDomainSaveCookie
Michal Privoznik [Mon, 13 Jan 2020 10:06:39 +0000 (11:06 +0100)] 
qemu: Use g_autoptr() for qemuDomainSaveCookie

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemuDomainSaveImageStartVM: Use g_autoptr() for virCommand
Michal Privoznik [Mon, 13 Jan 2020 10:05:41 +0000 (11:05 +0100)] 
qemuDomainSaveImageStartVM: Use g_autoptr() for virCommand

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemuDomainSaveImageStartVM: Use VIR_AUTOCLOSE for @intermediatefd
Michal Privoznik [Mon, 13 Jan 2020 09:07:32 +0000 (10:07 +0100)] 
qemuDomainSaveImageStartVM: Use VIR_AUTOCLOSE for @intermediatefd

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: Expose virDomainGetHostnameFlags
Julio Faracco [Fri, 27 Dec 2019 20:36:25 +0000 (17:36 -0300)] 
virsh: Expose virDomainGetHostnameFlags

Our virsh already has 'domhostname' command. Add '--source'
argument to it so that users can chose between 'lease' and
'agent' sources. Also, implement completer for the argument.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agolxc: Implement virDomainGetHostnameFlags
Julio Faracco [Thu, 9 Jan 2020 10:15:05 +0000 (11:15 +0100)] 
lxc: Implement virDomainGetHostnameFlags

Since there is no guest agent in LXC world (yet), we can
implement _LEASE flag only.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu: Implement virDomainGetHostnameFlags
Julio Faracco [Thu, 9 Jan 2020 12:19:21 +0000 (13:19 +0100)] 
qemu: Implement virDomainGetHostnameFlags

We have to keep the default - querying the agent if no flag is
set.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoIntroduce source flags to virDomainGetHostname()
Julio Faracco [Thu, 9 Jan 2020 10:12:37 +0000 (11:12 +0100)] 
Introduce source flags to virDomainGetHostname()

There is a lots of possibilities to retrieve hostname information
from domain. Libvirt could use lease information from dnsmasq to
get current hostname too. QEMU supports QEMU-agent but it can use
lease source.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agognulib: Pull in latest changes
Andrea Bolognani [Tue, 14 Jan 2020 16:59:02 +0000 (17:59 +0100)] 
gnulib: Pull in latest changes

In particular, we're interested in the following commits:

  commit 43b5194d5b156f8dd7ae576952568d331978f5f0
  Author: Bruno Haible <bruno@clisp.org>
  Date:   Sun Jan 5 20:42:12 2020 +0100

    tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.

    * lib/stdlib.in.h: Tweak last commit.

  commit b7d7afe10ddf599452bd80b8a840c830cd474b09
  Author: Bruno Haible <bruno@clisp.org>
  Date:   Sun Jan 5 09:13:25 2020 +0100

    tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.

    Reported by Jim Meyering in
    <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00040.html>.

    * lib/stdlib.in.h (GNULIB_defined_canonicalize_file_name): New macro.
    (GNULIB_defined_ptsname_r): New macro.
    * tests/test-canonicalize.c (_GL_ARG_NONNULL): Define to empty.
    (main): Disable the NULL argument test if canonicalize_file_name does
    not come from gnulib.
    * tests/test-canonicalize-lgpl.c (_GL_ARG_NONNULL): Define to empty.
    (main): Disable the NULL argument test if canonicalize_file_name does
    not come from gnulib.
    * tests/test-ptsname_r.c (_GL_ARG_NONNULL): Define to empty.
    (test_errors): Disable the NULL argument test if ptsname_r does not come
    from gnulib.

since they fix a build failure caused by the gnulib tests failing
on ppc64le, as reported in

  https://www.redhat.com/archives/libvir-list/2020-January/msg00616.html

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Tracked-down-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
5 years agoconf: do not generate machine names ending with a dash
Ján Tomko [Tue, 14 Jan 2020 05:20:52 +0000 (06:20 +0100)] 
conf: do not generate machine names ending with a dash

As of systemd commit:

commit d65652f1f21a4b0c59711320f34266c635393c89
Author:     Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
CommitDate: 2018-12-10 09:56:56 +0100

    Partially unify hostname_is_valid() and dns_name_is_valid()

Dashes are no longer allowed at the end of machine names.

Trim the trailing dashes from the generated name before passing
it to machined.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoutil: add virBufferTrimChars
Ján Tomko [Tue, 14 Jan 2020 07:04:14 +0000 (08:04 +0100)] 
util: add virBufferTrimChars

A new helper for trimming combinations of specified characters from
the tail of the buffer.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: use field names when initalizing test info
Ján Tomko [Tue, 14 Jan 2020 07:06:34 +0000 (08:06 +0100)] 
virbuftest: use field names when initalizing test info

Allow adding new fields without changing all the macros.

Otherwise the compiler complains that not all have been initialized:
../../tests/virbuftest.c:419:5: error: missing field 'arg' initializer [-Werror,-Wmissing-field-initializers]
    DO_TEST_ESCAPE("<td></td><td></td>",
    ^
../../tests/virbuftest.c:414:56: note: expanded from macro 'DO_TEST_ESCAPE'
        struct testBufAddStrData info = { data, expect }; \

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: declare testBufAddStrData earlier
Ján Tomko [Tue, 14 Jan 2020 07:04:29 +0000 (08:04 +0100)] 
virbuftest: declare testBufAddStrData earlier

Move the declaration to the beginning of the file for reuse.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: remove unnecessary labels
Ján Tomko [Tue, 14 Jan 2020 07:10:25 +0000 (08:10 +0100)] 
virbuftest: remove unnecessary labels

Remove the ret variables and labels from functions that no longer need
them.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: use g_autofree
Ján Tomko [Tue, 14 Jan 2020 07:04:54 +0000 (08:04 +0100)] 
virbuftest: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: remove extra G_GNUC_UNUSED markers
Ján Tomko [Tue, 14 Jan 2020 07:05:56 +0000 (08:05 +0100)] 
virbuftest: remove extra G_GNUC_UNUSED markers

These functions do use the opaque argument.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agomaint: Post-release version bump to 6.1.0
Ján Tomko [Tue, 3 Dec 2019 04:20:37 +0000 (21:20 -0700)] 
maint: Post-release version bump to 6.1.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoRelease of libvirt-6.0.0 v6.0.0
Daniel Veillard [Wed, 15 Jan 2020 15:18:42 +0000 (16:18 +0100)] 
Release of libvirt-6.0.0

* docs/news.xml: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
5 years agonews: Document <disk type='nvme'/>
Michal Privoznik [Tue, 14 Jan 2020 08:24:52 +0000 (09:24 +0100)] 
news: Document <disk type='nvme'/>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agonews: News for RDT-MBM feature
Han Han [Tue, 14 Jan 2020 05:48:23 +0000 (13:48 +0800)] 
news: News for RDT-MBM feature

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agovircgroupv2devices: free BPF map when replacing with new one v6.0.0-rc2
Pavel Hrdina [Mon, 13 Jan 2020 11:50:41 +0000 (12:50 +0100)] 
vircgroupv2devices: free BPF map when replacing with new one

This leaks the FD of BPF map which means it will not be freed.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agonews: Update for libvirt 6.0.0
Andrea Bolognani [Mon, 13 Jan 2020 10:47:09 +0000 (11:47 +0100)] 
news: Update for libvirt 6.0.0

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: Rearrange a few entries
Andrea Bolognani [Mon, 13 Jan 2020 09:30:05 +0000 (10:30 +0100)] 
news: Rearrange a few entries

Some were in the wrong section, some in the wrong version.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: Fix typo (Libivrt -> Libvirt)
Andrea Bolognani [Mon, 13 Jan 2020 10:49:47 +0000 (11:49 +0100)] 
news: Fix typo (Libivrt -> Libvirt)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_capabilities: Do not report USB as subsystem type if it is not available
Thomas Huth [Mon, 13 Jan 2020 08:04:57 +0000 (09:04 +0100)] 
qemu_capabilities: Do not report USB as subsystem type if it is not available

libvirt currently always reports that USB is available as a bus subsystem
type when running "virsh domcapabilities". However, this is not always
true, for example the qemu-system-s390x binary normally never has support
for USB. Thus we should only report that USB is available if there is
also a USB host controller available where we can attach USB devices.

Reported-by: Sebastian Mitterle <smitterl@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1759849
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodomain_conf: Do not use USB by default for <input> devices on s390x
Thomas Huth [Mon, 13 Jan 2020 08:30:14 +0000 (09:30 +0100)] 
domain_conf: Do not use USB by default for <input> devices on s390x

When trying to specify an input device on s390x without bus like this:

 <input type='keyboard'/>

... then libvirt currently complains:

 error: unsupported configuration: USB is disabled for this domain,
 but USB devices are present in the domain XML

This is somewhat confusing since the user did not specify an USB
device here. Since USB is not available on s390x, we should default
to the "virtio" bus here instead.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1790189
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: Always format storage source auth and encryption under <source> for backing...
Peter Krempa [Fri, 10 Jan 2020 16:25:16 +0000 (17:25 +0100)] 
conf: Always format storage source auth and encryption under <source> for backing files

Historically there are two places where we format authentication and
encryption for a disk. The logich which formats it for backing files was
flawed though and didn't format it at all. This worked if the image
became a backing file through the means of a snapshot but not directly.

Force formatting of the source and encryption for any non-disk case to
fix the issue.

This caused problems in many places as we use the formatter to copy the
definition. Effectively any copy lost the secret definition.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2xml: Enable luks-disks-source-qcow2 case
Peter Krempa [Fri, 10 Jan 2020 16:35:10 +0000 (17:35 +0100)] 
tests: qemuxml2xml: Enable luks-disks-source-qcow2 case

The test data was used only in xml->argv testing but it will have some
interresting fallout soon.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2argv: Run luks-disks-source-qcow2 case with latest caps
Peter Krempa [Fri, 10 Jan 2020 16:49:42 +0000 (17:49 +0100)] 
tests: qemuxml2argv: Run luks-disks-source-qcow2 case with latest caps

Try also the modern incarnation of the test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2argv: Add disk image with encrypted backing file
Peter Krempa [Fri, 10 Jan 2020 16:32:33 +0000 (17:32 +0100)] 
tests: qemuxml2argv: Add disk image with encrypted backing file

Add another disk to luks-disks-source-qcow2 case to cover a backing
chain with encrypted members.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemuxml2*test: Fix hugepages-default-system-size tests
Jiri Denemark [Mon, 13 Jan 2020 08:39:22 +0000 (09:39 +0100)] 
qemuxml2*test: Fix hugepages-default-system-size tests

Commit v5.10.0-269-g62065a6cb5 moved NUMA validation code to domain
definition time and appropriately adjusted affected test cases except
for hugepages-default-system-size. And since we don't mock
virGetSystemPageSizeKB in our tests, hugepages-default-system-size test
would fail on architectures (ppc64le) with default page size other than
4KiB.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoFix typo (cetificate -> certificate)
Andrea Bolognani [Mon, 13 Jan 2020 10:47:41 +0000 (11:47 +0100)] 
Fix typo (cetificate -> certificate)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
5 years agovirerror: Make it easier to add new error number
Michal Privoznik [Thu, 9 Jan 2020 08:53:31 +0000 (09:53 +0100)] 
virerror: Make it easier to add new error number

In v5.0.0-rc1~94 we switched from one huge switch() to an array
for translating error numbers into error messages. However, the
array is declared to have VIR_ERR_NUMBER_LAST items which makes
it impossible to spot this place by compile checking when adding
new error number.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonews: Mention problems with backing image format probing
Peter Krempa [Fri, 10 Jan 2020 11:28:19 +0000 (12:28 +0100)] 
news: Mention problems with backing image format probing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: storage: Link to knowledge base when reporting missing image backing format
Peter Krempa [Fri, 10 Jan 2020 11:27:07 +0000 (12:27 +0100)] 
util: storage: Link to knowledge base when reporting missing image backing format

Mention the knowledge base article which has tips how to fix the backing
chain to work with current libvirt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agotests: avoid re-execing test once for each mock
Daniel P. Berrangé [Thu, 9 Jan 2020 18:01:44 +0000 (18:01 +0000)] 
tests: avoid re-execing test once for each mock

When debugging tests under GDB/valgrind there is a significant
delay each time an execve is done as they scan shared libraries
once again. For tests which use many mock libraries, we have
been invoking execve many times which makes the debug experience
horrible. This changes our framework to activate the full
set of mock libraries in one single execve.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: Add snapshot-revert qemu managedsave force
Michael Weiser [Fri, 3 Jan 2020 18:43:25 +0000 (19:43 +0100)] 
docs: Add snapshot-revert qemu managedsave force

Add documentation for additional reason why snapshot-revert might need
to be forced. This explains why restoring an inactive snapshot while
there is managed saved state is refused by default.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Reformat snapshot-revert force reasons
Michael Weiser [Fri, 3 Jan 2020 18:43:24 +0000 (19:43 +0100)] 
docs: Reformat snapshot-revert force reasons

Reformat explanations of the snapshot-revert force reasons in
preparation for more to be added. This is a simple reformat without any
wording changes.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Warn of restore with managed save being risky
Michael Weiser [Fri, 3 Jan 2020 18:43:23 +0000 (19:43 +0100)] 
qemu: Warn of restore with managed save being risky

Internal snapshots of a non-running domain do not carry any memory state
and restoring such a snapshot will not replace existing saved memory
state. This allows a scenario, where a user first suspends a domain into
managedsave, restores a non-running snapshot and then resumes the domain
from managedsave. After that, the guest system will run with its
previous memory state atop a different disk state. The most obvious
possible fallout from this is extensive file system corruption. Swap
content and RAID bitmaps might also be off.

This has been discussed[1] and fixed[2] from the end-user perspective for
virt-manager.

This patch marks the restore operation as risky at the libvirt level,
requiring the user to remove the saved memory state first or force the
operation.

[1] https://www.redhat.com/archives/virt-tools-list/2019-November/msg00011.html
[2] https://www.redhat.com/archives/virt-tools-list/2019-December/msg00049.html

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Harmonize hypervisor names for QEMU and LXC
Michael Weiser [Fri, 3 Jan 2020 18:39:56 +0000 (19:39 +0100)] 
docs: Harmonize hypervisor names for QEMU and LXC

Trivially replace usages of qemu and lxc in the virsh manpage with their
more heavily used and (according to Wikipedia) correct upper-case
spellings QEMU and LXC.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Don't use NULL path from qemuDomainGetHostdevPath v6.0.0-rc1
Jiri Denemark [Thu, 9 Jan 2020 14:40:14 +0000 (15:40 +0100)] 
qemu: Don't use NULL path from qemuDomainGetHostdevPath

Commit v5.10.0-290-g3a4787a301 refactored qemuDomainGetHostdevPath to
return a single path rather than an array of paths. When the function is
called on a missing device, it will now return NULL in @path rather than
a NULL array with zero items and the callers need to be adapted
properly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirsh migrate: Require --tls for --tls-destination
Jiri Denemark [Tue, 17 Dec 2019 13:31:10 +0000 (14:31 +0100)] 
virsh migrate: Require --tls for --tls-destination

--tls-destination would be just ignored unless --tls is not specified,
which is correct, but let's provide a bit of a guidance is a user
forgets to add --tls.

This is just a virsh-only check targeted to end users as we don't
currently have such checks at the API level for migration parameters
that depend on flags.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agotests: avoid probing host CPU from bhyve test
Daniel P. Berrangé [Wed, 8 Jan 2020 18:17:58 +0000 (18:17 +0000)] 
tests: avoid probing host CPU from bhyve test

bhyveargv2xmlmock calls virBhyveCapsBuild which in turn
calls virCPUProbeHost, probing the real host CPU. This
causes a test failure if the host CPU happens to contain
the 'arch-capabilities' feature as it triggers a call
to virHostCPUGetMSR() which fails on FreeBSD.

Fortunately we already have convenient code for mocking
the host CPU probing.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoschema: Allow iSCSI source to have interleaved children
Michal Privoznik [Wed, 8 Jan 2020 16:03:42 +0000 (17:03 +0100)] 
schema: Allow iSCSI source to have interleaved children

There is no need to require users to produce iSCSI disk source
following our ordering of children elements. In fact, we don't
even accept our own order in the schema :(.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agobhyve_parse_command: Undefine CONSUME_ARG macro when no longer needed
Michal Privoznik [Wed, 8 Jan 2020 10:17:23 +0000 (11:17 +0100)] 
bhyve_parse_command: Undefine CONSUME_ARG macro when no longer needed

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agobhyve_parse_command.c: Don't jump onto non-existent label in CONSUME_ARG()
Michal Privoznik [Wed, 8 Jan 2020 10:13:55 +0000 (11:13 +0100)] 
bhyve_parse_command.c: Don't jump onto non-existent label in CONSUME_ARG()

In v5.10.0-508-gfbf3f3d86a, the 'error' label was removed from
bhyveParseBhyveCommandLine(), however the CONSUME_ARG() macro
still uses it. Fix the macro to return an error instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: fix implicit fallthrough warning
Ján Tomko [Wed, 8 Jan 2020 09:20:39 +0000 (10:20 +0100)] 
qemu: fix implicit fallthrough warning

src/qemu/qemu_domain_address.c:680:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             switch ((virDomainFSModel) dev->data.fs->model) {

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: f363af7e351c6cac0ff442390d0dab283cbd9fae
5 years agovz: Don't try to jump on a non-existent label in prlsdkRemoveBootDevices()
Michal Privoznik [Wed, 8 Jan 2020 08:46:27 +0000 (09:46 +0100)] 
vz: Don't try to jump on a non-existent label in prlsdkRemoveBootDevices()

Commit v5.10.0-522-g9000b2f298 was too aggressive and removed the
'error' label from prlsdkRemoveBootDevices() even though it's
used. Luckily, it's used only from one place and we have an
alternative for it that doesn't require the label.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()
Michal Privoznik [Wed, 8 Jan 2020 08:42:47 +0000 (09:42 +0100)] 
qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()

The point of this function is to translate virDomainOsDefFirmware
enum to qemuFirmwareOSInterface enum. However, with my commit
v5.10.0-507-g8e1804f9f6 we are passing a variable type of
virDomainLoader enum. Make the function accept both enums and
make the enum members correspond to each other.

This fixes clang build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: formatdomain: use 'element' instead of 'block'
Ján Tomko [Wed, 18 Dec 2019 14:09:20 +0000 (15:09 +0100)] 
docs: formatdomain: use 'element' instead of 'block'

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: command: take fsdriver type into account
Ján Tomko [Tue, 6 Aug 2019 15:57:44 +0000 (17:57 +0200)] 
qemu: command: take fsdriver type into account

Split the formatting by fsdriver type to allow adding a new type.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: address: take fsdriver type into account
Ján Tomko [Tue, 16 Jul 2019 06:27:28 +0000 (08:27 +0200)] 
qemu: address: take fsdriver type into account

Split the switch by fsdriver type to allow adding a new one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: pass private data to qemuBuildFilesystemCommandLine
Ján Tomko [Tue, 6 Aug 2019 16:22:24 +0000 (18:22 +0200)] 
qemu: pass private data to qemuBuildFilesystemCommandLine

This will be used by a future patch.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: add private data to virDomainFSDef
Ján Tomko [Tue, 10 Dec 2019 12:53:10 +0000 (13:53 +0100)] 
qemu: add private data to virDomainFSDef

Wire up the allocation and disposal of private data.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add private data to virDomainFSDef
Ján Tomko [Tue, 10 Dec 2019 12:52:52 +0000 (13:52 +0100)] 
conf: add private data to virDomainFSDef

Add an object to hold the private data and call the
allocation function if it's present in xmlopt.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add xmlopt to virDomainFSDefNew
Ján Tomko [Tue, 10 Dec 2019 12:51:54 +0000 (13:51 +0100)] 
conf: add xmlopt to virDomainFSDefNew

This will be needed in the future for allocating private data.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: rename gluster_debug_entry
Ján Tomko [Wed, 11 Dec 2019 21:22:31 +0000 (22:22 +0100)] 
qemu: rename gluster_debug_entry

Remove the 'gluster' part and decouple the return from
the gluster_debug_level parsing to allow adding more options
to this section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: error out when check-augeas fails
Ján Tomko [Wed, 18 Dec 2019 13:42:46 +0000 (14:42 +0100)] 
build: error out when check-augeas fails

Fixes: 2ffbdabb859594256d45c1b48521dd6501629852
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: backup: Move capability check after inactive check
Peter Krempa [Mon, 6 Jan 2020 11:27:40 +0000 (12:27 +0100)] 
qemu: backup: Move capability check after inactive check

Inactive VM doesn't have qemuCaps set thus we'd never properly report
that VM backups are supported only for running VMs.

Move the capability check after the active check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agopo: Fix indentation of SED_PO_FIXUP_ARGS variable
Michal Privoznik [Tue, 7 Jan 2020 16:36:59 +0000 (17:36 +0100)] 
po: Fix indentation of SED_PO_FIXUP_ARGS variable

The variable value is split on multiple lines, which have too
long indentation prefix leading to needless long lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoremote_daemon: Initialize host boot time global variable
Michal Privoznik [Tue, 17 Dec 2019 13:08:42 +0000 (14:08 +0100)] 
remote_daemon: Initialize host boot time global variable

This is not strictly needed, but it makes sure we initialize the
@bootTime global variable. Thing is, in order to validate XATTRs
and prune those set in some previous runs of the host, a
timestamp is recorded in XATTRs. The host boot time was unique
enough so it was chosen as the timestamp value. And to avoid
querying and parsing /proc/uptime every time, the query function
does that only once and stores the boot time in a global
variable. However, the only time the query function is called is
in a child process that does lock files and changes seclabels. So
effectively, we are doing exactly what we wanted to prevent from
happening.

The fix is simple, call the virHostBootTimeInit() function which
sets the global variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirhostuptime: Introduce virHostBootTimeInit()
Michal Privoznik [Thu, 19 Dec 2019 09:11:04 +0000 (10:11 +0100)] 
virhostuptime: Introduce virHostBootTimeInit()

The idea is to offer callers an init function that they can call
independently to ensure that the global variables get
initialized.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirt-aa-helper: Drop unused variable in verify_xpath_context()
Michal Privoznik [Tue, 7 Jan 2020 15:55:50 +0000 (16:55 +0100)] 
virt-aa-helper: Drop unused variable in verify_xpath_context()

After one of previous commits (v5.10.0-524-gce56408e5f) there is
a variable left unused in verify_xpath_context() which breaks the
build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoexamples: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:50 +0000 (18:57 -0300)] 
examples: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotests: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:49 +0000 (18:57 -0300)] 
tests: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agologging: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:48 +0000 (18:57 -0300)] 
logging: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoutil: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:45 +0000 (18:57 -0300)] 
util: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosecurity: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:44 +0000 (18:57 -0300)] 
security: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovbox: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:43 +0000 (18:57 -0300)] 
vbox: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovz/vz_sdk.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:42 +0000 (18:57 -0300)] 
vz/vz_sdk.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:40 +0000 (18:57 -0300)] 
qemu: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoopenvz: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:39 +0000 (18:57 -0300)] 
openvz: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosecret/secret_driver.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:38 +0000 (18:57 -0300)] 
secret/secret_driver.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonode_device: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:37 +0000 (18:57 -0300)] 
node_device: remove unneeded labels

gather_scsi_host_cap() in node_device_hal.c can be greatly
simplified, given that the 'out' label is always getting
hit regardless of 'retval', which can also be eliminated.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agolxc: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:36 +0000 (18:57 -0300)] 
lxc: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agocpu/cpu_ppc64.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:35 +0000 (18:57 -0300)] 
cpu/cpu_ppc64.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agolocking/lock_driver_lockd.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:34 +0000 (18:57 -0300)] 
locking/lock_driver_lockd.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agohyperv/hyperv_wmi.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:33 +0000 (18:57 -0300)] 
hyperv/hyperv_wmi.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoremote/remote_daemon_config.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:32 +0000 (18:57 -0300)] 
remote/remote_daemon_config.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonwfilter: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:31 +0000 (18:57 -0300)] 
nwfilter: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agostorage: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:30 +0000 (18:57 -0300)] 
storage: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest/test_driver.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:29 +0000 (18:57 -0300)] 
test/test_driver.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoconf: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:26 +0000 (18:57 -0300)] 
conf: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agobhyve: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:25 +0000 (18:57 -0300)] 
bhyve: remove unneeded labels

Labels that are simply a jump to a 'return' call are
unneeded and can be replaced by the return value instead.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu_firmware: Try to autofill for old style UEFI specification
Michal Privoznik [Tue, 17 Dec 2019 16:45:50 +0000 (17:45 +0100)] 
qemu_firmware: Try to autofill for old style UEFI specification

While we discourage people to use the old style of specifying
UEFI for their domains (the old style is putting path to the FW
image under /domain/os/loader/ whilst the new one is using
/domain/os/@firmware), some applications might have not adapted
yet. They still rely on libvirt autofilling NVRAM path and
figuring out NVRAM template when using the old way (notably
virt-install does this). We must preserve backcompat for this
previously supported config approach. However, since we really
want distro maintainers to leave --with-loader-nvram configure
option and rely on JSON descriptors, we need to implement
autofilling of NVRAM template for the old way too.

Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1782778
RHEL: https://bugzilla.redhat.com/show_bug.cgi?id=1776949

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>