Re: [libvirt] [PATCH v3 0/5] libxl: PVHv2 support

2018-10-02 Thread Jim Fehlig
On 10/2/18 3:38 PM, Jim Fehlig wrote: On 9/30/18 8:15 PM, Marek Marczykowski-Górecki wrote: This is a respin of my old PVHv1 patch[1], converted to PVHv2. Should the code use "PVH" name (as libxl does internally), or "PVHv2" as in many places in Xen documentation? I've chosen the former, but

Re: [libvirt] [PATCH v3 2/5] libxl: add support for PVH

2018-10-02 Thread Jim Fehlig
On 10/2/18 5:02 PM, Marek Marczykowski-Górecki wrote: On Tue, Oct 02, 2018 at 04:50:02PM -0600, Jim Fehlig wrote: On 9/30/18 8:15 PM, Marek Marczykowski-Górecki wrote: Since this is something between PV and HVM, it makes sense to put the setting in place where domain type is specified. To

Re: [libvirt] [PATCH v3 2/5] libxl: add support for PVH

2018-10-02 Thread Marek Marczykowski-Górecki
On Tue, Oct 02, 2018 at 04:50:02PM -0600, Jim Fehlig wrote: > On 9/30/18 8:15 PM, Marek Marczykowski-Górecki wrote: > > Since this is something between PV and HVM, it makes sense to put the > > setting in place where domain type is specified. > > To enable it, use It is > > also included in

Re: [libvirt] [PATCH v3 2/5] libxl: add support for PVH

2018-10-02 Thread Jim Fehlig
On 9/30/18 8:15 PM, Marek Marczykowski-Górecki wrote: Since this is something between PV and HVM, it makes sense to put the setting in place where domain type is specified. To enable it, use It is also included in capabilities.xml, for every supported HVM guest type - it doesn't seems to be

