[libvirt] [PATCH v2] test_driver: implement virDomainMemoryStats

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 54 ++ 1 file changed, 54 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index aae9875194..0e0acf2baf 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Daniel Henrique Barboza
On 8/1/19 11:24 AM, Daniel Henrique Barboza wrote: [...] So yeah. I am not sure what's different from the environments I use versus the one you're using (and probably the env of every other committer here, otherwise this test failure would be pointed out earlier). I'll need to think more

Re: [libvirt] [PATCH] RFC: security: Make sure to decrease ref count label value

2019-08-01 Thread Stefan Berger
On 7/29/19 5:17 AM, Michal Privoznik wrote: On 7/26/19 8:38 PM, Stefan Berger wrote: I noticed that if a domain fails to restore, the ref count in the xattr 'trusted.libvirt.security.ref_selinux' keeps on increasing indefinitely and the VM will never restore even if the root cause for the

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Eric Blake
On 8/1/19 9:24 AM, Daniel Henrique Barboza wrote: >>> >>> So I think the difference is that your dev box is not echoing the >>> commands, and the real problem is that the test is dependent on the >>> current environment (is there some configuration file that determines >>> whether virsh in batch

[libvirt] [PATCH 02/17] tools: fix double error reporting in virt-login-shell

2019-08-01 Thread Daniel P . Berrangé
The public API entry points will call virDispatchError which will print to stderr by default. We then jump to a cleanup path which calls virDispatchError again. We tried to stop the entry points printing to stderr, but incorrectly called virSetErrorFunc. It needs a real function that is a no-op,

[libvirt] [PATCH 11/17] nss: remove use for virFile helper APIs

2019-08-01 Thread Daniel P . Berrangé
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Signed-off-by: Daniel P. Berrangé --- cfg.mk | 2 +- tools/nss/libvirt_nss.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cfg.mk b/cfg.mk index

[libvirt] [PATCH 17/17] nss: only link to yajl library and nothing else

2019-08-01 Thread Daniel P . Berrangé
Now that the code does not refer to any libvirt headers, except internal.h macros, it does not need to link to any libvirt code, nor gnulib either. The only thing it needs is yajl. Signed-off-by: Daniel P. Berrangé --- config-post.h | 30 --- src/Makefile.am| 73

[libvirt] [PATCH 14/17] nss: custom parser for loading .leases file

2019-08-01 Thread Daniel P . Berrangé
The .leases file is currently loaded using the virLease class, which in turn uses the virJSON parsing code. This pulls in a heap of libvirt code (logging, hash tables, etc) which we do not wish to depend on. This uses the yajl parser code directly, so the only dep is yajl and plain libc

[libvirt] [PATCH 10/17] nss: remove use for virString helper APIs

2019-08-01 Thread Daniel P . Berrangé
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Signed-off-by: Daniel P. Berrangé --- tools/nss/libvirt_nss.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index

[libvirt] [PATCH 16/17] nss: remove last usages of libvirt headers

2019-08-01 Thread Daniel P . Berrangé
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Signed-off-by: Daniel P. Berrangé --- tools/nss/libvirt_nss.c| 16 +++- tools/nss/libvirt_nss.h| 5 +++-- tools/nss/libvirt_nss_leases.c | 6 -- 3 files changed, 18

[libvirt] [PATCH 12/17] nss: refactor code for processing mac addresses

2019-08-01 Thread Daniel P . Berrangé
Build a list of mac addresses immediately, so that later code searching for leases can be simplified and avoid needing to use the virMacMap object. Signed-off-by: Daniel P. Berrangé --- cfg.mk | 4 +-- tools/nss/libvirt_nss.c | 73 - 2

[libvirt] [PATCH 15/17] nss: directly use getnameinfo/getaddrinfo

2019-08-01 Thread Daniel P . Berrangé
Use the plain libc socket APIs to avoid a dependancy on the main libvirt code from the nss module. Signed-off-by: Daniel P. Berrangé --- tools/nss/libvirt_nss.c| 36 -- tools/nss/libvirt_nss_leases.c | 56 +- 2 files changed, 69

[libvirt] [PATCH 06/17] util: get rid of virIsSUID method

2019-08-01 Thread Daniel P . Berrangé
Now that none of the libvirt.so code will ever run in a setuid context, we can remove the virIsSUID() method. The global initializer function can just inline the check itself. The new inlined check is slightly stronger as it also looks for a setgid situation. Signed-off-by: Daniel P. Berrangé

[libvirt] [PATCH 13/17] nss: custom parser for loading .macs file

2019-08-01 Thread Daniel P . Berrangé
The .macs file is currently loaded using the virMacMap class, which in turn uses the virJSON parsing code. This pulls in a heap of libvirt code (logging, hash tables, objects, etc) which we do not wish to depend on. This uses the yajl parser code directly, so the only dep is yajl and plain libc

[libvirt] [PATCH 08/17] util: get rid of virGetEnv{Allow, Block}SUID functions

2019-08-01 Thread Daniel P . Berrangé
Now that 100% of libvirt code is forbidden in a SUID environment, we no longer need to worry about whether env variables are trustworthy or not. The virt-login-shell setuid program, which does not link to any libvirt code, will purge all environment variables, except $TERM, before invoking the

[libvirt] [PATCH 04/17] tools: split virt-login-shell into two binaries

2019-08-01 Thread Daniel P . Berrangé
The virt-login-shell binary is a setuid program that takes no arguments. When invoked it looks at the invoking uid, resolves it to a username, and finds an LXC guest with the same name. It then starts the guest and runs the shell in side the namespaces of the container. Given this set of tasks

[libvirt] [PATCH 09/17] nss: remove use for virDir helper APIs

2019-08-01 Thread Daniel P . Berrangé
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Signed-off-by: Daniel P. Berrangé --- cfg.mk | 2 +- tools/nss/libvirt_nss.c | 13 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cfg.mk b/cfg.mk index

[libvirt] [PATCH 07/17] util: simplify virCommand APIs for env passthrough.

2019-08-01 Thread Daniel P . Berrangé
Now that 100% of libvirt code is forbidden in a SUID environment, we no longer need to worry about whether env variables are trustworthy or not. The virt-login-shell setuid program, which does not link to any libvirt code, will purge all environment variables, except $TERM, before invoking the

[libvirt] [PATCH 00/17] Refactor virt-login-shell and nss module

2019-08-01 Thread Daniel P . Berrangé
As previously discussed, it is desirable to move libvirt to a model where we abort-on-OOM, possibly making use of glib2. This would be good for libvirt in general, but it is bad for a couple of libvirt addons. The virt-login-shell setuid program would be ok with abort-on-OOM, but absolutely can

[libvirt] [PATCH 01/17] tools: fix crash in virt-login-shell if config doesn't exist

2019-08-01 Thread Daniel P . Berrangé
If the 'allowed_users' config setting in virt-login-shell.conf does not exist, we dereference a NULL pointer resulting in a crash. We should check for this case and thus ensure the user is denied access gracefully. Signed-off-by: Daniel P. Berrangé --- tools/virt-login-shell.c | 2 +- 1 file

[libvirt] [PATCH 03/17] tools: rename source for virt-login-shell

2019-08-01 Thread Daniel P . Berrangé
We'll shortly be renaming the binary to virt-login-shell-helper and introducing a new tool as virt-login-shell. Renaming the source file first gives a much more usefull diff for the next commit. Signed-off-by: Daniel P. Berrangé --- tools/Makefile.am | 2 +-

[libvirt] [PATCH 05/17] build: drop libvirt setuid library build

2019-08-01 Thread Daniel P . Berrangé
The virt-login-shell setuid program is now a tiny piece of code that only uses standard libc functions, and santizes the execution environment before invoking the real virt-login-shell-helper. The latter is thus able to use the normal libvirt.so build, allowing us to delete the special cut down

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Daniel Henrique Barboza
On 8/1/19 9:49 AM, Daniel Henrique Barboza wrote: On 8/1/19 8:43 AM, Eric Blake wrote: On 8/1/19 6:30 AM, Eric Blake wrote: On 7/31/19 4:58 PM, Daniel Henrique Barboza wrote: There is a chance that the current sed filtering used in these new tests might fail in some machines due to the

[libvirt] [PATCH 7/7] virsh: add 'guestinfo' command

2019-08-01 Thread Jonathon Jongsma
The 'guestinfo' command uses the new virDomainGetGuestInfo() API to query information about the specified domain and print it out for the user. The output is modeled roughly on the 'domstats' command. Signed-off-by: Jonathon Jongsma --- tools/virsh-domain.c | 53

[libvirt] [PATCH 6/7] qemu: Implement virDomainGetGuestInfo()

2019-08-01 Thread Jonathon Jongsma
Iimplements the new guest information API by querying requested information via the guest agent. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_driver.c | 77 ++ 1 file changed, 77 insertions(+) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCH 5/7] qemu_agent: add helper for querying timezone info

