[libvirt] [PATCH v3 0/2] Introducing testDomainRename().
by Julio Faracco
This commit introduces the testDomainRename() for test driver. It includes:
- testDomainRename() implementation.
- Testcase script to test 'domrename' command.
Julio Faracco (2):
test: Implementing testDomainRename().
tests: Adding test case for virsh 'domrename' command.
src/test/test_driver.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/Makefile.am | 1 +
tests/virsh-rename | 43 ++++++++++++++++++++++++++
3 files changed, 128 insertions(+)
create mode 100755 tests/virsh-rename
--
2.7.4
6 years, 9 months
[libvirt] [PATCH] qemu: Fix memory leak in processGuestPanicEvent
by John Ferlan
After processing the processEvent->data for a qemuProcessEventHandler
callout, it's expected that the called processEvent->eventType helper
will perform the proper free on the data field. In this case it's
a qemuMonitorEventPanicInfoPtr.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Noticed this while working through the DumpComplete patch series.
One has to follow the bouncing ball, but will note that when the
processEvent->data is passed to other cases, it ends up getting
VIR_FREE()'d at the end of various functions, so this should too
since it's at the end of the line.
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a203c9297..5eaf97a46 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4309,6 +4309,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
qemuDomainRemoveInactiveJob(driver, vm);
cleanup:
+ qemuMonitorEventPanicInfoFree(info);
virObjectUnref(cfg);
}
--
2.13.6
6 years, 9 months
[libvirt] [PATCH] tests: Clean up GIC test cases
by Andrea Bolognani
These test cases are supposed to verify GIC support works as
expected, and shouldn't concern themselves with other features;
we can trim them down significantly, and make them less likely
to need updating after unrelated changes.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/qemuxml2argvdata/aarch64-gic-default.xml | 8 ++------
tests/qemuxml2argvdata/aarch64-gic-host.xml | 2 ++
tests/qemuxml2argvdata/aarch64-gic-invalid.xml | 8 ++------
tests/qemuxml2argvdata/aarch64-gic-none-tcg.xml | 2 +-
tests/qemuxml2argvdata/aarch64-gic-none.xml | 8 ++------
tests/qemuxml2argvdata/aarch64-gic-not-arm.xml | 8 ++------
tests/qemuxml2argvdata/aarch64-gic-not-virt.xml | 8 ++------
tests/qemuxml2argvdata/aarch64-gic-v2.xml | 2 ++
tests/qemuxml2argvdata/aarch64-gic-v3.xml | 2 ++
tests/qemuxml2xmloutdata/aarch64-gic-none-tcg.xml | 1 +
10 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default.xml b/tests/qemuxml2argvdata/aarch64-gic-default.xml
index b219972b3..accfbb0af 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-default.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-default.xml
@@ -2,21 +2,17 @@
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
<memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
- <boot dev='hd'/>
</os>
<features>
<gic/>
</features>
<cpu mode='host-passthrough'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-host.xml b/tests/qemuxml2argvdata/aarch64-gic-host.xml
index b14d14281..561f6edc6 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-host.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-host.xml
@@ -18,5 +18,7 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-invalid.xml b/tests/qemuxml2argvdata/aarch64-gic-invalid.xml
index 1cf9ea88d..98566b86d 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-invalid.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-invalid.xml
@@ -2,21 +2,17 @@
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
<memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
- <boot dev='hd'/>
</os>
<features>
<gic version='none'/>
</features>
<cpu mode='host-passthrough'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none-tcg.xml b/tests/qemuxml2argvdata/aarch64-gic-none-tcg.xml
index 0aa33dbec..64745f3e0 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-none-tcg.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-none-tcg.xml
@@ -5,13 +5,13 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
- <boot dev='hd'/>
</os>
<cpu mode='custom'>
<model>cortex-a57</model>
</cpu>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
<memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none.xml b/tests/qemuxml2argvdata/aarch64-gic-none.xml
index 272d0c857..302c132a3 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-none.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-none.xml
@@ -2,18 +2,14 @@
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
<memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
- <boot dev='hd'/>
</os>
<cpu mode='host-passthrough'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-not-arm.xml b/tests/qemuxml2argvdata/aarch64-gic-not-arm.xml
index 3b907bc41..e33bca0ef 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-not-arm.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-not-arm.xml
@@ -2,21 +2,17 @@
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
<memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc64' machine='pseries'>hvm</type>
- <boot dev='hd'/>
</os>
<features>
<gic/>
</features>
<cpu mode='host-passthrough'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-not-virt.xml b/tests/qemuxml2argvdata/aarch64-gic-not-virt.xml
index 256664ed8..12148d99e 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-not-virt.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-not-virt.xml
@@ -2,21 +2,17 @@
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
<memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='not-virt'>hvm</type>
- <boot dev='hd'/>
</os>
<features>
<gic/>
</features>
<cpu mode='host-passthrough'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-v2.xml b/tests/qemuxml2argvdata/aarch64-gic-v2.xml
index 8b9983752..f451c87b7 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-v2.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-v2.xml
@@ -18,5 +18,7 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/aarch64-gic-v3.xml b/tests/qemuxml2argvdata/aarch64-gic-v3.xml
index bde94e16c..f3a6b9283 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-v3.xml
+++ b/tests/qemuxml2argvdata/aarch64-gic-v3.xml
@@ -18,5 +18,7 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-none-tcg.xml b/tests/qemuxml2xmloutdata/aarch64-gic-none-tcg.xml
index a0cd0b768..b97843970 100644
--- a/tests/qemuxml2xmloutdata/aarch64-gic-none-tcg.xml
+++ b/tests/qemuxml2xmloutdata/aarch64-gic-none-tcg.xml
@@ -20,6 +20,7 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
<memballoon model='none'/>
</devices>
</domain>
--
2.14.3
6 years, 10 months
[libvirt] [PATCH 0/1] WIP: try to implement volume rename
by Vasiliy Tolstov
This is incomplete work for implementing volume rename in libvirt
I'm try to impelemnt it for some backends.
First missing part is remote rpc call, and second - tests.
If somebody can/want to help me, i'll very happy.
Vasiliy Tolstov (1):
[WIP] implement vol rename
include/libvirt/libvirt-storage.h | 3 ++
m4/virt-storage-lvm.m4 | 3 ++
src/libvirt-storage.c | 39 +++++++++++++++++++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 8 ++++-
src/remote/remote_driver.c | 1 +
src/storage/storage_backend_fs.c | 3 ++
src/storage/storage_backend_logical.c | 27 +++++++++++++++
src/storage/storage_backend_rbd.c | 28 +++++++++++++++
src/storage/storage_backend_vstorage.c | 1 +
src/storage/storage_driver.c | 63 ++++------------------------------
src/storage/storage_util.c | 13 +++++++
src/storage/storage_util.h | 5 +++
src/util/virstoragefile.c | 39 +++++++++++++++++++++
tools/virsh-volume.c | 53 ++++++++++++++++++++++++++++
15 files changed, 229 insertions(+), 58 deletions(-)
--
2.14.3
6 years, 10 months
[libvirt] [REBASE PATCH v2 0/9] Implement query-dump command
by John Ferlan
https://www.redhat.com/archives/libvir-list/2018-January/msg00128.html
Rebase the patches to 71d56a397925a1bd55d3aee30afdbdcd1a14f9a8 since
4.0.0 is released and the capabilities were adjusted.
I also note fromt the archives that Michal responded to the series:
https://www.redhat.com/archives/libvir-list/2018-January/msg00154.html
but that never made it to my inbox (curses, the Red Hat email processing
sometimes is very, very delayed).
Anyway, the only difference for this series is the addition of patch 9
to generate a news.xml article.
John Ferlan (9):
qemu: Add support for DUMP_COMPLETED event
qemu: Introduce qemuProcessHandleDumpCompleted
qemu: Introduce qemuMonitor[JSON]QueryDump
qemu: Add new parameter to qemuMonitorDumpToFd
qemu: Introduce qemuDomainGetJobInfoMigrationStats
qemu: Introduce qemuDomainGetJobInfoDumpStats
qemu: Add dump completed event to the capabilities
qemu: Allow showing the dump progress for memory only dump
docs: Add news article for query memory-only dump processing
percentage
docs/news.xml | 11 ++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 2 +
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 146 ++++++++++++++++++---
src/qemu/qemu_monitor.c | 39 +++++-
src/qemu/qemu_monitor.h | 33 ++++-
src/qemu/qemu_monitor_json.c | 104 ++++++++++++++-
src/qemu/qemu_monitor_json.h | 7 +-
src/qemu/qemu_process.c | 23 ++++
.../caps_2.10.0-gicv2.aarch64.xml | 1 +
.../caps_2.10.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
tests/qemumonitorjsontest.c | 3 +-
28 files changed, 363 insertions(+), 26 deletions(-)
--
2.13.6
6 years, 10 months
[libvirt] [PATCHv4 RESEND] vhost-user: add support reconnect for vhost-user ports
by ZhiPeng Lu
For vhost-user ports, Open vSwitch acts as the server and QEMU the client.
When OVS crashes or restarts, the QEMU process should be reconnected to
OVS.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v1->v2:
- modify xml format
v2->v3:
- fix commit message syntax
- reimplemente functions and the struct about reconnect
v3->v4:
- revert reimplemente functions and the struct about reconnect
---
docs/formatdomain.html.in | 7 +-
docs/schemas/domaincommon.rng | 26 ++--
src/conf/domain_conf.c | 158 +++++++++++++----------
tests/qemuxml2argvdata/net-vhostuser-multiq.args | 12 +-
tests/qemuxml2argvdata/net-vhostuser-multiq.xml | 11 +-
5 files changed, 127 insertions(+), 87 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index d272cc1..f0f9f4b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5832,7 +5832,9 @@ qemu-kvm -net nic,model=? /dev/null
</interface>
<interface type='vhostuser'>
<mac address='52:54:00:3b:83:1b'/>
- <source type='unix' path='/tmp/vhost2.sock' mode='client'/>
+ <source type='unix' path='/tmp/vhost2.sock' mode='client'>
+ <reconnect enabled='yes' timeout='10'/>
+ </source>
<model type='virtio'/>
<driver queues='5'/>
</interface>
@@ -5848,6 +5850,9 @@ qemu-kvm -net nic,model=? /dev/null
are supported.
vhost-user requires the virtio model type, thus the
<code><model></code> element is mandatory.
+ <span class="since">Since 3.10.0</span> the element has an optional
+ attribute <code>reconnect</code> which configures reconnect timeout
+ (in seconds) if the connection is lost.
</p>
<h5><a id="elementNwfilter">Traffic filtering with NWFilter</a></h5>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index f22c932..9258c7d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2399,6 +2399,18 @@
</attribute>
</optional>
</define>
+ <define name="reconnect">
+ <element name="reconnect">
+ <attribute name="enabled">
+ <ref name="virYesNo"/>
+ </attribute>
+ <optional>
+ <attribute name="timeout">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ </element>
+ </define>
<!--
An interface description can either be of type bridge in which case
@@ -2460,6 +2472,9 @@
<value>client</value>
</choice>
</attribute>
+ <optional>
+ <ref name="reconnect"/>
+ </optional>
<empty/>
</element>
<ref name="interface-options"/>
@@ -3728,16 +3743,7 @@
</attribute>
</optional>
<optional>
- <element name="reconnect">
- <attribute name="enabled">
- <ref name="virYesNo"/>
- </attribute>
- <optional>
- <attribute name="timeout">
- <ref name="unsignedInt"/>
- </attribute>
- </optional>
- </element>
+ <ref name="reconnect"/>
</optional>
<zeroOrMore>
<ref name='devSeclabel'/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a1c2506..ccc8ff7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10695,6 +10695,56 @@ virDomainNetAppendIPAddress(virDomainNetDefPtr def,
return -1;
}
+static int
+virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def,
+ xmlNodePtr node,
+ xmlXPathContextPtr ctxt)
+{
+ int ret = -1;
+ int tmpVal;
+ char *tmp = NULL;
+ xmlNodePtr saveNode = ctxt->node;
+ xmlNodePtr cur;
+
+ ctxt->node = node;
+
+ if ((cur = virXPathNode("./reconnect", ctxt))) {
+ if ((tmp = virXMLPropString(cur, "enabled"))) {
+ if ((tmpVal = virTristateBoolTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid reconnect enabled value: '%s'"),
+ tmp);
+ goto cleanup;
+ }
+ def->enabled = tmpVal;
+ VIR_FREE(tmp);
+ }
+
+ if (def->enabled == VIR_TRISTATE_BOOL_YES) {
+ if ((tmp = virXMLPropString(cur, "timeout"))) {
+ if (virStrToLong_ui(tmp, NULL, 10, &def->timeout) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid reconnect timeout value: '%s'"),
+ tmp);
+ goto cleanup;
+ }
+ VIR_FREE(tmp);
+ } else {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing timeout for chardev with "
+ "reconnect enabled"));
+ goto cleanup;
+ }
+ }
+ }
+
+ ret = 0;
+ cleanup:
+ ctxt->node = saveNode;
+ VIR_FREE(tmp);
+ return ret;
+}
+
/* Parse the XML definition for a network interface
* @param node XML nodeset to parse for net definition
* @return 0 on success, -1 on failure
@@ -10749,6 +10799,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
virNWFilterHashTablePtr filterparams = NULL;
virDomainActualNetDefPtr actual = NULL;
xmlNodePtr oldnode = ctxt->node;
+ virDomainChrSourceReconnectDef reconnect = {0};
int rv, val;
if (VIR_ALLOC(def) < 0)
@@ -10830,11 +10881,14 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
goto error;
}
} else if (!vhostuser_path && !vhostuser_mode && !vhostuser_type
- && def->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
- virXMLNodeNameEqual(cur, "source")) {
+ && def->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER
+ && virXMLNodeNameEqual(cur, "source")) {
vhostuser_type = virXMLPropString(cur, "type");
vhostuser_path = virXMLPropString(cur, "path");
vhostuser_mode = virXMLPropString(cur, "mode");
+ if (virDomainChrSourceReconnectDefParseXML(&reconnect, cur, ctxt) < 0)
+ goto error;
+
} else if (!def->virtPortProfile
&& virXMLNodeNameEqual(cur, "virtualport")) {
if (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
@@ -11056,8 +11110,16 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
if (STREQ(vhostuser_mode, "server")) {
def->data.vhostuser->data.nix.listen = true;
+ if (reconnect.enabled != VIR_TRISTATE_BOOL_ABSENT) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("'reconnect' attribute unsupported "
+ "'server' mode for <interface type='vhostuser'>"));
+ goto error;
+ }
} else if (STREQ(vhostuser_mode, "client")) {
def->data.vhostuser->data.nix.listen = false;
+ def->data.vhostuser->data.nix.reconnect.enabled = reconnect.enabled;
+ def->data.vhostuser->data.nix.reconnect.timeout = reconnect.timeout;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Wrong <source> 'mode' attribute "
@@ -11763,57 +11825,6 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
return ret;
}
-static int
-virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def,
- xmlNodePtr node,
- xmlXPathContextPtr ctxt)
-{
- int ret = -1;
- int tmpVal;
- char *tmp = NULL;
- xmlNodePtr saveNode = ctxt->node;
- xmlNodePtr cur;
-
- ctxt->node = node;
-
- if ((cur = virXPathNode("./reconnect", ctxt))) {
- if ((tmp = virXMLPropString(cur, "enabled"))) {
- if ((tmpVal = virTristateBoolTypeFromString(tmp)) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("invalid reconnect enabled value: '%s'"),
- tmp);
- goto cleanup;
- }
- def->enabled = tmpVal;
- VIR_FREE(tmp);
- }
-
- if (def->enabled == VIR_TRISTATE_BOOL_YES) {
- if ((tmp = virXMLPropString(cur, "timeout"))) {
- if (virStrToLong_ui(tmp, NULL, 10, &def->timeout) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("invalid reconnect timeout value: '%s'"),
- tmp);
- goto cleanup;
- }
- VIR_FREE(tmp);
- } else {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("missing timeout for chardev with "
- "reconnect enabled"));
- goto cleanup;
- }
- }
- }
-
- ret = 0;
- cleanup:
- ctxt->node = saveNode;
- VIR_FREE(tmp);
- return ret;
-}
-
-
typedef enum {
VIR_DOMAIN_CHR_SOURCE_MODE_CONNECT,
VIR_DOMAIN_CHR_SOURCE_MODE_BIND,
@@ -23634,6 +23645,21 @@ virDomainVirtioNetDriverFormat(char **outstr,
return 0;
}
+static void
+virDomainChrSourceReconnectDefFormat(virBufferPtr buf,
+ virDomainChrSourceReconnectDefPtr def)
+{
+ if (def->enabled == VIR_TRISTATE_BOOL_ABSENT)
+ return;
+
+ virBufferAsprintf(buf, "<reconnect enabled='%s'",
+ virTristateBoolTypeToString(def->enabled));
+
+ if (def->enabled == VIR_TRISTATE_BOOL_YES)
+ virBufferAsprintf(buf, " timeout='%u'", def->timeout);
+
+ virBufferAddLit(buf, "/>\n");
+}
int
virDomainNetDefFormat(virBufferPtr buf,
@@ -23728,6 +23754,14 @@ virDomainNetDefFormat(virBufferPtr buf,
def->data.vhostuser->data.nix.listen ?
"server" : "client");
sourceLines++;
+ if (def->data.vhostuser->data.nix.reconnect.enabled != VIR_TRISTATE_BOOL_ABSENT) {
+ virBufferAddLit(buf, ">\n");
+ sourceLines++;
+ virBufferAdjustIndent(buf, 2);
+ virDomainChrSourceReconnectDefFormat(buf, &def->data.vhostuser->data.nix.reconnect);
+ virBufferAdjustIndent(buf, -2);
+ }
+
}
break;
@@ -23960,24 +23994,6 @@ virDomainChrAttrsDefFormat(virBufferPtr buf,
return 0;
}
-
-static void
-virDomainChrSourceReconnectDefFormat(virBufferPtr buf,
- virDomainChrSourceReconnectDefPtr def)
-{
- if (def->enabled == VIR_TRISTATE_BOOL_ABSENT)
- return;
-
- virBufferAsprintf(buf, "<reconnect enabled='%s'",
- virTristateBoolTypeToString(def->enabled));
-
- if (def->enabled == VIR_TRISTATE_BOOL_YES)
- virBufferAsprintf(buf, " timeout='%u'", def->timeout);
-
- virBufferAddLit(buf, "/>\n");
-}
-
-
static int
virDomainChrSourceDefFormat(virBufferPtr buf,
virDomainChrSourceDefPtr def,
diff --git a/tests/qemuxml2argvdata/net-vhostuser-multiq.args b/tests/qemuxml2argvdata/net-vhostuser-multiq.args
index b69ebd8..f2aec7b 100644
--- a/tests/qemuxml2argvdata/net-vhostuser-multiq.args
+++ b/tests/qemuxml2argvdata/net-vhostuser-multiq.args
@@ -32,7 +32,11 @@ addr=0x4 \
-netdev socket,listen=:2015,id=hostnet2 \
-device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,\
addr=0x5 \
--chardev socket,id=charnet3,path=/tmp/vhost2.sock \
--netdev vhost-user,chardev=charnet3,queues=4,id=hostnet3 \
--device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,\
-mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6
+-chardev socket,id=charnet3,path=/tmp/vhost2.sock,reconnect=10 \
+-netdev vhost-user,chardev=charnet3,id=hostnet3 \
+-device virtio-net-pci,netdev=hostnet3,id=net3,\
+mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6 \
+-chardev socket,id=charnet4,path=/tmp/vhost3.sock,reconnect=0 \
+-netdev vhost-user,chardev=charnet4,queues=4,id=hostnet4 \
+-device virtio-net-pci,mq=on,vectors=10,netdev=hostnet4,id=net4,\
+mac=52:54:00:ee:96:6e,bus=pci.0,addr=0x7
diff --git a/tests/qemuxml2argvdata/net-vhostuser-multiq.xml b/tests/qemuxml2argvdata/net-vhostuser-multiq.xml
index d5c42fe..a30cce6 100644
--- a/tests/qemuxml2argvdata/net-vhostuser-multiq.xml
+++ b/tests/qemuxml2argvdata/net-vhostuser-multiq.xml
@@ -40,7 +40,16 @@
</interface>
<interface type='vhostuser'>
<mac address='52:54:00:ee:96:6d'/>
- <source type='unix' path='/tmp/vhost2.sock' mode='client'/>
+ <source type='unix' path='/tmp/vhost2.sock' mode='client'>
+ <reconnect enabled='yes' timeout='10'/>
+ </source>
+ <model type='virtio'/>
+ </interface>
+ <interface type='vhostuser'>
+ <mac address='52:54:00:ee:96:6e'/>
+ <source type='unix' path='/tmp/vhost3.sock' mode='client'>
+ <reconnect enabled='no'/>
+ </source>
<model type='virtio'/>
<driver queues='4'/>
</interface>
--
1.8.3.1
6 years, 10 months
Re: [libvirt] [PATCH RESEND v1 1/2] i386: Add Intel Processor Trace feature support
by Eduardo Habkost
CCing libvirt developers.
On Mon, Jan 15, 2018 at 10:33:35AM +0100, Paolo Bonzini wrote:
> On 15/01/2018 08:19, Kang, Luwei wrote:
> >> If you are forwarding host info directly to the guest, the feature
> >> is not migration-safe. The new feature needs to be added to
> >> feature_word_info[FEAT_7_0_EBX].unmigratable_flags.
> >>
> > Hi, Thanks for you review. I want to support Intel PT live migration
> > and patch [2/2] to do this. I don't understand why need to add this
> > feature in feature_word_info[FEAT_7_0_EBX].unmigratable_flags first
> > to disable live migration.
>
> Hi Luwei,
>
> the issue is that different hosts can have different CPUID flags. You
> don't have a way to set the CPUID flags from the "-cpu" command line,
> and it's not clear what values will be there in the various Ice Lake SKUs.
>
> I am not sure if there is a mechanism to allow live migration only for
> "-cpu host", but it cannot be supported for any other "-cpu" model.
IIRC, we don't have any mechanism to actually prevent migration
if an unmigratable flag is enabled. We just avoid enabling them
by accident on "-cpu host".
This case is slightly more problematic, however: the new feature
is actually migratable (under very controlled circumstances)
because of patch 2/2, but it is not migration-safe[1]. This
means libvirt shouldn't include it in "host-model" expansion
(which uses the query-cpu-model-expansion QMP command) until we
make the feature migration-safe.
For QEMU, this means the feature shouldn't be returned by
"query-cpu-model-expansion type=static model=max" (but it can be
returned by "query-cpu-model-expansion type=full model=max").
Jiri, it looks like libvirt uses type=full on
query-cpu-model-expansion on x86. It needs to use
type=static[2], or it will have no way to find out if a feature
is migration-safe or not.
This case is similar to "pmu", which is not migration-safe but
enabled by -cpu host by default. But "pmu" is less problematic
because it is already skipped by query-cpu-model-expansion
type=static.
---
[1] "migration-safe" is defined in the documentation for CpuDefinitionInfo on
the QAPI schema:
# @migration-safe: whether a CPU definition can be safely used for
# migration in combination with a QEMU compatibility machine
# when migrating between different QMU versions and between
# hosts with different sets of (hardware or software)
# capabilities. If not provided, information is not available
# and callers should not assume the CPU definition to be
# migration-safe. (since 2.8)
[2] It looks like libvirt uses type=full because it wants to get
all QOM property aliases returned. In this case, one
solution for libvirt is to use:
static_expansion = query_cpu_model_expansion(type=static, model)
all_props = query_cpu_model_expansion(type=full, static_expansion)
--
Eduardo
6 years, 10 months
[libvirt] [PATCH] docs: Add missing element encryption description term entry
by John Ferlan
Missed adding the "encryption" description term entry to the list
of possible sub-elements for disk source. The description details
were there, just not the tag.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Found this while looking at Michal's persistent reservations series.
Pushing as trivial - it doesn't cause a conflict with that series.
docs/formatdomain.html.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 41ba4d41e..cf0654497 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2824,6 +2824,7 @@
attribute matching the key that was specified in the
secret object.
</dd>
+ <dt><code>encryption</code></dt>
<dd><span class="since">Since libvirt 3.9.0</span>, the
<code>encryption</code> can be a sub-element of the
<code>source</code> element for encrypted storage sources.
--
2.13.6
6 years, 10 months
[libvirt] [PATCH hooks 0/1] Enforce requirement for Signed-off-by line
by Daniel P. Berrange
As a general rule most libvirt commits in recent history have have a
valid Signed-off-by line present. There are still cases, however, where
this is being forgotten. It is time to put some checks on git pushes to
detect missinged Signed-off-by lines and reject the push.
I created a new git repository that contains the original git repository
update hook Eric provided years back. This commit then augments that
hook to add the Signed-off-by check. The updated hook gets automatically
installed on the server when we push to this repo.
Daniel P. Berrange (1):
Add check for Signed-off-by in commit messages
update | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
--
2.14.3
6 years, 10 months
[libvirt] [PATCH 0/2] vsh: Print help for the aliased cmd rather than the alias itself
by Erik Skultety
The alias doesn't have any definition rather than a reference for the aliased
command. Therefore when printing help, we have to print help for the aliased
command, otherwise our faith is going to be met with SIGSEGV.
Erik Skultety (2):
vsh: Drop redundant definition searches from vshCmd{def,Grp}Help
vsh: Cmd aliases lookups should return results for the aliased command
tools/vsh.c | 45 +++++++++++++++++----------------------------
tools/vsh.h | 4 ++--
2 files changed, 19 insertions(+), 30 deletions(-)
--
2.13.6
6 years, 10 months