[libvirt] [PATCH] build: Don't install sysconfig files as scripts
by Jiri Denemark
The files are not scripts and should not be executable.
Broken by v4.0.0-294-g5f998681df.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0c380780c3..b2db1e9db9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -768,7 +768,7 @@ install-sysconfig:
for f in $(SYSCONF_FILES:%.sysconf=%) ; \
do \
tgt=`basename $$f`; \
- $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
+ $(INSTALL_DATA) $(srcdir)/$$f.sysconf \
$(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
--
2.17.1
6 years, 5 months
[libvirt] [PATCH V2] tests: xmconfigtest: add tests for cmdline formating
by Jim Fehlig
Commit 656151bf fixed formatting of the <cmdline> element. Perhaps it
would have been noticed and fixed earlier if we had a test. With this
change, all possible cases of formating <cmdline> from xmconfig are
covered
1. no 'extra=' or 'root=' in xm.cfg
2. 'extra=' but no 'root=' in xm.cfg
3. 'root=' but no 'extra=' in xm.cfg
4. both 'root=' and 'extra=' in xm.cfg
Case 1 is covered by all existing paravirt tests since they have no
'extra=' or 'root='. Case 2 is covered by adding 'extra=' to a few
of the existing paravirt tests. Cases 3 and 4 are covered by new
tests that only test conversion of xm.cfg to xml.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
tests/xmconfigdata/test-paravirt-extra-root.cfg | 13 ++++++++++
tests/xmconfigdata/test-paravirt-extra-root.xml | 34 +++++++++++++++++++++++++
tests/xmconfigdata/test-paravirt-maxvcpus.cfg | 1 +
tests/xmconfigdata/test-paravirt-maxvcpus.xml | 1 +
tests/xmconfigdata/test-paravirt-root.cfg | 12 +++++++++
tests/xmconfigdata/test-paravirt-root.xml | 34 +++++++++++++++++++++++++
tests/xmconfigdata/test-paravirt-vcpu.cfg | 1 +
tests/xmconfigdata/test-paravirt-vcpu.xml | 1 +
tests/xmconfigtest.c | 2 ++
9 files changed, 99 insertions(+)
create mode 100644 tests/xmconfigdata/test-paravirt-extra-root.cfg
create mode 100644 tests/xmconfigdata/test-paravirt-extra-root.xml
create mode 100644 tests/xmconfigdata/test-paravirt-root.cfg
create mode 100644 tests/xmconfigdata/test-paravirt-root.xml
diff --git a/tests/xmconfigdata/test-paravirt-extra-root.cfg b/tests/xmconfigdata/test-paravirt-extra-root.cfg
new file mode 100644
index 0000000000..2569f2f22c
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-extra-root.cfg
@@ -0,0 +1,13 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+memory = 512
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+root = "/dev/xvda2"
+extra = "console=hvc0"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-extra-root.xml b/tests/xmconfigdata/test-paravirt-extra-root.xml
new file mode 100644
index 0000000000..325b07d8e1
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-extra-root.xml
@@ -0,0 +1,34 @@
+<domain type='xen'>
+ <name>XenGuest1</name>
+ <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <cmdline>root=/dev/xvda2 console=hvc0</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <disk type='block' device='disk'>
+ <driver name='phy' type='raw'/>
+ <source dev='/dev/HostVG/XenGuest1'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:66:94:9c'/>
+ <source bridge='br0'/>
+ <script path='vif-bridge'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ <input type='mouse' bus='xen'/>
+ <input type='keyboard' bus='xen'/>
+ <memballoon model='xen'/>
+ </devices>
+</domain>
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.cfg b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
index 8d1ac4d786..f06db61171 100644
--- a/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
@@ -10,4 +10,5 @@ on_reboot = "restart"
on_crash = "restart"
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
bootloader = "/usr/bin/pygrub"
+extra = "console=hvc0"
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.xml b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
index ce66503dc5..3012821ad4 100644
--- a/tests/xmconfigdata/test-paravirt-maxvcpus.xml
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
@@ -7,6 +7,7 @@
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='x86_64' machine='xenpv'>linux</type>
+ <cmdline>console=hvc0</cmdline>
</os>
<clock offset='utc' adjustment='reset'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/xmconfigdata/test-paravirt-root.cfg b/tests/xmconfigdata/test-paravirt-root.cfg
new file mode 100644
index 0000000000..8cdfbd9384
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-root.cfg
@@ -0,0 +1,12 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+memory = 512
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+root = "/dev/xvda2"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-root.xml b/tests/xmconfigdata/test-paravirt-root.xml
new file mode 100644
index 0000000000..12d1e3bdbd
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-root.xml
@@ -0,0 +1,34 @@
+<domain type='xen'>
+ <name>XenGuest1</name>
+ <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ <cmdline>root=/dev/xvda2</cmdline>
+ </os>
+ <clock offset='utc' adjustment='reset'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <disk type='block' device='disk'>
+ <driver name='phy' type='raw'/>
+ <source dev='/dev/HostVG/XenGuest1'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:66:94:9c'/>
+ <source bridge='br0'/>
+ <script path='vif-bridge'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ <input type='mouse' bus='xen'/>
+ <input type='keyboard' bus='xen'/>
+ <memballoon model='xen'/>
+ </devices>
+</domain>
diff --git a/tests/xmconfigdata/test-paravirt-vcpu.cfg b/tests/xmconfigdata/test-paravirt-vcpu.cfg
index 8d1ac4d786..f06db61171 100644
--- a/tests/xmconfigdata/test-paravirt-vcpu.cfg
+++ b/tests/xmconfigdata/test-paravirt-vcpu.cfg
@@ -10,4 +10,5 @@ on_reboot = "restart"
on_crash = "restart"
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
bootloader = "/usr/bin/pygrub"
+extra = "console=hvc0"
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-vcpu.xml b/tests/xmconfigdata/test-paravirt-vcpu.xml
index ce66503dc5..3012821ad4 100644
--- a/tests/xmconfigdata/test-paravirt-vcpu.xml
+++ b/tests/xmconfigdata/test-paravirt-vcpu.xml
@@ -7,6 +7,7 @@
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='x86_64' machine='xenpv'>linux</type>
+ <cmdline>console=hvc0</cmdline>
</os>
<clock offset='utc' adjustment='reset'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 6851fa73cd..eaec7c3a5c 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -200,6 +200,8 @@ mymain(void)
DO_TEST("paravirt-net-vifname");
DO_TEST("paravirt-vcpu");
DO_TEST("paravirt-maxvcpus");
+ DO_TEST_FORMAT("paravirt-root");
+ DO_TEST_FORMAT("paravirt-extra-root");
DO_TEST("fullvirt-new-cdrom");
DO_TEST("fullvirt-utc");
DO_TEST("fullvirt-localtime");
--
2.16.3
6 years, 5 months
[libvirt] [PATCH] Post-release version bump to 4.5.0
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as "should really be done as part of the release process" :-)
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index b869a17afe..5378e49c0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [4.4.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
+AC_INIT([libvirt], [4.5.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
diff --git a/docs/news.xml b/docs/news.xml
index 74f3ea1638..18f3897b3b 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -33,6 +33,14 @@
-->
<libvirt>
+ <release version="v4.5.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v4.4.0" date="2018-06-04">
<section title="New features">
<change>
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] nwfilter: directly use poll to wait for packets instead of pcap_next
by Daniel P. Berrangé
When a QEMU VM shuts down its TAP device gets deleted while nwfilter
IP address learning thread is still capturing packets. It is seen that
with TPACKET_V3 support in libcap, the pcap_next() call will not always
exit its poll() when the NIC is removed. This prevents the learning
thread from exiting which blocks the rest of libvirtd waiting on mutex
acquisition. By switching to do poll() in libvirt code, we can ensure
that we always exit the poll() at a time that is right for libvirt.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/nwfilter/nwfilter_learnipaddr.c | 37 +++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 061b39d72b..e117be9ce2 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
+#include <poll.h>
#include <arpa/inet.h>
#include <net/ethernet.h>
@@ -414,6 +415,7 @@ learnIPAddressThread(void *arg)
bool showError = true;
enum howDetect howDetected = 0;
virNWFilterTechDriverPtr techdriver = req->techdriver;
+ struct pollfd fds[1];
if (virNWFilterLockIface(req->ifname) < 0)
goto err_no_lock;
@@ -435,6 +437,9 @@ learnIPAddressThread(void *arg)
goto done;
}
+ fds[0].fd = pcap_fileno(handle);
+ fds[0].events = POLLIN | POLLERR;
+
virMacAddrFormat(&req->macaddr, macaddr);
switch (req->howDetect) {
@@ -483,17 +488,45 @@ learnIPAddressThread(void *arg)
pcap_freecode(&fp);
while (req->status == 0 && vmaddr == 0) {
+ int n = poll(fds, ARRAY_CARDINALITY(fds), PKT_TIMEOUT_MS);
+
+ if (n < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ continue;
+
+ req->status = errno;
+ showError = true;
+ break;
+ }
+
+ if (n == 0) {
+ if (threadsTerminate || req->terminate) {
+ VIR_DEBUG("Terminate request seen, cancelling pcap");
+ req->status = ECANCELED;
+ showError = false;
+ break;
+ }
+ continue;
+ }
+
+ if (fds[0].revents & (POLLHUP | POLLERR)) {
+ VIR_DEBUG("Error from FD probably dev deleted");
+ req->status = ENODEV;
+ showError = false;
+ break;
+ }
+
packet = pcap_next(handle, &header);
if (!packet) {
-
+ /* Already handled with poll, but lets be sure */
if (threadsTerminate || req->terminate) {
req->status = ECANCELED;
showError = false;
break;
}
- /* check whether VM's dev is still there */
+ /* Again, already handled above, but lets be sure */
if (virNetDevValidateConfig(req->ifname, NULL, req->ifindex) <= 0) {
virResetLastError();
req->status = ENODEV;
--
2.17.0
6 years, 5 months
[libvirt] Release of libvirt-4.4.0
by Daniel Veillard
It's finally out, tagged in git, with signed tarball and rpms at the usual
place:
ftp://libvirt.org/libvirt/
I also made a 4.4.0 release for the python bindings that one can find at
ftp://libvirt.org/libvirt/python/
There is apparently more new features than improvements, and no bug fix in
this release, I would just guess that people don't feel like updating news.xml
on bug fixes, rather than no bug needing fixes for a full month. It may
still be a good idea to update to this release and not just for the fun of
testing new features !
New features:
bhyve: Support locking guest memory
Bhyve's guest memory may be wired using the
<memoryBacking><locked/></memoryBacking> element.
qemu: Provide VFIO channel I/O passthrough support
Support passthrough devices that use channel I/O based mechanism in a
QEMU virtual machine.
qemu: Add support for migration of VMs with non-shared storage over TLS
It's now possible to use the VIR_MIGRATE_TLS flag together with
VIR_MIGRATE_NON_SHARED_DISK. The connection is then secured using the
TLS environment which is setup for the migration connection.
Add support for VM Generation ID
The VM Generatation ID exposes a 128-bit, cryptographically random,
integer value identifier, referred to as a Globally Unique Identifier
(GUID) to the guest in order to notify the guest operating system when
the virtual machine is executed with a different configuration. Add a
new domain XML processing and a domain capabilities feature.
Introduce virDomainDetachDeviceAlias
This new API enables users to detach device using only its alias.
Introduce new virConnectCompareHypervisorCPU and
virConnectBaselineHypervisorCPU APIs
Unlike the old virConnectCompareCPU and virConnectBaselineCPU APIs,
both new APIs consider capabilities of a specific hypervisor.
Introduce SCSI persistent reservations support
The QEMU driver gained support for qemu-pr-helper which enables guests
to issue SCSI commands for persistent reservation.
qemu: Implement multiple screen support for virDomainScreenshot
While the virDomainScreenshot API supported multihead video cards, the
implementation was missing. But now that QEMU implemented it libvirt
has done as well.
qemu: add support for vhost-vsock-device
A new vsock device was introduced, allowing communication between the
guest and the host via the AF_VSOCK family.
Improvements:
qemu: Add suport for OpenGL rendering with SDL
Domains using SDL as a graphics backend will now be able to use OpenGL
accelerated rendering.
qemu: Add support for 'output' audio codec
Support QEMU's 'hda-output' codec advertising only a line-out for ich6
and ich9 sound devices.
virsh: Enhance event name completion
Implement event name completion for some commands (e.g. event,
secret-event, pool-event and nodedev-event)
Thanks for everybody who contributed to that feature rich release, be it
with code, ideas, reviews etc ...
Hopefully it won't crash and burn,
Enjoy and Banzai !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
6 years, 5 months
[libvirt] [PATCH] conf: Introduce align for hostmem-file
by Jie Wang
QEMU has add the 'align' option to 'memory-backend-file'. Expose
this option to users by new element align.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
docs/formatdomain.html.in | 18 +++++++
docs/schemas/domaincommon.rng | 7 +++
src/conf/domain_conf.c | 14 +++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 4 ++
.../memory-hotplug-nvdimm-align.args | 31 +++++++++++
.../memory-hotplug-nvdimm-align.xml | 63 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
.../memory-hotplug-nvdimm-align.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
10 files changed, 143 insertions(+)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
create mode 100644 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 0d0fd3b..29fe145 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7932,6 +7932,9 @@ qemu-kvm -net nic,model=? /dev/null
</target>
</memory>
<memory model='nvdimm'>
+ <align>
+ <sieze unit='KiB'>2048</size>
+ </align>
<source>
<path>/tmp/nvdimm</path>
</source>
@@ -7983,6 +7986,21 @@ qemu-kvm -net nic,model=? /dev/null
</p>
</dd>
+ <dt><code>align</code></dt>
+ <dd>
+ <p>
+ For NVDIMM type devices one can optionally use
+ <code>align</code> and its subelement <code>size</code>
+ to configure the size of alignment within the NVDIMM module.
+ The <code>size</code> element has usual meaning described
+ <a href="#elementsMemoryAllocation">here</a>.
+ For QEMU domains the following restrictions apply:
+ </p>
+ <ol>
+ <li>the alignment must be multiples of page size 4KiB,</li>
+ </ol>
+ </dd>
+
<dt><code>source</code></dt>
<dd>
<p>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 71ac3d0..9e994b1 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5145,6 +5145,13 @@
<ref name="virYesNo"/>
</attribute>
</optional>
+ <optional>
+ <element name="align">
+ <element name="size">
+ <ref name="scaledInteger"/>
+ </element>
+ </element>
+ </optional>
<interleave>
<optional>
<ref name="memorydev-source"/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3689ac0..bf91167 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15739,6 +15739,12 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt,
}
VIR_FREE(tmp);
+ if ((node = virXPathNode("./align", ctxt))) {
+ if (virDomainParseMemory("./align/size", "./align/size/@unit", ctxt,
+ &def->align, true, false) < 0)
+ goto error;
+ }
+
/* source */
if ((node = virXPathNode("./source", ctxt)) &&
virDomainMemorySourceDefParseXML(node, ctxt, def) < 0)
@@ -25334,6 +25340,14 @@ virDomainMemoryDefFormat(virBufferPtr buf,
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
+ if (def->align) {
+ virBufferAddLit(buf, "<align>\n");
+ virBufferAdjustIndent(buf, 2);
+ virBufferAsprintf(buf, "<size unit='KiB'>%llu</size>\n", def->align);
+ virBufferAdjustIndent(buf, -2);
+ virBufferAddLit(buf, "</align>\n");
+ }
+
if (virDomainMemorySourceDefFormat(buf, def) < 0)
return -1;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a78fdee..1155c84 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2107,6 +2107,7 @@ typedef enum {
struct _virDomainMemoryDef {
virDomainMemoryAccess access;
virTristateBool discard;
+ unsigned long long align;
/* source */
virBitmapPtr sourceNodes;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c423733..5862457 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3186,6 +3186,10 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps,
if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0)
goto cleanup;
+ if (mem->align &&
+ virJSONValueObjectAdd(props, "u:align", mem->align * 1024, NULL) < 0)
+ goto cleanup;
+
if (mem->sourceNodes) {
nodemask = mem->sourceNodes;
} else {
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args
new file mode 100644
index 0000000..e6fcf58
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
+-m size=219136k,slots=16,maxmem=1099511627776k \
+-smp 2,sockets=2,cores=1,threads=1 \
+-numa node,nodeid=0,cpus=0-1,mem=214 \
+-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
+share=no,size=536870912,align=2097152 \
+-device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
new file mode 100644
index 0000000..aa9e99b
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
@@ -0,0 +1,63 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>1267710</memory>
+ <currentMemory unit='KiB'>1267710</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <idmap>
+ <uid start='0' target='1000' count='10'/>
+ <gid start='0' target='1000' count='10'/>
+ </idmap>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ <numa>
+ <cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <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'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ <memory model='nvdimm' access='private'>
+ <align>
+ <size unit='KiB'>2048</size>
+ </align>
+ <source>
+ <path>/tmp/nvdimm</path>
+ </source>
+ <target>
+ <size unit='KiB'>523264</size>
+ <node>0</node>
+ <label>
+ <size unit='KiB'>128</size>
+ </label>
+ </target>
+ <address type='dimm' slot='0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 07e5ba1..4674ded 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2588,6 +2588,9 @@ mymain(void)
DO_TEST("memory-hotplug-nvdimm-label",
QEMU_CAPS_DEVICE_NVDIMM,
QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
+ DO_TEST("memory-hotplug-nvdimm-align",
+ QEMU_CAPS_DEVICE_NVDIMM,
+ QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("machine-aeskeywrap-on-caps",
QEMU_CAPS_AES_KEY_WRAP,
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
new file mode 100644
index 0000000..9fc6001
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 7cedc2b..822e98a 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1098,6 +1098,7 @@ mymain(void)
DO_TEST("memory-hotplug-nvdimm", NONE);
DO_TEST("memory-hotplug-nvdimm-access", NONE);
DO_TEST("memory-hotplug-nvdimm-label", NONE);
+ DO_TEST("memory-hotplug-nvdimm-align", NONE);
DO_TEST("net-udp", NONE);
DO_TEST("video-virtio-gpu-device", NONE);
--
1.8.3.1
6 years, 5 months
[libvirt] [PATCH] qemu: check for QEMU_CAPS_DEVICE_VHOST_VSOCK
by Ján Tomko
My commit b8b42ca added support for formatting the vsock
command line without actually checking if it's supported.
Add it to the per-device validation function.
https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Reported-by: John Ferlan <jferlan(a)redhat.com>
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_domain.c | 20 +++++++++++++++++++-
tests/qemuxml2xmltest.c | 4 ++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2c51e4c0d8..474bef0ec9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5283,6 +5283,21 @@ qemuDomainDeviceDefValidateMemory(const virDomainMemoryDef *memory ATTRIBUTE_UNU
}
+static int
+qemuDomainDeviceDefValidateVsock(const virDomainVsockDef *vsock ATTRIBUTE_UNUSED,
+ virQEMUCapsPtr qemuCaps)
+{
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_VSOCK)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("vsock device is not supported "
+ "with this QEMU binary"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int
qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
@@ -5342,6 +5357,10 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
ret = qemuDomainDeviceDefValidateMemory(dev->data.memory, def);
break;
+ case VIR_DOMAIN_DEVICE_VSOCK:
+ ret = qemuDomainDeviceDefValidateVsock(dev->data.vsock, qemuCaps);
+ break;
+
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_INPUT:
@@ -5354,7 +5373,6 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
case VIR_DOMAIN_DEVICE_IOMMU:
- case VIR_DOMAIN_DEVICE_VSOCK:
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_LAST:
break;
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 5671114de0..fdb3d2946b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1212,8 +1212,8 @@ mymain(void)
DO_TEST_STATUS("migration-out-params");
DO_TEST_STATUS("migration-out-nbd-tls");
- DO_TEST("vhost-vsock", NONE);
- DO_TEST("vhost-vsock-auto", NONE);
+ DO_TEST("vhost-vsock", QEMU_CAPS_DEVICE_VHOST_VSOCK);
+ DO_TEST("vhost-vsock-auto", QEMU_CAPS_DEVICE_VHOST_VSOCK);
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
virFileDeleteTree(fakerootdir);
--
2.16.1
6 years, 5 months
[libvirt] [PATCH] Add Virtlyst web application to apps.html
by Daniel Nicoletti
---
docs/apps.html.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index 863be4ff23..0aa3568eed 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -466,6 +466,21 @@
minutes. The only requirements for the users are a Web browser and
a lightweight remote viewer.
</dd>
+ <dt><a href="https://github.com/cutelyst/Virtlyst">Virtlyst</a></dt>
+ <dd>
+ Virtlyst is an open source web application built with C++11, Cutelyst and Qt.
+ It features:
+ <ul>
+ <li>Low memory usage (around 5 MiB of RAM)</li>
+ <li>Look and feel easily customized with HTML templates that use the Django syntax</li>
+ <li>VNC/Spice console pages</li>
+ <li>Host and Domain stats graphs (CPU, Memory, IO, Network)</li>
+ <li>Connect to multiple libvirtd intances (over local unix socket, SSH, TCP and TLS)</li>
+ <li>Manage Storages, Networks, Interfaces and Secrets</li>
+ <li>Create and launch VMs</li>
+ <li>Configure VMs with easy pannels or go pro and edit it's XML</li>
+ </ul>
+ </dd>
</dl>
<h2><a id="mobile">Mobile applications</a></h2>
--
2.17.0
6 years, 5 months
[libvirt] [tck PATCH] Don't assume the domain's network interface tap device is named "vnet0"
by Laine Stump
Some of the tests perform operations on the tap device of the test
domain's network interface. They mostly assume that this tap device is
named "vnet0", which is the case if there is no other domain running
on the host, but isn't true if some other domain was running.
This patch adds a utility function
NetworkHelpers::get_first_interface_target_dev($dom), which learns the
name of the tap device for the first interface in the domain, and uses
the result of that function instead of "vnet0".
It's an ugly name, but follows the pattern of other function names in
that file. It also is very specific (it could have been parameterized
to get the tap device name of other interfaces, but we only ever need
the first). On the other hand, it causes the tests in question to
succeed on my host when they previously failed. (If anyone wants the
function to be named differently or be more flexible, I'd be happy to
do that).
Signed-off-by: Laine Stump <laine(a)laine.org>
---
lib/Sys/Virt/TCK.pm | 3 ++-
lib/Sys/Virt/TCK/NetworkHelpers.pm | 6 ++++++
scripts/domain/180-interface-parameters.t | 6 ++++--
scripts/nwfilter/100-ping-still-working.t | 3 ++-
scripts/nwfilter/210-no-mac-spoofing.t | 3 ++-
scripts/nwfilter/230-no-mac-broadcast.t | 3 ++-
scripts/nwfilter/240-no-arp-spoofing.t | 3 ++-
7 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index ac9c125..29280f6 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -821,11 +821,12 @@ sub generic_machine_domain {
$dom->create();
# Wait for the first boot to reach network setting
+ my $iface = get_first_interface_target_dev($dom);
my $stats;
my $tries = 0;
do {
sleep(10);
- $stats = $dom->interface_stats("vnet0");
+ $stats = $dom->interface_stats($iface);
$tries++;
} while ($stats->{"tx_packets"} < 10 && $tries < 10);
diff --git a/lib/Sys/Virt/TCK/NetworkHelpers.pm b/lib/Sys/Virt/TCK/NetworkHelpers.pm
index 7bbce62..50ade0f 100644
--- a/lib/Sys/Virt/TCK/NetworkHelpers.pm
+++ b/lib/Sys/Virt/TCK/NetworkHelpers.pm
@@ -10,6 +10,12 @@ sub get_first_macaddress {
return $mac;
}
+sub get_first_interface_target_dev {
+ my $dom = shift;
+ my $targetdev = xpath($dom, "string(/domain/devices/interface[1]/target/\@dev)");
+ return $targetdev;
+}
+
sub get_network_ip {
my $conn = shift;
my $netname = shift;
diff --git a/scripts/domain/180-interface-parameters.t b/scripts/domain/180-interface-parameters.t
index d7866c0..66c7ed6 100644
--- a/scripts/domain/180-interface-parameters.t
+++ b/scripts/domain/180-interface-parameters.t
@@ -33,6 +33,7 @@ use warnings;
use Test::More tests => 10;
use Sys::Virt::TCK;
+use Sys::Virt::TCK::NetworkHelpers;
use Test::Exception;
use File::stat;
@@ -59,12 +60,13 @@ diag "Set/Get interface parameters";
my %params = (Sys::Virt::Domain::BANDWIDTH_IN_AVERAGE=>1000, Sys::Virt::Domain::BANDWIDTH_IN_PEAK=>1001,
Sys::Virt::Domain::BANDWIDTH_IN_BURST=>1002, Sys::Virt::Domain::BANDWIDTH_OUT_AVERAGE=>1003,
Sys::Virt::Domain::BANDWIDTH_OUT_PEAK=>1004, Sys::Virt::Domain::BANDWIDTH_OUT_BURST=>1005);
-lives_ok(sub {$dom->set_interface_parameters("vnet0", \%params)}, "Set vnet0 parameters");
+my $iface = get_first_interface_target_dev($dom);
+lives_ok(sub {$dom->set_interface_parameters($iface, \%params)}, "Set $iface parameters");
for my $key (sort keys %params) {
diag "Set $key => $params{$key} ";
}
-my $param = $dom->get_interface_parameters("vnet0", 0);
+my $param = $dom->get_interface_parameters($iface, 0);
my $in_average = $param->{Sys::Virt::Domain::BANDWIDTH_IN_AVERAGE};
my $in_burst = $param->{Sys::Virt::Domain::BANDWIDTH_IN_BURST};
my $in_peak = $param->{Sys::Virt::Domain::BANDWIDTH_IN_PEAK};
diff --git a/scripts/nwfilter/100-ping-still-working.t b/scripts/nwfilter/100-ping-still-working.t
index 1bbd7c5..12f2c7c 100644
--- a/scripts/nwfilter/100-ping-still-working.t
+++ b/scripts/nwfilter/100-ping-still-working.t
@@ -55,11 +55,12 @@ $dom->create;
ok($dom->get_id() > 0, "running domain has an ID > 0");
diag "Waiting for guest to finish booting";
+my $iface = get_first_interface_target_dev($dom);
my $stats;
my $tries = 0;
do {
sleep(10);
- $stats = $dom->interface_stats("vnet0");
+ $stats = $dom->interface_stats($iface);
$tries++;
} while ($stats->{"tx_packets"} < 10 && $tries < 10);
diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t
index 7b74f94..99c5058 100644
--- a/scripts/nwfilter/210-no-mac-spoofing.t
+++ b/scripts/nwfilter/210-no-mac-spoofing.t
@@ -59,11 +59,12 @@ $dom->create;
ok($dom->get_id() > 0, "running domain has an ID > 0");
diag "Waiting for guest to finish booting";
+my $iface = get_first_interface_target_dev($dom);
my $stats;
my $tries = 0;
do {
sleep(10);
- $stats = $dom->interface_stats("vnet0");
+ $stats = $dom->interface_stats($iface);
$tries++;
} while ($stats->{"tx_packets"} < 10 && $tries < 10);
diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t
index ee2d43f..b65b3fc 100644
--- a/scripts/nwfilter/230-no-mac-broadcast.t
+++ b/scripts/nwfilter/230-no-mac-broadcast.t
@@ -85,11 +85,12 @@ $dom->create;
ok($dom->get_id() > 0, "running domain has an ID > 0");
diag "Waiting for guest to finish booting";
+my $iface = get_first_interface_target_dev($dom);
my $stats;
my $tries = 0;
do {
sleep(10);
- $stats = $dom->interface_stats("vnet0");
+ $stats = $dom->interface_stats($iface);
$tries++;
} while ($stats->{"tx_packets"} < 10 && $tries < 10);
diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-no-arp-spoofing.t
index 350b604..69851b6 100644
--- a/scripts/nwfilter/240-no-arp-spoofing.t
+++ b/scripts/nwfilter/240-no-arp-spoofing.t
@@ -58,11 +58,12 @@ $dom->create;
ok($dom->get_id() > 0, "running domain has an ID > 0");
diag "Waiting for guest to finish booting";
+my $iface = get_first_interface_target_dev($dom);
my $stats;
my $tries = 0;
do {
sleep(10);
- $stats = $dom->interface_stats("vnet0");
+ $stats = $dom->interface_stats($iface);
$tries++;
} while ($stats->{"tx_packets"} < 10 && $tries < 10);
--
2.14.4
6 years, 5 months
[libvirt] [tck PATCH v2 00/13] Make sure all tests pass
by Daniel P. Berrangé
I went through and fixed every single broken test, so everything should
now pass when run against latest git master.
Daniel P. Berrangé (13):
scripts: avoid using multicast MAC addresses
scripts: strip quotes from URI before checking it
scripts: fix block info test conditions
scripts: remove testing of 'cow' format
scripts: portability fixes in checking command output
scripts: cope with multiple seclabels in live XML
scripts: switch to using luks encryption with QEMU
scripts: skip luks test entirely for now
scripts: fix the various hotplug tests
scripts: don't abort the entire test harness when libvirtd isn't
running
scripts: re-enable save/restore test
lib: don't re-assign $_
lib: allow marking the scratch disk as shareable
lib/Sys/Virt/TCK.pm | 6 +++++-
lib/Sys/Virt/TCK/DomainBuilder.pm | 7 +++++--
lib/Sys/Virt/TCK/Hooks.pm | 5 ++---
lib/Sys/Virt/TCK/StorageVolBuilder.pm | 18 +++++++++++++-----
scripts/domain/081-unique-id-create.t | 4 ++--
scripts/domain/102-broken-save-restore.t | 3 +--
scripts/domain/121-block-info.t | 5 ++---
scripts/domain/200-disk-hotplug.t | 4 +++-
scripts/domain/205-disk-hotplug-ordering.t | 5 ++++-
scripts/domain/210-nic-hotplug.t | 5 ++++-
scripts/domain/215-nic-hotplug-many.t | 11 +++++++----
scripts/hooks/051-daemon-hook.t | 2 +-
scripts/hooks/052-domain-hook.t | 14 +++++++++-----
scripts/networks/networkApplyTest.sh | 2 +-
.../networkxml2hostout/tck-testnet-1.dat | 2 +-
.../networkxml2hostout/tck-testnet-2.dat | 2 +-
.../networkxml2hostout/tck-testnet-3.dat | 4 ++--
scripts/nwfilter/nwfilter2vmtest.sh | 2 +-
scripts/nwfilter/nwfilter_concurrent.sh | 2 +-
scripts/qemu/100-disk-encryption.t | 3 +++
scripts/selinux/100-static-relabel-no.t | 4 ++--
scripts/selinux/110-static-relabel-yes.t | 6 +++---
scripts/storage/100-create-vol-dir.t | 19 +------------------
scripts/storage/200-clone-vol-dir.t | 4 ++--
24 files changed, 76 insertions(+), 63 deletions(-)
--
2.17.0
6 years, 5 months