[libvirt] memory ballooning and nova
by Raymond Durand
Is Libvirt memory ballooning managed by nova in OpenStack Juno?
Is Libvirt memory ballooning independent from the OpenStack "RAM
allocation ratio"? and allow a VM to expand (page out) even though the
overall RAM allocation ratio is already at his maximum?
Thanks,
Regards,
9 years, 8 months
[libvirt] [PATCH 0/3] libxl: a few minor patches
by Jim Fehlig
This series contains a few simple changes to the libxl driver.
Patches 1 and 2 were included in
https://www.redhat.com/archives/libvir-list/2015-February/msg00611.html
To make an upcoming V2 of that series easier to review, I removed the
mostly unrelated patches and include them here, along with one other
small fix.
Jim Fehlig (3):
libxl: remove redundant calls to libxl_evdisable_domain_death
libxl: use libxl_ctx passed to libxlConsoleCallback
libxl: remove unneeded cleanup_unlock label
src/libxl/libxl_domain.c | 13 ++-----------
src/libxl/libxl_driver.c | 10 +++-------
2 files changed, 5 insertions(+), 18 deletions(-)
--
1.8.4.5
9 years, 8 months
[libvirt] [libvirt-python PATCH 0/2] Python bindings for IOThreads
by John Ferlan
Going along with the recent libvirt IOThreads API additions, here's the
Python patches... These would only be submitted once the libvirt code
goes in... See the following for the libvirt patches:
http://www.redhat.com/archives/libvir-list/2015-February/msg00593.html
Reviewer's NOTE:
- Alternatively to the error from patch 1, I could modify the code to
not fail on <= 0, but rather just < 0 with the result being the following
for a domain without IOThreads configured:
$ python iothr.py
[]
$
Instead of:
Traceback (most recent call last):
File "iothr.py", line 6, in <module>
print dom2.getIOThreadsInfo()
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1197, in getIOThreadsInfo
if ret is None: raise libvirtError ('virDomainGetIOThreadsInfo() failed', dom=self)
libvirt.libvirtError: virDomainGetIOThreadsInfo() failed
John Ferlan (2):
Support virDomainGetIOThreadsInfo and virDomainIOThreadsInfoFree
Support virDomainSetIOThreads
generator.py | 6 ++
libvirt-override-api.xml | 14 ++++
libvirt-override.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 3 +
4 files changed, 186 insertions(+)
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v3 0/9] Introduce display of IOThreads Information
by John Ferlan
v2 here:
http://www.redhat.com/archives/libvir-list/2015-February/msg00562.html
Changes over v2:
Patches 1-4
* Add "resources" and "nresources" in order to return the resources that
are using an IOThread
* Fixed memory leak - neglected to free the qemuMonitorIOThreadsInfoPtr
'iothreads' in patch 3
Patches 5-9 (NEW)
* Patches 5 & 6 implement the API/remote protocol for virDomainSetIOThreads
* Patch 7 implements a couple of helper function - copies of existing
vcpupin functions
* Patch 8 implements the qemu backend qemuDomainSetIOThreads in order to
allow setting IOThread pin data either for live or config. Heavily lifted
from existing vcpu code
* Patch 9 implements the virsh command options in order to set the pinning
on a specific thread. As a side effect/benefit one can now display just one
IOThread if so desired.
All the changes are sufficient to satisfy the following bz:
https://bugzilla.redhat.com/show_bug.cgi?id=1135491
John Ferlan (9):
Implement public API for virDomainGetIOThreadsInfo
remote: Implement the remote plumbing for virDomainGetIOThreadsInfo
qemu: Implement the qemu driver fetch for IOThreads
virsh: Add 'iothreads' command
Implement public API for virDomainSetIOThreads
remote: Implement remote plumbing for virDomainSetIOThreads
domain: Introduce virDomainIOThreadsPin{Add|Del}
qemu: Add qemuDomainSetIOThreads
virsh: Allow setting of the iothread pin
daemon/remote.c | 99 +++++++-
include/libvirt/libvirt-domain.h | 48 +++-
src/conf/domain_conf.c | 64 +++++
src/conf/domain_conf.h | 10 +
src/driver-hypervisor.h | 16 +-
src/libvirt-domain.c | 149 ++++++++++-
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 7 +
src/qemu/qemu_driver.c | 519 +++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 94 ++++++-
src/remote/remote_protocol.x | 48 +++-
src/remote_protocol-structs | 33 +++
src/rpc/gendispatch.pl | 1 +
tools/virsh-domain.c | 154 ++++++++++++
tools/virsh.pod | 20 ++
15 files changed, 1257 insertions(+), 7 deletions(-)
--
2.1.0
9 years, 8 months
[libvirt] [PATCH 00/10] A bunch of extensions to libxl driver
by Marek Marczykowski-Górecki
This are some additional features to libxl driver. Some of them require change
in domain config structures/syntax. Details described with each patch.
Actually this is next iteration of a few years old patch series...
Marek Marczykowski-Górecki (10):
libxl: update dom->id in libxlDomainCreateWithFlags
conf: support backend domain name in disk and network devices
libxl: support backend domain setting for disk and net devices
libxl: fill HVM SDL and VNC settings based on <graphics/> entries
libxl: pass ipaddr to libxl toolstack
libxl: add tablet/mouse input device support
libxl: prevent attaching multiple netdevs with the same MAC
libxl: support domain config modification in virDomainRestoreFlags
libxl: stubdom emulator type
tests: add some simple libxl XML->XML tests
docs/formatdomain.html.in | 43 ++++-
docs/schemas/domaincommon.rng | 43 ++++-
src/conf/domain_conf.c | 69 +++++++-
src/conf/domain_conf.h | 10 ++
src/libxl/libxl_conf.c | 194 ++++++++++++++++++---
src/libxl/libxl_domain.c | 11 ++
src/libxl/libxl_driver.c | 61 ++++++-
src/util/virstoragefile.c | 4 +-
src/util/virstoragefile.h | 1 +
tests/Makefile.am | 9 +-
tests/domainschematest | 2 +-
tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml | 41 +++++
tests/xlxml2xmldata/xlxml2xml-hvm.xml | 40 +++++
tests/xlxml2xmldata/xlxml2xml-network-bridged.xml | 38 ++++
.../xlxml2xml-network-driver-domain.xml | 38 ++++
tests/xlxml2xmldata/xlxml2xml-network-routed.xml | 39 +++++
tests/xlxml2xmldata/xlxml2xml-pv.xml | 38 ++++
tests/xlxml2xmltest.c | 189 ++++++++++++++++++++
18 files changed, 824 insertions(+), 46 deletions(-)
create mode 100644 tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-hvm.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-bridged.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-driver-domain.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-routed.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-pv.xml
create mode 100644 tests/xlxml2xmltest.c
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 01/10] libxl: update dom->id in libxlDomainCreateWithFlags
Date: Thu, 5 Feb 2015 06:17:07 +0100
Message-Id: <1423113436-18213-2-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Otherwise domainCreateWithFlags via remote returns -1 as domid.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index c95b387..ce3a99b 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2375,6 +2375,9 @@ libxlDomainCreateWithFlags(virDomainPtr dom,
}
ret = libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_START_PAUSED) != 0, -1);
+ if (ret < 0)
+ goto cleanup;
+ dom->id = vm->def->id;
cleanup:
if (vm)
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 02/10] conf: support backend domain name in disk and network devices
Date: Thu, 5 Feb 2015 06:17:08 +0100
Message-Id: <1423113436-18213-3-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
At least Xen supports backend drivers in another domain (aka "driver
domain"). This patch introduces XML config option for such setting as
'domain' attribute of 'source' element. Verification its content is left
for the driver.
In the future same option will be needed for USB devices (hostdev
objects), but for now libxl doesn't have support for PVUSB.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
Changes in v2:
- describe in docs/formatdomain.html.in
- enforce empty domain tag (only 'name' attribute allowed)
Changes in v3:
- change <domain name='xx'/> element to domain='' attribute of source
element - this is more logical place
- grammar of docs
docs/formatdomain.html.in | 29 +++++++++++++++++++++++++++--
docs/schemas/domaincommon.rng | 20 ++++++++++++++++++++
src/conf/domain_conf.c | 33 +++++++++++++++++++++++++++++----
src/conf/domain_conf.h | 1 +
src/util/virstoragefile.c | 4 +++-
src/util/virstoragefile.h | 1 +
6 files changed, 81 insertions(+), 7 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c5ad6f4..38c42d5 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1907,13 +1907,17 @@
<span class="since">since 0.0.3</span></dt>
<dd>
The <code>file</code> attribute specifies the fully-qualified
- path to the file holding the disk.
+ path to the file holding the disk. The optional
+ <code>domain</code> attribute allows specifying a backend domain
+ (aka driver domain) where the file is stored.
</dd>
<dt><code>type='block'</code>
<span class="since">since 0.0.3</span></dt>
<dd>
The <code>dev</code> attribute specifies the path to the
- host device to serve as the disk.
+ host device to serve as the disk. The optional
+ <code>domain</code> attribute allows specifying a backend domain
+ (aka driver domain) for the device.
</dd>
<dt><code>type='dir'</code>
<span class="since">since 0.7.5</span></dt>
@@ -4336,6 +4340,27 @@ qemu-kvm -net nic,model=? /dev/null
element is unspecified is to have the link state <code>up</code>.
<span class="since">Since 0.9.5</span>
</p>
+ <h5><a name="elementDomain">Setting up a network backend in a driver domain</a></h5>
+<pre>
+ ...
+ <devices>
+ ...
+ <interface type='bridge'>
+ <source bridge='br0' <b>domain='netvm'</b>/>
+ </interface>
+ ...
+ </devices>
+ ...</pre>
+
+ <p>
+ The optional <code>domain</code> attribute allows specifying a backend
+ domain (aka driver domain) for the device. Use the <code>name</code> attribute
+ to specify its name. You can use it to create a direct network link between
+ domains (so data will not go through host system). Use with type 'ethernet'
+ to create plain network link, or with 'bridge' to connect to some bridge
+ inside the driver domain.
+ <span class="since">Since 1.0.7 (Xen only)</span>
+ </p>
<h5><a name="ipconfig">IP configuration</a></h5>
<pre>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index d467dce..a4321f1 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1340,6 +1340,11 @@
<attribute name="file">
<ref name="absFilePath"/>
</attribute>
+ <optional>
+ <attribute name="domain">
+ <ref name="domainName"/>
+ </attribute>
+ </optional>
</optional>
<optional>
<ref name="storageStartupPolicy"/>
@@ -1365,6 +1370,11 @@
</attribute>
</optional>
<optional>
+ <attribute name="domain">
+ <ref name="domainName"/>
+ </attribute>
+ </optional>
+ <optional>
<ref name="storageStartupPolicy"/>
</optional>
<optional>
@@ -2040,6 +2050,11 @@
<attribute name="bridge">
<ref name="deviceName"/>
</attribute>
+ <optional>
+ <attribute name="domain">
+ <ref name="domainName"/>
+ </attribute>
+ </optional>
<empty/>
</element>
</optional>
@@ -2059,6 +2074,11 @@
<attribute name="dev">
<ref name="deviceName"/>
</attribute>
+ <optional>
+ <attribute name="domain">
+ <ref name="domainName"/>
+ </attribute>
+ </optional>
<empty/>
</element>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4251b13..17b699a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1442,6 +1442,7 @@ void virDomainNetDefFree(virDomainNetDefPtr def)
VIR_FREE(def->backend.vhost);
VIR_FREE(def->virtPortProfile);
VIR_FREE(def->script);
+ VIR_FREE(def->domain_name);
VIR_FREE(def->ifname);
VIR_FREE(def->ifname_guest);
VIR_FREE(def->ifname_guest_actual);
@@ -5520,9 +5521,11 @@ virDomainDiskSourceParse(xmlNodePtr node,
switch ((virStorageType)src->type) {
case VIR_STORAGE_TYPE_FILE:
src->path = virXMLPropString(node, "file");
+ src->domain_name = virXMLPropString(node, "domain");
break;
case VIR_STORAGE_TYPE_BLOCK:
src->path = virXMLPropString(node, "dev");
+ src->domain_name = virXMLPropString(node, "domain");
break;
case VIR_STORAGE_TYPE_DIR:
src->path = virXMLPropString(node, "dir");
@@ -7369,6 +7372,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
char *vhostuser_path = NULL;
char *vhostuser_type = NULL;
char *trustGuestRxFilters = NULL;
+ char *domain_name = NULL;
virNWFilterHashTablePtr filterparams = NULL;
virDomainActualNetDefPtr actual = NULL;
xmlNodePtr oldnode = ctxt->node;
@@ -7423,12 +7427,14 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
def->type == VIR_DOMAIN_NET_TYPE_BRIDGE &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
bridge = virXMLPropString(cur, "bridge");
+ domain_name = virXMLPropString(cur, "domain");
} else if (!dev &&
(def->type == VIR_DOMAIN_NET_TYPE_ETHERNET ||
def->type == VIR_DOMAIN_NET_TYPE_DIRECT) &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
dev = virXMLPropString(cur, "dev");
mode = virXMLPropString(cur, "mode");
+ domain_name = virXMLPropString(cur, "domain");
} else if (!vhostuser_path && !vhostuser_mode && !vhostuser_type
&& def->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
@@ -7802,6 +7808,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
def->script = script;
script = NULL;
}
+ if (domain_name != NULL) {
+ def->domain_name = domain_name;
+ domain_name = NULL;
+ }
if (ifname != NULL) {
def->ifname = ifname;
ifname = NULL;
@@ -8061,6 +8071,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
VIR_FREE(addrtype);
VIR_FREE(trustGuestRxFilters);
VIR_FREE(ips);
+ VIR_FREE(domain_name);
virNWFilterHashTableFree(filterparams);
return def;
@@ -16544,6 +16555,7 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
virBufferAddLit(buf, "<source");
virBufferEscapeString(buf, " file='%s'", src->path);
virBufferEscapeString(buf, " startupPolicy='%s'", startupPolicy);
+ virBufferEscapeString(buf, " domain='%s'", src->domain_name);
virDomainDiskSourceDefFormatSeclabel(buf, src->nseclabels,
src->seclabels, flags,
@@ -16554,6 +16566,7 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
virBufferAddLit(buf, "<source");
virBufferEscapeString(buf, " dev='%s'", src->path);
virBufferEscapeString(buf, " startupPolicy='%s'", startupPolicy);
+ virBufferEscapeString(buf, " domain='%s'", src->domain_name);
virDomainDiskSourceDefFormatSeclabel(buf, src->nseclabels,
src->seclabels, flags,
@@ -17713,8 +17726,14 @@ virDomainNetDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_NET_TYPE_ETHERNET:
- virBufferEscapeString(buf, "<source dev='%s'/>\n",
- def->data.ethernet.dev);
+ if (def->data.ethernet.dev || def->domain_name) {
+ virBufferAddLit(buf, "<source");
+ virBufferEscapeString(buf, " dev='%s'",
+ def->data.ethernet.dev);
+ virBufferEscapeString(buf, " domain='%s'",
+ def->domain_name);
+ virBufferAddLit(buf, "/>\n");
+ }
break;
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
@@ -17730,8 +17749,14 @@ virDomainNetDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_NET_TYPE_BRIDGE:
- virBufferEscapeString(buf, "<source bridge='%s'/>\n",
- def->data.bridge.brname);
+ if (def->data.bridge.brname || def->domain_name) {
+ virBufferAddLit(buf, "<source");
+ virBufferEscapeString(buf, " bridge='%s'",
+ def->data.bridge.brname);
+ virBufferEscapeString(buf, " domain='%s'",
+ def->domain_name);
+ virBufferAddLit(buf, "/>\n");
+ }
break;
case VIR_DOMAIN_NET_TYPE_SERVER:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 93f2314..28c6920 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -995,6 +995,7 @@ struct _virDomainNetDef {
unsigned long sndbuf;
} tune;
char *script;
+ char *domain_name; /* backend domain name */
char *ifname;
char *ifname_guest;
char *ifname_guest_actual;
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 8d3d1f5..c2703b7 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1835,7 +1835,8 @@ virStorageSourceCopy(const virStorageSource *src,
VIR_STRDUP(ret->backingStoreRaw, src->backingStoreRaw) < 0 ||
VIR_STRDUP(ret->snapshot, src->snapshot) < 0 ||
VIR_STRDUP(ret->configFile, src->configFile) < 0 ||
- VIR_STRDUP(ret->compat, src->compat) < 0)
+ VIR_STRDUP(ret->compat, src->compat) < 0 ||
+ VIR_STRDUP(ret->domain_name, src->domain_name))
goto error;
if (src->nhosts) {
@@ -2023,6 +2024,7 @@ virStorageSourceClear(virStorageSourcePtr def)
VIR_FREE(def->path);
VIR_FREE(def->volume);
+ VIR_FREE(def->domain_name);
virStorageSourcePoolDefFree(def->srcpool);
VIR_FREE(def->driverName);
virBitmapFree(def->features);
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index b4c3808..a3c7e1e 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -241,6 +241,7 @@ struct _virStorageSource {
char *snapshot; /* for storage systems supporting internal snapshots */
char *configFile; /* some storage systems use config file as part of
the source definition */
+ char *domain_name; /* name of domain holding backing storage file/dev */
size_t nhosts;
virStorageNetHostDefPtr hosts;
virStorageSourcePoolDefPtr srcpool;
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 03/10] libxl: support backend domain setting for disk and net devices
Date: Thu, 5 Feb 2015 06:17:09 +0100
Message-Id: <1423113436-18213-4-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
This implement handling of <source domain=''/> parameter introduced in
previous patch.
Lookup on domain name (to get domain ID) requires libxlDriverPrivate
object, so it must be passed down to libxlMakeDisk and libxlMakeNet from
top level callers.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
Changes in v2:
- rebase on 1.0.6+
- fix indentation
- make libxl_name_to_domid switch more defensive
Changes in v3:
- rebase on 1.2.12+
- leave name->XID resolution to libxl itself, which greatly simplify
the code (but requires Xen at least 4.3)
src/libxl/libxl_conf.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0555b91..1811a83 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -971,6 +971,18 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
return -1;
}
+ if (l_disk->src->domain_name) {
+#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ if (VIR_STRDUP(x_disk->backend_domname, l_disk->src->domain_name) < 0)
+ return -1;
+#else
+ virReportError(VIR_ERR_XML_DETAIL, "%s",
+ _("this version of libxenlight does not "
+ "support backend domain name"));
+ return -1;
+#endif
+ }
+
return 0;
}
@@ -1098,6 +1110,18 @@ libxlMakeNic(virDomainDefPtr def,
return -1;
}
+ if (l_nic->domain_name) {
+#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ if (VIR_STRDUP(x_nic->backend_domname, l_nic->domain_name) < 0)
+ return -1;
+#else
+ virReportError(VIR_ERR_XML_DETAIL, "%s",
+ _("this version of libxenlight does not "
+ "support backend domain name"));
+ return -1;
+#endif
+ }
+
return 0;
}
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 04/10] libxl: fill HVM SDL and VNC settings based on <graphics/> entries
Date: Thu, 5 Feb 2015 06:17:10 +0100
Message-Id: <1423113436-18213-5-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Vfb entries in domain config are used only by PV drivers. Qemu
parameters are build based on b_info struct. So fill it with the same
data as vfb entries (actually the first one).
This will additionally allow graphic-less domain, when no <graphics/>
entries are present in domain XML (previously VNC was always enabled).
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_conf.c | 100 ++++++++++++++++++++++++++++++++++++-------------
1 file changed, 74 insertions(+), 26 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1811a83..c9f8ad5 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -618,12 +618,53 @@ libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
_("unsupported chardev '%s'"), type);
return -1;
}
+ return 0;
+}
+
+static int
+libxlMakeVNCInfo(virPortAllocatorPtr graphicsports,
+ virDomainGraphicsDefPtr l_vfb,
+ libxl_vnc_info *x_vnc)
+{
+ unsigned short port;
+ const char *listenAddr;
+
+ libxl_defbool_set(&x_vnc->enable, 1);
+ /* driver handles selection of free port */
+ libxl_defbool_set(&x_vnc->findunused, 0);
+ if (l_vfb->data.vnc.autoport) {
+
+ if (virPortAllocatorAcquire(graphicsports, &port) < 0)
+ return -1;
+ l_vfb->data.vnc.port = port;
+ }
+ x_vnc->display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
+ listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
+ if (listenAddr) {
+ /* libxl_device_vfb_init() does VIR_STRDUP("127.0.0.1") */
+ VIR_FREE(x_vnc->listen);
+ if (VIR_STRDUP(x_vnc->listen, listenAddr) < 0)
+ return -1;
+ }
+ return 0;
+}
+
+static int
+libxlMakeSDLInfo(virDomainGraphicsDefPtr l_vfb,
+ libxl_sdl_info *x_sdl)
+{
+ libxl_defbool_set(&x_sdl->enable, 1);
+ if (VIR_STRDUP(x_sdl->display, l_vfb->data.sdl.display) < 0)
+ return -1;
+ if (VIR_STRDUP(x_sdl->xauthority, l_vfb->data.sdl.xauth) < 0)
+ return -1;
return 0;
}
static int
libxlMakeDomBuildInfo(virDomainDefPtr def,
+ virPortAllocatorPtr graphicsports,
libxl_ctx *ctx,
libxl_domain_config *d_config)
{
@@ -745,6 +786,35 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
return -1;
}
+ /* Disable VNC and SDL until explicitly enabled */
+ libxl_defbool_set(&b_info->u.hvm.vnc.enable, 0);
+ libxl_defbool_set(&b_info->u.hvm.sdl.enable, 0);
+
+ for (i = 0; i < def->ngraphics; i++) {
+ switch (def->graphics[i]->type) {
+ case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
+ if (libxl_defbool_val(b_info->u.hvm.vnc.enable))
+ continue;
+ if (libxlMakeVNCInfo(graphicsports,
+ def->graphics[i],
+ &b_info->u.hvm.vnc) < 0)
+ return -1;
+ if (def->graphics[i]->data.vnc.keymap &&
+ VIR_STRDUP(b_info->u.hvm.keymap,
+ def->graphics[i]->data.vnc.keymap) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+ break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
+ if (libxl_defbool_val(b_info->u.hvm.sdl.enable))
+ continue;
+ if (libxlMakeSDLInfo(def->graphics[i], &b_info->u.hvm.sdl) < 0)
+ return -1;
+ break;
+ }
+ }
+
/*
* The following comment and calculation were taken directly from
* libxenlight's internal function libxl_get_required_shadow_memory():
@@ -1171,38 +1241,16 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
virDomainGraphicsDefPtr l_vfb,
libxl_device_vfb *x_vfb)
{
- unsigned short port;
- const char *listenAddr;
-
libxl_device_vfb_init(x_vfb);
switch (l_vfb->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
- libxl_defbool_set(&x_vfb->sdl.enable, 1);
- if (VIR_STRDUP(x_vfb->sdl.display, l_vfb->data.sdl.display) < 0)
- return -1;
- if (VIR_STRDUP(x_vfb->sdl.xauthority, l_vfb->data.sdl.xauth) < 0)
+ if (libxlMakeSDLInfo(l_vfb, &x_vfb->sdl) < 0)
return -1;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
- libxl_defbool_set(&x_vfb->vnc.enable, 1);
- /* driver handles selection of free port */
- libxl_defbool_set(&x_vfb->vnc.findunused, 0);
- if (l_vfb->data.vnc.autoport) {
-
- if (virPortAllocatorAcquire(graphicsports, &port) < 0)
- return -1;
- l_vfb->data.vnc.port = port;
- }
- x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
-
- listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
- if (listenAddr) {
- /* libxl_device_vfb_init() does VIR_STRDUP("127.0.0.1") */
- VIR_FREE(x_vfb->vnc.listen);
- if (VIR_STRDUP(x_vfb->vnc.listen, listenAddr) < 0)
- return -1;
- }
+ if (libxlMakeVNCInfo(graphicsports, l_vfb, &x_vfb->vnc) < 0)
+ return -1;
if (VIR_STRDUP(x_vfb->keymap, l_vfb->data.vnc.keymap) < 0)
return -1;
break;
@@ -1611,7 +1659,7 @@ libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
if (libxlMakeDomCreateInfo(ctx, def, &d_config->c_info) < 0)
return -1;
- if (libxlMakeDomBuildInfo(def, ctx, d_config) < 0)
+ if (libxlMakeDomBuildInfo(def, graphicsports, ctx, d_config) < 0)
return -1;
if (libxlMakeDiskList(def, d_config) < 0)
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 05/10] libxl: pass ipaddr to libxl toolstack
Date: Thu, 5 Feb 2015 06:17:11 +0100
Message-Id: <1423113436-18213-6-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Do not silently ignore its value. LibXL support only one address, so
refuse multiple IPs.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_conf.c | 5 +++++
src/libxl/libxl_domain.c | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index c9f8ad5..4730585 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1133,6 +1133,11 @@ libxlMakeNic(virDomainDefPtr def,
case VIR_DOMAIN_NET_TYPE_ETHERNET:
if (VIR_STRDUP(x_nic->script, l_nic->script) < 0)
return -1;
+ if (l_nic->nips > 0) {
+ x_nic->ip = virSocketAddrFormat(&l_nic->ips[0]->address);
+ if (!x_nic->ip)
+ return -1;
+ }
break;
case VIR_DOMAIN_NET_TYPE_NETWORK:
{
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 856cfb4..afb0b15 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -482,6 +482,17 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
STRNEQ(def->os.type, "hvm"))
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+ if (dev->type == VIR_DOMAIN_DEVICE_NET &&
+ (dev->data.net->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+ dev->data.net->type == VIR_DOMAIN_NET_TYPE_ETHERNET)) {
+ if (dev->data.net->nips > 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("multiple IP addresses not supported on device type %s"),
+ virDomainNetTypeToString(dev->data.net->type));
+ return -1;
+ }
+ }
+
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV ||
(dev->type == VIR_DOMAIN_DEVICE_NET &&
dev->data.net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)) {
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 06/10] libxl: add tablet/mouse input device support
Date: Thu, 5 Feb 2015 06:17:12 +0100
Message-Id: <1423113436-18213-7-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
Changes in v2:
- rebase on 1.2.12+
- multiple devices support
src/libxl/libxl_conf.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 4730585..b1131ea 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -815,6 +815,54 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
}
}
+ if (def->ninputs) {
+#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ if (VIR_ALLOC_N(b_info->u.hvm.usbdevice_list, def->ninputs+1) < 0)
+ return -1;
+#else
+ if (def->ninputs > 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("libxenlight supports only one input device"));
+ return -1;
+ }
+#endif
+ for (i = 0; i < def->ninputs; i++) {
+ if (def->inputs[i]->bus != VIR_DOMAIN_INPUT_BUS_USB) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("libxenlight supports only USB input"));
+ return -1;
+ }
+ }
+ for (i = 0; i < def->ninputs; i++) {
+ switch (def->inputs[i]->type) {
+ case VIR_DOMAIN_INPUT_TYPE_MOUSE:
+#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ if (VIR_STRDUP(b_info->u.hvm.usbdevice_list[i], "mouse") < 0)
+ return -1;
+#else
+ VIR_FREE(b_info->u.hvm.usbdevice);
+ if (VIR_STRDUP(b_info->u.hvm.usbdevice, "mouse") < 0)
+ return -1;
+#endif
+ break;
+ case VIR_DOMAIN_INPUT_TYPE_TABLET:
+#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ if (VIR_STRDUP(b_info->u.hvm.usbdevice_list[i], "tablet") < 0)
+ return -1;
+#else
+ VIR_FREE(b_info->u.hvm.usbdevice);
+ if (VIR_STRDUP(b_info->u.hvm.usbdevice, "tablet") < 0)
+ return -1;
+#endif
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Unknown input device type"));
+ return -1;
+ }
+ }
+ }
+
/*
* The following comment and calculation were taken directly from
* libxenlight's internal function libxl_get_required_shadow_memory():
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 07/10] libxl: prevent attaching multiple netdevs with the same MAC
Date: Thu, 5 Feb 2015 06:17:13 +0100
Message-Id: <1423113436-18213-8-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
It will not be possible to detach such device later. Also improve
logging in such cases.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_driver.c | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ce3a99b..005cc96 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2787,6 +2787,7 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver,
int actualType;
libxl_device_nic nic;
int ret = -1;
+ char mac[VIR_MAC_STRING_BUFLEN];
/* preallocate new slot for device */
if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets + 1) < 0)
@@ -2801,6 +2802,14 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver,
actualType = virDomainNetGetActualType(net);
+ /* -2 means "multiple matches" so then fail also */
+ if (virDomainNetFindIdx(vm->def, net) != -1) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("device matching mac address %s already exists"),
+ virMacAddrFormat(&net->mac, mac));
+ return -1;
+ }
+
if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
/* This is really a "smart hostdev", so it should be attached
* as a hostdev (the hostdev code will reach over into the
@@ -2879,6 +2888,7 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
virDomainHostdevDefPtr hostdev;
virDomainHostdevDefPtr found;
virDomainHostdevSubsysPCIPtr pcisrc;
+ char mac[VIR_MAC_STRING_BUFLEN];
switch (dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
@@ -2896,6 +2906,12 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
+ if (virDomainNetFindIdx(vmdef, net) >= 0) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("network device with mac %s already exists."),
+ virMacAddrFormat(&net->mac, mac));
+ return -1;
+ }
if (virDomainNetInsert(vmdef, net))
return -1;
dev->data.net = NULL;
@@ -3060,8 +3076,18 @@ libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver,
char mac[VIR_MAC_STRING_BUFLEN];
int ret = -1;
- if ((detachidx = virDomainNetFindIdx(vm->def, net)) < 0)
+ if ((detachidx = virDomainNetFindIdx(vm->def, net)) < 0) {
+ if (detachidx == -2) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("multiple devices matching mac address %s found"),
+ virMacAddrFormat(&net->mac, mac));
+ } else {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("network device %s not found"),
+ virMacAddrFormat(&net->mac, mac));
+ }
return -1;
+ }
detach = vm->def->nets[detachidx];
@@ -3136,6 +3162,7 @@ libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
virDomainHostdevDefPtr hostdev, det_hostdev;
virDomainNetDefPtr net;
int idx;
+ char mac[VIR_MAC_STRING_BUFLEN];
switch (dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
@@ -3150,8 +3177,18 @@ libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((idx = virDomainNetFindIdx(vmdef, net)) < 0) {
+ if (idx == -2) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("multiple devices matching mac address %s found"),
+ virMacAddrFormat(&dev->data.net->mac, mac));
+ } else {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("network device %s not found"),
+ virMacAddrFormat(&dev->data.net->mac, mac));
+ }
return -1;
+ }
/* this is guaranteed to succeed */
virDomainNetDefFree(virDomainNetRemove(vmdef, idx));
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 08/10] libxl: support domain config modification in virDomainRestoreFlags
Date: Thu, 5 Feb 2015 06:17:14 +0100
Message-Id: <1423113436-18213-9-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
There was a discussion about calling virDomainDefCheckABIStability. The use
case I have for this is to start multiple domains from the same savefile. This
require changing:
- UUID
- name
- IP address
Those are exactly type of changes blocked by virDomainDefCheckABIStability.
Perhaps some "permissive" mode should be introduced to the
virDomainDefCheckABIStability function?
src/libxl/libxl_driver.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 005cc96..7539d33 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1456,11 +1456,6 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
#endif
virCheckFlags(VIR_DOMAIN_SAVE_PAUSED, -1);
- if (dxml) {
- virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("xml modification unsupported"));
- return -1;
- }
fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr);
if (fd < 0)
@@ -1469,6 +1464,18 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
goto cleanup_unlock;
+ if (dxml) {
+ virDomainDefPtr def2 = NULL;
+
+ if (!(def2 = virDomainDefParseString(dxml, cfg->caps, driver->xmlopt,
+ 1 << VIR_DOMAIN_VIRT_XEN,
+ VIR_DOMAIN_XML_INACTIVE))) {
+ goto cleanup;
+ }
+ virDomainDefFree(def);
+ def = def2;
+ }
+
if (!(vm = virDomainObjListAdd(driver->domains, def,
driver->xmlopt,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 09/10] libxl: Stubdom emulator type
Date: Thu, 5 Feb 2015 06:17:15 +0100
Message-Id: <1423113436-18213-10-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Xen have feature of having device model in separate domain (called stub
domain). Add a 'type' attribute to 'emulator' element to allow selecting
such a configuration. Emulator path is still used for qemu running in dom0 (if
any). Libxl currently do not allow to select stubdomain path.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
I think it would be good idea to introduce the same change to capabilities XML.
The problem is I can't include domain_conf.h from capabilities.h, so probably
that enum declaration needs to be moved to capabilities.h. Is it the right way?
Or it should be done somehow different?
docs/formatdomain.html.in | 14 ++++++++++++++
docs/schemas/domaincommon.rng | 23 ++++++++++++++++++++++-
src/conf/domain_conf.c | 36 ++++++++++++++++++++++++++++++++++--
src/conf/domain_conf.h | 9 +++++++++
src/libxl/libxl_conf.c | 17 +++++++++++++++++
5 files changed, 96 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 38c42d5..4f539e2 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1652,6 +1652,20 @@
The <a href="formatcaps.html">capabilities XML</a> specifies
the recommended default emulator to use for each particular
domain type / architecture combination.
+
+ <span class="since">Since 1.2.13</span>, the <code>emulator</code>
+ element may contain <code>type</code> attribute. Possible values are:
+ <dl>
+ <dt><code>type='default'</code></dt>
+ <dd>Equivalent to not setting <code>type</code> attribute at all.
+ </dd>
+
+ <dt><code>type='stubdom'</code></dt>
+ <dd>Launch emulator in stub domain (Xen only). The emulator path
+ still indicate which binary is used in dom0 - there is no control
+ which binary is used as a stub domain.
+ </dd>
+ </dl>
</dd>
</dl>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index a4321f1..2a12073 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2519,7 +2519,28 @@
-->
<define name="emulator">
<element name="emulator">
- <ref name="absFilePath"/>
+ <choice>
+ <group>
+ <optional>
+ <attribute name="type">
+ <choice>
+ <value>qemu</value>
+ <value>stubdom</value>
+ </choice>
+ </attribute>
+ </optional>
+ <ref name="absFilePath"/>
+ </group>
+ <group>
+ <attribute name="type">
+ <choice>
+ <value>qemu</value>
+ <value>stubdom</value>
+ </choice>
+ </attribute>
+ <empty/>
+ </group>
+ </choice>
</element>
</define>
<!--
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 17b699a..c268091 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -741,6 +741,10 @@ VIR_ENUM_IMPL(virDomainDiskTray, VIR_DOMAIN_DISK_TRAY_LAST,
"closed",
"open");
+VIR_ENUM_IMPL(virDomainEmulatorType, VIR_DOMAIN_EMULATOR_TYPE_LAST,
+ "qemu",
+ "stubdom");
+
VIR_ENUM_IMPL(virDomainRNGModel,
VIR_DOMAIN_RNG_MODEL_LAST,
"virtio");
@@ -13712,6 +13716,14 @@ virDomainDefParseXML(xmlDocPtr xml,
}
def->emulator = virXPathString("string(./devices/emulator[1])", ctxt);
+ if ((tmp = virXPathString("string(./devices/emulator/@type)", ctxt))) {
+ def->emulator_type = virDomainEmulatorTypeTypeFromString(tmp);
+ VIR_FREE(tmp);
+ if (def->emulator_type < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unknown emulator type '%s'"), tmp);
+ }
+ }
/* analysis of the disk devices */
if ((n = virXPathNodeSet("./devices/disk", ctxt, &nodes)) < 0)
@@ -15690,6 +15702,14 @@ virDomainDefCheckABIStability(virDomainDefPtr src,
goto error;
}
+ if (src->emulator_type != dst->emulator_type) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain emulator type %s does not match source %s"),
+ virDomainEmulatorTypeTypeToString(dst->emulator_type),
+ virDomainEmulatorTypeTypeToString(src->emulator_type));
+ goto error;
+ }
+
if (!virDomainDefFeaturesCheckABIStability(src, dst))
goto error;
@@ -19893,8 +19913,20 @@ virDomainDefFormatInternal(virDomainDefPtr def,
virBufferAddLit(buf, "<devices>\n");
virBufferAdjustIndent(buf, 2);
- virBufferEscapeString(buf, "<emulator>%s</emulator>\n",
- def->emulator);
+ if (def->emulator ||
+ def->emulator_type != VIR_DOMAIN_EMULATOR_TYPE_DEFAULT) {
+ virBufferAddLit(buf, "<emulator");
+ if (def->emulator_type != VIR_DOMAIN_EMULATOR_TYPE_DEFAULT) {
+ virBufferAsprintf(buf, " type='%s'",
+ virDomainEmulatorTypeTypeToString(def->emulator_type));
+ }
+ if (!def->emulator) {
+ virBufferAddLit(buf, "/>\n");
+ } else {
+ virBufferEscapeString(buf, ">%s</emulator>\n",
+ def->emulator);
+ }
+ }
for (n = 0; n < def->ndisks; n++)
if (virDomainDiskDefFormat(buf, def->disks[n], flags) < 0)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 28c6920..38b9037 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1918,6 +1918,13 @@ struct _virBlkioDevice {
};
typedef enum {
+ VIR_DOMAIN_EMULATOR_TYPE_DEFAULT,
+ VIR_DOMAIN_EMULATOR_TYPE_STUBDOM,
+
+ VIR_DOMAIN_EMULATOR_TYPE_LAST
+} virDomainEmulatorType;
+
+typedef enum {
VIR_DOMAIN_RNG_MODEL_VIRTIO,
VIR_DOMAIN_RNG_MODEL_LAST
@@ -2083,6 +2090,7 @@ struct _virDomainDef {
virDomainOSDef os;
char *emulator;
+ virDomainEmulatorType emulator_type;
/* These three options are of type virTristateSwitch,
* except VIR_DOMAIN_FEATURE_CAPABILITIES that is of type
* virDomainCapabilitiesPolicy */
@@ -2841,6 +2849,7 @@ VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode)
VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy)
VIR_ENUM_DECL(virDomainHyperv)
VIR_ENUM_DECL(virDomainKVM)
+VIR_ENUM_DECL(virDomainEmulatorType)
VIR_ENUM_DECL(virDomainRNGModel)
VIR_ENUM_DECL(virDomainRNGBackend)
VIR_ENUM_DECL(virDomainTPMModel)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index b1131ea..a84ce09 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -768,6 +768,23 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
b_info->device_model_version = libxlDomainGetEmulatorType(def);
}
+ /* In case of stubdom there will be two qemu instances:
+ * - in stubdom (libxl uses hardcoded path for this one),
+ * - in dom0 as a backend for stubdom (if needed).
+ * Emulator path control only the second one. It makes a perfect sense
+ * to use <emulator type='stubdom'/> (yes, without emulator path).
+ */
+ if (def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM)
+ libxl_defbool_set(&b_info->device_model_stubdomain, 1);
+
+ if (def->os.cmdline && def->os.cmdline[0]) {
+ b_info->extra_hvm = virStringSplit(def->os.cmdline, " ", 0);
+ if (b_info->extra_hvm == NULL) {
+ virReportOOMError();
+ return -1;
+ }
+ }
+
if (def->nserials) {
if (def->nserials > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
--
1.8.3.1
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvirt-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 10/10] tests: add some simple libxl XML->XML tests
Date: Thu, 5 Feb 2015 06:17:16 +0100
Message-Id: <1423113436-18213-11-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1423113436-18213-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Handle features supported only on xen: driver domains, qemu in
stubdomain.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
tests/Makefile.am | 9 +-
tests/domainschematest | 2 +-
tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml | 41 +++++
tests/xlxml2xmldata/xlxml2xml-hvm.xml | 40 +++++
tests/xlxml2xmldata/xlxml2xml-network-bridged.xml | 38 +++++
.../xlxml2xml-network-driver-domain.xml | 38 +++++
tests/xlxml2xmldata/xlxml2xml-network-routed.xml | 39 +++++
tests/xlxml2xmldata/xlxml2xml-pv.xml | 38 +++++
tests/xlxml2xmltest.c | 189 +++++++++++++++++++++
9 files changed, 431 insertions(+), 3 deletions(-)
create mode 100644 tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-hvm.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-bridged.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-driver-domain.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-network-routed.xml
create mode 100644 tests/xlxml2xmldata/xlxml2xml-pv.xml
create mode 100644 tests/xlxml2xmltest.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 938270c..48648b9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -85,6 +85,7 @@ EXTRA_DIST = \
domainsnapshotxml2xmlout \
fchostdata \
interfaceschemadata \
+ xlxml2xmldata \
lxcconf2xmldata \
lxcxml2xmldata \
lxcxml2xmloutdata \
@@ -230,7 +231,7 @@ test_programs += xml2sexprtest sexpr2xmltest \
endif WITH_XEN
if WITH_LIBXL
-test_programs += xlconfigtest
+test_programs += xlconfigtest xlxml2xmltest
endif WITH_LIBXL
if WITH_QEMU
@@ -515,8 +516,12 @@ xlconfigtest_SOURCES = \
xlconfigtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
+xlxml2xmltest_SOURCES = \
+ xlxml2xmltest.c testutilsxen.c testutilsxen.h \
+ testutils.c testutils.h
+xlxml2xmltest_LDADD =$(libxl_LDADDS)
else ! WITH_LIBXL
-EXTRA_DIST += xlconfigtest.c
+EXTRA_DIST += xlconfigtest.c xlxml2xmltest.c
endif ! WITH_LIBXL
QEMUMONITORTESTUTILS_SOURCES = \
diff --git a/tests/domainschematest b/tests/domainschematest
index ba90180..18b442b 100755
--- a/tests/domainschematest
+++ b/tests/domainschematest
@@ -8,7 +8,7 @@ DIRS=""
DIRS="$DIRS domainschemadata qemuxml2argvdata sexpr2xmldata"
DIRS="$DIRS xmconfigdata xml2sexprdata qemuxml2xmloutdata"
DIRS="$DIRS lxcxml2xmldata lxcxml2xmloutdata"
-DIRS="$DIRS bhyvexml2argvdata"
+DIRS="$DIRS bhyvexml2argvdata xlxml2xmldata"
SCHEMA="domain.rng"
check_schema "$DIRS" "$SCHEMA"
diff --git a/tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml b/tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml
new file mode 100644
index 0000000..ed6440c
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-hvm-stubdom.xml
@@ -0,0 +1,41 @@
+<domain type='xen'>
+ <name>testhvm</name>
+ <uuid>a3d3fa04-dc23-4136-9eab-b579d2930817</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenfv'>hvm</type>
+ <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ <viridian/>
+ </features>
+ <clock offset='variable' adjustment='0' basis='localtime'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator type='stubdom'>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testhvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testhvm/private.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='network'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <source network='default'/>
+ </interface>
+ <input type='tablet' bus='usb'/>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmldata/xlxml2xml-hvm.xml b/tests/xlxml2xmldata/xlxml2xml-hvm.xml
new file mode 100644
index 0000000..95d9b84
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-hvm.xml
@@ -0,0 +1,40 @@
+<domain type='xen'>
+ <name>testhvm</name>
+ <uuid>a3d3fa04-dc23-4136-9eab-b579d2930817</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenfv'>hvm</type>
+ <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ <viridian/>
+ </features>
+ <clock offset='variable' adjustment='0' basis='localtime'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testhvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testhvm/private.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='network'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <source network='default'/>
+ </interface>
+ <input type='tablet' bus='usb'/>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmldata/xlxml2xml-network-bridged.xml b/tests/xlxml2xmldata/xlxml2xml-network-bridged.xml
new file mode 100644
index 0000000..a6b8f59
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-network-bridged.xml
@@ -0,0 +1,38 @@
+<domain type='xen'>
+ <name>testvm</name>
+ <uuid>900e3685-4998-41ad-a2c9-e496a5ed40a4</uuid>
+ <memory unit='KiB'>4096000</memory>
+ <currentMemory unit='KiB'>409600</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <kernel>/boot/vmlinuz-3.12.37-1</kernel>
+ <initrd>/boot/initramfs-3.12.37-1.img</initrd>
+ <cmdline>root=/dev/xvda ro nomodeset console=hvc0 rd_NO_PLYMOUTH 3</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'>
+ <timer name='tsc' mode='native'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='file'/>
+ <source dev='/var/lib/libvirt/images/testvm/home.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <source bridge='xenbr0'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmldata/xlxml2xml-network-driver-domain.xml b/tests/xlxml2xmldata/xlxml2xml-network-driver-domain.xml
new file mode 100644
index 0000000..31c0437
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-network-driver-domain.xml
@@ -0,0 +1,38 @@
+<domain type='xen'>
+ <name>testvm</name>
+ <uuid>900e3685-4998-41ad-a2c9-e496a5ed40a4</uuid>
+ <memory unit='KiB'>4096000</memory>
+ <currentMemory unit='KiB'>409600</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <kernel>/boot/vmlinuz-3.12.37-1</kernel>
+ <initrd>/boot/initramfs-3.12.37-1.img</initrd>
+ <cmdline>root=/dev/xvda ro nomodeset console=hvc0 rd_NO_PLYMOUTH 3</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'>
+ <timer name='tsc' mode='native'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='file'/>
+ <source dev='/var/lib/libvirt/images/testvm/home.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <source bridge='xenbr0' domain='netvm'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmldata/xlxml2xml-network-routed.xml b/tests/xlxml2xmldata/xlxml2xml-network-routed.xml
new file mode 100644
index 0000000..fac9d8d
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-network-routed.xml
@@ -0,0 +1,39 @@
+<domain type='xen'>
+ <name>testvm</name>
+ <uuid>900e3685-4998-41ad-a2c9-e496a5ed40a4</uuid>
+ <memory unit='KiB'>4096000</memory>
+ <currentMemory unit='KiB'>409600</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <kernel>/boot/vmlinuz-3.12.37-1</kernel>
+ <initrd>/boot/initramfs-3.12.37-1.img</initrd>
+ <cmdline>root=/dev/xvda ro nomodeset console=hvc0 rd_NO_PLYMOUTH 3</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'>
+ <timer name='tsc' mode='native'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='file'/>
+ <source dev='/var/lib/libvirt/images/testvm/home.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='ethernet'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <ip address='192.168.0.1' family='ipv4'/>
+ <script path='vif-route'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmldata/xlxml2xml-pv.xml b/tests/xlxml2xmldata/xlxml2xml-pv.xml
new file mode 100644
index 0000000..b937b8b
--- /dev/null
+++ b/tests/xlxml2xmldata/xlxml2xml-pv.xml
@@ -0,0 +1,38 @@
+<domain type='xen'>
+ <name>testvm</name>
+ <uuid>900e3685-4998-41ad-a2c9-e496a5ed40a4</uuid>
+ <memory unit='KiB'>4096000</memory>
+ <currentMemory unit='KiB'>409600</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <kernel>/boot/vmlinuz-3.12.37-1</kernel>
+ <initrd>/boot/initramfs-3.12.37-1.img</initrd>
+ <cmdline>root=/dev/xvda ro nomodeset console=hvc0 rd_NO_PLYMOUTH 3</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'>
+ <timer name='tsc' mode='native'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/var/lib/libvirt/images/testvm/root.img'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='file'/>
+ <source dev='/var/lib/libvirt/images/testvm/home.img'/>
+ <target dev='xvdb' bus='xen'/>
+ </disk>
+ <interface type='network'>
+ <mac address='00:16:3e:5e:6c:09'/>
+ <source network='default'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/xlxml2xmltest.c b/tests/xlxml2xmltest.c
new file mode 100644
index 0000000..131e43b
--- /dev/null
+++ b/tests/xlxml2xmltest.c
@@ -0,0 +1,189 @@
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <fcntl.h>
+
+#include "testutils.h"
+
+#ifdef WITH_LIBXL
+
+# include "internal.h"
+# include "libxl/libxl_conf.h"
+# include "libxl/libxl_domain.h"
+# include "testutilsxen.h"
+# include "virstring.h"
+
+# define VIR_FROM_THIS VIR_FROM_NONE
+
+static virCapsPtr caps;
+static virDomainXMLOptionPtr xmlopt;
+
+static int
+testCompareXMLToXMLFiles(const char *inxml, const char *outxml, bool live)
+{
+ char *inXmlData = NULL;
+ char *outXmlData = NULL;
+ char *actual = NULL;
+ int ret = -1;
+ virDomainDefPtr def = NULL;
+ unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE;
+ unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
+ if (!live)
+ format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
+
+ if (virtTestLoadFile(inxml, &inXmlData) < 0)
+ goto fail;
+ if (virtTestLoadFile(outxml, &outXmlData) < 0)
+ goto fail;
+
+ if (!(def = virDomainDefParseString(inXmlData, caps, xmlopt,
+ 1 << VIR_DOMAIN_VIRT_XEN, parse_flags)))
+ goto fail;
+
+ if (!virDomainDefCheckABIStability(def, def)) {
+ fprintf(stderr, "ABI stability check failed on %s", inxml);
+ goto fail;
+ }
+
+ if (!(actual = virDomainDefFormat(def, format_flags)))
+ goto fail;
+
+ if (STRNEQ(outXmlData, actual)) {
+ virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
+ goto fail;
+ }
+
+ ret = 0;
+ fail:
+ VIR_FREE(inXmlData);
+ VIR_FREE(outXmlData);
+ VIR_FREE(actual);
+ virDomainDefFree(def);
+ return ret;
+}
+
+enum {
+ WHEN_INACTIVE = 1,
+ WHEN_ACTIVE = 2,
+ WHEN_EITHER = 3,
+};
+
+struct testInfo {
+ const char *name;
+ bool different;
+ int when;
+};
+
+static int
+testCompareXMLToXMLHelper(const void *data)
+{
+ const struct testInfo *info = data;
+ char *xml_in = NULL;
+ char *xml_out = NULL;
+ char *xml_out_active = NULL;
+ char *xml_out_inactive = NULL;
+ int ret = -1;
+
+ if (virAsprintf(&xml_in, "%s/xlxml2xmldata/xlxml2xml-%s.xml",
+ abs_srcdir, info->name) < 0 ||
+ virAsprintf(&xml_out, "%s/xlxml2xmldata/xlxml2xml-%s-out.xml",
+ abs_srcdir, info->name) < 0 ||
+ virAsprintf(&xml_out_active,
+ "%s/xlxml2xmldata/xlxml2xml-%s-active.xml",
+ abs_srcdir, info->name) < 0 ||
+ virAsprintf(&xml_out_inactive,
+ "%s/xlxml2xmldata/xlxml2xml-%s-inactive.xml",
+ abs_srcdir, info->name) < 0)
+ goto cleanup;
+
+ if ((info->when & WHEN_INACTIVE)) {
+ char *out;
+ if (!info->different)
+ out = xml_in;
+ else if (virFileExists(xml_out_inactive))
+ out = xml_out_inactive;
+ else
+ out = xml_out;
+
+ if (testCompareXMLToXMLFiles(xml_in, out, false) < 0)
+ goto cleanup;
+ }
+
+ if ((info->when & WHEN_ACTIVE)) {
+ char *out;
+ if (!info->different)
+ out = xml_in;
+ else if (virFileExists(xml_out_active))
+ out = xml_out_active;
+ else
+ out = xml_out;
+
+ if (testCompareXMLToXMLFiles(xml_in, out, true) < 0)
+ goto cleanup;
+ }
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(xml_in);
+ VIR_FREE(xml_out);
+ VIR_FREE(xml_out_active);
+ VIR_FREE(xml_out_inactive);
+ return ret;
+}
+
+
+static int
+mymain(void)
+{
+ int ret = 0;
+
+ if ((caps = testXLInitCaps()) == NULL)
+ return EXIT_FAILURE;
+
+ if (!(xmlopt = libxlCreateXMLConf()))
+ return EXIT_FAILURE;
+
+# define DO_TEST_FULL(name, is_different, when) \
+ do { \
+ const struct testInfo info = {name, is_different, when}; \
+ if (virtTestRun("LibXL XML-2-XML " name, \
+ testCompareXMLToXMLHelper, &info) < 0) \
+ ret = -1; \
+ } while (0)
+
+# define DO_TEST(name) \
+ DO_TEST_FULL(name, false, WHEN_EITHER)
+
+# define DO_TEST_DIFFERENT(name) \
+ DO_TEST_FULL(name, true, WHEN_EITHER)
+
+ DO_TEST("hvm");
+ DO_TEST("pv");
+ DO_TEST("hvm-stubdom");
+ DO_TEST("network-bridged");
+ DO_TEST("network-routed");
+ DO_TEST("network-driver-domain");
+
+ virObjectUnref(caps);
+ virObjectUnref(xmlopt);
+
+ return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+VIRT_TEST_MAIN(mymain)
+
+#else
+
+int
+main(void)
+{
+ return EXIT_AM_SKIP;
+}
+
+#endif /* WITH_LIBXL */
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH] domain_conf: Format <pvpanic/> without address correctly
by Michal Privoznik
We have something like pvpanic device. However, in some cases it does
not have any address assigned, in which case we produce this ugly XML
(still valid though):
<devices>
<emulator>/usr/bin/qemu</emulator>
...
<panic>
</panic>
</devices>
Lets format "<pvpanic/>" instead.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 20 ++++++++++-----
.../qemuxml2argv-panic-no-address.args | 5 ++++
.../qemuxml2argv-panic-no-address.xml | 29 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 +++
tests/qemuxml2xmltest.c | 1 +
5 files changed, 52 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6da02b0..a02d656 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18750,13 +18750,21 @@ virDomainWatchdogDefFormat(virBufferPtr buf,
static int virDomainPanicDefFormat(virBufferPtr buf,
virDomainPanicDefPtr def)
{
- virBufferAddLit(buf, "<panic>\n");
- virBufferAdjustIndent(buf, 2);
- if (virDomainDeviceInfoFormat(buf, &def->info, 0) < 0)
- return -1;
- virBufferAdjustIndent(buf, -2);
- virBufferAddLit(buf, "</panic>\n");
+ virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
+ int indent = virBufferGetIndent(buf, false);
+ virBufferAddLit(buf, "<panic");
+ virBufferAdjustIndent(&childrenBuf, indent + 2);
+ if (virDomainDeviceInfoFormat(&childrenBuf, &def->info, 0) < 0)
+ return -1;
+ if (virBufferUse(&childrenBuf)) {
+ virBufferAddLit(buf, ">\n");
+ virBufferAddBuffer(buf, &childrenBuf);
+ virBufferAddLit(buf, "</panic>\n");
+ } else {
+ virBufferAddLit(buf, "/>\n");
+ }
+ virBufferFreeAndReset(&childrenBuf);
return 0;
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args
new file mode 100644
index 0000000..3cbd688
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /dev/HostVG/QEMUGuest1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -device pvpanic
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.xml
new file mode 100644
index 0000000..79f8a1e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='fdc' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ <panic/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 00fd044..e2ad713 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1522,6 +1522,9 @@ mymain(void)
DO_TEST("panic", QEMU_CAPS_DEVICE_PANIC,
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("panic-no-address", QEMU_CAPS_DEVICE_PANIC,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+
DO_TEST("fips-enabled", QEMU_CAPS_ENABLE_FIPS);
DO_TEST("shmem", QEMU_CAPS_PCIDEVICE,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 58917c3..9e85d4e 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -400,6 +400,7 @@ mymain(void)
DO_TEST("pcihole64-q35");
DO_TEST("panic");
+ DO_TEST("panic-no-address");
DO_TEST_DIFFERENT("disk-backing-chains");
--
2.0.5
9 years, 8 months
[libvirt] [PATCHv2] spec: Enable RBD storage driver in RHEL-7
by Peter Krempa
Use correct package names too as they differ.
---
libvirt.spec.in | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 12bd17c..ce792e6 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -108,7 +108,7 @@
%define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}}
%define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}}
%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}}
-%if 0%{?fedora} >= 16
+%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7
%define with_storage_rbd 0%{!?_without_storage_rbd:%{server_drivers}}
%else
%define with_storage_rbd 0
@@ -182,6 +182,13 @@
%endif
%endif
+# librados and librbd are built only on x86_64 on rhel
+%ifnarch x86_64
+ %if 0%{?rhel} >= 7
+ %define with_storage_rbd 0
+ %endif
+%endif
+
# RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor,
# VMWare, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
# or HyperV.
@@ -566,7 +573,12 @@ BuildRequires: device-mapper-devel
%endif
%endif
%if %{with_storage_rbd}
+ %if 0%{?rhel} >= 7
+BuildRequires: librados2-devel
+BuildRequires: librbd1-devel
+ %else
BuildRequires: ceph-devel
+ %endif
%endif
%if %{with_storage_gluster}
%if 0%{?rhel} >= 6
--
2.2.2
9 years, 8 months
[libvirt] [PATCH] conf: Remove duplicate entries in <metadata> by namespace
by Peter Krempa
Since the APIs support just one element per namespace and while
modifying an element all duplicates would be removed, let's do this
right away in the post parse callback.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1190590
---
src/conf/domain_conf.c | 42 ++++++++++++++++++++++
.../qemuxml2argv-metadata-duplicate.xml | 34 ++++++++++++++++++
.../qemuxml2xmlout-metadata-duplicate.xml | 31 ++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
4 files changed, 108 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata-duplicate.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6da02b0..5467bef 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3148,6 +3148,45 @@ virDomainDefRejectDuplicateControllers(virDomainDefPtr def)
}
+/**
+ * virDomainDefRemoveDuplicateMetadata:
+ * @def: Remove duplicate metadata for this def
+ *
+ * This function removes metadata elements in @def that share the namespace.
+ * The first metadata entry of every duplicate namespace is kept.
+ */
+static void
+virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def)
+{
+ xmlNodePtr child;
+ xmlNodePtr next;
+
+ if (!def || !def->metadata)
+ return;
+
+ for (child = def->metadata->children; child; child = child->next) {
+ /* check that every other child of @root doesn't share the namespace of
+ * the current one and delete them possibly */
+ next = child->next;
+ while (next) {
+ xmlNodePtr dupl = NULL;
+
+ if (child->ns && next->ns &&
+ STREQ_NULLABLE((const char *) child->ns->href,
+ (const char *) next->ns->href))
+ dupl = next;
+
+ next = next->next;
+
+ if (dupl) {
+ xmlUnlinkNode(dupl);
+ xmlFreeNode(dupl);
+ }
+ }
+ }
+}
+
+
static int
virDomainDefPostParseInternal(virDomainDefPtr def,
virCapsPtr caps ATTRIBUTE_UNUSED)
@@ -3316,6 +3355,9 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
}
}
+ /* clean up possibly duplicated metadata entries */
+ virDomainDefRemoveDuplicateMetadata(def);
+
return 0;
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml b/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
new file mode 100644
index 0000000..13fb449
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static' cpuset='1-4,8-20,525'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+ <!-- intentional mis-indentation -->
+ <metadata>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app3:foo xmlns:app3="http://foo.org/">fooish</app3:foo>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app2:bar xmlns:app2="http://bar.com/" maman="baz">barish</app2:bar>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app2:bar xmlns:app2="http://bar.com/" maman="baz">barish</app2:bar>
+ </metadata>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata-duplicate.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata-duplicate.xml
new file mode 100644
index 0000000..e32fb67
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata-duplicate.xml
@@ -0,0 +1,31 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <metadata>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app2:bar xmlns:app2="http://bar.com/" maman="baz">barish</app2:bar>
+ </metadata>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static' cpuset='1-4,8-20,525'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 58917c3..2bec2b2 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -367,6 +367,7 @@ mymain(void)
DO_TEST_DIFFERENT("usb-ich9-ehci-addr");
DO_TEST_DIFFERENT("metadata");
+ DO_TEST_DIFFERENT("metadata-duplicate");
DO_TEST("tpm-passthrough");
DO_TEST("pci-bridge");
--
2.2.2
9 years, 8 months
[libvirt] [libvirt-python PATCH] Clarify description for virNodeGetSecurityModel
by Ján Tomko
s/host/hypervisor/ to match the wording used by the C binding.
https://bugzilla.redhat.com/show_bug.cgi?id=1198518
---
libvirt-override-api.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Pushed as trivial.
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index 439cb40..144479c 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -105,7 +105,7 @@
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
<function name='virNodeGetSecurityModel' file='python'>
- <info>Extract information about the host security model</info>
+ <info>Extract information about the hypervisor security model</info>
<return type='char *' info='the list of information or None in case of error'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
--
2.0.5
9 years, 8 months
[libvirt] [PATCH 0/3] unify memtune value representation in libvirt
by Pavel Hrdina
The first patch rewrites virsh memtune command to accept 0 as valid value
instead of ignoring it.
In the second patch I'll introduce a simple helper to crop the *_limit values
to VIR_DOMAIN_MEMORY_PARAM_UNLIMITED as its used several times while reading
values from cgroups.
The last patch actually changes the internal representation of unlimited memtune
settings. More detailed description is in commit message. My motivation to
change it completely is to prevent future bugs with those limits.
Pavel Hrdina (3):
virsh: fix memtune to also accept 0 as valid value
virutil: introduce helper to set memory limits
memtune: change the way how we store unlimited value
docs/formatdomain.html.in | 4 +-
src/conf/domain_conf.c | 75 +++++++++++++++++-----
src/libvirt-domain.c | 3 +
src/lxc/lxc_cgroup.c | 18 +++---
src/lxc/lxc_driver.c | 3 -
src/lxc/lxc_fuse.c | 12 ++--
src/lxc/lxc_native.c | 6 +-
src/openvz/openvz_conf.c | 4 +-
src/openvz/openvz_driver.c | 4 +-
src/qemu/qemu_cgroup.c | 24 +++----
src/qemu/qemu_command.c | 8 ++-
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 5 +-
src/util/virutil.c | 8 +--
src/util/virutil.h | 4 ++
tests/qemuxml2argvdata/qemuxml2argv-memtune.xml | 2 +-
.../qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml | 2 +-
tools/virsh-domain.c | 62 ++++++------------
19 files changed, 140 insertions(+), 112 deletions(-)
--
2.0.5
9 years, 8 months