[libvirt] [PATCH v2 0/5] Add virtio-gpu & virgl support
by Marc-André Lureau
The following series allow using virtio-gpu and virgl if qemu support
it. Ths Spice bits are not yet in qemu 2.5, but should make it in 2.6
and I added the RFC patches that are expected to not change much.
v1->v2: addressing Ján Tomko review
- update accel2d/accel3d to be tristate and fix its usage
- use a single QEMU_CAPS_DEVICE_VIRTIO_GPU cap for -device
virtio-gpu-* & virtio-vga
- remove qemu legacy, -vga support or command line parsing
- add xml2xml tests
- squash xml2argvtests with their respecitve feature addition commits
- update libvirt version in doc
- update commit messages
Marc-André Lureau (5):
Replace support{2d,3d} with accel{2d,3d}
domain: replace bool accel{2d,3d} with a tristate
qemu: add virtio video device
qemu: add virtio-gpu virgl support
RFC qemu: add spice opengl support
docs/formatdomain.html.in | 11 +-
docs/schemas/domaincommon.rng | 6 +
src/conf/domain_conf.c | 84 +-
src/conf/domain_conf.h | 6 +-
src/qemu/qemu_capabilities.c | 12 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 40 +-
src/vbox/vbox_common.c | 18 +-
src/vz/vz_sdk.c | 2 +-
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 95 +-
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 168 +
tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4043 ++++++++++++++++++++
tests/qemucapabilitiestest.c | 1 +
.../qemuxml2argv-video-virtio-gpu-device.args | 23 +
.../qemuxml2argv-video-virtio-gpu-device.xml | 31 +
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 23 +
.../qemuxml2argv-video-virtio-gpu-spice-gl.xml | 36 +
.../qemuxml2argv-video-virtio-gpu-virgl.args | 23 +
.../qemuxml2argv-video-virtio-gpu-virgl.xml | 33 +
tests/qemuxml2argvtest.c | 14 +
tests/qemuxml2xmltest.c | 4 +
29 files changed, 4732 insertions(+), 99 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.caps
create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.replies
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml
--
2.5.0
8 years, 8 months
[libvirt] [PATCH] admin: Fix memory leak in remoteAdminConnectClose
by Erik Skultety
When virt-admin is run with valgrind, this kind of output can be obtained:
HEAP SUMMARY:
in use at exit: 134,589 bytes in 1,031 blocks
total heap usage: 2,667 allocs, 1,636 frees, 496,755 bytes allocated
88 bytes in 1 blocks are definitely lost in loss record 82 of 128
at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x52F6D1F: virAllocVar (viralloc.c:560)
by 0x5350268: virObjectNew (virobject.c:193)
by 0x53503E0: virObjectLockableNew (virobject.c:219)
by 0x4E3BBCB: virAdmConnectNew (datatypes.c:832)
by 0x4E38495: virAdmConnectOpen (libvirt-admin.c:209)
by 0x10C541: vshAdmConnect (virt-admin.c:107)
by 0x10C7B2: vshAdmReconnect (virt-admin.c:163)
by 0x10CC7C: cmdConnect (virt-admin.c:298)
by 0x110838: vshCommandRun (vsh.c:1224)
by 0x10DFD8: main (virt-admin.c:862)
LEAK SUMMARY:
definitely lost: 88 bytes in 1 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 134,501 bytes in 1,030 blocks
suppressed: 0 bytes in 0 blocks
This is because virNetClientSetCloseCallback was being reinitialized
incorrectly. By resetting the callbacks in a proper way, the leak itself is
fixed, however we should still dispose of the client object properly by
issuing virObjectUnref on it.
---
src/admin/admin_remote.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index e634fa7..e174e88 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -180,7 +180,11 @@ remoteAdminConnectClose(virAdmConnectPtr conn)
goto done;
}
- virNetClientSetCloseCallback(priv->client, NULL, NULL, NULL);
+ virNetClientSetCloseCallback(priv->client, NULL, conn->closeCallback,
+ virObjectFreeCallback);
+ virNetClientClose(priv->client);
+ virObjectUnref(priv->client);
+ priv->client = NULL;
rv = 0;
--
2.4.3
8 years, 8 months
[libvirt] Libvirtd and OSX... with QEMU
by Justin Clift
Heyas,
Interestingly on OSX, starting libvirtd (1.3.1) indicates it can see
the installed QEMU. However, it crashes out shortly afterwards with
a weird error:
2016-01-17 22:02:17.159+0000: 18446744073709551615: error : virEventPollRunOnce:648 : Unable to poll on file handles: Bad file descriptor
Does anyone know what that might be about, and/or how to capture more
meaningful info? :)
Regards and best wishes,
Justin Clift
8 years, 8 months
[libvirt] [PATCH v2 00/10] Reorganizing qemu_command.c continued
by John Ferlan
v1: http://www.redhat.com/archives/libvir-list/2016-February/msg00804.html
v2 changes:
Patch 1 makes changes as requested from review.
Patches 2-7 are v1's 4-10 take a different approach by creating
qemuBuildXXXXCommandLine helper routines.
Patches 8-10 are new, but follow the others...
John Ferlan (10):
qemu: Make basic upfront checks before create command
qemu: Rename qemuBuildMachineArgStr
qemu: Rename qemuBuildCpuArgStr to qemuBuildCpuCommandLine
qemu: Introduce qemuBuildMemCommandLine
qemu: Rename qemuBuildSmpArgStr to qemuBuildSmpCommandLine
qemu: Introduce qemuBuildIOThreadCommandLine
qemu: Introduce qemuBuildNumaCommandLine
qemu: Introduce qemuBuildSmbiosCommandLine
qemu: Introduce qemuBuildSgaCommandLine
qemu: Introduce qemuBuildMonitorCommandLine
src/qemu/qemu_command.c | 740 ++++++++++++++++++++++++++++--------------------
1 file changed, 434 insertions(+), 306 deletions(-)
--
2.5.0
8 years, 8 months
[libvirt] [PATCHv3 0/2] notify about reverting to a snapshot
by Dmitry Andreev
Reverting to snapshot may change domain configuration but
there will be no events about that.
Lack of the event become a problem for virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=1081148
This patch-set introduces new event and emits it in
qemuDomainRevertToSnapshot.
v3:
[2/2] event is emited only in the case when stopped domain
is reverted to a stopped domain.
Dmitry Andreev (2):
Introduce new VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT sub-event
qemu: emit 'defined' event after reverted to snapshot without state
changes
examples/object-events/event-test.c | 2 ++
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_driver.c | 8 +++++++-
tools/virsh-domain.c | 3 ++-
4 files changed, 12 insertions(+), 2 deletions(-)
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH] qemu: cgroup: fix cgroup permission logic
by Bjoern Walk
Fix logic error introduced in commit d6c91b3c which essentially broke
starting any domain.
Signed-off-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
---
src/qemu/qemu_cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 53642a1..f3c5fbb 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -65,7 +65,7 @@ qemuSetupImagePathCgroup(virDomainObjPtr vm,
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES))
return 0;
- if (readonly)
+ if (!readonly)
perms |= VIR_CGROUP_DEVICE_WRITE;
VIR_DEBUG("Allow path %s, perms: %s",
--
2.3.0
8 years, 8 months
[libvirt] [PATCH v2] virsh: Remove <backingStore> when changing cdrom media source
by Peter Krempa
Since the code is changing the source image path by modifying the
existing XML snippet the <backingStore> stays in place.
As <backingStore> is relevant to the <source> part of the image, the
update of that part makes the element invalid.
CD/floppy images usually don't have a backing chain and the element is
currently ignored though but it might start being used in the future so
let's start behaving correctly.
Drop the <backingStore> subtree once we want to update the XML.
Before this patch, you'd get:
$ virsh change-media --eject --print-xml 10 hdc
<disk type="file" device="cdrom">
<driver name="qemu" type="qcow2"/>
<backingStore type="file" index="1">
<format type="qcow2"/>
<source file="/var/lib/libvirt/images/vm.1436949097"/>
<backingStore/>
</backingStore>
<target dev="hdc" bus="ide"/>
...
</disk>
After:
$ virsh change-media --eject --print-xml 10 hdc
<disk type="file" device="cdrom">
<driver name="qemu" type="qcow2"/>
<target dev="hdc" bus="ide"/>
...
</disk>
---
Notes:
v2:
- adapted to new version of code
- fixed use after free from previous version
- added more text to commit message
tools/virsh-domain.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index bf65a60..83edb21 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11052,6 +11052,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node,
{
xmlNodePtr tmp = NULL;
xmlNodePtr source = NULL;
+ xmlNodePtr backingStore = NULL;
xmlNodePtr target_node = NULL;
xmlNodePtr text_node = NULL;
char *device_type = NULL;
@@ -11092,13 +11093,22 @@ virshUpdateDiskXML(xmlNodePtr disk_node,
if (xmlStrEqual(tmp->name, BAD_CAST "target"))
target_node = tmp;
+ if (xmlStrEqual(tmp->name, BAD_CAST "backingStore"))
+ backingStore = tmp;
+
/*
* We've found all we needed.
*/
- if (source && target_node)
+ if (source && target_node && backingStore)
break;
}
+ /* drop the <backingStore> subtree since it would become invalid */
+ if (backingStore) {
+ xmlUnlinkNode(backingStore);
+ xmlFreeNode(backingStore);
+ }
+
if (type == VIRSH_UPDATE_DISK_XML_EJECT) {
if (!source) {
vshError(NULL, _("The disk device '%s' doesn't have media"), target);
--
2.6.2
8 years, 8 months
[libvirt] [PATCH] qemu: Kill VIR_WRAPPER_SHELL_PREFIX
by Peter Krempa
The migration code now doesn't need it, so remove the macros and the
configure code that is detecting it.
---
configure.ac | 50 -------------------------------------------------
src/qemu/qemu_monitor.h | 13 -------------
2 files changed, 63 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7d74f53..93d347c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1111,56 +1111,6 @@ dnl
LIBVIRT_DRIVER_CHECK_BHYVE
-dnl
-dnl check for shell that understands <> redirection without truncation,
-dnl needed by src/qemu/qemu_monitor_{text,json}.c.
-dnl
-if test "$with_qemu" = yes; then
- lv_wrapper_shell=
- AC_CACHE_CHECK([for shell that supports <> redirection],
- [lv_cv_wrapper_shell],
- [
- # If cross-compiling, guess that /bin/sh is good enough except for
- # Linux, where it might be dash 0.5.5 which is known broken; and on
- # Linux, we have a good chance that /bin/bash will exist.
- # If we guess wrong, a user can override the cache variable.
- # Going through /bin/bash is a slight slowdown if /bin/sh works.
- if test "$cross_compiling" = yes; then
- case $host_os in
- linux*) lv_cv_wrapper_shell=/bin/bash ;;
- *) lv_cv_wrapper_shell=/bin/sh ;;
- esac
- else
- for lv_cv_wrapper_shell in /bin/sh bash ksh zsh none; do
- test $lv_cv_wrapper_shell = none &&
- AC_MSG_ERROR([could not find decent shell])
- echo a > conftest.a
- ($lv_cv_wrapper_shell -c ': 1<>conftest.a') 2>/dev/null &&
- case `cat conftest.a`.$lv_cv_wrapper_shell in
- a./*) break;; dnl /bin/sh is good enough
- a.*) dnl bash, ksh, and zsh all understand 'command', use that
- dnl to determine the absolute path of the shell
- lv_cv_wrapper_shell=`$lv_cv_wrapper_shell -c \
- "command -v $lv_cv_wrapper_shell"`
- case $lv_cv_wrapper_shell in
- /*) break;;
- esac
- ;;
- esac
- done
- rm -f conftest.a
- fi
- ])
- if test "x$lv_cv_wrapper_shell" != x/bin/sh; then
- lv_wrapper_shell=$lv_cv_wrapper_shell
- fi
- if test "x$lv_wrapper_shell" != x; then
- AC_DEFINE_UNQUOTED([VIR_WRAPPER_SHELL], ["$lv_wrapper_shell"],
- [Define to the absolute path of a shell that does not truncate on
- <> redirection, if /bin/sh does not fit the bill])
- fi
-fi
-
dnl
dnl check for kernel headers required by src/bridge.c
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 134cbb6..d1a667a 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -926,17 +926,4 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
int qemuMonitorMigrateIncoming(qemuMonitorPtr mon,
const char *uri);
-/**
- * When running two dd process and using <> redirection, we need a
- * shell that will not truncate files. These two strings serve that
- * purpose.
- */
-# ifdef VIR_WRAPPER_SHELL
-# define VIR_WRAPPER_SHELL_PREFIX VIR_WRAPPER_SHELL " -c '"
-# define VIR_WRAPPER_SHELL_SUFFIX "'"
-# else
-# define VIR_WRAPPER_SHELL_PREFIX /* nothing */
-# define VIR_WRAPPER_SHELL_SUFFIX /* nothing */
-# endif
-
#endif /* QEMU_MONITOR_H */
--
2.6.2
8 years, 8 months
[libvirt] [PATCH 0/5] tests: qemuargv2xml: Enabling REGENERATE_OUTPUT
by Cole Robinson
This reworks qemuargv2xml and lxcconf2xml tests to allow use of
VIR_TEST_REGENERATE_OUTPUT
Cole Robinson (5):
tests: qemuargv2xml: Remove unneeded XML blanking
tests: qemuargv2xml: Remove UUID randomness
tests: qemuargv2xml: hardcode disk auth usage=
tests: qemuargv2xml: Drop memory XML blanking
tests: lxcconf2xml: Drop XML blanking
tests/lxcconf2xmltest.c | 22 +++------
tests/qemuargv2xmldata/qemuargv2xml-boot-cdrom.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-boot-floppy.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-boot-network.xml | 4 +-
.../qemuargv2xml-clock-localtime.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-clock-utc.xml | 4 +-
.../qemuargv2xml-console-compat.xml | 4 +-
.../qemuargv2xml-disk-cdrom-empty.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-cdrom.xml | 4 +-
.../qemuargv2xml-disk-drive-boot-cdrom.xml | 4 +-
.../qemuargv2xml-disk-drive-boot-disk.xml | 4 +-
.../qemuargv2xml-disk-drive-cache-v2-none.xml | 4 +-
.../qemuargv2xml-disk-drive-network-iscsi-auth.xml | 2 +-
.../qemuargv2xml-disk-drive-network-rbd-auth.xml | 2 +-
.../qemuargv2xml-graphics-vnc-policy.xml | 4 +-
.../qemuargv2xml-graphics-vnc-sasl.xml | 4 +-
.../qemuargv2xml-graphics-vnc-socket.xml | 4 +-
.../qemuargv2xml-graphics-vnc-tls.xml | 4 +-
.../qemuargv2xml-graphics-vnc-websocket.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-graphics-vnc.xml | 4 +-
.../qemuargv2xml-hostdev-pci-address.xml | 6 +--
.../qemuargv2xmldata/qemuargv2xml-hyperv-panic.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-hyperv.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-kvm-features.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-kvmclock.xml | 4 +-
.../qemuargv2xml-machine-aeskeywrap-off-argv.xml | 4 +-
.../qemuargv2xml-machine-aeskeywrap-on-argv.xml | 4 +-
.../qemuargv2xml-machine-core-off.xml | 4 +-
.../qemuargv2xml-machine-core-on.xml | 4 +-
.../qemuargv2xml-machine-deakeywrap-off-argv.xml | 4 +-
.../qemuargv2xml-machine-deakeywrap-on-argv.xml | 4 +-
.../qemuargv2xml-machine-keywrap-none-argv.xml | 4 +-
.../qemuargv2xml-misc-disable-s3.xml | 6 +--
.../qemuargv2xml-misc-disable-suspends.xml | 6 +--
.../qemuargv2xml-misc-enable-s4.xml | 6 +--
.../qemuargv2xml-misc-no-reboot.xml | 4 +-
.../qemuargv2xml-net-eth-ifname.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-net-eth.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-nosharepages.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-parallel-tcp.xml | 4 +-
.../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 2 +-
.../qemuargv2xml-pseries-nvram.xml | 2 +-
.../qemuargv2xml-reboot-timeout-disabled.xml | 4 +-
.../qemuargv2xml-reboot-timeout-enabled.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 4 +-
.../qemuargv2xml-serial-tcp-telnet.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 4 +-
tests/qemuargv2xmldata/qemuargv2xml-watchdog.xml | 4 +-
tests/qemuargv2xmltest.c | 54 ++++++++++++----------
50 files changed, 133 insertions(+), 135 deletions(-)
--
2.5.0
8 years, 8 months
[libvirt] [PATCH] qemu: Move PORT definitions to qemu_conf.c
by Cole Robinson
Which is the only user. That was the only reason for including
qemu_command.h, though we need to explicitly include qemu_domain.h
afterwards.
---
Had this sitting in a branch.
jferlan: this is in your neck of the woods, not sure if it's going
to conflict with any of your reorg patches though...
src/qemu/qemu_command.h | 16 ----------------
src/qemu/qemu_conf.c | 18 +++++++++++++++++-
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 776954e..fb684d0 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -39,22 +39,6 @@
# define QEMU_DRIVE_HOST_PREFIX "drive-"
# define QEMU_FSDEV_HOST_PREFIX "fsdev-"
-/* These are only defaults, they can be changed now in qemu.conf and
- * explicitly specified port is checked against these two (makes
- * sense to limit the values).
- *
- * This limitation is mentioned in qemu.conf, so bear in mind that the
- * configuration file should reflect any changes made to these values.
- */
-# define QEMU_REMOTE_PORT_MIN 5900
-# define QEMU_REMOTE_PORT_MAX 65535
-
-# define QEMU_WEBSOCKET_PORT_MIN 5700
-# define QEMU_WEBSOCKET_PORT_MAX 65535
-
-# define QEMU_MIGRATION_PORT_MIN 49152
-# define QEMU_MIGRATION_PORT_MAX 49215
-
VIR_ENUM_DECL(qemuVideo)
typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 14683f5..fd3055f 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -36,8 +36,8 @@
#include "virerror.h"
#include "qemu_conf.h"
-#include "qemu_command.h"
#include "qemu_capabilities.h"
+#include "qemu_domain.h"
#include "viruuid.h"
#include "virbuffer.h"
#include "virconf.h"
@@ -58,6 +58,22 @@
VIR_LOG_INIT("qemu.qemu_conf");
+/* These are only defaults, they can be changed now in qemu.conf and
+ * explicitly specified port is checked against these two (makes
+ * sense to limit the values).
+ *
+ * This limitation is mentioned in qemu.conf, so bear in mind that the
+ * configuration file should reflect any changes made to these values.
+ */
+#define QEMU_REMOTE_PORT_MIN 5900
+#define QEMU_REMOTE_PORT_MAX 65535
+
+#define QEMU_WEBSOCKET_PORT_MIN 5700
+#define QEMU_WEBSOCKET_PORT_MAX 65535
+
+#define QEMU_MIGRATION_PORT_MIN 49152
+#define QEMU_MIGRATION_PORT_MAX 49215
+
static virClassPtr virQEMUDriverConfigClass;
static void virQEMUDriverConfigDispose(void *obj);
--
2.5.0
8 years, 8 months