]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agovirLXCProcessSetupNamespaceName: Fix potential uninitialized free of 'path'
Peter Krempa [Thu, 5 Mar 2020 08:25:35 +0000 (09:25 +0100)]
virLXCProcessSetupNamespaceName: Fix potential uninitialized free of 'path'

'path' could be accessed uninitialized. Fix it by using g_autofree which
also mandates initialization.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirNetworkPortDefSaveStatus: Fix potentially uninitialized 'path' by refactoring...
Peter Krempa [Thu, 5 Mar 2020 08:20:48 +0000 (09:20 +0100)]
virNetworkPortDefSaveStatus: Fix potentially uninitialized 'path' by refactoring cleanup

Use 'g_autofree' to clean both 'path' and 'xml' which mandates
initialization and get rid of the 'cleanup' label and 'ret variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc: add pthread_np.h include for FreeBSD
Daniel P. Berrangé [Thu, 5 Mar 2020 15:13:45 +0000 (15:13 +0000)]
src: add pthread_np.h include for FreeBSD

On FreeBSD the non-portable pthread APIs need to be obtained
via the pthread_np.h header.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: improve thread naming with human targetted names
Daniel P. Berrangé [Fri, 14 Feb 2020 11:20:10 +0000 (11:20 +0000)]
src: improve thread naming with human targetted names

Historically threads are given a name based on the C function,
and this name is just used inside libvirt. With OS level thread
naming this name is now visible to debuggers, but also has to
fit in 15 characters on Linux, so function names are too long
in some cases.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: set the OS level thread name
Daniel P. Berrangé [Fri, 14 Feb 2020 10:44:01 +0000 (10:44 +0000)]
src: set the OS level thread name

Setting the thread name makes it easier to debug libvirtd
when many threads are running.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: drop ability to open monitor from FD
Daniel P. Berrangé [Wed, 12 Feb 2020 14:08:01 +0000 (14:08 +0000)]
qemu: drop ability to open monitor from FD

The qemuMonitorOpenFD method has not been used since it
was first introduced.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: drop support for agent connections on PTYs
Daniel P. Berrangé [Wed, 12 Feb 2020 11:45:10 +0000 (11:45 +0000)]
qemu: drop support for agent connections on PTYs

Libvirt has never configured the QEMU agent to support
running on a PTY implicitly. In theory an end user may
have written such an XML config, but this is reasonably
unlikely since when a bare <channel> is provided, libvirt
will auto-expand it to a UNIX socket backend.

With this change a user who has use the PTY backend will
have to switch to the UNIX backend if they wish to use
libvirt APIs for interacting with the agent. This will
not have guest ABI impact.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemuhotplugtestcpus: Always use 'query-cpus-fast'
Peter Krempa [Wed, 4 Mar 2020 11:19:39 +0000 (12:19 +0100)]
qemuhotplugtestcpus: Always use 'query-cpus-fast'

Use the new command in the test suite by asserting the capability
and adjusting test data to the correct field names as they changed
compared to 'query-cpus'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemuMonitorJSONSetMigrationParams: Refactor command construction and cleanup
Peter Krempa [Wed, 4 Mar 2020 09:10:56 +0000 (10:10 +0100)]
qemuMonitorJSONSetMigrationParams: Refactor command construction and cleanup

qemuMonitorJSONMakeCommandInternal does the full command construction if
you pass in what would become the value of the 'arguments' key. Refactor
the open-coded implementation to use the helper and use modern cleanup
helpers at the same time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: json: Convert virJSONValueNewObject() to g_new0
Peter Krempa [Wed, 4 Mar 2020 09:04:33 +0000 (10:04 +0100)]
util: json: Convert virJSONValueNewObject() to g_new0

Make it obvious that the function always returns a valid pointer and fix
all callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu_shim: Ignore SIGPIPE
Michal Privoznik [Fri, 28 Feb 2020 14:36:49 +0000 (15:36 +0100)]
qemu_shim: Ignore SIGPIPE

I've found that if my virtlogd is socket activated but the daemon
doesn't run yet, then the virt-qemu-run is killed right after it
tries to start the domain. The problem is that because the default
setting is to use virtlogd, the domain create code tries to
connect to virtlogd socket, which in turn tries to detect who is
connecting (virNetSocketGetUNIXIdentity()) and as a part of it,
it will try to open /proc/${PID_OF_SHIM}/stat which is denied by
SELinux:

  type=AVC msg=audit(1582903501.927:323): avc:  denied  { search } for  \
  pid=1210 comm="virtlogd" name="1843" dev="proc" ino=37224 \
  scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 \
  tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=dir \
  permissive=0

