[libvirt] [PATCHv4 11/18] conf: Refactor code for matching existing resctrls

2018-09-30 Thread Wang Huaqiang
Refactoring the code of matching the new resctrl with existing resctrl groups. Add the virObjectRef action into function virDomainResctrlVcpuMatch. Signed-off-by: Wang Huaqiang --- src/conf/domain_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[libvirt] [PATCHv4 12/18] conf: Refactor virDomainResctrlAppend

2018-09-30 Thread Wang Huaqiang
Refactor virDomainResctrlAppend to facilitate virDomainResctrlDef with the capability to hold more element. Signed-off-by: Wang Huaqiang --- src/conf/domain_conf.c | 64 +++--- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git

[libvirt] [PATCHv4 17/18] qemu: refactor qemuDomainGetStatsCpu

2018-09-30 Thread Wang Huaqiang
Refactoring qemuDomainGetStatsCpu, make it possible to add more CPU statistics. Signed-off-by: Wang Huaqiang --- src/qemu/qemu_driver.c | 45 ++--- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCHv4 16/18] conf: Add a 'id' to virDomainResctrlDef

2018-09-30 Thread Wang Huaqiang
Adding element 'id' to virDomainResctrlDef. This 'id' reflects the attribute 'id' of of element 'cachetune in XML. virResctrlAlloc.id is a copy of virDomanResctrlDef.id. Signed-off-by: Wang Huaqiang --- src/conf/domain_conf.c | 20 src/conf/domain_conf.h | 1 + 2 files

[libvirt] [PATCHv4 18/18] qemu: Report cache occupancy (CMT) with domstats

2018-09-30 Thread Wang Huaqiang
Adding the interface in qemu to report CMT statistic information through command 'virsh domstats --cpu-total'. Below is a typical output: # virsh domstats 1 --cpu-total Domain: 'ubuntu16.04-base' ... cpu.cache.monitor.count=2

[libvirt] [PATCHv4 06/18] util: Add monitor interface to determine path

2018-09-30 Thread Wang Huaqiang
Add interface for resctrl monitor to determine the path. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 32 src/util/virresctrl.h| 3 +++ 3 files changed, 36 insertions(+) diff --git a/src/libvirt_private.syms

[libvirt] [PATCHv4 14/18] Util: Add function for checking if monitor is running

2018-09-30 Thread Wang Huaqiang
Check monitor status by checking the PIDs are in file 'task' or not. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 84 +++- src/util/virresctrl.h| 4 +++ 3 files changed, 88 insertions(+), 1

[libvirt] [PATCHv4 13/18] conf: Add resctrl monitor configuration

2018-09-30 Thread Wang Huaqiang
Introducing element under to represent a cache monitor. Supports two kind of monitors, which are, monitor under default allocation or monitor under particular allocation. Monitor supervises the cache or memory bandwidth usage for interested vcpu thread set, if the vcpu thread set is belong to

[libvirt] [PATCHv4 15/18] qemu: enable resctrl monitor in qemu

2018-09-30 Thread Wang Huaqiang
Add functions for creating, destroying, reconnecting resctrl monitor in qemu according to the configuration in domain XML. Signed-off-by: Wang Huaqiang --- src/qemu/qemu_process.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCHv4 09/18] util: Add more interfaces for resctrl monitor

2018-09-30 Thread Wang Huaqiang
Add interfaces monitor group to support operations such as add PID, set ID, remove group ... etc. The interface for getting cache occupancy information from the monitor is also added. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 6 ++ src/util/virresctrl.c| 209

[libvirt] [PATCHv4 10/18] util: Introduce default monitor

2018-09-30 Thread Wang Huaqiang
In resctrl file system, more than one monitoring groups could be created within one allocation group, along with the creation of allocation group, a monitoring group is created at the same, which monitors the resource utilization information of whole allocation group. This patch is introducing

[libvirt] [PATCHv4 07/18] util: Refactor code for creating resctrl group

2018-09-30 Thread Wang Huaqiang
The code for creating resctrl allocation group could be reused for monitoring group, refactor it for reusing in the later patch. Signed-off-by: Wang Huaqiang --- src/util/virresctrl.c | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git

[libvirt] [PATCHv4 08/18] util: Add interface for creating monitor group

2018-09-30 Thread Wang Huaqiang
Add interface for creating the resource monitoring group according to '@virResctrlMonitor->path'. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 28 src/util/virresctrl.h| 6 ++ 3 files changed, 35 insertions(+)

[libvirt] [PATCHv4 02/18] util: Introduce resctrl monitor for CMT

2018-09-30 Thread Wang Huaqiang
Cache Monitoring Technology (aka CMT) provides the capability to report cache utilization information of system task. This patch introduces the concept of resctrl monitor through data structure virResctrlMonitor. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 +

