[PATCH 15/16] Enable booting from hostdevs with bhyve

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_command.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index dbf6fbf168..14e80e6eec 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -997,11 +9

[PATCH 16/16] Allow PCI functions up to 255 for PCI ARI

2020-02-21 Thread Ryan Moeller
PCI Alternative Routing-ID Interpretation (ARI) capable devices use an implied Device Number of 0 and repurpose those bits to allow for 256 Function Numbers instead of 8. An example of such a device is the Chelsio T580-LP-CR, which uses the additional function numbers to provide Virtual Function (

[PATCH 10/16] Add hooks for bhyve backend

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_process.c | 33 + src/util/virhook.c| 15 +++ src/util/virhook.h| 11 +++ 3 files changed, 59 insertions(+) diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index

[PATCH 06/16] Factor out conn

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_driver.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 7b8e4808f9..625dc0ec22 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -946,7 +

[PATCH 14/16] Add hostdev handling for bhyve

2020-02-21 Thread Ryan Moeller
Handle PCI passthrough and virtio-scsi using hostdev devices. Example PCI passthrough: domain xml snippet ``` ``` loader.conf snippet ``` vmm_load="YES" pptdevs="6/2/0" ``` Example SCSI passthrough: domain xml snippet ``` ``` ctl.conf snippet ``` portal-

[PATCH 13/16] Reorder slot,bus,func -> bus,slot,func in parsers

2020-02-21 Thread Ryan Moeller
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. Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_parse_command.c | 34 --

[PATCH 08/16] Make bhyveMonitor a virClass

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_monitor.c | 116 +- 1 file changed, 76 insertions(+), 40 deletions(-) diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c index 0e55e19772..58d40e1f70 100644 --- a/src/bhyve/bhyve_monitor.c +++ b/s

[PATCH 12/16] Refactor virBhyveProcessBuildBhyveCmd a bit

2020-02-21 Thread Ryan Moeller
Reduces the complexity by isolating loop bodies in separate functions. Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_command.c | 115 ++ 1 file changed, 67 insertions(+), 48 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c ind

[PATCH 07/16] Don't bother seeking to the end of a file opened O_APPEND

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_process.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index b0b428eeb4..a11f75a894 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -101,8 +101,6 @@ virBhyveP

[PATCH 05/16] Eliminate rc variable

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_monitor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c index b9ad4520d9..0e55e19772 100644 --- a/src/bhyve/bhyve_monitor.c +++ b/src/bhyve/bhyve_monitor.c @@ -130,7 +130

[PATCH 11/16] Add reboot support for bhyve backend

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_driver.c | 30 ++ src/bhyve/bhyve_monitor.c | 19 +- src/bhyve/bhyve_monitor.h | 2 ++ src/bhyve/bhyve_process.c | 52 --- src/bhyve/bhyve_process.h | 3 +++ 5 files changed, 85

[PATCH 09/16] Refactor bhyve monitor register/unregister

2020-02-21 Thread Ryan Moeller
Pull the code for registering and unregistering a bhyve monitor object into separate functions to improve code clarity. Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_monitor.c | 50 ++- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/src/bhyv

[PATCH 00/16] Bhyve driver improvements

2020-02-21 Thread Ryan Moeller
Ryan Moeller (16): Fix build errors on FreeBSD Simplify bhyve driver caps helpers Remove redundant parameter to virBhyveProcessStart() Fix indentation Eliminate rc variable Factor out conn Don't bother seeking to the end of a file opened O_APPEND Make bhyveMonitor a virClass Refac

[PATCH 04/16] Fix indentation

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_command.c | 46 +++ src/bhyve/bhyve_monitor.c | 4 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index a1078d1460..7e420165aa 100644 -

[PATCH 03/16] Remove redundant parameter to virBhyveProcessStart()

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_driver.c | 6 +++--- src/bhyve/bhyve_process.c | 18 -- src/bhyve/bhyve_process.h | 1 - 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 365a3777a0..7b8e48

[PATCH 02/16] Simplify bhyve driver caps helpers

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_command.c | 40 +++ src/bhyve/bhyve_command.h | 4 ++-- src/bhyve/bhyve_driver.c | 21 +--- src/bhyve/bhyve_driver.h | 4 ++-- src/bhyve/bhyve_process.c | 8 +++- tests/bhyvexml2argvtest.c

[PATCH 01/16] Fix build errors on FreeBSD

2020-02-21 Thread Ryan Moeller
Don't free the file string until after it has been used to print the error message. I was seeing `undefined symbol: rpl_ioctl` so followed the example set by 05a38d4c4ac035ca5dac0f00ce641a8f9b087831 Signed-off-by: Ryan Moeller --- src/bhyve/bhyve_process.c | 1 - src/conf/virnetworkobj.c | 5 +

[PATCH] Add missing files for OpenRC

2020-02-21 Thread Ryan Moeller
Signed-off-by: Ryan Moeller --- src/locking/Makefile.inc.am | 7 +++ src/locking/virtlockd.init.in | 14 ++ src/logging/Makefile.inc.am | 10 ++ src/logging/virtlogd.init.in | 14 ++ 4 files changed, 45 insertions(+) create mode 100644 src/locking/virtlo

[libvirt PATCH 7/7] qemumonitorjsontest: GetCPUModelBaseline: use g_auto

2020-02-21 Thread Ján Tomko
Use g_autoptr for the virCPUDef variables. Signed-off-by: Ján Tomko --- tests/qemumonitorjsontest.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 168d6cd172..d3bee2043e 100644 --- a/tests/qemumonitorjs

[libvirt PATCH 4/7] qemumonitorjsontest: use virCPUDefNew()

2020-02-21 Thread Ján Tomko
virCPUDefPtr uses refcounting internally and must be allocated using virCPUDefNew, otherwise virCPUDefFree would be a no-op. Signed-off-by: Ján Tomko Fixes: fa2404bf4f91813431beb797fc30a1237a743823 Fixes: eee09435eec46553aac4fdf1c2d8f3214167bded --- tests/qemumonitorjsontest.c | 8 1 fi

[libvirt PATCH 6/7] qemumonitorjsontest: GetCPUModelComparison: use g_auto

2020-02-21 Thread Ján Tomko
Use g_autoptr for the virCPUDef variables and get rid of the cleanup label. Signed-off-by: Ján Tomko --- tests/qemumonitorjsontest.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 1a090b0cb5

[libvirt PATCH 2/7] tests: valgrind: do not trace system binaries

2020-02-21 Thread Ján Tomko
Add /usr/bin/* to -trace-children-skip Signed-off-by: Ján Tomko --- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ed5255b62d..7c76b5cec6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -482,7 +482,7 @@

[libvirt PATCH 5/7] virsystemdtest: do not leak socket path

2020-02-21 Thread Ján Tomko
Use an autofree'd helper variable to store the socket path and free it after the function finishes. Signed-off-by: Ján Tomko Fixes: 5b8569dd6e284b9159c701e8bffafb196983fc4a --- tests/virsystemdtest.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/virsystemdtest.c b

[libvirt PATCH 1/7] tests: valgrind.supp: suppress g_type_register_static leaks

2020-02-21 Thread Ján Tomko
When a type is registered, it holds allocated memory until the program exits. Add an exception to valgrind.supp to make the output of make -C tests valgrind more readable. Signed-off-by: Ján Tomko --- tests/.valgrind.supp | 13 + 1 file changed, 13 insertions(+) diff --git a/test

[libvirt PATCH 0/7] valgrind-inspired fixes

2020-02-21 Thread Ján Tomko
First, clean up some valgrind noise. Then, fix some reported leaks in the test suite. Last, refactor some touched tests. Ján Tomko (7): tests: valgrind.supp: suppress g_type_register_static leaks tests: valgrind: do not trace system binaries qemumonitorjsontest: do not leak qapiData.schema

[libvirt PATCH 3/7] qemumonitorjsontest: do not leak qapiData.schema

2020-02-21 Thread Ján Tomko
Free the x86_64 schema before overwriting it with s390x schema. Signed-off-by: Ján Tomko Fixes: eee09435eec46553aac4fdf1c2d8f3214167bded --- tests/qemumonitorjsontest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e9f95e317d.

[PATCH] util: virhostcpu: Fail when fetching CPU Stats for invalid cpu

2020-02-21 Thread Mauro S. M. Rodrigues
virHostCPUGetStatsLinux walks through every cpu in /proc/stat until it finds cpu%cpuNum that matches with the requested cpu. If none is found it logs the error but it should return -1, instead of 0. Otherwise virsh nodecpustats --cpu and API bindings don't fail properly, printing a blank line inst

Re: [PATCH] storage: Add support to set{uid,gid} and sticky bit

2020-02-21 Thread Julio Faracco
Hi Jano! Em qui., 20 de fev. de 2020 às 12:57, Ján Tomko escreveu: > > On Wed, Feb 19, 2020 at 05:51:44PM -0300, Julio Faracco wrote: > >This commit add more features to storages that supports setuid, setgid > >and sticky bit. This extend some permission levels of volumes when you > >run an hyper

[jenkins-ci PATCH] guests: Update vault

2020-02-21 Thread Andrea Bolognani
Add secrets for libvirt-centos-8, libvirt-opensuse-151, libvirt-ubuntu-1604 and libvirt-ubuntu-1804 Jenkins builders. Signed-off-by: Andrea Bolognani --- Pushed under the unreviewable vault update rule. guests/vars/vault.yml | 100 +- 1 file changed, 59 i

[PATCH 2/7] virStorageSourceUpdateCapacity: Drop 'probe' argument

2020-02-21 Thread Peter Krempa
Both callers pass false. Since we frown upon format probing, remove the unused possibility to do the probing. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/storage/storage_util.c | 2 +- src/util/virstoragefile.c | 23 ++- src/util/virstoragefile.h

[PATCH 3/7] util: storage: Store backing store format in virStorageSource

2020-02-21 Thread Peter Krempa
We store the backing file string in the structure so we should also store the format so that callers can be simplified. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 35 +-- src/util/virstoragefile.h | 1 + 2 files changed, 18 insertions(+), 18 dele

[PATCH 4/7] virStorageSourceNewFromBacking: Also transfer the format

2020-02-21 Thread Peter Krempa
When we create the new virStorageSource from the definitions stored in the parent we should also use the 'backingStoreRawFormat' field to populate the format. Callers which use virStorageSourceNewFromBacking are also fixed to stop setting the format manually. Signed-off-by: Peter Krempa --- src

[PATCH 5/7] virStorageBackendGlusterRefreshVol: Refactor handling of backing store

2020-02-21 Thread Peter Krempa
Take the format of the backing store from the 'meta' object directly and use g_steal_pointer go steal the path. Signed-off-by: Peter Krempa --- src/storage/storage_backend_gluster.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/storage/storage_backend_gluste

[PATCH 6/7] virStorageFileGetMetadataFromBuf: Remove 'backingFormat' argument

2020-02-21 Thread Peter Krempa
None of the callers actually use it. Signed-off-by: Peter Krempa --- src/storage/storage_backend_gluster.c | 3 +-- src/util/virstoragefile.c | 16 ++-- src/util/virstoragefile.h | 3 +-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/st

[PATCH 7/7] virStorageFileGetMetadataFromFD: Remove unused 'backingFormat' argument

2020-02-21 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/storage/storage_util.c | 3 +-- src/util/virstoragefile.c | 12 +--- src/util/virstoragefile.h | 3 +-- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index f71abbd729..8e43c78

[PATCH 1/7] tests: virstorage: Fix backing file format of created image

2020-02-21 Thread Peter Krempa
We create some images for testing our code. We've recorded wrong format of the backing file for one of the images though. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c ind

[PATCH 0/7] util: More storage file detection cleanups

2020-02-21 Thread Peter Krempa
Found while investigating options of how to improve image detection. Peter Krempa (7): tests: virstorage: Fix backing file format of created image virStorageSourceUpdateCapacity: Drop 'probe' argument util: storage: Store backing store format in virStorageSource virStorageSourceNewFromBack

Libvirt got accepted to GSoC 2020

2020-02-21 Thread Michal Privoznik
I'd like to share great news. Libvirt got accepted again to this year's Google Summer of Code [1]. We can expect to see e-mails, irc discussions with potential candidates. If you have any idea for a project please add it to our Ideas page [2], even if you don't feel like mentoring it. I will fi

Re: [PATCH V4 0/5] Introduce Advanced Watch Dog module

2020-02-21 Thread Zhang, Chen
On 2/12/2020 10:56 AM, Jason Wang wrote: On 2020/2/11 下午4:58, Zhang, Chen wrote: -Original Message- From: Jason Wang Sent: Monday, January 20, 2020 10:57 AM To: Zhang, Chen; Paolo Bonzini ; Philippe Mathieu-Daudé; qemu-dev Cc: Zhang Chen Subject: Re: [PATCH V4 0/5] Introduce Advanced W

Re: [ruby PATCH] Fix cpumap allocation for virDomainGetVcpus and use return value

2020-02-21 Thread Ján Tomko
On Thu, Feb 20, 2020 at 11:01:32AM +, Charlie Smurthwaite wrote: This patch fixes a bug in which only enough memory for one cpumap is allocated for virDomainGetVcpus instead of one per virtual CPU. This Fixes an overflow. Additionally, it uses the return value of virDomainGetVcpus to determ

Re: [PATCH 3/3] qemuTestParseCapabilitiesArch: Free @binary

2020-02-21 Thread Ján Tomko
On Fri, Feb 21, 2020 at 08:44:51AM +0100, Michal Privoznik wrote: The variable is allocated, but never freed. ==119642== 29 bytes in 1 blocks are definitely lost in loss record 409 of 671 ==119642==at 0x483579F: malloc (vg_replace_malloc.c:309) ==119642==by 0x5AB075F: __vasprintf_interna

Re: [PATCH 2/3] virDomainNetDefClear: Free @persistent name

2020-02-21 Thread Ján Tomko
On Fri, Feb 21, 2020 at 08:44:50AM +0100, Michal Privoznik wrote: The persistent alias name @persistent is allocated in virDomainNetDefParseXML() but never freed. ==119642== 22 bytes in 2 blocks are definitely lost in loss record 178 of 671 ==119642==at 0x483579F: malloc (vg_replace_malloc.c

Re: [libvirt RFC PATCH] util: vireventglibwatch: watch for G_IO_HUP and G_IO_ERR

2020-02-21 Thread Michal Privoznik
On 2/19/20 1:31 AM, Ján Tomko wrote: To more closely match the previous usage in virEventPollDispatchHandles, where called the handle callback for any revents returned by poll. This should fix the virtlogd error on subsequent domain startup: error: can't connect to virtlogd: Cannot open log f

Re: [PATCH 1/3] virDomainFSDefFree: Unref private data

2020-02-21 Thread Ján Tomko
On Fri, Feb 21, 2020 at 08:44:49AM +0100, Michal Privoznik wrote: The privateData object is allocated in virDomainFSDefNew() but never unref'd. ==119642== 480 bytes in 20 blocks are definitely lost in loss record 656 of 671 ==119642==at 0x4837B86: calloc (vg_replace_malloc.c:762) ==119642==

Re: [libvirt PATCH] docs: Expand documentation for the tickpolicy timer attribute

2020-02-21 Thread Michal Privoznik
On 2/18/20 9:47 PM, Andrea Bolognani wrote: The current documentation is fairly terse and not easy to decode for someone who's not intimately familiar with the inner workings of timer devices. Expand on it by providing a somewhat verbose description of what behavior each policy will result in, as

Re: [PATCH v1 0/3] qemumonitorjson tests for cpu compare and baseline

2020-02-21 Thread Michal Privoznik
On 2/20/20 11:01 PM, Collin Walling wrote: These patches implement tests for the libvirt qemu_monitor_json API for the hypervisor-cpu-compare and -baseline commands. The input and output data is mocked with arbitrary values. A prerequisite patch is included to load the capabilities schema for a

[PATCH 3/3] security: Don't fail if locking a file on NFS mount fails

2020-02-21 Thread Michal Privoznik
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

[PATCH 1/3] virSecurityManagerMetadataLock: Store locked paths

2020-02-21 Thread Michal Privoznik
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.

[PATCH 2/3] security: Don't remember seclabel for paths we haven't locked successfully

2020-02-21 Thread Michal Privoznik
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. Si

[PATCH 0/3] security: Don't fail if locking a file on NFS mount fails

2020-02-21 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): virSecurityManagerMetadataLock: Store locked paths security: Don't remember seclabel for paths we haven't locked successfully security: Don't fail if locking a file on NFS mount fails src/security/security_dac.c | 14 ++ src/secu