Virtlogd reacts by closing the connection which the shim sees as
SIGPIPE. Since the default response to the signal is Term, we
don't even get to reporting any error nor to removing the
temporary directory.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu_shim: Allow other users to enter the root dir
Michal Privoznik [Fri, 28 Feb 2020 13:42:44 +0000 (14:42 +0100)]
qemu_shim: Allow other users to enter the root dir

When virt-qemu-run is ran without any root directory specified on
the command line, a temporary directory is made and used instead.
But since we are using g_dir_make_tmp() to create the directory
it is going to have 0700 mode. So even though we create the whole
directory structure under it and label everything, QEMU is very
likely to not have the access. This is because in this case there
is no qemu.conf and thus distro default UID:GID is used to run
QEMU (e.g. qemu:kvm on Fedora). Change the mode of the temporary
directory so that everybody has eXecute permission.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: Don't compare local and remote hostnames on migration
Michal Privoznik [Tue, 25 Feb 2020 14:53:12 +0000 (15:53 +0100)]
qemu: Don't compare local and remote hostnames on migration

Libvirt tries to forbid migration onto the same host and it does
that by checking if local and remote hostnames are the same and
whether local and remote UUIDs are the same. Well, the latter
makes sense but the former doesn't really because libvirtd can be
running inside an UTS namespace and hostnames can appear the same
on both sides of migration. On the other hand, host UUIDs are
unique, so rely on them when trying to prevent migration onto the
same host.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoadmin: use g_autofree
Gaurav Agrawal [Wed, 4 Mar 2020 18:06:13 +0000 (23:36 +0530)]
admin: use g_autofree

Signed-off-by: Gaurav Agrawal <agrawalgaurav@gnome.org>
[removed dead assignment]
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: do not include skipped tests in failedTests
Ján Tomko [Wed, 4 Mar 2020 15:48:27 +0000 (16:48 +0100)]
tests: do not include skipped tests in failedTests

We recognize three return values from tests:
* OK    -> 0
* SKIP  -> EXIT_AM_SKIP
* ERROR -> anything else

Also check for EXIT_AM_SKIP when building a bitmap of failed tests,
otherwise the skipped tests would be printed in the suggested range
of tests that shoud be re-run.

Reported-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: cebb468ef5e82b8d4253e27ef70c67812cf93c5a
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: Don't request nested entries in qemuBlockGetNamedNodeData
Peter Krempa [Tue, 21 Jan 2020 15:51:40 +0000 (16:51 +0100)]
qemu: Don't request nested entries in qemuBlockGetNamedNodeData

Use the 'flat' flag for 'query-named-block-nodes' if qemu supports
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT in qemuBlockGetNamedNodeData.

We don't need the data so plumb in whether qemu supports the
'flat' output.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add 'flat' parameter for qemuMonitorJSONQueryNamedBlockNodes
Peter Krempa [Tue, 21 Jan 2020 15:42:49 +0000 (16:42 +0100)]
qemu: monitor: Add 'flat' parameter for qemuMonitorJSONQueryNamedBlockNodes

Modern qemu allows to skip the nested redundant data in the output of
query-named-block-nodes. Plumb in the support for the argument that
enables it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuCheckpointDiscardBitmaps: Use qemuBlockGetNamedNodeData
Peter Krempa [Wed, 26 Feb 2020 11:50:53 +0000 (12:50 +0100)]
qemuCheckpointDiscardBitmaps: Use qemuBlockGetNamedNodeData

Replace qemuMonitorBlockGetNamedNodeData by qemuBlockGetNamedNodeData.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Refactor variable cleanup in qemuMonitorJSONQueryNamedBlockNodes
Peter Krempa [Tue, 21 Jan 2020 15:33:12 +0000 (16:33 +0100)]
qemu: monitor: Refactor variable cleanup in qemuMonitorJSONQueryNamedBlockNodes

Use g_autoptr to get rid of the cleanup section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: capabilities: Add capability for the 'flat' argument of 'query-named-block...
Peter Krempa [Tue, 21 Jan 2020 14:13:47 +0000 (15:13 +0100)]
qemu: capabilities: Add capability for the 'flat' argument of 'query-named-block-nodes'