2019-08-01 Thread Jonathon Jongsma
This function queries timezone information within the guest and adds the information to an array of typed parameters with field names intended to be returned to virDomainGetGuestInfo() Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_agent.c | 46 ++

[libvirt] [PATCH 0/7] add virDomainGetGuestInfo()

2019-08-01 Thread Jonathon Jongsma
This series adds several bits of guest information provided by a new API function virDomainGetGuestInfo(). There is an implementation for qemu using the guest agent. In particular, it adds information about logged-in users, guest OS, and timezone. I had previously submitted a patch series with a

[libvirt] [PATCH 3/7] qemu_agent: add helper for getting guest users

2019-08-01 Thread Jonathon Jongsma
This function fetches the list of logged-in users from the qemu agent and adds them to a list of typed parameters so that they can be used internally in libvirt. Also add some basic tests for the function. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_agent.c | 92 +++

[libvirt] [PATCH 1/7] lib: add virDomainGetGuestInfo()

2019-08-01 Thread Jonathon Jongsma
This API is intended to aggregate several guest agent information queries and is ispired by stats API virDomainListGetStats(). It is anticipated that this information will be provided by a guest agent running within the domain. Signed-off-by: Jonathon Jongsma ---

[libvirt] [PATCH 4/7] qemu_agent: add helper function for querying OS info