Re: [libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread John Ferlan
On 10/2/18 10:14 AM, Andrea Bolognani wrote: > Background > == > > We have plenty of features in libvirt, some of which were designed at > a time when the virtualization story was much more straightforward > than the multi-architecture, multi-hypervisor, multi-machine world we >

Re: [libvirt] [PATCH v3 0/5] libxl: PVHv2 support

2018-10-02 Thread Jim Fehlig
On 9/30/18 8:15 PM, Marek Marczykowski-Górecki wrote: This is a respin of my old PVHv1 patch[1], converted to PVHv2. Should the code use "PVH" name (as libxl does internally), or "PVHv2" as in many places in Xen documentation? I've chosen the former, but want to confirm it. "PVH". Also, not

Re: [libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread Andrea Bolognani
I feel like I've addressed most of your points in my reply to Peter's message so I won't repeat the same arguments and will snip quite aggressively, but please let me know if I've missed anything. On Tue, 2018-10-02 at 17:38 +0200, Pavel Hrdina wrote: [...] > But in this case I thing that it's

Re: [libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread Andrea Bolognani
On Tue, 2018-10-02 at 17:19 +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:14:39 +0200, Andrea Bolognani wrote: [...] > > Two concrete examples are considered here: one is the > > virConnectNumOfDomains() API which, while known to be racy and having > > non-racy alternatives, can still be

Re: [libvirt] [RFC 7/7] tools: Force virsh to use deprecated features

2018-10-02 Thread Andrea Bolognani
On Tue, 2018-10-02 at 17:26 +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:43:04 +0200, Andrea Bolognani wrote: [...] > > Eh, nothing in this series is really meant to be pushed :) > > Such approach without any obvious markers is only warranted on 1st of > April. I figured the series

Re: [libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread Pavel Hrdina
On Tue, Oct 02, 2018 at 05:19:30PM +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:14:39 +0200, Andrea Bolognani wrote: > > Background > > == > > [...] > > > Two concrete examples are considered here: one is the > > virConnectNumOfDomains() API which, while known to be racy and

[libvirt] [PATCH 11/11] Revert "virlockspace: Allow caller to specify start and length offset in virLockSpaceAcquireResource"

2018-10-02 Thread Michal Privoznik
This reverts commit afd5a27575e8b6a494d2728552fe0e89c71e32b4. Signed-off-by: Michal Privoznik --- src/locking/lock_daemon_dispatch.c | 3 --- src/util/virlockspace.c| 15 +-- src/util/virlockspace.h| 4 tests/virlockspacetest.c | 29

[libvirt] [PATCH 06/11] Revert "lock_driver: Introduce VIR_LOCK_MANAGER_ACQUIRE_ROLLBACK"

2018-10-02 Thread Michal Privoznik
This reverts commit 385eb8399bdb1610447c2857abfe99cee4a9fb9e. Signed-off-by: Michal Privoznik --- src/locking/lock_driver.h | 4 -- src/locking/lock_driver_lockd.c | 82 - 2 files changed, 24 insertions(+), 62 deletions(-) diff --git

[libvirt] [PATCH 04/11] Revert "qemu_conf: Introduce metadata_lock_manager"

2018-10-02 Thread Michal Privoznik
This reverts commit 8b8aefb3d6ae2139ea3d4ef6d7dd2c06f57f6075. Signed-off-by: Michal Privoznik --- src/qemu/qemu_conf.c | 1 - src/qemu/qemu_conf.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index fc84186a7e..32705c3114 100644 ---

[libvirt] [PATCH 03/11] Revert "security_manager: Load lock plugin on init"

2018-10-02 Thread Michal Privoznik
This reverts commit 3e26b476b5f322353bf0dcd8e3f037ca672b8c62. Signed-off-by: Michal Privoznik --- cfg.mk | 4 +--- src/lxc/lxc_controller.c | 3 +-- src/lxc/lxc_driver.c | 2 +- src/qemu/qemu_driver.c | 3 ---

[libvirt] [PATCH 01/11] security: Always spawn process for transactions

2018-10-02 Thread Michal Privoznik
In the next commit the virSecurityManagerMetadataLock() is going to be turned thread unsafe. Therefore, we have to spawn a separate process for it. Always. Signed-off-by: Michal Privoznik --- src/security/security_dac.c | 12 ++-- src/security/security_selinux.c | 12 ++-- 2

[libvirt] [PATCH 07/11] Revert "lock_driver: Introduce VIR_LOCK_MANAGER_RESOURCE_TYPE_METADATA"

2018-10-02 Thread Michal Privoznik
This reverts commit 997283b54b0e1f599aed3085ceba027eb8110acb. Signed-off-by: Michal Privoznik --- src/locking/lock_driver.h | 2 -- src/locking/lock_driver_lockd.c | 47 +++ src/locking/lock_driver_sanlock.c | 3 +-- 3 files changed, 14

[libvirt] [PATCH 10/11] Revert "lock_driver_lockd: Introduce VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_METADATA flag"

2018-10-02 Thread Michal Privoznik
This reverts commit 21c34b86be5233634eb38f77be64e2263bfc4e48. Signed-off-by: Michal Privoznik --- src/locking/lock_daemon_dispatch.c | 10 ++ src/locking/lock_driver_lockd.c| 3 +-- src/locking/lock_driver_lockd.h| 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff

[libvirt] [PATCH 09/11] Revert "lock_driver: Introduce new VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON"

2018-10-02 Thread Michal Privoznik
This reverts commit 22baf6e08c65d9174b24f66370724ce961ce9576. Signed-off-by: Michal Privoznik --- src/locking/lock_driver.h | 2 - src/locking/lock_driver_lockd.c | 297 +- src/locking/lock_driver_sanlock.c | 37 ++--- 3 files changed, 116

[libvirt] [PATCH 08/11] Revert "_virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom union"

2018-10-02 Thread Michal Privoznik
This reverts commit aaf34cb9013d6d746f4edf9807408cb9dfbcf01d. Signed-off-by: Michal Privoznik --- src/locking/lock_driver_lockd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c index

[libvirt] [PATCH 05/11] Revert "lock_manager: Allow disabling configFile for virLockManagerPluginNew"

2018-10-02 Thread Michal Privoznik
This reverts commit 35b5b244da825fb41e35e4dc62e740d716214ec9. Signed-off-by: Michal Privoznik --- src/locking/lock_driver.h | 4 src/locking/lock_driver_lockd.c | 4 +--- src/locking/lock_driver_sanlock.c | 4 +--- src/locking/lock_manager.c| 10 +++--- 4 files

[libvirt] [PATCH 00/11] Implement alternative metadata locking

2018-10-02 Thread Michal Privoznik
The latest events (and bugs reported on the list) got me thinking. I went back to the drawing board and relized we don't need virtlockd if we fork() for every transaction. The whole reason for offloading file locking to virtlockd is that there is no good version of file locking in POSIX. flock()

[libvirt] [PATCH 02/11] security_manager: Rework metadata locking

2018-10-02 Thread Michal Privoznik
Trying to use virlockd to lock metadata turns out to be too big gun. Since we will always spawn a separate process for relabeling we are safe to use thread unsafe POSIX locks and take out virtlockd completely out of the picture. Signed-off-by: Michal Privoznik --- src/security/security_dac.c

Re: [libvirt] [RFC 5/7] Deprecate virConnectNumOfDomains()

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 17:25:34 +0200, Andrea Bolognani wrote: > On Tue, 2018-10-02 at 16:43 +0200, Peter Krempa wrote: > > On Tue, Oct 02, 2018 at 16:14:44 +0200, Andrea Bolognani wrote: > [...] > > I don't think our API contract allows for reporting an error AND > > returning success. And even

Re: [libvirt] [RFC 7/7] tools: Force virsh to use deprecated features

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 16:43:04 +0200, Andrea Bolognani wrote: > On Tue, 2018-10-02 at 16:30 +0200, Peter Krempa wrote: > > On Tue, Oct 02, 2018 at 16:14:46 +0200, Andrea Bolognani wrote: > > > Instead of trying newer APIs first and only falling back to > > > deprecated ones if those are not

Re: [libvirt] [RFC 5/7] Deprecate virConnectNumOfDomains()

2018-10-02 Thread Andrea Bolognani
On Tue, 2018-10-02 at 16:43 +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:14:44 +0200, Andrea Bolognani wrote: [...] > > @@ -97,6 +97,11 @@ virConnectNumOfDomains(virConnectPtr conn) > > int ret = conn->driver->connectNumOfDomains(conn); > > if (ret < 0) > >

Re: [libvirt] [tck PATCH] Fix runtime "undefined global" error in 100-disk-encryption.t

2018-10-02 Thread Jim Fehlig
On 10/1/18 2:07 PM, Laine Stump wrote: Commit 3836a38c added a $secret-undefine call at the end of 100-disk-encryption.t because the presence of the secret was reportedly causing an error when the test was run a 2nd time. Unfortunately the definition of "my $secret" was inside a SKIP: { ... }

Re: [libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 16:14:39 +0200, Andrea Bolognani wrote: > Background > == [...] > Two concrete examples are considered here: one is the > virConnectNumOfDomains() API which, while known to be racy and having > non-racy alternatives, can still be used by developers without >

Re: [libvirt] [RFC 6/7] Deprecate missing machine type in virDomainDefineXMLFlags()

2018-10-02 Thread Andrea Bolognani
On Tue, 2018-10-02 at 16:48 +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:14:45 +0200, Andrea Bolognani wrote: [...] > > @@ -19114,9 +19114,14 @@ virDomainDefParseCaps(virDomainDefPtr def, > > } else { > > if (!def->os.arch) > > def->os.arch = capsdata->arch; >

Re: [libvirt] question about syntax of storage volume element

2018-10-02 Thread Jim Fehlig
On 10/2/18 5:13 AM, Pavel Hrdina wrote: On Mon, Oct 01, 2018 at 02:28:09PM -0400, Cole Robinson wrote: On 09/28/2018 12:54 AM, Jim Fehlig wrote: I've attempted to use virt-manager to create a new VM that uses a volume from an rbd-based network pool, but have not been able to progress past step

Re: [libvirt] [RFC 6/7] Deprecate missing machine type in virDomainDefineXMLFlags()

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 16:14:45 +0200, Andrea Bolognani wrote: > This time we don't want to deprecate the API itself; instead, > we want warning to be reported whenever some specific condition > is met. > > Signed-off-by: Andrea Bolognani > --- > src/conf/domain_conf.c | 11 --- >

Re: [libvirt] [RFC 5/7] Deprecate virConnectNumOfDomains()

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 16:14:44 +0200, Andrea Bolognani wrote: > In this case we want to deprecate the API wholesale, so we > can simply report a warning in the public entry point. > > Signed-off-by: Andrea Bolognani > --- > src/libvirt-domain.c | 5 + > 1 file changed, 5 insertions(+) >

Re: [libvirt] [RFC 7/7] tools: Force virsh to use deprecated features

2018-10-02 Thread Andrea Bolognani
On Tue, 2018-10-02 at 16:30 +0200, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 16:14:46 +0200, Andrea Bolognani wrote: > > Instead of trying newer APIs first and only falling back to > > deprecated ones if those are not available, go straight for > > the older APIs. > > > > Running 'virsh list'

Re: [libvirt] [RFC 7/7] tools: Force virsh to use deprecated features

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 16:14:46 +0200, Andrea Bolognani wrote: > Instead of trying newer APIs first and only falling back to > deprecated ones if those are not available, go straight for > the older APIs. > > Running 'virsh list' will now cause warnings to be displayed. > > Signed-off-by:

[libvirt] [RFC 2/7] util: Introduce virReportWarning()

2018-10-02 Thread Andrea Bolognani
This new macro can be used to conveniently report warnings, just like the existing virReportError() is used for errors. Signed-off-by: Andrea Bolognani --- src/util/virerror.h | 4 1 file changed, 4 insertions(+) diff --git a/src/util/virerror.h b/src/util/virerror.h index

[libvirt] [RFC 4/7] util: Introduce VIR_ERR_DEPRECATED_FEATURE

2018-10-02 Thread Andrea Bolognani
This error code will be used whenever the user triggers execution of code that's been marked as deprecated. Signed-off-by: Andrea Bolognani --- include/libvirt/virterror.h | 1 + src/util/virerror.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/libvirt/virterror.h

[libvirt] [RFC 6/7] Deprecate missing machine type in virDomainDefineXMLFlags()

2018-10-02 Thread Andrea Bolognani
This time we don't want to deprecate the API itself; instead, we want warning to be reported whenever some specific condition is met. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 11 --- src/libvirt-domain.c | 1 + 2 files changed, 9 insertions(+), 3 deletions(-)

[libvirt] [RFC 5/7] Deprecate virConnectNumOfDomains()

2018-10-02 Thread Andrea Bolognani
In this case we want to deprecate the API wholesale, so we can simply report a warning in the public entry point. Signed-off-by: Andrea Bolognani --- src/libvirt-domain.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index

[libvirt] [RFC 3/7] tools: Print warnings in virsh

2018-10-02 Thread Andrea Bolognani
We delay dealing with actual errors until a later, more appropriate time in general, but if we wanted to do the same with warnings we'd have to introduce a lot of duplicated handling in virsh, so we just print them right away and move on with the usual processing instead. Signed-off-by: Andrea

[libvirt] [RFC 0/7] Warn at runtime when deprecated features are used

2018-10-02 Thread Andrea Bolognani
Background == We have plenty of features in libvirt, some of which were designed at a time when the virtualization story was much more straightforward than the multi-architecture, multi-hypervisor, multi-machine world we currently live in and, while we have found ways to keep the APIs

[libvirt] [RFC 1/7] util: Add 'level' argument to virReportErrorHelper()

2018-10-02 Thread Andrea Bolognani
Up until now it's been assumed that every single error reported through the helper would have VIR_ERR_ERROR level, but this will no longer be the case going forward so we need to make it a little more flexible. Signed-off-by: Andrea Bolognani --- src/access/viraccessdriverpolkit.c | 2 +-

[libvirt] [RFC 7/7] tools: Force virsh to use deprecated features

2018-10-02 Thread Andrea Bolognani
Instead of trying newer APIs first and only falling back to deprecated ones if those are not available, go straight for the older APIs. Running 'virsh list' will now cause warnings to be displayed. Signed-off-by: Andrea Bolognani --- tools/virsh-domain-monitor.c | 2 ++ 1 file changed, 2

Re: [libvirt] [PATCH 8/8] qemu: hotplug: Refactor qemuDomainAttachDeviceDiskLiveInternal

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > We now explicitly handle media change elsewhere so we can drop the > switch statement. This will also make it more intuitive once CDROM > device hotplug might be supported. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_hotplug.c | 70

Re: [libvirt] [PATCH 7/8] qemu: hotplug: Split out media change code from disk hotplug

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > Disk hotplug has slightly different semantics from media changing. Move > the media change code out and add proper initialization of the new > source object. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_driver.c | 15 +-- >

Re: [libvirt] [PATCH 6/8] qemu: conf: Export qemuAddSharedDisk

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > In cases where we know the device is a disk we can avoid using the full > device definition. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_conf.c | 2 +- > src/qemu/qemu_conf.h | 5 + > 2 files changed, 6 insertions(+), 1 deletion(-) >

Re: [libvirt] [PATCH 5/8] qemu: hotplug: Add wrapper for disk hotplug code

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > The disk hotplug code also overloads media change which is not ideal. > This will allow splitting out of the media change code. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_hotplug.c | 27 +++ > 1 file changed, 23

Re: [libvirt] [PATCH 4/8] qemu: hotplug: Prepare disk source for media changing

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > The disk storage source needs to be prepared if we want to use -blockdev > or secrets for the new media image. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_hotplug.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git

Re: [libvirt] [PATCH 3/8] qemu: hotplug: Use new source when preparing/translating for media change

2018-10-02 Thread John Ferlan
On 10/2/18 8:25 AM, Peter Krempa wrote: > On Tue, Oct 02, 2018 at 08:15:07 -0400, John Ferlan wrote: >> >> >> On 9/27/18 11:09 AM, Peter Krempa wrote: >>> Some internal helpers use only a virDomainDiskDef to do their job. If we >>> want to change source for the disk we need to update it to the

Re: [libvirt] [PATCH 2/2] cpu_map: Add Icelake CPU models

2018-10-02 Thread Ján Tomko
On Tue, Sep 18, 2018 at 03:55:03PM +0200, Jiri Denemark wrote: Introduced in QEMU by commit v3.0.0-156-g8a11c62da9. Signed-off-by: Jiri Denemark --- src/cpu_map/x86_Icelake-Client.xml | 85 ++ src/cpu_map/x86_Icelake-Server.xml | 95 ++ 2 files

Re: [libvirt] [PATCH 3/8] qemu: hotplug: Use new source when preparing/translating for media change

2018-10-02 Thread Peter Krempa
On Tue, Oct 02, 2018 at 08:15:07 -0400, John Ferlan wrote: > > > On 9/27/18 11:09 AM, Peter Krempa wrote: > > Some internal helpers use only a virDomainDiskDef to do their job. If we > > want to change source for the disk we need to update it to the new > > source in the disk definition for

Re: [libvirt] [PATCH 3/8] qemu: hotplug: Use new source when preparing/translating for media change

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > Some internal helpers use only a virDomainDiskDef to do their job. If we > want to change source for the disk we need to update it to the new > source in the disk definition for those to work correctly. > > Signed-off-by: Peter Krempa > --- >

Re: [libvirt] [PATCH 2/8] Revert "qemu: hotplug: consolidate media change code paths"

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > While the idea was good the implementation not so much as we need to > take into account the old disk data and the new source. The code will be > consolidated later in a different way. > > This reverts commit 663b1d55de652201b19d875f0eff730dc28e689e.

Re: [libvirt] [PATCH 1/8] Revert "qemu: hotplug: Prepare disk source in qemuDomainAttachDeviceDiskLive"

2018-10-02 Thread John Ferlan
On 9/27/18 11:09 AM, Peter Krempa wrote: > Preparing the storage source prior to assigning the alias will not work > as the names of the certain objects depend on the alias for the legacy > hotplug case as we generate the object names for the secrets based on > the alias. > > This reverts

Re: [libvirt] [PATCH] virFileIsSharedFSType: Check for fuse.glusterfs too

2018-10-02 Thread Jiri Denemark
On Mon, Oct 01, 2018 at 09:56:01 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1632711 > > GlusterFS is typically safe when it comes to migration. It's a > network FS after all. However, it can be mounted via FUSE driver > they provide. If that is the case we fail

Re: [libvirt] question about syntax of storage volume element

2018-10-02 Thread Pavel Hrdina
On Mon, Oct 01, 2018 at 02:28:09PM -0400, Cole Robinson wrote: > On 09/28/2018 12:54 AM, Jim Fehlig wrote: > > I've attempted to use virt-manager to create a new VM that uses a volume > > from an rbd-based network pool, but have not been able to progress past > > step 4/5 where VM storage is

[libvirt] [PATCH 46/53] vircgrouptest: prepare testCgroupDetectMounts for cgroup v2

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgroupdata/all-in-one.parsed | 1 + tests/vircgroupdata/cgroups1.parsed | 1 + tests/vircgroupdata/cgroups2.parsed | 1 + tests/vircgroupdata/cgroups3.parsed | 1 + tests/vircgroupdata/fedora-18.parsed | 1 +

[libvirt] [PATCH 50/53] vircgrouptest: add cgroup v2 tests

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgrouptest.c | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index ead5046600..fe0cb9585a 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c

[libvirt] [PATCH 44/53] vircgroupmock: add support to test cgroup v2

2018-10-02 Thread Pavel Hrdina
We need to create the cgroup v2 sysfs the same way as we do for cgroup v1. This introduces new VIR_CGROUP_MOCK_MODE env variable which will configure which cgroup mode each test requires. There are three different modes: - legacy: only cgroup v1 is available and it's the default mode -

[libvirt] [PATCH 49/53] vircgrouptest: prepare validateCgroup for cgroupv2

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgrouptest.c | 53 +++ 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index e766ad7cbe..ead5046600 100644 --- a/tests/vircgrouptest.c +++

[libvirt] [PATCH 25/53] vircgroup: introduce virCgroupV2SetBlkioDeviceReadIops

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index b7e4db9f41..408f7e3eeb 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 26/53] vircgroup: introduce virCgroupV2SetBlkioDeviceWriteIops

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 408f7e3eeb..6279072aab 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 52/53] virt-host-validate: rewrite cgroup detection to use util/vircgroup

2018-10-02 Thread Pavel Hrdina
This removes code duplication and simplifies cgroup detection. As a drawback we will not have separate messages to enable cgroup controller in kernel or to mount it. On the other side the rewrite adds support for cgroup v2. The kernel config support was wrong because it was parsing

[libvirt] [PATCH 30/53] vircgroup: introduce virCgroupV2GetMemoryStat

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 75 ++ 1 file changed, 75 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 32d20f2ff6..da3b3a984c 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 13/53] vircgroup: introduce virCgroupV2PathOfController

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 24 1 file changed, 24 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 57be0b92c9..3ca463e4c2 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -313,6 +313,29 @@

[libvirt] [PATCH 42/53] vircgroup: add support for hybrid configuration

2018-10-02 Thread Pavel Hrdina
This enables to use both cgroup v1 and v2 at the same time together with libvirt. It is supported by kernel and there is valid use-case, not all controllers are implemented in cgroup v2 so there might be configurations where administrator would enable these missing controllers in cgroup v1.

[libvirt] [PATCH 53/53] virt-host-validate: require freezer for LXC

2018-10-02 Thread Pavel Hrdina
Cgroup freezer support for LXC was added in libvirt-0.7.2. Signed-off-by: Pavel Hrdina --- tools/virt-host-validate-lxc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virt-host-validate-lxc.c b/tools/virt-host-validate-lxc.c index 3c55b1b26d..8613f37cc7 100644 ---

[libvirt] [PATCH 39/53] vircgroup: introduce virCgroupV2SupportsCpuBW

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 16 1 file changed, 16 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index d52e065685..61c881f7e2 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1443,6 +1443,21 @@

[libvirt] [PATCH 51/53] vircgrouptest: add hybrid tests

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgrouptest.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index fe0cb9585a..8fcee21bb2 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@

[libvirt] [PATCH 16/53] vircgroup: introduce virCgroupV2AddTask

2018-10-02 Thread Pavel Hrdina
In cgroups v2 we need to handle threads and processes differently. If you need to move a process you need to write its pid into cgrou.procs file and it will move the process with all its threads as well. The whole process will be moved if you use tid of any thread. In order to move only threads

[libvirt] [PATCH 48/53] vircgrouptest: add detect mounts test for hybrid cgroups

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgroupdata/hybrid.cgroups | 12 tests/vircgroupdata/hybrid.mounts | 23 +++ tests/vircgroupdata/hybrid.parsed | 11 +++ tests/vircgroupdata/hybrid.self.cgroup | 9 + tests/vircgrouptest.c

[libvirt] [PATCH 47/53] vircgrouptest: add detect mounts test for cgroup v2

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgroupdata/unified.cgroups | 13 + tests/vircgroupdata/unified.mounts | 20 tests/vircgroupdata/unified.parsed | 11 +++ tests/vircgroupdata/unified.self.cgroup | 1 + tests/vircgrouptest.c

[libvirt] [PATCH 43/53] vircgroupmock: change cgroup prefix

2018-10-02 Thread Pavel Hrdina
Remove the trailing '/' from prefix. This change is required in order to introduce tests for unified cgroups. They are usually mounted in '/sys/fs/cgroup'. Signed-off-by: Pavel Hrdina --- tests/vircgroupmock.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

[libvirt] [PATCH 36/53] vircgroup: introduce virCgroupV2SetCpuShares

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 3d1d68ded5..6cecfb9741 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1307,6 +1307,26 @@

[libvirt] [PATCH 45/53] vircgrouptest: introduce initFakeFS and cleanupFakeFS helpers

2018-10-02 Thread Pavel Hrdina
We need to configure multiple env variables for each set of tests so create helper functions to do that. Signed-off-by: Pavel Hrdina --- tests/vircgrouptest.c | 48 --- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/tests/vircgrouptest.c

[libvirt] [PATCH 28/53] vircgroup: introduce virCgroupV2SetBlkioDeviceWriteBps

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 88bd9fb37c..d48e9db559 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 27/53] vircgroup: introduce virCgroupV2SetBlkioDeviceReadBps

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 6279072aab..88bd9fb37c 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 41/53] vircgroup: introduce virCgroupV2GetCpuacctStat

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 49 ++ 1 file changed, 49 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index c6e66189bb..c7248c1145 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 37/53] vircgroup: introduce virCgroupV2SetCpuCfsPeriod

