Re: [libvirt] [PATCH v1 11/32] util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-29 Thread Erik Skultety
On Sat, Jul 28, 2018 at 11:31:26PM +0530, Sukrit Bhatnagar wrote: > Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in > src/util/viralloc.h, define a new wrapper around an existing > cleanup function which will be called when a variable declared > with VIR_AUTOPTR macro goes out of scope. Also

[libvirt] [PATCH v2 RESEND 16/17] conf: Add return value check to virResctrlAllocForeachCache

2018-07-29 Thread bing . niu
From: Bing Niu Add return value check to virResctrlAllocForeachCache in virDomainCachetuneDefFormat. The virResctrlAllocForeachCache dose have return value, so need check return value to make sure function executed without error. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 8

[libvirt] [PATCH v2 RESEND 13/17] conf: Factor out vcpus overlapping from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Factor out vcpus overlapping detecting part from virDomainCachetuneDefParse and introduce virDomainResctrlVcpuMatch. Instead of allocating virResctrlAllocPtr by default, allocating virResctrlAllocPtr after confirm vcpus not overlap with existing ones. And virDomainResctrlVcpuMatch

[libvirt] [PATCH v2 RESEND 15/17] conf: Add support for memorytune XML processing for resctrl MBA

2018-07-29 Thread bing . niu
From: Bing Niu Introduce a new section memorytune to support memory bandwidth allocation. This is consistent with existing cachetune. As the example: below: .. vpus --- vpus subjected to this memory bandwidth. id--- on which node memory bandwidth to be

[libvirt] [PATCH v2 RESEND 08/17] util: Add support to calculate MBA utilization

2018-07-29 Thread bing . niu
From: Bing Niu Introduce virResctrlMemoryBandwidthSubtract and virResctrlAllocMemoryBandwidth to be used as part of the virResctrlAllocAssign processing to configure the available memory bandwidth. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 105

[libvirt] [PATCH v2 RESEND 05/17] util: Add MBA check to virResctrlInfoGetCache

2018-07-29 Thread bing . niu
From: Bing Niu If we have some membw_info data, then we need to calculate the number of MBA controllers on the system. The value cannot be obtained from a direct query to the RDT kernel module, but it is the same as the last level cache value which is calculated by traversing the cache hierarchy

[libvirt] [PATCH v2 RESEND 07/17] util: Add MBA schemata parse and format methods

2018-07-29 Thread bing . niu
From: Bing Niu Introduce virResctrlAllocMemoryBandwidthFormat and virResctrlAllocParseMemoryBandwidthLine which will format and parse an entry in the schemata file for MBA. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 141 ++ 1 file change

[libvirt] [PATCH v2 RESEND 10/17] util: Introduce virResctrlAllocSetMemoryBandwidth

2018-07-29 Thread bing . niu
From: Bing Niu Introduce an API to allow setting of the MBA from domain XML. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 48 src/util/virresctrl.h| 5 + 3 files changed, 54 insertions(+) diff

[libvirt] [PATCH v2 RESEND 14/17] conf: Factor out virDomainResctrlDef update from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Factor out vcpus virDomainResctrlDef update from virDomainCachetuneDefParse and introduce virDomainResctrlAppend. virDomainResctrlAppend will format vcpus string and append a new virDomainResctrlDef to virDomainDefPtr. So that this logic can be reusable. Signed-off-by: Bing Niu -

[libvirt] [PATCH v2 RESEND 17/17] conf: Add memory bandwidth allocation capability of host

2018-07-29 Thread bing . niu
From: Bing Niu Add new XML section to report host's memory bandwidth allocation capability. The format as below example: . granularity granularity of memory bandwidth, unit percentage. min minimum memory bandwidth allowed, unit percentag

[libvirt] [PATCH v2 RESEND 03/17] util: Refactor virResctrlAllocFormat of virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Refactor virResctrlAllocFormat so that it is easy to support other resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) dif

[libvirt] [PATCH v2 RESEND 11/17] conf: Rename cachetune to resctrl

2018-07-29 Thread bing . niu
From: Bing Niu Resctrl not only supports cache tuning, but also memory bandwidth tuning. Renaming cachetune to resctrl to reflect that. With resctrl, all allocation for different resources (cache, memory bandwidth) are aggregated and represented by a virResctrlAllocPtr inside virDomainResctrlDef.

[libvirt] [PATCH v2 RESEND 09/17] util: Introduce virResctrlAllocForeachMemory

2018-07-29 Thread bing . niu
From: Bing Niu Introduce an API that will traverse the memory bandwidth data calling a callback function for each defined bandwidth entry. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 33 + src/util/virresctrl.h| 9

[libvirt] [PATCH v2 RESEND 12/17] conf: Factor out vcpus parsing part from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Extract vcpus parsing part from virDomainCachetuneDefParse into one function called virDomainResctrlParseVcpus. So that vcpus parsing logic can be reused by other resource control technologies. Adjust error message and use node->name so that the error message can fit to all technol

[libvirt] [PATCH v2 RESEND 00/17] Introduce RDT memory bandwidth allocation support

2018-07-29 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method to

[libvirt] [PATCH v2 RESEND 01/17] util: Rename some functions of virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Some functions in virresctrl are for CAT only, while some of other functions are for resource allocation, not just CAT. So change their names to reflect the reality. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 8 src/libvirt_private

[libvirt] [PATCH v2 RESEND 04/17] util: Add MBA capability information query to resctrl

2018-07-29 Thread bing . niu
From: Bing Niu Introducing virResctrlInfoMemBW for the information memory bandwidth allocation information. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 84 +++ 1 file changed, 84 insertions(+) diff --git a/src/u

[libvirt] [PATCH v2 RESEND 02/17] util: Refactor virResctrlGetInfo in virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Separate resctrl common information parts from CAT specific parts, so that common information parts can be reused among different resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 32 +++-

[libvirt] [PATCH v2 RESEND 06/17] util: Add MBA allocation to virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support to virresctrl class. Introducing virResctrlAllocMemBW which is used for allocating memory bandwidth. Following virResctrlAllocPerType, it also employs a nested sparse array to indicate whether allocation is available for particular last level

Re: [libvirt] [PATCH v2 0/4] New mdev type handling for aggregated resources

2018-07-29 Thread Zhenyu Wang
On 2018.07.27 16:45:55 +0200, Erik Skultety wrote: > On Thu, Jul 26, 2018 at 06:04:10PM +0200, Cornelia Huck wrote: > > On Thu, 26 Jul 2018 17:43:45 +0200 > > Erik Skultety wrote: > > > > > On Thu, Jul 26, 2018 at 05:30:07PM +0200, Cornelia Huck wrote: > > > > One thing I noticed is that we have s

[libvirt] Matching the type of mediated devices in the migration

2018-07-29 Thread Wang, Zhi A
BACKGROUND As the live migration of mdev is going to be supported in VFIO, a scheme of deciding if a mdev could be migratable between the source machine and the destination machine is needed. Mostly, this email is going to discuss a possible solution which needs fewer modifications of libvirt/V