Detect the presence of the flag and make it available internally as
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Remove leftovers from password callback
Peter Krempa [Tue, 21 Jan 2020 13:54:37 +0000 (14:54 +0100)]
qemu: monitor: Remove leftovers from password callback

The monitor password callback was removed long time ago but the callback
type and variable were left around. Finish the cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemucapabilities: Update capabilities of qemu-5.0.0 on x86_64
Peter Krempa [Thu, 23 Jan 2020 16:21:15 +0000 (17:21 +0100)]
tests: qemucapabilities: Update capabilities of qemu-5.0.0 on x86_64

Update to v4.2.0-1858-gdb736e0437 which contains my commit for 'flat'
output of 'query-named-block-nodes'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: default to virtio bus for input passthrough
Ján Tomko [Tue, 25 Feb 2020 14:46:31 +0000 (15:46 +0100)]
conf: default to virtio bus for input passthrough

Other buses are not supported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoconf: only allow virtio bus for input passthrough
Ján Tomko [Tue, 25 Feb 2020 14:44:23 +0000 (15:44 +0100)]
conf: only allow virtio bus for input passthrough

Other buses are not supported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1724928
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: build vhost-user-fs device command line
Ján Tomko [Tue, 6 Aug 2019 16:21:32 +0000 (18:21 +0200)]
qemu: build vhost-user-fs device command line

Format the 'vhost-user-fs' device on the QEMU command line.

This device provides shared file system access using the FUSE protocol
carried over virtio.
The actual file server is implemented in an external vhost-user-fs device
backend process.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: use the vhost-user schemas to find binary
Ján Tomko [Tue, 28 Jan 2020 14:38:52 +0000 (15:38 +0100)]
qemu: use the vhost-user schemas to find binary

Look into /usr/share/qemu/vhost-user to see whether we can find
a suitable virtiofsd binary, in case the user did not provide one
in the domain XML.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: put virtiofsd in the emulator cgroup
Ján Tomko [Tue, 18 Feb 2020 15:12:29 +0000 (16:12 +0100)]
qemu: put virtiofsd in the emulator cgroup

Wire up the code to put virtiofsd in the emulator cgroup on domain
startup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: add code for handling virtiofsd
Ján Tomko [Fri, 1 Nov 2019 11:34:52 +0000 (12:34 +0100)]
qemu: add code for handling virtiofsd

Start virtiofsd for each <filesystem> device using it.

Pre-create the socket for communication with QEMU and pass it
to virtiofsd.

Note that virtiofsd needs to run as root.

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

Introduced by QEMU commit a43efa34c7d7b628cbf1ec0fe60043e5c91043ea

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: forbid migration with vhost-user-fs device
Ján Tomko [Thu, 30 Jan 2020 16:28:27 +0000 (17:28 +0100)]
qemu: forbid migration with vhost-user-fs device

This is not yet supported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: validate virtiofs filesystems
Ján Tomko [Wed, 18 Dec 2019 16:46:54 +0000 (17:46 +0100)]
qemu: validate virtiofs filesystems

Reject unsupported configurations.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
5 years agoqemu: add virtiofsd_debug to qemu.conf
Ján Tomko [Wed, 11 Dec 2019 21:30:06 +0000 (22:30 +0100)]
qemu: add virtiofsd_debug to qemu.conf

Add a 'virtiofsd_debug' option for tuning whether to run virtiofsd
in debug mode.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoconf: add virtiofs-related elements and attributes
Ján Tomko [Tue, 21 Jan 2020 07:14:46 +0000 (08:14 +0100)]
conf: add virtiofs-related elements and attributes

Add more elements for tuning the virtiofsd daemon
and the vhost-user-fs device:

  <driver type='virtiofs' queue='1024' xattr='on'>
    <binary path='/usr/libexec/virtiofsd'>
      <cache mode='always'/>
      <lock posix='off' flock='off'/>
    </binary>
  </driver>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoconf: qemu: add virtiofs fsdriver type
Ján Tomko [Tue, 16 Jul 2019 05:01:30 +0000 (07:01 +0200)]
conf: qemu: add virtiofs fsdriver type

Introduce a new 'virtiofs' driver type for filesystem.

<filesystem type='mount' accessmode='passthrough'>
  <driver type='virtiofs'/>
  <source dir='/path'/>
  <target dir='mount_tag'>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</filesystem>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: add virtiofs kbase
Ján Tomko [Wed, 11 Dec 2019 12:10:07 +0000 (13:10 +0100)]
docs: add virtiofs kbase