2018-10-02 Thread Pavel Hrdina
In order to set CPU cfs period using cgroup v2 'cpu.max' interface we need to load the current value of CPU cfs quota first because format of 'cpu.max' interface is '$quota $period' and in order to change 'period' we need to write 'quota' as well. Writing only one number changes only 'quota'.

[libvirt] [PATCH 10/53] vircgroup: introduce virCgroupV2DetectControllers

2018-10-02 Thread Pavel Hrdina
Cgroup v2 has only single mount point for all controllers. The list of controllers is stored in cgroup.controllers file, name of controllers are separated by space. In cgroup v2 there is no cpuacct controller, the cpu.stat file always exists with usage stats. Signed-off-by: Pavel Hrdina ---

[libvirt] [PATCH 19/53] vircgroup: introduce virCgroupV2SetOwner

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 52 ++ 1 file changed, 52 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index e30f438015..fec5d28835 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 32/53] vircgroup: introduce virCgroupV2SetMemoryHardLimit

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 43 ++ 1 file changed, 43 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 9f37ff5be5..06522498f2 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 18/53] vircgroup: introduce virCgroupV2BindMount

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index c6a9e0a7df..e30f438015 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -21,6

[libvirt] [PATCH 05/53] vircgroup: introduce virCgroupV2CopyPlacement

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index d3f72b9006..11d9876d36 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -141,12 +141,39