2019-08-01 Thread Jonathon Jongsma
This function queries the guest operating system information and adds the returned information to an array of typed parameters with field names intended to be returned in virDomainGetGuestInfo(). Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_agent.c | 52 ++

[libvirt] [PATCH 2/7] remote: implement virDomainGetGuestInfo

2019-08-01 Thread Jonathon Jongsma
Add daemon and client code to serialize/deserialize virDomainGetGuestInfo(). Signed-off-by: Jonathon Jongsma --- src/remote/remote_daemon_dispatch.c | 41 ++ src/remote/remote_driver.c | 53 + src/remote/remote_protocol.x| 21

Re: [libvirt] virtio pmem support in libvirt

2019-08-01 Thread Pankaj Gupta
Hi Daniel, > > > > Hi all, > > > > Virtio-pmem support has been added to kernel[1] and qemu[2] > > upstream. User document[3] has more details on how to use this > > new device. > > > > We now need support in libvirt. Required support would be a subset > > of features already implemented

[libvirt] [PATCH 6/6] test_driver: implement virDomainUpdateDeviceFlags

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 72 ++ 1 file changed, 72 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index cffd60c75c..228e24b0ae 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[libvirt] [PATCH 5/6] test_driver: implement virDomainDetachDeviceAlias

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 12 1 file changed, 12 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index de449d89fb..cffd60c75c 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4487,6 +4487,17 @@

[libvirt] [PATCH 4/6] test_driver: implement virDomainDetachDevice

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 8 1 file changed, 8 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 1d371a5832..de449d89fb 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4487,6 +4487,13 @@

