[libvirt] [PATCH] conf: fix cannot get mutli value settings when parse controllers XML
by Luyao Huang
We will free the old parameter value settings in next loop when we
get scsi controller's driver specific options.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/domain_conf.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b9858cd..f7b4a7c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6870,11 +6870,21 @@ virDomainControllerDefParseXML(xmlNodePtr node,
cur = node->children;
while (cur != NULL) {
+ char *queues2 = NULL;
+ char *cmd_per_lun2 = NULL;
+ char *max_sectors2 = NULL;
+
if (cur->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(cur->name, BAD_CAST "driver")) {
- queues = virXMLPropString(cur, "queues");
- cmd_per_lun = virXMLPropString(cur, "cmd_per_lun");
- max_sectors = virXMLPropString(cur, "max_sectors");
+ queues2 = virXMLPropString(cur, "queues");
+ if (queues2)
+ queues = queues2;
+ cmd_per_lun2 = virXMLPropString(cur, "cmd_per_lun");
+ if (cmd_per_lun2)
+ cmd_per_lun = cmd_per_lun2;
+ max_sectors2 = virXMLPropString(cur, "max_sectors");
+ if (max_sectors2)
+ max_sectors = max_sectors2;
}
}
cur = cur->next;
--
1.8.3.1
9 years, 10 months
[libvirt] [PATCH] Parallels: Add VNC hostname setup
by Alexander Burluka
Add missing VNC setup via Parallels SDK.
Parallels Cloud Server starts one VNC server per domain,
so we could process only one VNC server definition.
Network-based listening currently is unimplemented.
Signed-off-by: Alexander Burluka <aburluka(a)parallels.com>
---
src/parallels/parallels_sdk.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 83a28b7..8394646 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -1929,7 +1929,7 @@ static int prlsdkCheckGraphicsUnsupportedParams(virDomainDefPtr def)
if (def->ngraphics == 0)
return 0;
- if (def->ngraphics >1) {
+ if (def->ngraphics > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Parallels Cloud Server supports only "
"one VNC per domain."));
@@ -1988,6 +1988,20 @@ static int prlsdkCheckGraphicsUnsupportedParams(virDomainDefPtr def)
return -1;
}
+ if (gr->nListens > 1) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("Parallels driver doesn't support more than "
+ "one listening VNC server per domain"));
+ return -1;
+ }
+
+ if (gr->nListens == 1 &&
+ virDomainGraphicsListenGetType(gr, 0) != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("Parallels driver supports only address-based VNC listening"));
+ return -1;
+ }
+
return 0;
}
@@ -2286,6 +2300,7 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
virDomainGraphicsDefPtr gr;
PRL_RESULT pret;
int ret = -1;
+ const char *listenAddr = NULL;
if (prlsdkCheckGraphicsUnsupportedParams(def))
return -1;
@@ -2306,6 +2321,14 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
prlsdkCheckRetGoto(pret, cleanup);
}
+ if (gr->nListens == 1) {
+ listenAddr = virDomainGraphicsListenGetAddress(gr, 0);
+ if (!listenAddr)
+ goto cleanup;
+ pret = PrlVmCfg_SetVNCHostName(sdkdom, listenAddr);
+ prlsdkCheckRetGoto(pret, cleanup);
+ }
+
ret = 0;
cleanup:
return ret;
--
1.7.1
9 years, 10 months
[libvirt] [PATCH] lxc: fix show the wrong xml when guest start failed
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1176503
When guest start failed, libvirt will keep the current vm->def,
this will make a issue that we cannot get a right xml after guest
start failed. Pass the newDef to def will make it work well.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/lxc/lxc_process.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 1c0d4e5..b7171ac 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1353,10 +1353,6 @@ int virLXCProcessStart(virConnectPtr conn,
VIR_FREE(veths[i]);
}
if (rc != 0) {
- if (vm->newDef) {
- virDomainDefFree(vm->newDef);
- vm->newDef = NULL;
- }
if (priv->monitor) {
virObjectUnref(priv->monitor);
priv->monitor = NULL;
@@ -1373,6 +1369,12 @@ int virLXCProcessStart(virConnectPtr conn,
VIR_FREE(vm->def->seclabels[0]->label);
VIR_FREE(vm->def->seclabels[0]->imagelabel);
}
+ if (vm->newDef) {
+ virDomainDefFree(vm->def);
+ vm->def = vm->newDef;
+ vm->def->id = -1;
+ vm->newDef = NULL;
+ }
}
for (i = 0; i < nttyFDs; i++)
VIR_FORCE_CLOSE(ttyFDs[i]);
--
1.8.3.1
9 years, 10 months
[libvirt] [PATCH V3 0/5] support sending sysrq key
by Chunyan Liu
xend/libxl support sending sysrq key to guest kernel but not support
sending any key sequence as virDomainSendKey is expected to do. To
add equivalant sysrq functionality in libvirt for xen/libxl, add a new
virDomainSendSysrq API and add related codes to virsh, remote driver,
xen/libxl driver.
Changes to V2:
* change parameter from 'const char *key' to 'char key'.
* add 'flags' parameter to virDomainSendSysrq API.
* update codes to fit for above changes.
V2 is here:
http://www.mail-archive.com/libvir-list@redhat.com/msg106106.html
Chunyan Liu (5):
Add public API virDomainSendSysrq
implement remote protocol for domainSendSysrq
virsh: add 'sysrq' command
libxl: implement .domainSendSysrq method
xen: add .domainSendSysrq method
include/libvirt/libvirt-domain.h | 3 +++
src/driver-hypervisor.h | 4 +++
src/libvirt-domain.c | 39 +++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 ++++
src/libxl/libxl_driver.c | 25 +++++++++++++++++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 14 ++++++++++-
src/remote_protocol-structs | 6 +++++
src/rpc/gendispatch.pl | 12 +++++++++
src/xen/xen_driver.c | 21 ++++++++++++++++
src/xen/xend_internal.c | 21 ++++++++++++++++
src/xen/xend_internal.h | 1 +
tools/virsh-domain.c | 54 ++++++++++++++++++++++++++++++++++++++++
13 files changed, 205 insertions(+), 1 deletion(-)
--
1.8.4.5
9 years, 10 months
[libvirt] [PATCH 00/12]qemu: support hot-plug/unplug RNG device
by Luyao Huang
qemu already support hot-plug and hot-unplug RNG device.
These patch will make libvirt support hot-plug/unplug RNG device for qemu driver.
Luyao Huang (12):
qemu: introduce a new func qemuAssignDeviceRNGAlias for rng device
qemu: rename qemuBuildRNGDeviceArgs to qemuBuildRNGDevStr and change
something
conf: introduce a new func virDomainRNGEquals
conf: introduce 3 functions for RNG device
libvirt_private: add 4 new func in libvirt_private.syms
qemu: add id when build RNG device and rename object id
qemu: introduce 2 func qemuDomainRNGInsert and qemuDomainRNGRemove
qemu: introduce 2 functions for attach a rng object in json monitor
qemu_monitor: add 2 functions qemuMonitorDetachRNGDev and
qemuMonitorAttachRNGDev
audit: make function virDomainAuditRNG global
qemu: Implement RNG device hotplug on live level
qemu: Implement RNG device hotunplug on live level
src/conf/domain_audit.c | 2 +-
src/conf/domain_audit.h | 7 ++
src/conf/domain_conf.c | 78 ++++++++++++++++
src/conf/domain_conf.h | 12 +++
src/libvirt_private.syms | 6 ++
src/qemu/qemu_command.c | 70 +++++++++-----
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_driver.c | 12 ++-
src/qemu/qemu_hotplug.c | 212 ++++++++++++++++++++++++++++++++++++++++++-
src/qemu/qemu_hotplug.h | 14 ++-
src/qemu/qemu_monitor.c | 43 +++++++++
src/qemu/qemu_monitor.h | 7 ++
src/qemu/qemu_monitor_json.c | 58 ++++++++++++
src/qemu/qemu_monitor_json.h | 5 +
14 files changed, 502 insertions(+), 29 deletions(-)
--
1.8.3.1
9 years, 10 months
[libvirt] [PATCH v2] Makefile: Fix parallel build after Xen-xl parser introduction
by Michal Privoznik
Well, the parallel build doesn't work as there are not dependencies
set correctly. When running 'make -j' I see this error:
make[2]: Entering directory '/home/zippy/work/libvirt/libvirt.git/src'
GEN util/virkeymaps.h
GEN locking/lock_protocol.h
make[2]: *** No rule to make target 'xenconfig/xen_xl_disk.h', needed by 'all'. Stop.
make[2]: *** Waiting for unfinished jobs....
GEN lxc/lxc_controller_dispatch.h
The fix is to correctly set dependencies by letting make know that .c
and .h are to be generated from .l. Moreover, the section is moved
closer to the other section which uses it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
This is reworked version of my first patch. The difference is
that I'm using a stamp this time.
src/Makefile.am | 46 +++++++++++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 17 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index c6d736e..e00ff63 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1000,23 +1000,6 @@ CPU_SOURCES = \
VMX_SOURCES = \
vmx/vmx.c vmx/vmx.h
-AM_LFLAGS = -Pxl_disk_ --header-file=../$*.h
-LEX_OUTPUT_ROOT = lex.xl_disk_
-BUILT_SOURCES += xenconfig/xen_xl_disk.c xenconfig/xen_xl_disk.h
-# Generated header file is not implicitly added to dist
-EXTRA_DIST += xenconfig/xen_xl_disk.h
-CLEANFILES += xenconfig/xen_xl_disk.h xenconfig/xen_xl_disk.c
-
-XENXLDISKPARSER_SOURCES = xenconfig/xen_xl_disk.l
-
-XENCONFIG_SOURCES = \
- xenconfig/xenxs_private.h \
- xenconfig/xen_common.c xenconfig/xen_common.h \
- xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
- xenconfig/xen_xm.c xenconfig/xen_xm.h \
- xenconfig/xen_xl.c xenconfig/xen_xl.h \
- xenconfig/xen_xl_disk.h
-
pkgdata_DATA = cpu/cpu_map.xml
EXTRA_DIST += $(pkgdata_DATA)
@@ -1070,6 +1053,33 @@ libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
endif WITH_VMX
if WITH_XENCONFIG
+
+XENXLDISKPARSER_GENERATED_STAMP = .xen_xl_disk.stamp
+
+$(XENXLDISKPARSER_GENERATED): $(XENXLDISKPARSER_GENERATED_STAMP)
+
+$(XENXLDISKPARSER_GENERATED_STAMP): $(XENXLDISKPARSER_SOURCES)
+ $(AM_V_GEN) $(SHELL) $(YLWRAP) $< lex.xl_disk_.c xenconfig/xen_xl_disk.c \
+ -- $(LEXCOMPILE) && touch $@
+
+AM_LFLAGS = -Pxl_disk_ --header-file=../$*.h
+XENXLDISKPARSER_GENERATED = xenconfig/xen_xl_disk.c xenconfig/xen_xl_disk.h
+
+BUILT_SOURCES += $(XENXLDISKPARSER_GENERATED)
+EXTRA_DIST += $(XENXLDISKPARSER_GENERATED) $(XENXLDISKPARSER_GENERATED_STAMP)
+MAINTAINERCLEANFILES += $(XENXLDISKPARSER_GENERATED) \
+ $(XENXLDISKPARSER_GENERATED_STAMP)
+
+XENXLDISKPARSER_SOURCES = xenconfig/xen_xl_disk.l
+
+XENCONFIG_SOURCES = \
+ xenconfig/xenxs_private.h \
+ xenconfig/xen_common.c xenconfig/xen_common.h \
+ xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
+ xenconfig/xen_xm.c xenconfig/xen_xm.h \
+ xenconfig/xen_xl.c xenconfig/xen_xl.h \
+ xenconfig/xen_xl_disk_i.h
+
# Flex generated XL disk parser needs to be compiled without WARN_FLAGS
# Add the generated object to its own library to control CFLAGS
noinst_LTLIBRARIES += libvirt_xenxldiskparser.la
@@ -1077,6 +1087,8 @@ libvirt_xenxldiskparser_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS) -Wno-unused-parameter
libvirt_xenxldiskparser_la_SOURCES = \
$(XENXLDISKPARSER_SOURCES)
+libvirt_xenxldiskparser_la_DEPENDENCIES = \
+ $(XENXLDISKPARSER_GENERATED)
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
--
2.0.5
9 years, 10 months
[libvirt] [PATCHv5 00/18] LXC IP configuration feature
by Cédric Bosdonnat
Hi all,
It's time for offering presents, so I'm sending you my updated patch series
for IP configuration in LXC containers.
The changes with v4 include:
* Replacing the <gateway> element by a <route> one.
* Addressing the comments you guys made
I didn't forbid the use of iproute2 / ifconfig in containers if built without
libnl, as I'm not sure about the possible consequences. Could it introduce
regressions for some use cases/distros?
Cédric Bosdonnat (18):
Forgot to cleanup ifname_guest* in domain network def parsing
virNetDevSetIPv4Address: libnl implementation
Renamed virNetDevSetIPv4Address to virNetDevSetIPAddress
virNetDevAddRoute: implementation using netlink
virNetDevClearIPv4Address: netlink implementation
Renamed virNetDevClearIPv4Address to virNetDevClearIPAddress
Domain conf: allow more than one IP address for net devices
IP doc
LXC: set IP addresses to veth devices in the container
lxc conf2xml: convert IP addresses
Allow network capabilities hostdev to configure IP addresses
lxc conf2xml: convert ip addresses for hostdev NICs
Domain network devices can now have a <route> element
lxc conf2xml: convert lxc.network.ipv[46].gateway
LXC: use the new net devices routes definition
LXC: honour network devices link state
Openvz --ipadd can be provided multiple times
Report error if a driver can't handle multiple IP addresses
docs/formatdomain.html.in | 46 +++
docs/schemas/domaincommon.rng | 75 ++++-
src/conf/domain_conf.c | 320 ++++++++++++++++++--
src/conf/domain_conf.h | 29 +-
src/libvirt_private.syms | 6 +-
src/lxc/lxc_container.c | 56 +++-
src/lxc/lxc_native.c | 202 +++++++++----
src/network/bridge_driver.c | 4 +-
src/openvz/openvz_conf.c | 2 +-
src/openvz/openvz_driver.c | 11 +-
src/qemu/qemu_driver.c | 26 +-
src/qemu/qemu_hotplug.c | 5 +-
src/uml/uml_conf.c | 2 +-
src/util/virnetdev.c | 332 ++++++++++++++++++---
src/util/virnetdev.h | 14 +-
src/util/virnetlink.c | 38 +++
src/util/virnetlink.h | 2 +
src/util/virsocketaddr.h | 4 +
src/vbox/vbox_common.c | 16 +-
src/xenconfig/xen_common.c | 29 +-
src/xenconfig/xen_sxpr.c | 26 +-
.../lxcconf2xmldata/lxcconf2xml-physnetwork.config | 4 +
tests/lxcconf2xmldata/lxcconf2xml-physnetwork.xml | 4 +
tests/lxcconf2xmldata/lxcconf2xml-simple.config | 4 +
tests/lxcconf2xmldata/lxcconf2xml-simple.xml | 4 +
tests/lxcxml2xmldata/lxc-hostdev.xml | 4 +
tests/lxcxml2xmldata/lxc-idmap.xml | 4 +
tests/openvzutilstest.c | 2 +-
tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-net-routed.xml | 2 +-
30 files changed, 1107 insertions(+), 168 deletions(-)
--
2.1.2
9 years, 10 months
[libvirt] [PATCH] docs: Document some -boot option limitations on UEFI
by Michal Privoznik
It was brought to my attention that some -boot options may not
work with UEFI. For instance, rebootTimeout is very SeaBIOS
specific,splash logo is not implemented yet on OVMF, and so on.
We should document this limitation at least.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/formatdomain.html.in | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 499879e..a35316e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -174,6 +174,18 @@
elements are mutually exclusive. <span class="since">Since 0.1.3,
per-device boot since 0.8.8</span>
</dd>
+ </dl>
+ <p>Up till here the BIOS/UEFI configuration knobs are generic enough to
+ be implemented by majority (if not all) firmwares out there. However,
+ from now on not every single setting makes sense to all firmwares. For
+ instance, <code>rebootTimeout</code> doesn't make sense for UEFI,
+ <code>useserial</code> might not be usable with a BIOS firmware that
+ doesn't produce any output onto serial line, etc. Moreover, firmwares
+ don't usually export their capabilities for libvirt (or users) to check.
+ And the set of their capabilities can change with every new release.
+ Hence users are advised to try the settings they use before relying on
+ them in production.</p>
+ <dl>
<dt><code>bootmenu</code></dt>
<dd> Whether or not to enable an interactive boot menu prompt on guest
startup. The <code>enable</code> attribute can be either "yes" or "no".
--
2.0.5
9 years, 10 months
[libvirt] [PATCHv2] qemu: fix tc old rules will be cleaned if set tc new rules fail
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1177723
If tc cmd failed (maybe value too large) when we use virDomainSetInterfaceParameters
, the old rules will be clean. Restore the old rules if tc failed.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
v1 make a big mistake that i used a old libvirt
src/qemu/qemu_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 73a825d..650e0dd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10494,8 +10494,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
sizeof(*newBandwidth->out));
}
- if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0)
+ if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0) {
+ ignore_value(virNetDevBandwidthSet(net->ifname,
+ net->bandwidth,
+ false));
goto endjob;
+ }
virNetDevBandwidthFree(net->bandwidth);
if (newBandwidth->in || newBandwidth->out) {
--
1.8.3.1
9 years, 10 months
[libvirt] [PATCH] qemu: fix miss goto cleanup in qemuDomainAttachNetDevice
by Luyao Huang
This place have a wrong logic, maybe forget goto cleanup.
Also fix some small things.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
I am not sure i am right, but hotplug a net do not a address
may cause a issue.
src/qemu/qemu_hotplug.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5d0d8e0..bfe1bd0 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -924,7 +924,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
/* Set device online immediately */
if (qemuInterfaceStartDevice(net) < 0)
- goto cleanup;
+ goto cleanup;
/* Set Bandwidth */
if (virNetDevSupportBandwidth(actualType) &&
@@ -952,7 +952,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto cleanup;
} else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("virtio-s390 net device cannot be hotplugged."));
+ _("virtio-s390 net device cannot be hotplugged."));
+ goto cleanup;
} else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
virDomainPCIAddressEnsureAddr(priv->pciaddrs, &net->info) < 0) {
goto cleanup;
--
1.8.3.1
9 years, 10 months