[libvirt] [PATCH 40/53] vircgroup: introduce virCgroupV2GetCpuacctUsage

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 33 + 1 file changed, 33 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 61c881f7e2..c6e66189bb 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1458,6

[libvirt] [PATCH 09/53] vircgroup: introduce virCgroupV2StealPlacement

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 12 1 file changed, 12 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 23443abfbb..d4e0366780 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -221,6 +221,17 @@

[libvirt] [PATCH 31/53] vircgroup: introduce virCgroupV2GetMemoryUsage

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index da3b3a984c..9f37ff5be5 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1118,6 +1118,20 @@

[libvirt] [PATCH 24/53] vircgroup: introduce virCgroupV2SetBlkioDeviceWeight

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 51 ++ 1 file changed, 51 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index eff410258c..b7e4db9f41 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 33/53] vircgroup: introduce virCgroupV2SetMemorySoftLimit

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 61 ++ 1 file changed, 61 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 06522498f2..b5cc5f8f2e 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 34/53] vircgroup: introduce virCgroupV2SetMemSwapHardLimit

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 62 ++ 1 file changed, 62 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index b5cc5f8f2e..ae352f0212 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 35/53] vircgroup: introduce virCgroupV2GetMemSwapUsage

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 16 1 file changed, 16 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index ae352f0212..3d1d68ded5 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1292,6 +1292,21 @@