Add a document describing the usage of virtiofs.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: add QEMU_CAPS_DEVICE_VHOST_USER_FS
Ján Tomko [Wed, 6 Feb 2019 12:29:00 +0000 (13:29 +0100)]
qemu: add QEMU_CAPS_DEVICE_VHOST_USER_FS

Introduced by QEMU commit 98fc1ada4cf70af0f1df1a2d7183cf786fc7da05
    virtio: add vhost-user-fs base device

Released in QEMU v4.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemuxml2xmltest: set driver as privileged
Ján Tomko [Wed, 26 Feb 2020 11:51:44 +0000 (12:51 +0100)]
qemuxml2xmltest: set driver as privileged

Some validation check might reject unprivileged drivers in the future.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: pass virDomainObjPtr to qemuExtDevicesSetupCgroup
Ján Tomko [Wed, 26 Feb 2020 11:45:02 +0000 (12:45 +0100)]
qemu: pass virDomainObjPtr to qemuExtDevicesSetupCgroup

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemuExtDevicesStart: pass logManager
Ján Tomko [Sat, 25 Jan 2020 17:35:13 +0000 (18:35 +0100)]
qemuExtDevicesStart: pass logManager

Pass logManager to qemuExtDevicesStart for future usage.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agoschema: wrap fsDriver in a choice group
Ján Tomko [Tue, 21 Jan 2020 08:02:58 +0000 (09:02 +0100)]
schema: wrap fsDriver in a choice group

Allow adding new groups without changing indentation.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
5 years agogitdm: Add missing entries
Andrea Bolognani [Fri, 28 Feb 2020 18:25:39 +0000 (19:25 +0100)]
gitdm: Add missing entries

A few new companies have contributed to libvirt since the last
time the gitdm configuration was updated.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agogitdm: Fix sorting
Andrea Bolognani [Fri, 28 Feb 2020 18:25:32 +0000 (19:25 +0100)]
gitdm: Fix sorting

Fixes: 3a3a85c529e92ad767fb2222e01587186854c175
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agogitdm: Add entry for example.com
Andrea Bolognani [Fri, 28 Feb 2020 18:29:02 +0000 (19:29 +0100)]
gitdm: Add entry for example.com

We already have one instance of it being used in our git history,
and more are probably bound to show up eventually.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoci: Drop handling of $PKG_CONFIG_LIBDIR
Andrea Bolognani [Tue, 25 Feb 2020 14:41:23 +0000 (15:41 +0100)]
ci: Drop handling of $PKG_CONFIG_LIBDIR

As of libvirt-jenkins-ci commit e41e341f0d8f, we no longer bake
this environment variable into our container images.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agomaint: Post-release version bump to 6.2.0
Michal Privoznik [Wed, 4 Mar 2020 09:32:58 +0000 (10:32 +0100)]
maint: Post-release version bump to 6.2.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoRelease of libvirt-6.1.0
Daniel Veillard [Tue, 3 Mar 2020 13:14:08 +0000 (14:14 +0100)]
Release of libvirt-6.1.0

* docs/news.xml: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
5 years agonews: Update for libvirt 6.1.0
Andrea Bolognani [Fri, 28 Feb 2020 17:50:51 +0000 (18:50 +0100)]
news: Update for libvirt 6.1.0

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonews: Document recent storage improvements
Peter Krempa [Thu, 27 Feb 2020 08:38:06 +0000 (09:38 +0100)]
news: Document recent storage improvements

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agokbase: backing_chains: Add steps how to securely probe image format
Peter Krempa [Thu, 27 Feb 2020 08:08:26 +0000 (09:08 +0100)]
kbase: backing_chains: Add steps how to securely probe image format

We document steps how to fix images if they are rejected for missing
the 'backing file format' field. Document also how to securely probe
the image format if it's unknown.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodaemon: set default memlock limit for systemd service
Pavel Hrdina [Wed, 26 Feb 2020 12:23:00 +0000 (13:23 +0100)]
daemon: set default memlock limit for systemd service

The default memlock limit is 64k which is not enough to start a single
VM. The requirements for one VM are 12k, 8k for eBPF map and 4k for eBPF
program, however, it fails to create eBPF map and program with 64k limit.
By testing I figured out that the minimal limit is 80k to start a single
VM with functional eBPF and if I add 12k I can start another one.

This leads into following calculation:

80k as memlock limit worked to start a VM with eBPF which means there
is 68k of lock memory that I was not able to figure out what was using
it.  So to get a number for 4096 VMs:

        68 + 12 * 4096 = 49220

If we round it up we will get 64M of memory lock limit to support 4096
VMs with default map size which can hold 64 entries for devices.

This should be good enough as a sane default and users can change it if
the need to.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: document port isolated property in domain/network/networkport
Laine Stump [Wed, 26 Feb 2020 00:47:07 +0000 (19:47 -0500)]
docs: document port isolated property in domain/network/networkport

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: fix docs about bandwidth setting with bridge networks
Daniel P. Berrangé [Tue, 25 Feb 2020 15:49:03 +0000 (15:49 +0000)]
docs: fix docs about bandwidth setting with bridge networks

We now support setting bandwidth on networks with type bridge.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Do not set default CPU for archs without CPU driver
Jiri Denemark [Tue, 25 Feb 2020 15:05:06 +0000 (16:05 +0100)]
qemu: Do not set default CPU for archs without CPU driver

Whenever there is a guest CPU configured in domain XML, we will call
some CPU driver APIs to validate the CPU definition and check its
compatibility with the hypervisor. Thus domains with guest CPU
specification can only be started if the guest architecture is supported
by the CPU driver. But we would add a default CPU to any domain as long
as QEMU reports it causing failures to start any domain on affected
architectures.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agokbase: backing_chains: Clarify some aspects of image probing
Peter Krempa [Tue, 25 Feb 2020 12:39:42 +0000 (13:39 +0100)]
kbase: backing_chains: Clarify some aspects of image probing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirStorageFileGetMetadataRecurse: Allow format probing under special circumstances
Peter Krempa [Mon, 17 Feb 2020 09:08:25 +0000 (10:08 +0100)]
virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

Allow format probing to work around lazy clients which did not specify
their format in the overlay. Format probing will be allowed only, if we
are able to probe the image, the probing result was successful and the
probed image does not have any backing or data file.

This relaxes the restrictions which were imposed in commit 3615e8b39bad
in cases when we know that the image probing will not result in security
issues or data corruption.