[libvirt] [PATCH 3/6] test_driver: implement virDomainDetachDeviceFlags

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 178 + 1 file changed, 178 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 784622985c..1d371a5832 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[libvirt] [PATCH 2/6] test_driver: implement virDomainAttachDevice

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index c8aad6a0bb..784622985c 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4302,6 +4302,15 @@

[libvirt] [PATCH 1/6] test_driver: implement virDomainAttachDeviceFlags

2019-08-01 Thread Ilias Stamatis
Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 290 + 1 file changed, 290 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index aae9875194..c8aad6a0bb 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[libvirt] [PATCH 0/6] test_driver: implement device attach/detach APIs

2019-08-01 Thread Ilias Stamatis
Ilias Stamatis (6): test_driver: implement virDomainAttachDeviceFlags test_driver: implement virDomainAttachDevice test_driver: implement virDomainDetachDeviceFlags test_driver: implement virDomainDetachDevice test_driver: implement virDomainDetachDeviceAlias test_driver: implement

Re: [libvirt] virtio pmem support in libvirt

2019-08-01 Thread Daniel P . Berrangé
On Thu, Aug 01, 2019 at 01:44:06AM -0400, Pankaj Gupta wrote: > > Hi all, > > Virtio-pmem support has been added to kernel[1] and qemu[2] > upstream. User document[3] has more details on how to use this > new device. > > We now need support in libvirt. Required support would be a subset > of

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Daniel Henrique Barboza
On 8/1/19 8:43 AM, Eric Blake wrote: On 8/1/19 6:30 AM, Eric Blake wrote: On 7/31/19 4:58 PM, Daniel Henrique Barboza wrote: There is a chance that the current sed filtering used in these new tests might fail in some machines due to the repetition of the 'virsh #' prompt at the same line,

[libvirt] virtio pmem support in libvirt

2019-08-01 Thread Pankaj Gupta
Hi all, Virtio-pmem support has been added to kernel[1] and qemu[2] upstream. User document[3] has more details on how to use this new device. We now need support in libvirt. Required support would be a subset of features already implemented for emulated nvdimm. We will use new

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Eric Blake
On 8/1/19 6:30 AM, Eric Blake wrote: > On 7/31/19 4:58 PM, Daniel Henrique Barboza wrote: >> There is a chance that the current sed filtering used in >> these new tests might fail in some machines due to the >> repetition of the 'virsh #' prompt at the same line, >> together with valid output that

Re: [libvirt] [PATCH 1/1] tests/virsh-checkpoint/snapshot: changing 'sed' out filtering

2019-08-01 Thread Eric Blake
On 7/31/19 4:58 PM, Daniel Henrique Barboza wrote: > There is a chance that the current sed filtering used in > these new tests might fail in some machines due to the > repetition of the 'virsh #' prompt at the same line, > together with valid output that shouldn't be filtered. Ah, so it is a

Re: [libvirt] [PATCH] daemon: improve Xen support in systemd service

2019-08-01 Thread Daniel P . Berrangé
On Wed, Jul 31, 2019 at 06:18:00PM +, Jim Fehlig wrote: > The xencommons service provides all the essential services such as > xenstored, xenconsoled, etc. needed by the libvirt Xen driver, so > libvirtd should be started after xencommons. > > The xendomains service uses Xen's xl tool to

Re: [libvirt] [PATCH 00/19] Add vhost-user-gpu support

2019-08-01 Thread Marc-André Lureau
Hi On Wed, Jun 5, 2019 at 2:32 PM wrote: > > From: Marc-André Lureau > > Hi, > > This series of patches adds support for running virtio GPUs in > seperate processes, thanks to vhost-user backend. > > The QEMU support landed for 4.1. There are several benefits of running > the GPU/virgl in an

Re: [libvirt] [PATCH] news: add entry for new max_threads_per_process option in qemu.conf

2019-08-01 Thread Andrea Bolognani
On Wed, 2019-07-31 at 17:58 +, Jim Fehlig wrote: > + > + > + qemu: Add support for overriding max threads per process limit > + > + > + systemd-based systems impose a limit on the number of threads a > + process can spawn, which in some