[libvirt] [PATCH v1 0/3] Loadparm support
by Farhan Ali
This patch series introduces the support for new s390x 'loadparm'
feature. The 'loadparm' can be used to select the boot entry to
boot from, for a boot device.
Here is a link to the QEMU patches:
https://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg00192.html
Thanks
Farhan Ali
Farhan Ali (3):
conf : Add loadparm boot option for a boot device
qemu : Add loadparm to qemu command line string
tests : Testcases for loadparm
docs/formatdomain.html.in | 8 ++-
docs/news.xml | 9 +++
docs/schemas/domaincommon.rng | 7 +++
src/conf/device_conf.h | 1 +
src/conf/domain_conf.c | 69 +++++++++++++++++++++-
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 37 ++++++++++++
...-machine-loadparm-multiple-disks-nets-s390.args | 28 +++++++++
...v-machine-loadparm-multiple-disks-nets-s390.xml | 43 ++++++++++++++
.../qemuxml2argv-machine-loadparm-net-s390.args | 20 +++++++
.../qemuxml2argv-machine-loadparm-net-s390.xml | 26 ++++++++
...xml2argv-machine-loadparm-s390-char-invalid.xml | 26 ++++++++
...uxml2argv-machine-loadparm-s390-len-invalid.xml | 26 ++++++++
.../qemuxml2argv-machine-loadparm-s390.args | 20 +++++++
.../qemuxml2argv-machine-loadparm-s390.xml | 26 ++++++++
tests/qemuxml2argvtest.c | 19 ++++++
17 files changed, 367 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-multiple-disks-nets-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-multiple-disks-nets-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-net-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-net-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-s390-char-invalid.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-s390-len-invalid.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-s390.xml
--
1.9.1
7 years, 6 months
[libvirt] [PATCH v2] xenconfig: fix handling of NULL disk source
by Wim Ten Have
From: Wim ten Have <wim.ten.have(a)oracle.com>
It is possible to crash libvirtd when converting xl native config to
domXML when the xl config contains an empty disk source, e.g. an empty
CDROM. Fix by checking that the disk source is non-NULL before parsing it.
Wim ten Have (1):
xenconfig: fix handling of NULL disk source
src/xenconfig/xen_xl.c | 4 ++++
tests/xlconfigdata/test-disk-positional-parms-partial.cfg | 2 +-
tests/xlconfigdata/test-disk-positional-parms-partial.xml | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
--
2.9.4
7 years, 6 months
[libvirt] [PATCH v1] xenParseXLDiskSrc: protect against a NULL pointer reference
by Wim Ten Have
From: Wim ten Have <wim.ten.have(a)oracle.com>
This patch protects against a NULL pointer dereference leading to a
SEGV and that way taking out libvirtd while performing domain conversion
requests per domxml-from-native xen-xl xl.cfg within xenParseXLDiskSrc()
when partial disk parameters are provided.
Wim ten Have (1):
xenParseXLDiskSrc: protect against a NULL pointer reference
src/xenconfig/xen_xl.c | 3 ++-
tests/xlconfigdata/test-disk-positional-parms-partial.cfg | 2 +-
tests/xlconfigdata/test-disk-positional-parms-partial.xml | 6 ++++++
3 files changed, 9 insertions(+), 2 deletions(-)
--
2.9.4
7 years, 6 months
[libvirt] [PATCH 0/3] Couple of build fixes after sparse streams
by Michal Privoznik
Some systems lack the symbols we need or have them in different header files.
Michal Privoznik (3):
virfile: Provide stub for virFileInData
virfiletest: Test virFileInData iff SEEK_HOLE is defined
virfiletest: include linux/falloc.h
configure.ac | 5 +++++
src/util/virfile.c | 15 +++++++++++++++
tests/virfiletest.c | 40 +++++++++++++++++++++++++++-------------
3 files changed, 47 insertions(+), 13 deletions(-)
--
2.13.0
7 years, 6 months
[libvirt] [PATCH] qemu: hotplug: print correct vcpu when validating hot(un)plug config
by Peter Krempa
The error message would contain first vcpu id after the list of vcpus
selected for modification. To print the proper vcpu id remember the
first vcpu selected to be modified.
---
src/qemu/qemu_hotplug.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e8d29186e..1d7f2cc71 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5866,6 +5866,7 @@ qemuDomainVcpuValidateConfig(virDomainDefPtr def,
virDomainVcpuDefPtr vcpu;
size_t maxvcpus = virDomainDefGetVcpusMax(def);
ssize_t next;
+ ssize_t firstvcpu = -1;
/* vcpu 0 can't be disabled */
if (!state && virBitmapIsBitSet(map, 0)) {
@@ -5880,13 +5881,17 @@ qemuDomainVcpuValidateConfig(virDomainDefPtr def,
continue;
/* skip vcpus being modified */
- if (virBitmapIsBitSet(map, next))
+ if (virBitmapIsBitSet(map, next)) {
+ if (firstvcpu < 0)
+ firstvcpu = next;
+
continue;
+ }
if (vcpu->online && vcpu->hotpluggable == VIR_TRISTATE_BOOL_NO) {
virReportError(VIR_ERR_INVALID_ARG,
_("vcpu '%zd' can't be modified as it is followed "
- "by non-hotpluggable online vcpus"), next);
+ "by non-hotpluggable online vcpus"), firstvcpu);
return -1;
}
}
--
2.12.2
7 years, 6 months
[libvirt] [PATCH] conf: Don't assign value from ..TypeFromString directly to enum
by Peter Krempa
Enums are unsigned, so it's impossible to check whether the helper
returned -1 for invalid conversions.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452454
---
src/conf/domain_conf.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9eba70a95..54d87666b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14083,6 +14083,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode,
xmlNodePtr save = ctxt->node;
xmlNodePtr node;
virDomainMemoryDefPtr def;
+ int accessval;
ctxt->node = memdevNode;
@@ -14102,12 +14103,14 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode,
}
VIR_FREE(tmp);
- tmp = virXMLPropString(memdevNode, "access");
- if (tmp &&
- (def->access = virDomainMemoryAccessTypeFromString(tmp)) <= 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("invalid access mode '%s'"), tmp);
- goto error;
+ if ((tmp = virXMLPropString(memdevNode, "access"))) {
+ if ((accessval = virDomainMemoryAccessTypeFromString(tmp)) <= 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid access mode '%s'"), tmp);
+ goto error;
+ }
+
+ def->access = accessval;
}
VIR_FREE(tmp);
--
2.12.2
7 years, 6 months
[libvirt] libvirt question
by zhunxun@gmail.com
Hello,I wrote a program using libvirt API to get vm information like this:
/*dom is virDomainPtr type*/
dom=virDomainLookupByID(conn,activeDomains[i]);
if(dom!=NULL)
printf("%d ----------%s\n",activeDomains[i],dom->name);
......
but when compile it,error occured like this:
vm_eraser_detect.c:125:54: error: dereferencing pointer to incomplete type
printf("%d ----------%s\n",activeDomains[i],dom->name);
what is the reason of it???
thanka a lot!
zhunxun(a)gmail.com
7 years, 6 months
[libvirt] [PATCH] datatypes: removing unnecessary return statement.
by Julio Faracco
There is a wrong 'return' statement after a 'goto' statement inside the
function virConnectCloseCallbackDataRegister(). This commit only removes
the 'return'.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/datatypes.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/datatypes.c b/src/datatypes.c
index 59ba956..46414ae 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -193,7 +193,6 @@ void virConnectCloseCallbackDataRegister(virConnectCloseCallbackDataPtr closeDat
VIR_WARN("Attempt to register callback on armed"
" close callback object %p", closeData);
goto cleanup;
- return;
}
closeData->conn = virObjectRef(conn);
--
2.7.4
7 years, 6 months
[libvirt] [PATCH] nodedev: mdev: Fix build caused by symbol shadowing
by Erik Skultety
GCC 4.6 complains about a local declaration shadowing a global symbol.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Pushed as build breaker.
src/node_device/node_device_udev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 8288be1cb..4ecb0b18f 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1076,16 +1076,16 @@ udevProcessMediatedDevice(struct udev_device *dev,
const char *uuidstr = NULL;
int iommugrp = -1;
char *linkpath = NULL;
- char *realpath = NULL;
+ char *canonicalpath = NULL;
virNodeDevCapMdevPtr data = &def->caps->data.mdev;
if (virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)) < 0)
goto cleanup;
- if (virFileResolveLink(linkpath, &realpath) < 0)
+ if (virFileResolveLink(linkpath, &canonicalpath) < 0)
goto cleanup;
- if (VIR_STRDUP(data->type, last_component(realpath)) < 0)
+ if (VIR_STRDUP(data->type, last_component(canonicalpath)) < 0)
goto cleanup;
uuidstr = udev_device_get_sysname(dev);
@@ -1100,7 +1100,7 @@ udevProcessMediatedDevice(struct udev_device *dev,
ret = 0;
cleanup:
VIR_FREE(linkpath);
- VIR_FREE(realpath);
+ VIR_FREE(canonicalpath);
return ret;
}
--
2.13.0
7 years, 6 months
[libvirt] [PATCH] qemu: monitor: Don't bother extracting vCPU halted state in text monitor
by Peter Krempa
The code causes the 'offset' variable to be overwritten (possibly with
NULL if neither of the vCPUs is halted) which causes a crash since the
variable is still used after that part.
Additionally there's a bug, since strstr() would look up the '(halted)'
string in the whole string rather than just the currently processed line
the returned data is completely bogus.
Rather than switching to single line parsing let's remove the code
altogether since it has a commonly used JSON monitor alternative and
the data itself is not very useful to report.
The code was introduced in commit cc5e695bde
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452106
---
src/qemu/qemu_monitor_text.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 9c9eeea01..66c94fbcd 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -552,12 +552,6 @@ qemuMonitorTextQueryCPUs(qemuMonitorPtr mon,
cpu.qemu_id = cpuid;
cpu.tid = tid;
- /* Extract halted indicator */
- if ((offset = strstr(line, "(halted)")) != NULL)
- cpu.halted = true;
- else
- cpu.halted = false;
-
if (VIR_APPEND_ELEMENT_COPY(cpus, ncpus, cpu) < 0) {
ret = -1;
goto cleanup;
--
2.12.2
7 years, 6 months