We perform the image format detection and in the case that we were able
to probe the format and the format does not specify a backing store (or
doesn't support backing store) we can use this format.

With pre-blockdev configurations this will restore the previous
behaviour for the images mentioned above as qemu would probe the format
anyways. It also improves error reporting compared to the old state as
we now report that the backing chain will be broken in case when there
is a backing file.

In blockdev configurations this ensures that libvirt will not cause data
corruption by ending the chain prematurely without notifying the user,
but still allows the old semantics when the users forgot to specify the
format.

Users thus don't have to re-invent when image format detection is safe
to do.

The price for this is that libvirt will need to keep the image format
detector still current and working or replace it by invocation of
qemu-img.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: domain: Convert detected 'iso' image format into 'raw'
Peter Krempa [Tue, 25 Feb 2020 12:28:10 +0000 (13:28 +0100)]
qemu: domain: Convert detected 'iso' image format into 'raw'

While our code can detect ISO as a separate format, qemu does not use it
as such and just passes it through as raw. Add conversion for detected
parts of the backing chain so that the validation code does not reject
it right away.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: include virnetworkportdef.h in domain_conf.h
Ján Tomko [Mon, 17 Feb 2020 17:51:55 +0000 (18:51 +0100)]
conf: include virnetworkportdef.h in domain_conf.h

Now that this file no longer transitively includes
domain_conf.h, it can be included here.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: reduce includes in virnetworkportdef.h
Ján Tomko [Sat, 22 Feb 2020 16:01:14 +0000 (17:01 +0100)]
conf: reduce includes in virnetworkportdef.h

All the _conf includes are only needed in the C file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: do not pass vm object to virDomainClearNetBandwidth
Ján Tomko [Mon, 17 Feb 2020 17:37:25 +0000 (18:37 +0100)]
conf: do not pass vm object to virDomainClearNetBandwidth

This function only uses the domain definition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: virNetDevSupportsBandwidth: move into the C file
Ján Tomko [Mon, 17 Feb 2020 17:35:37 +0000 (18:35 +0100)]
conf: virNetDevSupportsBandwidth: move into the C file

Make the header easier to read and let the compiler inline
what it wants.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: rename virNetDevSupportBandwidth to virNetDevSupportsBandwidth
Ján Tomko [Mon, 17 Feb 2020 17:17:23 +0000 (18:17 +0100)]
conf: rename virNetDevSupportBandwidth to virNetDevSupportsBandwidth

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: virnetworkportdef: include virnetdevmacvlan
Ján Tomko [Sat, 22 Feb 2020 16:08:57 +0000 (17:08 +0100)]
conf: virnetworkportdef: include virnetdevmacvlan

This is pulled in via domain_conf.h somehow, but it is directly used.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agobridge: include netdev_bandwidth_conf.h
Ján Tomko [Sat, 22 Feb 2020 15:57:50 +0000 (16:57 +0100)]
bridge: include netdev_bandwidth_conf.h

This file uses the virNetDevBandwidth*Floor helpers
without including the correct include,
relying on virnetworkportdef.h to include it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 17f430eb5cfaaa3388077f2b0856f011f0b2a4c3
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: virnwfilterbindingdef: include virxml.h
Ján Tomko [Sun, 16 Feb 2020 22:09:05 +0000 (23:09 +0100)]
conf: virnwfilterbindingdef: include virxml.h

The ParseNode function takes arguments with types
from libxml.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: fix missing test data for network port XML
Daniel P. Berrangé [Tue, 25 Feb 2020 11:08:41 +0000 (11:08 +0000)]
tests: fix missing test data for network port XML

The network port XML files were not including any usage of vlan
tags or port options, and one of the files was not even processed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agolxc: Replacing default strings definitions by g_autofree statement
Julio Faracco [Mon, 24 Feb 2020 14:24:27 +0000 (11:24 -0300)]
lxc: Replacing default strings definitions by g_autofree statement

There are a lots of strings being handled inside some LXC functions.
They can be moved to g_autofree to avoid declaring a return value to get
proper code cleanups. This commit is changing functions from
lxc_{controller,cgroup,fuse} only.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
5 years agotests: libxl: do not run the emulator
Ján Tomko [Sat, 22 Feb 2020 12:56:19 +0000 (13:56 +0100)]
tests: libxl: do not run the emulator

Ever since commit c5a00350 the libxl parser invokes the emulator
to probe which device model to use.

Commit b90c4b5 introduced a workaround that used a stable path
which was very likely to result in the answer matching the default.
However the test is still affected by the host state and the binary
gets invoked if present.

Mock the libxlDomainGetEmulatorType function to stop wasting CPU
cycles every time a 'make check' is run on a system with xen installed.

For example xlconfigtest gets faster by 90 %

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: b90c4b5f505698d600303c5b4f03f5d229b329dd
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agotests: link the libxl tests with libxltestdriver.la
Ján Tomko [Sat, 22 Feb 2020 13:51:05 +0000 (14:51 +0100)]
tests: link the libxl tests with libxltestdriver.la

This lets us mock functions from the libxl driver.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agolibxl: do not mock virFileMakePath
Ján Tomko [Sat, 22 Feb 2020 12:12:17 +0000 (13:12 +0100)]
libxl: do not mock virFileMakePath

Point the logDir to abs_builddir instead.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agolibxl: split out DriverConfigInit out of DriverConfigNew
Ján Tomko [Sat, 22 Feb 2020 12:01:38 +0000 (13:01 +0100)]
libxl: split out DriverConfigInit out of DriverConfigNew

Take the parts affected by the host state out of DriverConfigNew
and put them into a separate function.

Adjust all the callers to call both functions.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agolibxl: StateInitialize: use g_autofree
Ján Tomko [Sat, 22 Feb 2020 12:02:27 +0000 (13:02 +0100)]
libxl: StateInitialize: use g_autofree

Use g_autofree to free the driver config file path.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agolibxl: conf: move default keepalive settings to libxlDriverConfigNew
Ján Tomko [Sat, 22 Feb 2020 12:02:18 +0000 (13:02 +0100)]
libxl: conf: move default keepalive settings to libxlDriverConfigNew

These hardcoded defaults do not need to be read from
the file. Move them out of libxlDriverConfigLoadFile.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agotestutilsxen: error out on initialization failure
Ján Tomko [Sat, 22 Feb 2020 11:44:45 +0000 (12:44 +0100)]
testutilsxen: error out on initialization failure

libxlDriverConfigNew can possibly fail on wrong
firmware values (unlikely) or on failure to create
the log directory (possible if you're debugging
tests with VIR_FILE_ACCESS)

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 4a4132b4625778cf80acb9c92d06351b44468ac3
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agosecurity: Don't fail if locking a file on NFS mount fails
Michal Privoznik [Thu, 20 Feb 2020 14:38:43 +0000 (15:38 +0100)]
security: Don't fail if locking a file on NFS mount fails

The way that our file locking works is that we open() the file we
want to lock and then use fcntl(fd, F_SETLKW, ...) to lock it.
The problem is, we are doing all of these as root which doesn't
work if the file lives on root squashed NFS, because if it does
then the open() fails. The way to resolve this is to make this a
non fatal error and leave callers deal with this (i.e. disable
remembering) - implemented in the previous commit.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agosecurity: Don't remember seclabel for paths we haven't locked successfully
Michal Privoznik [Thu, 20 Feb 2020 14:38:10 +0000 (15:38 +0100)]
security: Don't remember seclabel for paths we haven't locked successfully

There are some cases where we want to remember the original owner
of a file but we fail to lock it for XATTR change (e.g. root
squashed NFS). If that is the case we error out and refuse to
start a domain. Well, we can do better if we disable remembering
for paths we haven't locked successfully.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agovirSecurityManagerMetadataLock: Store locked paths
Michal Privoznik [Thu, 20 Feb 2020 14:37:48 +0000 (15:37 +0100)]
virSecurityManagerMetadataLock: Store locked paths

So far, in the lock state we are storing only the file
descriptors of the files we've locked. Therefore, when unlocking
them and something does wrong the only thing we can report is FD
number, which is not user friendly at all. But if we store paths
among with FDs we can do better error reporting.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agosrc: add virutil.h to more source files for geteuid() compat
Daniel P. Berrangé [Tue, 25 Feb 2020 10:01:09 +0000 (10:01 +0000)]
src: add virutil.h to more source files for geteuid() compat

The virutil.h header defines a geteuid() macro for Windows platforms.
This fixes a few missed cases from:

  commit b11e8cccdd5163727fd4cecda0076ac2b63fe32d
  Author: Ján Tomko <jtomko@redhat.com>
  Date:   Sun Feb 16 23:09:15 2020 +0100

    Remove virutil.h from all header files

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: stop running aclocal manually
Daniel P. Berrangé [Mon, 24 Feb 2020 16:45:12 +0000 (16:45 +0000)]
build: stop running aclocal manually

The autoreconf script will already run aclocal for us,
so there's no need to do that ahead of time.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonode_device: hal: include virutil.h
Ján Tomko [Tue, 25 Feb 2020 00:32:19 +0000 (01:32 +0100)]
node_device: hal: include virutil.h

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: b11e8cccdd5163727fd4cecda0076ac2b63fe32d
5 years agovirt-aa-helper: Fix build by including virutil.h
Jim Fehlig [Mon, 24 Feb 2020 23:24:14 +0000 (16:24 -0700)]
virt-aa-helper: Fix build by including virutil.h

Commit fb01e1a44d missed including virutil.h, causing the following
compilation error

../../src/security/virt-aa-helper.c:1055:43: error: implicit declaration of
function 'virHostGetDRMRenderNode' [-Werror=implicit-function-declaration]
1055 |                 char *defaultRenderNode = virHostGetDRMRenderNode();

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
5 years agoRemove virutil.h from all header files
Ján Tomko [Sun, 16 Feb 2020 22:09:15 +0000 (23:09 +0100)]
Remove virutil.h from all header files

After the split of enum functions into virenum.h,
this function does not contain anything worth including
in another header file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: include virutil.h where used
Ján Tomko [Sun, 16 Feb 2020 21:59:28 +0000 (22:59 +0100)]
virsh: include virutil.h where used

Include virutil.h in all files that use it,
instead of relying on it being pulled in somehow.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoInclude unistd.h where used
Ján Tomko [Sun, 16 Feb 2020 21:59:28 +0000 (22:59 +0100)]
Include unistd.h where used

Include unistd.h in all files that use it, instead
of relying on it being pulled in via virutil.h

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: virt-host-validate: move virutil.h include
Ján Tomko [Sun, 16 Feb 2020 21:59:15 +0000 (22:59 +0100)]
tools: virt-host-validate: move virutil.h include

After the introduction of virenum.h in commit 285c5f28c41,
it is only needed in the C file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: virportallocator: add includes
Ján Tomko [Sun, 23 Feb 2020 22:11:34 +0000 (23:11 +0100)]
util: virportallocator: add includes

Include both virutil.h and unistd.h.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: vircgroup: include unistd.h rather than virutil.h
Ján Tomko [Sun, 16 Feb 2020 22:03:51 +0000 (23:03 +0100)]
util: vircgroup: include unistd.h rather than virutil.h

There is nothing in the vircgroup.h header file
requiring virutil.h.

Remove it and include unistd.h in the C files.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotests: include unistd.h instead of virutil.h
Ján Tomko [Sun, 23 Feb 2020 21:02:26 +0000 (22:02 +0100)]
tests: include unistd.h instead of virutil.h

These tests do not use anything from virutil.h
apart from the transitive include.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoRemove virutil.h where possible
Ján Tomko [Sat, 22 Feb 2020 15:22:54 +0000 (16:22 +0100)]
Remove virutil.h where possible

Historically, this file was a dump for most of our helper
functions and needed almost everywhere.
With the introduction of virfile.h and virstring.h,
and more importantly, virenum.h and the introduction
of GLib, that is no longer true.

Remove its include from C files that don't even use it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: remove virHexToBin
Ján Tomko [Sun, 23 Feb 2020 19:54:46 +0000 (20:54 +0100)]
util: remove virHexToBin

Now that it is no longer used.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agoRemove all use of virHexToBin
Ján Tomko [Sun, 23 Feb 2020 19:58:35 +0000 (20:58 +0100)]
Remove all use of virHexToBin

Replace it by g_ascii_xdigit_value.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agoutil: uuid: remove use of virHexToBin
Ján Tomko [Sun, 23 Feb 2020 19:58:53 +0000 (20:58 +0100)]
util: uuid: remove use of virHexToBin

Prefer g_ascii_xdigit_value to virHexToBin.

Check the return value of the function and
remove the g_ascii_isxdigit calls, since
they're done anyway internally.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agobhyve: utils: use relative path for virclosecallbacks.h
Ján Tomko [Mon, 24 Feb 2020 19:16:24 +0000 (20:16 +0100)]
bhyve: utils: use relative path for virclosecallbacks.h

When moving virclosecallbacks to src/hypervisor, I did not
adjust all the possible includes in Makefiles.

Use a path relative to src to fix the build.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 25c29ac2f5842a7d48d9f9619317f68acf5d9995
5 years agobhyve: parse_command: slot, bus, func -> bus, slot, func
Ryan Moeller [Mon, 24 Feb 2020 06:46:21 +0000 (01:46 -0500)]
bhyve: parse_command: slot, bus, func -> bus, slot, func

This *is* a no-op, but there was a period of sickening dread while
auditing to be sure that no actual confusion between bus and slot had
occurred. I hope to avoid that by following the conventional order.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: command: refactor virBhyveProcessBuildBhyveCmd
Ryan Moeller [Mon, 24 Feb 2020 06:46:20 +0000 (01:46 -0500)]
bhyve: command: refactor virBhyveProcessBuildBhyveCmd

Reduce the complexity by isolating loop bodies in separate functions.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: add reboot support
Ryan Moeller [Mon, 24 Feb 2020 06:46:19 +0000 (01:46 -0500)]
bhyve: add reboot support

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: add hooks
Ryan Moeller [Mon, 24 Feb 2020 06:46:18 +0000 (01:46 -0500)]
bhyve: add hooks

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: monitor: refactor register/unregister
Ryan Moeller [Mon, 24 Feb 2020 06:46:17 +0000 (01:46 -0500)]
bhyve: monitor: refactor register/unregister

Pull the code for registering and unregistering a bhyve monitor object
into separate functions to improve code clarity.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: monitor: Make bhyveMonitor a virClass
Ryan Moeller [Mon, 24 Feb 2020 06:46:16 +0000 (01:46 -0500)]
bhyve: monitor: Make bhyveMonitor a virClass

This makes lifecycle management a bit easier thanks to ref counting, and
it is closer to what the qemu driver does.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: process: don't bother seeking to end of log
Ryan Moeller [Mon, 24 Feb 2020 06:46:15 +0000 (01:46 -0500)]
bhyve: process: don't bother seeking to end of log

The file is opened O_APPEND.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agoconf: fix use after free
Ryan Moeller [Mon, 24 Feb 2020 06:46:14 +0000 (01:46 -0500)]
conf: fix use after free

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
5 years agobhyve: process: remove unneeded header
Ryan Moeller [Mon, 24 Feb 2020 06:46:13 +0000 (01:46 -0500)]
bhyve: process: remove unneeded header

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>