[libvirt] [PATCHv4 03/18] util: Refactor code for adding PID to the resource group

2018-09-30 Thread Wang Huaqiang
The code of adding PID to the allocation could be reused, refactor it for later reusing. Signed-off-by: Wang Huaqiang --- src/util/virresctrl.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index

[libvirt] [PATCHv4 01/18] docs: Refactor schemas to support default allocation

2018-09-30 Thread Wang Huaqiang
The resctrl default allocation is introduced in this patch, which refers to the root directory (/sys/fs/resctrl) and immediately be created after mounting, owns all the tasks and cpus in the system and can make full use of all resources. It does not intentionally allocate any dedicated amount of

[libvirt] [PATCHv4 04/18] util: Add interface for adding PID to monitor

2018-09-30 Thread Wang Huaqiang
Add interface for adding task PID to monitor. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 8 src/util/virresctrl.h| 4 3 files changed, 13 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index

[libvirt] [PATCHv4 05/18] util: Refactor code for determining allocation path

2018-09-30 Thread Wang Huaqiang
The code for determining resctrl allocation path could be reused for monitor. Refactor it for reusing. Signed-off-by: Wang Huaqiang --- src/util/virresctrl.c | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/util/virresctrl.c

[libvirt] [PATCHv4 00/18] Introduce x86 Cache Monitoring Technology (CMT)

2018-09-30 Thread Wang Huaqiang
This series of patches and the series already been merged introduce the x86 Cache Monitoring Technology (CMT) to libvirt by interacting with kernel resource control (resctrl) interface. CMT is one of the Intel(R) x86 CPU feature which belongs to the Resource Director Technology (RDT). CMT reports

Re: [libvirt] [PATCH RFC] lxc: Include support to lxc version 3.0 and higher.

2018-09-30 Thread Julio Faracco
For further reference: https://lists.linuxcontainers.org/pipermail/lxc-devel/2018-April/017663.html Em dom, 30 de set de 2018 às 23:24, Julio Faracco escreveu: > > Hi guys, > > I put the RFC mark because I don't know if this is the best way to > enhance the support for LXC 3.0. Considering this

Re: [libvirt] [PATCH RFC] lxc: Include support to lxc version 3.0 and higher.

2018-09-30 Thread Julio Faracco
Hi guys, I put the RFC mark because I don't know if this is the best way to enhance the support for LXC 3.0. Considering this patch, I can use both o version without any issue, but I would like to see other points of view. I'm not completely right about this approach. -- Julio Cesar Faracco Em

[libvirt] [PATCH RFC] lxc: Include support to lxc version 3.0 and higher.

2018-09-30 Thread Julio Faracco
This patch introduce the new settings for LXC 3.0 and higher. The older versions keep the compatibility to deprecated settings for LXC, but after release 3.0, the compatibility was removed. This commit adds the support to the refactored settings. Signed-off-by: Julio Faracco ---

[libvirt] [PATCH v3 5/5] xenconfig: add support for type="pvh"

2018-09-30 Thread Marek Marczykowski-Górecki
Handle PVH domain type in both directions (xen-xl->xml, xml->xen-xl). And add a test for it. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - update for modified "libxl: add support for PVH" --- src/xenconfig/xen_common.c | 11 +-- src/xenconfig/xen_xl.c

[libvirt] [PATCH v3 1/5] libxl: reorder libxlMakeDomBuildInfo for upcoming PVH support

2018-09-30 Thread Marek Marczykowski-Górecki
Make it easier to share HVM and PVH code where relevant. No functional change. Signed-off-by: Marek Marczykowski-Górecki --- src/libxl/libxl_conf.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c

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

2018-09-30 Thread Marek Marczykowski-Górecki
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 any other requirement (besides new enough Xen).

[libvirt] [PATCH v3 3/5] tests: add basic Xen PVH test

2018-09-30 Thread Marek Marczykowski-Górecki
Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - update for modified "libxl: add support for PVH" - skip PVH test on too old Xen --- tests/libxlxml2domconfigdata/basic-pvh.json | 49 ++- tests/libxlxml2domconfigdata/basic-pvh.xml | 28 +-

[libvirt] [PATCH v3 4/5] xenconfig: add support for parsing type= xl config entry

2018-09-30 Thread Marek Marczykowski-Górecki
builder="hvm" is deprecated since Xen 4.10, new syntax is type="hvm" (or type="pv", which is default). Since the old one is still supported, still use it when writing native config, so the config will work on older Xen too (and will also not complicate tests). Signed-off-by: Marek

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

2018-09-30 Thread Marek Marczykowski-Górecki
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. Also, not sure about VIR_DOMAIN_OSTYPE_XENPVH (as discussed on PVHv1 patch)