[libvirt] [PATCH 22/53] vircgroup: introduce virCgroupV2GetBlkioIoServiced

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 3e2cd16335..30c400f129 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 07/53] vircgroup: introduce virCgroupV2DetectPlacement

2018-10-02 Thread Pavel Hrdina
If the placement was copied from parent or set to absolute path there is nothing to do, otherwise set the placement based on process placement from /proc/self/cgroup or /proc/{pid}/cgroup. Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 26 ++ 1 file changed, 26

[libvirt] [PATCH 38/53] vircgroup: introduce virCgroupV2SetCpuCfsQuota

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 52 ++ 1 file changed, 52 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 92fe825795..d52e065685 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 12/53] vircgroup: introduce virCgroupV2GetAnyController

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 8 1 file changed, 8 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 5cd8e86b97..57be0b92c9 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -306,6 +306,13 @@

[libvirt] [PATCH 14/53] vircgroup: introduce virCgroupV2MakeGroup

2018-10-02 Thread Pavel Hrdina
When creating cgroup hierarchy we need to enable controllers in the parent cgroup in order to be usable. That means writing "+{controller}" into cgroup.subtree_control file. We can enable only controllers that are enabled for parent cgroup, that means we need to do that for the whole cgroup

[libvirt] [PATCH 03/53] vircgroup: introduce virCgroupV2ValidateMachineGroup

2018-10-02 Thread Pavel Hrdina
When reconnecting to a domain we are validating the cgroup name. In case of cgroup v2 we need to validate only the new format for host without systemd '{machinename}.libvirt-{drivername}' or scope name generated by systemd. Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 43

[libvirt] [PATCH 21/53] vircgroup: introduce virCgroupV2SetBlkioWeight

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 49 ++ 1 file changed, 49 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index fec5d28835..3e2cd16335 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 23/53] vircgroup: introduce virCgroupV2GetBlkioIoDeviceServiced

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 30c400f129..eff410258c 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@

[libvirt] [PATCH 15/53] vircgroup: introduce virCgroupV2Remove

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 20 1 file changed, 20 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 8fb9ace474..103f37fe91 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -413,6 +413,25 @@

[libvirt] [PATCH 17/53] vircgroup: introduce virCgroupV2HasEmptyTasks

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index e7dbace42b..c6a9e0a7df 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -446,6 +446,22 @@

[libvirt] [PATCH 29/53] vircgroup: introduce virCgroupV2SetMemory

2018-10-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/vircgroupv2.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index d48e9db559..32d20f2ff6 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1017,6

  1   2   >