[libvirt] [PATCHv2 0/2] Adding support for LXC Docker-json configuration
by Venkat Datta N H
Hi All,
I added two patches to support conversion of Docker JSON configuration into LXC Native Domain XML.
Venkat Datta N H (2):
lxc: add support for docker-json Memory and VCPU conversion
lxc: add support for docker-json command conversion
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/lxc/lxc_docker.c | 181 +++++++++++++++++++++
src/lxc/lxc_docker.h | 32 ++++
src/lxc/lxc_driver.c | 13 +-
src/lxc/lxc_native.h | 1 +
tests/Makefile.am | 8 +-
.../lxcdocker2xmldata-command.json | 47 ++++++
.../lxcdocker2xmldata-command.xml | 17 ++
.../lxcdocker2xmldata-simple.json | 36 ++++
.../lxcdocker2xmldata/lxcdocker2xmldata-simple.xml | 15 ++
tests/lxcdocker2xmltest.c | 150 +++++++++++++++++
12 files changed, 496 insertions(+), 6 deletions(-)
create mode 100644 src/lxc/lxc_docker.c
create mode 100644 src/lxc/lxc_docker.h
create mode 100644 tests/lxcdocker2xmldata/lxcdocker2xmldata-command.json
create mode 100644 tests/lxcdocker2xmldata/lxcdocker2xmldata-command.xml
create mode 100644 tests/lxcdocker2xmldata/lxcdocker2xmldata-simple.json
create mode 100644 tests/lxcdocker2xmldata/lxcdocker2xmldata-simple.xml
create mode 100644 tests/lxcdocker2xmltest.c
--
2.7.4
7 years, 3 months
[libvirt] [PATCH] qemu: domain: Use vcpu 'node-id' property and pass it back to qemu
by Peter Krempa
vcpu properties gathered from query-hotpluggable cpus need to be passed
back to qemu. As qemu did not use the node-id property until now and
libvirt forgot to pass it back properly (it was parsed but not passed
around) we did not honor this.
This patch adds node-id to the structures where it was missing and
passes it around as necessary.
The test data was generated with a VM with following config:
<numa>
<cell id='0' cpus='0,2,4,6' memory='512000' unit='KiB'/>
<cell id='1' cpus='1,3,5,7' memory='512000' unit='KiB'/>
</numa>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452053
---
src/qemu/qemu_command.c | 4 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_monitor.c | 2 +
src/qemu/qemu_monitor.h | 1 +
...qemumonitorjson-cpuinfo-x86-node-full-cpus.json | 35 +++++++++
...umonitorjson-cpuinfo-x86-node-full-hotplug.json | 87 ++++++++++++++++++++++
.../qemumonitorjson-cpuinfo-x86-node-full.data | 48 ++++++++++++
tests/qemumonitorjsontest.c | 3 +
9 files changed, 182 insertions(+)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-hotplug.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c53ab97b9..3fe291863 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10508,6 +10508,10 @@ qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu)
virJSONValueObjectAdd(ret, "i:thread-id", vcpupriv->thread_id, NULL) < 0)
goto error;
+ if (vcpupriv->node_id != -1 &&
+ virJSONValueObjectAdd(ret, "i:node-id", vcpupriv->node_id, NULL) < 0)
+ goto error;
+
return ret;
error:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8e7404da6..0d9cd94b2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6986,6 +6986,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
vcpupriv->socket_id = info[i].socket_id;
vcpupriv->core_id = info[i].core_id;
vcpupriv->thread_id = info[i].thread_id;
+ vcpupriv->node_id = info[i].node_id;
vcpupriv->vcpus = info[i].vcpus;
VIR_FREE(vcpupriv->type);
VIR_STEAL_PTR(vcpupriv->type, info[i].type);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index aae322473..365b23c96 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -359,6 +359,7 @@ struct _qemuDomainVcpuPrivate {
int socket_id;
int core_id;
int thread_id;
+ int node_id;
int vcpus;
};
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 5c29b3763..2b0afcc21 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1750,6 +1750,7 @@ qemuMonitorCPUInfoClear(qemuMonitorCPUInfoPtr cpus,
cpus[i].socket_id = -1;
cpus[i].core_id = -1;
cpus[i].thread_id = -1;
+ cpus[i].node_id = -1;
cpus[i].vcpus = 0;
cpus[i].tid = 0;
cpus[i].halted = false;
@@ -1902,6 +1903,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
vcpus[mastervcpu].socket_id = hotplugvcpus[i].socket_id;
vcpus[mastervcpu].core_id = hotplugvcpus[i].core_id;
vcpus[mastervcpu].thread_id = hotplugvcpus[i].thread_id;
+ vcpus[mastervcpu].node_id = hotplugvcpus[i].node_id;
vcpus[mastervcpu].vcpus = hotplugvcpus[i].vcpus;
VIR_STEAL_PTR(vcpus[mastervcpu].qom_path, hotplugvcpus[i].qom_path);
VIR_STEAL_PTR(vcpus[mastervcpu].alias, hotplugvcpus[i].alias);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 8956bf929..1697db55c 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -483,6 +483,7 @@ struct _qemuMonitorCPUInfo {
int socket_id;
int core_id;
int thread_id;
+ int node_id;
unsigned int vcpus; /* number of vcpus added if given entry is hotplugged */
/* name of the qemu type to add in case of hotplug */
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
new file mode 100644
index 000000000..6b39efa69
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
@@ -0,0 +1,35 @@
+{
+ "return": [
+ {
+ "arch": "x86",
+ "current": true,
+ "props": {
+ "core-id": 0,
+ "thread-id": 0,
+ "node-id": 0,
+ "socket-id": 0
+ },
+ "CPU": 0,
+ "qom_path": "/machine/unattached/device[0]",
+ "pc": 1048956,
+ "halted": true,
+ "thread_id": 2033724
+ },
+ {
+ "arch": "x86",
+ "current": false,
+ "props": {
+ "core-id": 0,
+ "thread-id": 1,
+ "node-id": 1,
+ "socket-id": 0
+ },
+ "CPU": 1,
+ "qom_path": "/machine/unattached/device[2]",
+ "pc": 1037318,
+ "halted": true,
+ "thread_id": 2033725
+ }
+ ],
+ "id": "libvirt-21"
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-hotplug.json
new file mode 100644
index 000000000..dfddd9632
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-hotplug.json
@@ -0,0 +1,87 @@
+{
+ "return": [
+ {
+ "props": {
+ "core-id": 1,
+ "thread-id": 1,
+ "node-id": 1,
+ "socket-id": 1
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 1,
+ "thread-id": 0,
+ "node-id": 0,
+ "socket-id": 1
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 0,
+ "thread-id": 1,
+ "node-id": 1,
+ "socket-id": 1
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 0,
+ "thread-id": 0,
+ "node-id": 0,
+ "socket-id": 1
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 1,
+ "thread-id": 1,
+ "node-id": 1,
+ "socket-id": 0
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 1,
+ "thread-id": 0,
+ "node-id": 0,
+ "socket-id": 0
+ },
+ "vcpus-count": 1,
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 0,
+ "thread-id": 1,
+ "node-id": 1,
+ "socket-id": 0
+ },
+ "vcpus-count": 1,
+ "qom-path": "/machine/unattached/device[2]",
+ "type": "Broadwell-x86_64-cpu"
+ },
+ {
+ "props": {
+ "core-id": 0,
+ "thread-id": 0,
+ "node-id": 0,
+ "socket-id": 0
+ },
+ "vcpus-count": 1,
+ "qom-path": "/machine/unattached/device[0]",
+ "type": "Broadwell-x86_64-cpu"
+ }
+ ],
+ "id": "libvirt-20"
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
new file mode 100644
index 000000000..070ea084e
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
@@ -0,0 +1,48 @@
+[vcpu libvirt-id='0']
+ online=yes
+ hotpluggable=no
+ thread-id='2033724'
+ enable-id='1'
+ query-cpus-id='0'
+ type='Broadwell-x86_64-cpu'
+ qom_path='/machine/unattached/device[0]'
+ topology: socket='0' core='0' thread='0' node='0' vcpus='1'
+[vcpu libvirt-id='1']
+ online=yes
+ hotpluggable=no
+ thread-id='2033725'
+ enable-id='2'
+ query-cpus-id='1'
+ type='Broadwell-x86_64-cpu'
+ qom_path='/machine/unattached/device[2]'
+ topology: socket='0' core='0' thread='1' node='1' vcpus='1'
+[vcpu libvirt-id='2']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='0' core='1' thread='0' node='0' vcpus='1'
+[vcpu libvirt-id='3']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='0' core='1' thread='1' node='1' vcpus='1'
+[vcpu libvirt-id='4']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='1' core='0' thread='0' node='0' vcpus='1'
+[vcpu libvirt-id='5']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='1' core='0' thread='1' node='1' vcpus='1'
+[vcpu libvirt-id='6']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='1' core='1' thread='0' node='0' vcpus='1'
+[vcpu libvirt-id='7']
+ online=no
+ hotpluggable=yes
+ type='Broadwell-x86_64-cpu'
+ topology: socket='1' core='1' thread='1' node='1' vcpus='1'
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index e9f9d47b5..6da27f783 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2604,6 +2604,8 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus,
virBufferAsprintf(&buf, " core='%d'", vcpu->core_id);
if (vcpu->thread_id != -1)
virBufferAsprintf(&buf, " thread='%d'", vcpu->thread_id);
+ if (vcpu->node_id != -1)
+ virBufferAsprintf(&buf, " node='%d'", vcpu->node_id);
if (vcpu->vcpus != 0)
virBufferAsprintf(&buf, " vcpus='%u'", vcpu->vcpus);
virBufferAddLit(&buf, "\n");
@@ -2913,6 +2915,7 @@ mymain(void)
DO_TEST_CPU_INFO("x86-basic-pluggable", 8);
DO_TEST_CPU_INFO("x86-full", 11);
+ DO_TEST_CPU_INFO("x86-node-full", 8);
DO_TEST_CPU_INFO("ppc64-basic", 24);
DO_TEST_CPU_INFO("ppc64-hotplug-1", 24);
--
2.12.2
7 years, 3 months
[libvirt] [PATCH] test: adding tests to virStrToDouble() inside virstringtest.
by Julio Faracco
There are no occurrences of tests related to Strings and Double numbers
inside virstringtest.c. This commit introduces some tests to validate the
conversion. The test does not include locale changes yet.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tests/virstringtest.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index 97c6e76..32ce79c 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -652,6 +652,52 @@ testStringToLong(const void *opaque)
}
+struct stringToDoubleData {
+ const char *str;
+ const char *end_ptr;
+ double res;
+};
+
+/* This test checks if double strings are successfully converted to double
+ * number considering the byproduct string too. */
+static int
+testStringToDouble(const void *opaque)
+{
+ const struct stringToDoubleData *data = opaque;
+ int ret = -1;
+ char *end_ptr = NULL;
+ double res = 0;
+
+ if (data->end_ptr) {
+ ret = virStrToDouble(data->str, &end_ptr, &res);
+ } else {
+ /* end_ptr returns or a substring or an empty string.
+ * It never returns a NULL pointer. */
+ ret = virStrToDouble(data->str, NULL, &res);
+ }
+
+ if (ret < 0) {
+ fprintf(stderr, "Convert error of '%s', expected '%f'\n",
+ data->str, data->res);
+ return ret;
+ }
+
+ if (res != data->res) {
+ fprintf(stderr, "Returned '%f', expected '%f'\n",
+ res, data->res);
+ return -1;
+ }
+
+ /* Comparing substrings. */
+ if (STRNEQ_NULLABLE(end_ptr, data->end_ptr)) {
+ fprintf(stderr, "Expected substring '%s', but got '%s'\n",
+ end_ptr, data->end_ptr);
+ return -1;
+ }
+
+ return ret;
+}
+
/* The point of this test is to check whether all members of the array are
* freed. The test has to be checked using valgrind. */
static int
@@ -965,6 +1011,44 @@ mymain(void)
TEST_STRTOL("-18446744073709551616", NULL, 0, -1, 0U, -1,
0LL, -1, 0ULL, -1);
+#define TEST_STRTOD(str, end_ptr, res) \
+ do { \
+ struct stringToDoubleData data = { \
+ str, end_ptr, res, \
+ }; \
+ if (virTestRun("virStringToDouble '" str "'", \
+ testStringToDouble, &data) < 0) \
+ ret = -1; \
+ } while(0)
+
+ /* Simple numbers. */
+ TEST_STRTOD("0.0", NULL, 0);
+ TEST_STRTOD("1.0", NULL, 1);
+ TEST_STRTOD("3.14159", NULL, 3.14159);
+ TEST_STRTOD("0.57721", NULL, 0.57721);
+
+ /* Testing ending string. */
+ TEST_STRTOD("2.718", "", 2.718);
+ TEST_STRTOD("2.718 281 828 459", " 281 828 459", 2.718);
+ TEST_STRTOD("2.718,281,828,459", ",281,828,459", 2.718);
+
+ /* Scientific numbers. */
+ TEST_STRTOD("3.14159e+000", NULL, 3.14159);
+ TEST_STRTOD("2.00600e+003", NULL, 2006);
+ TEST_STRTOD("1.00000e-010", NULL, 1e-010);
+
+ /* Negative numbers. */
+ TEST_STRTOD("-1.6180339887", NULL, -1.6180339887);
+ TEST_STRTOD("-0.00031e-010", NULL, -0.00031e-010);
+
+ /* Long numbers. */
+ TEST_STRTOD("57089907708238388904078437636832797971793838081897.0",
+ NULL,
+ 57089907708238388904078437636832797971793838081897.0);
+ TEST_STRTOD("3.141592653589793238462643383279502884197169399375105",
+ NULL,
+ 3.141592653589793238462643383279502884197169399375105);
+
/* test virStringListFreeCount */
if (virTestRun("virStringListFreeCount", testVirStringListFreeCount,
NULL) < 0)
--
2.7.4
7 years, 3 months
[libvirt] [PATCH] qemu: Use iohelper during restore
by Shivaprasad G Bhat
Commit afe6e58 & c4caab53 made necessary changes to use io-helpers
during save and restore. The commit c4caab53 missed to remove the
redundant check in qemuDomainSaveImageOpen() because of which
virFileWrapperFdNew() is not called if bypass_cache is false.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_driver.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 516a851..ac89372 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6150,9 +6150,11 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
virDomainDefPtr def = NULL;
int oflags = open_write ? O_RDWR : O_RDONLY;
virCapsPtr caps = NULL;
+ unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING;
if (bypass_cache) {
int directFlag = virFileDirectFdFlag();
+ wrapperFlags |= VIR_FILE_WRAPPER_BYPASS_CACHE;
if (directFlag < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("bypass cache unsupported by this system"));
@@ -6166,9 +6168,8 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL, NULL)) < 0)
goto error;
- if (bypass_cache &&
- !(*wrapperFd = virFileWrapperFdNew(&fd, path,
- VIR_FILE_WRAPPER_BYPASS_CACHE)))
+ if (wrapperFd &&
+ !(*wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags)))
goto error;
if (saferead(fd, &header, sizeof(header)) != sizeof(header)) {
7 years, 3 months
[libvirt] [PATCH v3 00/26] Multiple PHBs and hostdev isolation for pSeries guests
by Andrea Bolognani
Changes from [v2]:
* support hot(un)plug properly;
* add documentation.
Changes from [v1]:
* address review comments;
* implement a much better isolation algorithm that doesn't
require parsing and formatting the isolation group and
can handle more dynamic scenarios, such as empty PHBs
changing their isolation groups to accomodate hotplugged
hostdevs;
* add more test cases.
Known limitations:
* hostdevs in IOMMU group 0 are not handled properly
- the default isolation group is currently 0, which
means hostdevs in IOMMU group 0 will be assigned
addresses as if they were emulated devices and will
not be isolated properly. Fixing this will be a lot
of work because it requires cleaning up the the code
that instantiates pretty much anything embedding a
virDomainDeviceInfo, which is... A lot of things.
Luckily, IOMMU group 0 will probably not contain any
devices that are actually usable as hostdevs, so it
should be okay to fix this in a follow-up series
rather than upfront.
Reviewed-by tags have been collected, so figuring out which
patches are still in need of reviewing is pretty easy.
[v1] https://www.redhat.com/archives/libvir-list/2017-June/msg00110.html
[v2] https://www.redhat.com/archives/libvir-list/2017-June/msg00695.html
Andrea Bolognani (26):
conf: Remove obsolete comment
conf: Make virDomainPCIAddressSetGrow() private
conf: Make virDomainPCIAddressFlagsCompatible() private
conf: Tweak virDomainPCIAddressGetNextAddr() signature
qemu: Clean up qemuDomainAttachHostPCIDevice()
tests: Update qemumemlock data
tests: Mock IOMMU groups
conf: Simplify slot allocation
qemu: Allow qemuBuildControllerDevStr() to return NULL
qemu: Tweak index number checking
conf: Move index number checking to drivers
qemu: Relax pci-root index requirement for pSeries guests
conf: Parse and format <target index='...'/>
conf: Add 'spapr-pci-host-bridge' controller model
qemu: Automatically pick target index and model for pci-root
controllers
qemu: Introduce QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE
qemu: Deal with PHB naming conventions
qemu: Use multiple PHBs for pSeries guests
tests: Add tests for pSeries guests with multiple PHBs
tests: Add baseline tests for automatic PHB usage
qemu: Use PHBs to fill holes in PCI bus numbering
qemu: Use PHBs when extending the guest PCI topology
conf: Introduce isolation groups
conf: Implement isolation rules
qemu: Isolate hostdevs on pSeries guests
news: Update for multiple PHBs and hostdev isolation
docs/formatdomain.html.in | 5 +
docs/news.xml | 21 ++
docs/schemas/domaincommon.rng | 7 +
src/bhyve/bhyve_device.c | 4 +-
src/bhyve/bhyve_domain.c | 15 ++
src/conf/device_conf.h | 14 +-
src/conf/domain_addr.c | 222 ++++++++++++------
src/conf/domain_addr.h | 38 ++-
src/conf/domain_conf.c | 31 ++-
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 2 -
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 148 ++++++++++--
src/qemu/qemu_command.h | 9 +-
src/qemu/qemu_domain.c | 14 ++
src/qemu/qemu_domain_address.c | 261 +++++++++++++++++++--
src/qemu/qemu_hotplug.c | 23 +-
.../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 5 +-
.../qemuargv2xml-pseries-nvram.xml | 5 +-
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
.../qemumemlock-pc-hardlimit+hostdev.xml | 2 +-
.../qemumemlock-pc-hardlimit+locked+hostdev.xml | 2 +-
tests/qemumemlockdata/qemumemlock-pc-hostdev.xml | 2 +-
.../qemumemlock-pc-locked+hostdev.xml | 2 +-
.../qemumemlock-pseries-hardlimit+hostdev.xml | 2 +-
...emumemlock-pseries-hardlimit+locked+hostdev.xml | 2 +-
.../qemumemlock-pseries-hostdev.xml | 2 +-
.../qemumemlock-pseries-locked+hostdev.xml | 2 +-
tests/qemumemlocktest.c | 21 +-
.../qemuxml2argv-pseries-hostdevs-1.args | 25 ++
.../qemuxml2argv-pseries-hostdevs-1.xml | 38 +++
.../qemuxml2argv-pseries-hostdevs-2.args | 25 ++
.../qemuxml2argv-pseries-hostdevs-2.xml | 37 +++
.../qemuxml2argv-pseries-hostdevs-3.args | 24 ++
.../qemuxml2argv-pseries-hostdevs-3.xml | 31 +++
.../qemuxml2argv-pseries-many-buses-1.args | 22 ++
.../qemuxml2argv-pseries-many-buses-1.xml | 19 ++
.../qemuxml2argv-pseries-many-buses-2.args | 22 ++
.../qemuxml2argv-pseries-many-buses-2.xml | 18 ++
.../qemuxml2argv-pseries-many-devices.args | 53 +++++
.../qemuxml2argv-pseries-many-devices.xml | 48 ++++
.../qemuxml2argv-pseries-phb-default-missing.args | 22 ++
.../qemuxml2argv-pseries-phb-default-missing.xml | 16 ++
.../qemuxml2argv-pseries-phb-simple.args | 22 ++
.../qemuxml2argv-pseries-phb-simple.xml | 17 ++
tests/qemuxml2argvtest.c | 64 ++++-
.../qemuxml2xmlout-panic-pseries.xml | 5 +-
.../qemuxml2xmlout-ppc64-usb-controller-legacy.xml | 5 +-
.../qemuxml2xmlout-ppc64-usb-controller.xml | 5 +-
.../qemuxml2xmlout-pseries-hostdevs-1.xml | 54 +++++
.../qemuxml2xmlout-pseries-hostdevs-2.xml | 50 ++++
.../qemuxml2xmlout-pseries-hostdevs-3.xml | 47 ++++
...xml => qemuxml2xmlout-pseries-many-buses-1.xml} | 19 +-
...xml => qemuxml2xmlout-pseries-many-buses-2.xml} | 20 +-
.../qemuxml2xmlout-pseries-many-devices.xml | 125 ++++++++++
.../qemuxml2xmlout-pseries-nvram.xml | 5 +-
.../qemuxml2xmlout-pseries-panic-missing.xml | 5 +-
.../qemuxml2xmlout-pseries-panic-no-address.xml | 5 +-
...qemuxml2xmlout-pseries-phb-default-missing.xml} | 18 +-
...m.xml => qemuxml2xmlout-pseries-phb-simple.xml} | 18 +-
tests/qemuxml2xmltest.c | 59 ++++-
tests/virpcimock.c | 43 +++-
63 files changed, 1637 insertions(+), 216 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-1.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-pseries-nvram.xml => qemuxml2xmlout-pseries-many-buses-1.xml} (55%)
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-pseries-nvram.xml => qemuxml2xmlout-pseries-many-buses-2.xml} (54%)
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-devices.xml
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-pseries-nvram.xml => qemuxml2xmlout-pseries-phb-default-missing.xml} (56%)
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-pseries-nvram.xml => qemuxml2xmlout-pseries-phb-simple.xml} (56%)
--
2.7.5
7 years, 3 months
[libvirt] [PATCH] qemu: Take all PHBs into account while calculating memlock limits
by Shivaprasad G Bhat
Now that the multi-phb support series is in, work on the TODO at
qemuDomainGetMemLockLimitBytes() to arrive at the correct memlock limit
value.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
This patch should be applied on top of Andrea's multi-phb support
patchset.
src/qemu/qemu_domain.c | 12 ++++++++----
tests/qemumemlocktest.c | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index a3ce10a..a8293b4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6674,12 +6674,16 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def)
unsigned long long memory;
unsigned long long baseLimit;
unsigned long long passthroughLimit;
- size_t nPCIHostBridges;
+ size_t nPCIHostBridges = 0;
bool usesVFIO = false;
- /* TODO: Detect at runtime once we start using more than just
- * the default PCI Host Bridge */
- nPCIHostBridges = 1;
+ for (i = 0; i < def->ncontrollers; i++) {
+ if (def->controllers[i]->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI ||
+ def->controllers[i]->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) {
+ continue;
+ }
+ nPCIHostBridges++;
+ }
for (i = 0; i < def->nhostdevs; i++) {
virDomainHostdevDefPtr dev = def->hostdevs[i];
diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index c0f1dc3..268563d 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -131,7 +131,7 @@ mymain(void)
DO_TEST("pseries-hardlimit", 2147483648);
DO_TEST("pseries-locked", VIR_DOMAIN_MEMORY_PARAM_UNLIMITED);
- DO_TEST("pseries-hostdev", 2168455168);
+ DO_TEST("pseries-hostdev", 4320133120);
DO_TEST("pseries-hardlimit+locked", 2147483648);
DO_TEST("pseries-hardlimit+hostdev", 2147483648);
7 years, 3 months
[libvirt] [PATCH v3 0/4] lxc improvements
by Cédric Bosdonnat
Hi all,
Here is a series grouping several small patches I sent
independently to the mailing list.
Main change since v2:
* <inituser> and <initgroup> have been changed to hold either a uid or
name as text child, rather than in an attribute.
* Moved the uid/gid setting to after the pivot_root to allow getting
the uid/gid from name.
Cédric Bosdonnat (4):
lxc: allow defining environment variables
util: share code between virExec and virCommandExec
lxc: allow user to specify command working directory
lxc: add possibility to define init uid/gid
docs/formatdomain.html.in | 17 +++++++++
docs/schemas/domaincommon.rng | 29 +++++++++++++++
src/conf/domain_conf.c | 52 ++++++++++++++++++++++++++
src/conf/domain_conf.h | 11 ++++++
src/lxc/lxc_container.c | 59 ++++++++++++++++++++++++++++++
src/util/vircommand.c | 69 ++++++++++++++++++++---------------
tests/lxcxml2xmldata/lxc-initdir.xml | 30 +++++++++++++++
tests/lxcxml2xmldata/lxc-initenv.xml | 30 +++++++++++++++
tests/lxcxml2xmldata/lxc-inituser.xml | 31 ++++++++++++++++
tests/lxcxml2xmltest.c | 3 ++
10 files changed, 302 insertions(+), 29 deletions(-)
create mode 100644 tests/lxcxml2xmldata/lxc-initdir.xml
create mode 100644 tests/lxcxml2xmldata/lxc-initenv.xml
create mode 100644 tests/lxcxml2xmldata/lxc-inituser.xml
--
2.12.2
7 years, 4 months
[libvirt] [PATCH v3 00/12] Make virNodeDeviceObj and virNodeDeviceObjList private
by John Ferlan
v2: https://www.redhat.com/archives/libvir-list/2017-May/msg00999.html
Some patches from v2 were pushed (3, 4, 6, 7, 8, 9, 11, & 12), but a
few remained from that series and are the first 5 patches of this series.
What changed?
-> Reworked the virNodeDeviceObjRemove patch (former patch 2, but new
series patch 1). That affected the Test patch (former patch 1, but
now patch 2). This patch removes the address of obj logic and moves
the onus of the ObjFree to the caller (see patch for reason).
-> Patch 3 is the former patch 5, with no essential change
-> Patch 4 is the former patch 10, with no essential change
-> Former patch 13 and 14, were altered to remove the offending
address of pointer logic. The result is patch 5 which just
essentially former patch 14 without the address of pointer logic.
-> Patches 6-12 for this series are new, but follow along through the
logic to make things private.
John Ferlan (12):
nodedev: Alter virNodeDeviceObjRemove
test: Adjust cleanup/error paths for nodedev test APIs
nodedev: Use common naming for virnodedeviceobj
nodedev: Use consistent names for driver variables
nodedev: Introduce virNodeDeviceObjNew
nodedev: Introduce virNodeDeviceObjListNew
nodedev: Alter node device obj list function names
nodedev: Dereference the obj/def in virNodeDeviceObjListFind* APIs
nodedev: Introduce virNodeDeviceGetSCSIHostCaps
nodedev: Introduce virNodeDeviceObjListFindSCSIHostByWWNs
nodedev: Privatize _virNodeDeviceObj and _virNodeDeviceObjList
nodedev: Convert virNodeDeviceObj to use virObjectLockable
src/conf/node_device_conf.c | 82 ++++++
src/conf/node_device_conf.h | 20 +-
src/conf/virnodedeviceobj.c | 420 ++++++++++++++++++------------
src/conf/virnodedeviceobj.h | 67 ++---
src/libvirt_private.syms | 20 +-
src/node_device/node_device_driver.c | 159 +++++------
src/node_device/node_device_hal.c | 47 ++--
src/node_device/node_device_linux_sysfs.c | 77 +-----
src/node_device/node_device_udev.c | 52 ++--
src/test/test_driver.c | 136 +++++-----
10 files changed, 570 insertions(+), 510 deletions(-)
--
2.9.4
7 years, 4 months
[libvirt] [PATCH RFC V2 0/2] Implement l3 CAT
by Eli Qiao
Allow user to define cachetune in domain xml.
V2 -> V1 changes:
* Redefine cachetune xml in domain xml.
* Create a struct for driver to talk with util/virresctrl.*
* Nit fixes
Eli Qiao (2):
Resctrl: Add new xml element to support cache tune
Resctrl: Do cache allocation while boot a qemu VM
docs/schemas/domaincommon.rng | 29 ++
include/libvirt/virterror.h | 1 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 112 ++++
src/conf/domain_conf.h | 19 +
src/libvirt_private.syms | 9 +
src/qemu/qemu_process.c | 81 +++
src/util/virerror.c | 1 +
src/util/virresctrl.c | 822 ++++++++++++++++++++++++++++++
src/util/virresctrl.h | 88 ++++
tests/Makefile.am | 8 +-
tests/virresctrldata/L3-free.schemata | 1 +
tests/virresctrldata/L3CODE-free.schemata | 1 +
tests/virresctrldata/L3DATA-free.schemata | 1 +
tests/virresctrldata/linux-resctrl | 1 +
tests/virresctrldata/linux-resctrl-cdp | 1 +
tests/virresctrltest.c | 119 +++++
17 files changed, 1294 insertions(+), 1 deletion(-)
create mode 100644 src/util/virresctrl.c
create mode 100644 src/util/virresctrl.h
create mode 100644 tests/virresctrldata/L3-free.schemata
create mode 100644 tests/virresctrldata/L3CODE-free.schemata
create mode 100644 tests/virresctrldata/L3DATA-free.schemata
create mode 120000 tests/virresctrldata/linux-resctrl
create mode 120000 tests/virresctrldata/linux-resctrl-cdp
create mode 100644 tests/virresctrltest.c
--
1.9.1
7 years, 4 months