[libvirt] [PATCH V4] Expose resource control capabilites on cache bank
by Eli Qiao
This patch is based on Martin's cache branch.
* This patch amends the cache bank capability as follow:
<cache>
<bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
<control min='768' unit='KiB' scope='BOTH' max_allocation='4'/>
</bank>
<bank id='1' level='3' type='unified' size='15360' unit='KiB' cpus='6-11'>
<control min='768' unit='KiB' scope='BOTH' max_allocation='4'/>
</bank>
</cache>
For CDP enabled on x86 arch, we will have:
<cache>
<bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
<control min='768' unit='KiB' scope='CODE' max_allocation='4'/>
<control min='768' unit='KiB' scope='DATA' max_allocation='4'/>
</bank>
...
* Added a new testdata directory `linux-resctrl-cdp` to test CDP enabled
case.
* Along with vircaps2xmltest case updated.
P.S. here the scope is from /sys/fs/resctrl/info/L3{"" "CODE" "DATA"}, I
keep it capital upper as I need to use a macro to convert from enum to
string easily.
Signed-off-by: Eli Qiao <liyong.qiao(a)intel.com>
---
docs/schemas/capability.rng | 20 +++
src/conf/capabilities.c | 135 ++++++++++++++++++++-
src/conf/capabilities.h | 26 +++-
.../vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus | 1 +
.../linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask | 1 +
.../resctrl/info/L3CODE/min_cbm_bits | 1 +
.../resctrl/info/L3CODE/num_closids | 1 +
.../linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask | 1 +
.../resctrl/info/L3DATA/min_cbm_bits | 1 +
.../resctrl/info/L3DATA/num_closids | 1 +
.../linux-resctrl-cdp/resctrl/manualres/cpus | 1 +
.../linux-resctrl-cdp/resctrl/manualres/schemata | 2 +
.../linux-resctrl-cdp/resctrl/manualres/tasks | 0
.../linux-resctrl-cdp/resctrl/schemata | 2 +
.../linux-resctrl-cdp/resctrl/tasks | 0
tests/vircaps2xmldata/linux-resctrl-cdp/system | 1 +
.../vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml | 55 +++++++++
tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 8 +-
tests/vircaps2xmltest.c | 10 ++
19 files changed, 261 insertions(+), 6 deletions(-)
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/min_cbm_bits
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num_closids
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/min_cbm_bits
create mode 100755 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num_closids
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/tasks
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks
create mode 120000 tests/vircaps2xmldata/linux-resctrl-cdp/system
create mode 100644 tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 2080953..bfed4f8 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -277,6 +277,26 @@
<attribute name='cpus'>
<ref name='cpuset'/>
</attribute>
+ <zeroOrMore>
+ <element name='control'>
+ <attribute name='min'>
+ <ref name='unsignedInt'/>
+ </attribute>
+ <attribute name='unit'>
+ <ref name='unit'/>
+ </attribute>
+ <attribute name='scope'>
+ <choice>
+ <value>BOTH</value>
+ <value>CODE</value>
+ <value>DATA</value>
+ </choice>
+ </attribute>
+ <attribute name='max_allocation'>
+ <ref name='unsignedInt'/>
+ </attribute>
+ </element>
+ </zeroOrMore>
</element>
</oneOrMore>
</element>
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 416dd1a..c6641d1 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -52,6 +52,7 @@
#define VIR_FROM_THIS VIR_FROM_CAPABILITIES
#define SYSFS_SYSTEM_PATH "/sys/devices/system/"
+#define SYSFS_RESCTRL_PATH "/sys/fs/resctrl/"
VIR_LOG_INIT("conf.capabilities")
@@ -873,6 +874,9 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
virCapsHostCacheBankPtr *caches)
{
size_t i = 0;
+ size_t j = 0;
+ int indent = virBufferGetIndent(buf, false);
+ virBuffer controlBuf = VIR_BUFFER_INITIALIZER;
if (!ncaches)
return 0;
@@ -894,13 +898,38 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
*/
virBufferAsprintf(buf,
"<bank id='%u' level='%u' type='%s' "
- "size='%llu' unit='%s' cpus='%s'/>\n",
+ "size='%llu' unit='%s' cpus='%s'",
bank->id, bank->level,
virCacheTypeToString(bank->type),
bank->size >> (kilos * 10),
kilos ? "KiB" : "B",
cpus_str);
+ /* Format control */
+ virBufferAdjustIndent(&controlBuf, indent + 4);
+ for (j = 0; j < bank->ncontrols; j++) {
+ bool min_kilos = !(bank->controls[j]->min % 1024);
+ virBufferAsprintf(&controlBuf,
+ "<control min='%llu' unit='%s' "
+ "scope='%s' max_allocation='%u'/>\n",
+ bank->controls[j]->min >> (min_kilos * 10),
+ min_kilos ? "KiB" : "B",
+ virResctrlCacheTypeToString(bank->controls[j]->scope),
+ bank->controls[j]->max_allocation);
+ }
+
+ /* Put it all together */
+ if (virBufferUse(&controlBuf)) {
+ virBufferAddLit(buf, ">\n");
+ virBufferAddBuffer(buf, &controlBuf);
+ virBufferAddLit(buf, "</bank>\n");
+
+ } else {
+ virBufferAddLit(buf, "/>\n");
+ }
+
+
+ virBufferFreeAndReset(&controlBuf);
VIR_FREE(cpus_str);
}
@@ -1513,13 +1542,101 @@ virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
void
virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr)
{
+ size_t i;
+
if (!ptr)
return;
virBitmapFree(ptr->cpus);
+ for (i = 0; i < ptr->ncontrols; i++)
+ VIR_FREE(ptr->controls[i]);
+ VIR_FREE(ptr->controls);
VIR_FREE(ptr);
}
+VIR_ENUM_IMPL(virResctrlCache, VIR_RESCTRL_CACHE_TYPE_LAST,
+ "BOTH",
+ "CODE",
+ "DATA")
+
+/* test which TYPE of cache control supported
+ * -1: don't support
+ * 0: cat
+ * 1: cdp
+ */
+static int
+virCapabilitiesGetCacheControlType(virCapsHostCacheBankPtr bank)
+{
+ int ret = -1;
+ char *path = NULL;
+ if (virAsprintf(&path,
+ SYSFS_RESCTRL_PATH "info/L%u",
+ bank->level) < 0)
+ return -1;
+
+ if (virFileExists(path)) {
+ ret = 0;
+ } else {
+ VIR_FREE(path);
+ /* for CDP enabled case, CODE and DATA will show together */
+ if (virAsprintf(&path,
+ SYSFS_RESCTRL_PATH "info/L%uCODE",
+ bank->level) < 0)
+ return -1;
+ if (virFileExists(path))
+ ret = 1;
+ }
+
+ VIR_FREE(path);
+ return ret;
+}
+
+static int
+virCapabilitiesGetCacheControl(virCapsHostCacheBankPtr bank,
+ virResctrlCacheType scope)
+{
+ int ret = -1;
+ char *path = NULL;
+ char *cbm_mask = NULL;
+ virCapsHostCacheControlPtr control;
+
+ if (VIR_ALLOC(control) < 0)
+ goto cleanup;
+
+ if (virFileReadValueUint(&control->max_allocation,
+ SYSFS_RESCTRL_PATH "info/L%u%s/num_closids",
+ bank->level,
+ scope ? virResctrlCacheTypeToString(scope) : "") < 0)
+ goto cleanup;
+
+ if (virFileReadValueString(&cbm_mask,
+ SYSFS_RESCTRL_PATH
+ "info/L%u%s/cbm_mask",
+ bank->level,
+ scope ? virResctrlCacheTypeToString(scope) : "") < 0)
+ goto cleanup;
+
+ virStringTrimOptionalNewline(cbm_mask);
+
+ control->min = bank->size / (strlen(cbm_mask) * 4);
+
+ control->scope = scope;
+
+ if (VIR_APPEND_ELEMENT(bank->controls,
+ bank->ncontrols,
+ control) < 0)
+ goto error;
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(path);
+ return ret;
+ error:
+ VIR_FREE(control);
+ return -1;
+}
+
int
virCapabilitiesInitCaches(virCapsPtr caps)
{
@@ -1595,7 +1712,21 @@ virCapabilitiesInitCaches(virCapsPtr caps)
pos, ent->d_name) < 0)
goto cleanup;
- if (bank->level < cache_min_level) {
+ ret = virCapabilitiesGetCacheControlType(bank);
+
+ if ((bank->level >= cache_min_level) || (ret >= 0)) {
+ if (ret == 0) {
+ if (virCapabilitiesGetCacheControl(bank,
+ VIR_RESCTRL_CACHE_TYPE_BOTH) < 0)
+ goto cleanup;
+ } else if (ret == 1) {
+ if ((virCapabilitiesGetCacheControl(bank,
+ VIR_RESCTRL_CACHE_TYPE_CODE) < 0) ||
+ (virCapabilitiesGetCacheControl(bank,
+ VIR_RESCTRL_CACHE_TYPE_DATA) < 0))
+ goto cleanup;
+ }
+ } else {
virCapsHostCacheBankFree(bank);
bank = NULL;
continue;
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index e099ccc..5fd3e57 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -138,10 +138,30 @@ struct _virCapsHostSecModel {
virCapsHostSecModelLabelPtr labels;
};
+/* the enum value is equal to virCacheType, but we define a new enum
+ as for resctrl it has different statement */
+typedef enum {
+ VIR_RESCTRL_CACHE_TYPE_BOTH,
+ VIR_RESCTRL_CACHE_TYPE_CODE,
+ VIR_RESCTRL_CACHE_TYPE_DATA,
+
+ VIR_RESCTRL_CACHE_TYPE_LAST
+} virResctrlCacheType;
+
+VIR_ENUM_DECL(virResctrlCache);
+
+typedef struct _virCapsHostCacheControl virCapsHostCacheControl;
+typedef virCapsHostCacheControl *virCapsHostCacheControlPtr;
+struct _virCapsHostCacheControl {
+ unsigned long long min; /* B */
+ virResctrlCacheType scope; /* Data, Code or Both */
+ unsigned int max_allocation; /* max number of supported allocations */
+};
+
typedef enum {
- VIR_CACHE_TYPE_DATA,
- VIR_CACHE_TYPE_INSTRUCTION,
VIR_CACHE_TYPE_UNIFIED,
+ VIR_CACHE_TYPE_INSTRUCTION,
+ VIR_CACHE_TYPE_DATA,
VIR_CACHE_TYPE_LAST
} virCacheType;
@@ -156,6 +176,8 @@ struct _virCapsHostCacheBank {
unsigned long long size; /* B */
virCacheType type; /* Data, Instruction or Unified */
virBitmapPtr cpus; /* All CPUs that share this bank */
+ size_t ncontrols;
+ virCapsHostCacheControlPtr *controls;
};
typedef struct _virCapsHost virCapsHost;
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus
new file mode 100644
index 0000000..b3a79aa
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus
@@ -0,0 +1 @@
+ffffff,ffffffff,ffffffff
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask
new file mode 100755
index 0000000..78031da
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/cbm_mask
@@ -0,0 +1 @@
+fffff
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/min_cbm_bits b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/min_cbm_bits
new file mode 100755
index 0000000..d00491f
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/min_cbm_bits
@@ -0,0 +1 @@
+1
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num_closids b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num_closids
new file mode 100755
index 0000000..45a4fb7
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3CODE/num_closids
@@ -0,0 +1 @@
+8
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask
new file mode 100755
index 0000000..78031da
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/cbm_mask
@@ -0,0 +1 @@
+fffff
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/min_cbm_bits b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/min_cbm_bits
new file mode 100755
index 0000000..d00491f
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/min_cbm_bits
@@ -0,0 +1 @@
+1
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num_closids b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num_closids
new file mode 100755
index 0000000..45a4fb7
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/info/L3DATA/num_closids
@@ -0,0 +1 @@
+8
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus
new file mode 100644
index 0000000..ede4cc2
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/cpus
@@ -0,0 +1 @@
+000000,00000000,00000000
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata
new file mode 100644
index 0000000..a0ef381
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/schemata
@@ -0,0 +1,2 @@
+L3DATA:0=c0000;1=c0000
+L3CODE:0=30000;1=30000
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/tasks b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/manualres/tasks
new file mode 100644
index 0000000..e69de29
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata
new file mode 100644
index 0000000..89dc76b
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/schemata
@@ -0,0 +1,2 @@
+L3DATA:0=fffff;1=fffff
+L3CODE:0=fffff;1=fffff
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks b/tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks
new file mode 100644
index 0000000..e69de29
diff --git a/tests/vircaps2xmldata/linux-resctrl-cdp/system b/tests/vircaps2xmldata/linux-resctrl-cdp/system
new file mode 120000
index 0000000..2f3a1d9
--- /dev/null
+++ b/tests/vircaps2xmldata/linux-resctrl-cdp/system
@@ -0,0 +1 @@
+../linux-resctrl/system/
\ No newline at end of file
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
new file mode 100644
index 0000000..1242d2e
--- /dev/null
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
@@ -0,0 +1,55 @@
+<capabilities>
+
+ <host>
+ <cpu>
+ <arch>x86_64</arch>
+ </cpu>
+ <power_management/>
+ <migration_features>
+ <live/>
+ </migration_features>
+ <topology>
+ <cells num='2'>
+ <cell id='0'>
+ <memory unit='KiB'>1048576</memory>
+ <pages unit='KiB' size='4'>2048</pages>
+ <pages unit='KiB' size='2048'>4096</pages>
+ <pages unit='KiB' size='1048576'>6144</pages>
+ <cpus num='6'>
+ <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
+ <cpu id='1' socket_id='0' core_id='1' siblings='1'/>
+ <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
+ <cpu id='3' socket_id='0' core_id='3' siblings='3'/>
+ <cpu id='4' socket_id='0' core_id='4' siblings='4'/>
+ <cpu id='5' socket_id='0' core_id='5' siblings='5'/>
+ </cpus>
+ </cell>
+ <cell id='1'>
+ <memory unit='KiB'>2097152</memory>
+ <pages unit='KiB' size='4'>4096</pages>
+ <pages unit='KiB' size='2048'>6144</pages>
+ <pages unit='KiB' size='1048576'>8192</pages>
+ <cpus num='6'>
+ <cpu id='6' socket_id='1' core_id='0' siblings='6'/>
+ <cpu id='7' socket_id='1' core_id='1' siblings='7'/>
+ <cpu id='8' socket_id='1' core_id='2' siblings='8'/>
+ <cpu id='9' socket_id='1' core_id='3' siblings='9'/>
+ <cpu id='10' socket_id='1' core_id='4' siblings='10'/>
+ <cpu id='11' socket_id='1' core_id='5' siblings='11'/>
+ </cpus>
+ </cell>
+ </cells>
+ </topology>
+ <cache>
+ <bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
+ <control min='768' unit='KiB' scope='CODE' max_allocation='8'/>
+ <control min='768' unit='KiB' scope='DATA' max_allocation='8'/>
+ </bank>
+ <bank id='1' level='3' type='unified' size='15360' unit='KiB' cpus='6-11'>
+ <control min='768' unit='KiB' scope='CODE' max_allocation='8'/>
+ <control min='768' unit='KiB' scope='DATA' max_allocation='8'/>
+ </bank>
+ </cache>
+ </host>
+
+</capabilities>
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
index c30ea87..ad2ca62 100644
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
@@ -41,8 +41,12 @@
</cells>
</topology>
<cache>
- <bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'/>
- <bank id='1' level='3' type='unified' size='15360' unit='KiB' cpus='6-11'/>
+ <bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
+ <control min='768' unit='KiB' scope='BOTH' max_allocation='4'/>
+ </bank>
+ <bank id='1' level='3' type='unified' size='15360' unit='KiB' cpus='6-11'>
+ <control min='768' unit='KiB' scope='BOTH' max_allocation='4'/>
+ </bank>
</cache>
</host>
diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c
index f590249..db7de4c 100644
--- a/tests/vircaps2xmltest.c
+++ b/tests/vircaps2xmltest.c
@@ -47,6 +47,7 @@ test_virCapabilities(const void *opaque)
char *capsXML = NULL;
char *path = NULL;
char *dir = NULL;
+ char *resctrl = NULL;
int ret = -1;
/*
@@ -58,6 +59,13 @@ test_virCapabilities(const void *opaque)
data->resctrl ? "/system" : "") < 0)
goto cleanup;
+ if (virAsprintf(&resctrl, "%s/vircaps2xmldata/linux-%s/resctrl",
+ abs_srcdir,
+ data->resctrl ? data->filename : "foo") < 0)
+ goto cleanup;
+
+
+ virFileMockAddPrefix("/sys/fs/resctrl", resctrl);
virFileMockAddPrefix("/sys/devices/system", dir);
caps = virCapabilitiesNew(data->arch, data->offlineMigrate, data->liveMigrate);
@@ -84,6 +92,7 @@ test_virCapabilities(const void *opaque)
cleanup:
VIR_FREE(dir);
+ VIR_FREE(resctrl);
VIR_FREE(path);
VIR_FREE(capsXML);
virObjectUnref(caps);
@@ -112,6 +121,7 @@ mymain(void)
DO_TEST("caches", VIR_ARCH_X86_64);
DO_TEST_FULL("resctrl", VIR_ARCH_X86_64, true, true, true);
+ DO_TEST_FULL("resctrl-cdp", VIR_ARCH_X86_64, true, true, true);
return ret;
}
--
1.9.1
8 years, 3 months
[libvirt] [PATCH 0/3] nwfilter: Create common virNWFilterObj* APIs
by John Ferlan
Effectively move code from nwfilter_driver.c into virnwfiltereobj to
count the number of devices, to return a list of names, and to return
an array of filters.
FWIW: This is part of the common driver objects code I've been working
through. I figured I will post each driver separately rather than one
larger series.
John Ferlan (3):
nwfilter: Introduce virNWFilterObjNumOfNWFilters
nwfilter: Introduce virNWFilterObjGetNames
nwfilter: Introduce virNWFilterObjListExport
src/conf/virnwfilterobj.c | 104 +++++++++++++++++++++++++++++++++++++++++
src/conf/virnwfilterobj.h | 22 +++++++++
src/libvirt_private.syms | 3 ++
src/nwfilter/nwfilter_driver.c | 86 +++++-----------------------------
4 files changed, 140 insertions(+), 75 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] [libvirt-3.2] NBD-based storage migration fails with "error: invalid argument: monitor must not be NULL"
by Kashyap Chamarthy
[Filed this bug -- https://bugzilla.redhat.com/show_bug.cgi?id=1439841]
Easy reproducer:
$ virsh migrate --verbose --copy-storage-all \
--p2p --live l2-f25 qemu+ssh://root@devstack-a/system
error: invalid argument: monitor must not be NULL
- - -
This is a nested Fedora-25 environment. So, I'm trying to migrate a
level-2 Fedora-25 guest.
libvirt version:
$ rpm -q libvirt-daemon-kvm
libvirt-daemon-kvm-3.2.0-1.fc25.x86_64
The QEMU binary used to boot the nested guest (to be migrated) on source
guest hypervisor (host from which migration originates) _and_ on the
destination guest hypervisor is built from Git, with this specific patch
from QEMU
https://lists.nongnu.org/archive/html/qemu-block/2017-04/msg00085.html
-- [RFC PATCH for-2.9] block: Ignore guest dev permissions during
incoming migration
So the built binary version (showing `git describe` output):
$ /home/stack/build/build-qemu/x86_64-softmmu/qemu-system-x86_64 --version
QEMU emulator version 2.8.93 (v2.9.0-rc3-3-g3a8624b)
NB: However, the QEMU version is irrelevant, Michal Privoznik confirms
on IRC that this is a clear libvirt bug.
Steps to reproduce
------------------
(1) Setup two hosts:
https://kashyapc.fedorapeople.org/virt/libvirt-migration-tests-with-qemu+...
(2) Then, migrate the guest to the destination host:
$ virsh migrate --verbose --copy-storage-all \
--p2p --live l2-f25 qemu+ssh://root@devstack-a/system
Actual results
--------------
$ virsh migrate --verbose --copy-storage-all \
--p2p --live l2-f25 qemu+ssh://root@devstack-a/system
error: invalid argument: monitor must not be NULL
--
/kashyap
8 years, 3 months
[libvirt] [PATCH 0/3] Add support for coalesce settings on interfaces
by Martin Kletzander
In linux this is supported since 4.11-rc3, I tested it with
4.11.0-rc5-next-20170407. The particular patch can be found
here:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit...
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627
Martin Kletzander (3):
util: Add virNetDevSetCoalesce function
conf, docs: Add support for coalesce setting(s)
Set coalesce settings for domain interfaces
configure.ac | 3 +-
docs/formatdomain.html.in | 24 ++++++
docs/schemas/domaincommon.rng | 3 +
docs/schemas/networkcommon.rng | 17 ++++
src/bhyve/bhyve_command.c | 2 +-
src/conf/domain_conf.c | 9 +++
src/conf/domain_conf.h | 2 +
src/conf/networkcommon_conf.c | 91 ++++++++++++++++++++++
src/conf/networkcommon_conf.h | 9 +++
src/libvirt_private.syms | 3 +
src/network/bridge_driver.c | 2 +-
src/qemu/qemu_domain.c | 31 ++++++++
src/qemu/qemu_interface.c | 2 +-
src/uml/uml_conf.c | 2 +-
src/util/virnetdev.c | 83 ++++++++++++++++++++
src/util/virnetdev.h | 34 ++++++++
src/util/virnetdevtap.c | 8 +-
src/util/virnetdevtap.h | 2 +
tests/bhyvexml2argvmock.c | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 64 +++++++++++++++
.../qemuxml2xmlout-net-coalesce.xml | 69 ++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
22 files changed, 456 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
--
2.12.2
8 years, 3 months
[libvirt] [PATCH 0/7] storage: Create common virStorageObj* APIs
by John Ferlan
Merge code in storage_driver.c and test_driver into virstorageobj to
count the number of volumes/pools, to return a list of names, return
the collected list of objects for volumes/pools. For volumes, that's
moved code, while for pools that's just changing the export API to
take an address of 'devobjs' to follow other usages. I also added
code to converge the FindBy{UUID|Name}
FWIW: This is part of the common driver objects code I've been working
through. I figured I will post each driver separately rather than one
John Ferlan (7):
storage: Introduce virStoragePoolObjNumOfVolumes
storage: Introduce virStoragePoolObjVolumeGetNames
storage: Introduce virStoragePoolObjVolumeListExport
storage: Introduce virStoragePoolObjNumOfStoragePools
storage: Introduce virStoragePoolObjGetNames
storage: Pass driver arg by ref
storage: Create helpers to perform FindByUUID and FindByName
src/conf/virstorageobj.c | 165 +++++++++++++++++++++++-
src/conf/virstorageobj.h | 45 ++++++-
src/libvirt_private.syms | 5 +
src/storage/storage_driver.c | 297 +++++++++++++------------------------------
src/test/test_driver.c | 131 +++++--------------
5 files changed, 332 insertions(+), 311 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] [PATCH 0/3] nodedev: Create common virNodeDeviceObj* APIs
by John Ferlan
Merge code in node_device_driver.c and test_driver into virnodedeviceobj
to count the number of devices and to return a list of names. Also modify
the export list API to take an address of 'devobjs' to follow other usages.
FWIW: This is part of the common driver objects code I've been working
through. I figured I will post each driver separately rather than one
larger series.
John Ferlan (3):
nodedev: Introduce virNodeDeviceObjNumOfDevices
nodedev: Introduce virNodeDeviceObjGetNames
nodedev: Pass driver arg by ref
src/conf/virnodedeviceobj.c | 66 +++++++++++++++++++++++++++++++++---
src/conf/virnodedeviceobj.h | 20 ++++++++---
src/libvirt_private.syms | 3 +-
src/node_device/node_device_driver.c | 48 +++++++-------------------
src/test/test_driver.c | 33 ++++--------------
5 files changed, 98 insertions(+), 72 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] [PATCH 0/3] interface: Create common virInterface* APIs
by John Ferlan
Effectively move code from test_driver.c into virinterfaceobj to
count the number of devices and to return a list of names. Patch 3
is a bit out of order from my norm, but at least I didn't forget...
FWIW: This is part of the common driver objects code I've been working
through. I figured I will post each driver separately rather than one
larger series.
John Ferlan (3):
interface: Introduce virInterfaceObjNumOfInterfaces
interface: Introduce virInterfaceObjGetNames
interface: Clean up Interface section of test_driver
src/conf/virinterfaceobj.c | 54 ++++++++++++++++
src/conf/virinterfaceobj.h | 10 +++
src/libvirt_private.syms | 2 +
src/test/test_driver.c | 155 +++++++++++++++++++++------------------------
4 files changed, 139 insertions(+), 82 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] creating stream
by Vasiliy Tolstov
Hi. I know that libvirt devs does not like devs that used internal rpc
of libvirt... I need to create stream to use with upload/download and
as i see it does not created via rpc call, can you suggest me what
files i need to check to understand how virStreamNew works and how to
read write works internally?
Thanks!
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
8 years, 3 months
[libvirt] [PATCH v4 00/12] hyperv: add support for Hyper-V 2012 and newer.
by Dawid Zamirski
Changes in v4:
* changed hypervWqlQuery struct to use virBuffer as query member so that
hypervEnumAndPull and free it for us.
* fixed hypervFreeObject that had outdated code in code path that was
compiled away via preprocessor - this fix is in patch 5
* fixed whitespace/spelling and missing comment in generator
* update doc text
Dawid Zamirski (12):
hyperv: store WMI version in hypervPrivate.
hyperv: introduce hypervWmiClassInfo struct.
hyperv: update hypervObject struct.
hyperv: add hypervWqlQuery struct.
hyperv: make hypervEnumAndPull use hypervWqlQuery
hyperv: update generator input file.
hyperv: update wmi code generator.
hyperv: add helper for getting WMI class lists.
hyperv: port rest of the driver to new stucts.
hyperv: add hypervInitConnection.
hyperv: update driver documentation.
news: update for Hyper-V 2012+ support.
docs/drvhyperv.html.in | 2 +-
docs/news.xml | 11 +
src/Makefile.am | 2 -
src/hyperv/hyperv_driver.c | 166 ++++++++-------
src/hyperv/hyperv_private.h | 8 +-
src/hyperv/hyperv_wmi.c | 174 +++++++++++++---
src/hyperv/hyperv_wmi.h | 56 ++++-
src/hyperv/hyperv_wmi_classes.h | 30 +++
src/hyperv/hyperv_wmi_generator.input | 239 ++++++++++++++++++---
src/hyperv/hyperv_wmi_generator.py | 381 +++++++++++++++++++++++++---------
10 files changed, 822 insertions(+), 247 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] [PATCH v3 0/7] Provide an standard asyncio event loop impl
by Daniel P. Berrange
This patch series is a followup to Wojtek's v2 posting:
https://www.redhat.com/archives/libvir-list/2017-March/msg00838.html
It contains the fixes I pointed out in v1 / v2, along with a bunch of
updates to the event-test.py example, so we can use it to demonstrate
the asyncio impl. eg i'm using:
$ python3 ./examples/event-test.py --loop=asyncio --timeout=30 qemu:///session
Daniel P. Berrange (5):
event-test: free opaque data when removing callbacks
event-test: add timeout to exit event loop
event-test: unregister callbacks & close conn on exit
event-test: rename example event loop impl
event-test: add ability to run the asyncio event loop
Wojtek Porczyk (2):
Allow for ff callbacks to be called by custom event implementations
Add asyncio event loop implementation
MANIFEST.in | 1 +
examples/event-test.py | 194 +++++++++++++++---------
libvirt-override.c | 68 +++++----
libvirt-override.py | 23 +++
libvirt-python.spec.in | 2 +
libvirtaio.py | 399 +++++++++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 3 +-
setup.py | 12 ++
8 files changed, 603 insertions(+), 99 deletions(-)
create mode 100644 libvirtaio.py
--
2.9.3
8 years, 3 months