[libvirt] [PATCH] docs: List possible GIC versions
by Andrea Bolognani
Recent changes to the handling of GIC version, specifically commit
2a7b11eafb67, have clearly defined what values are acceptable for the
version attribute of the <gic> element. Update the documentation
accordingly.
---
docs/formatdomain.html.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e96798f..faee603 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1577,7 +1577,8 @@
Controller instead of APIC in order to handle interrupts.
For example, the 'aarch64' architecture uses
<code>gic</code> instead of <code>apic</code>. The optional
- attribute <code>version</code> specifies the GIC version;
+ attribute <code>version</code> specifies the GIC version (one of
+ <code>2</code>, <code>3</code> and <code>host</code>);
however, it may not be supported by all hypervisors. <span
class="since">Since 1.2.16</span>
</dd>
--
2.5.0
8 years, 8 months
[libvirt] [PATCH 0/2] tweak iothread/emulator pinning setting
by Peter Krempa
Per review feedback ...
Peter Krempa (2):
qemu: emulatorpin: Always set affinity when pinning emulator thread
qemu: iothreadpin: Always set affinity when pinning iothread
src/qemu/qemu_driver.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
--
2.6.2
8 years, 8 months
[libvirt] [PATCH 0/6] vcpu info refactors - part 3a
by Peter Krempa
A short dump of patches that are separate enough which can be reviewed while
I'm working on other things.
Peter Krempa (6):
virsh: cmdVcpuPin: Simplify handling of API flags
util: Use virBitmapIsBitSet in freebsd impl of virProcessSetAffinity
qemu: vcpupin: Don't overwrite errors from functions setting pinning
qemu: vcpupin: Always set affinity even when cgroups are supported
qemu: qemuDomainGetStatsVcpu: Fix output for possible sparse vCPU
settings
virsh: cpupin: Extract getter code into a separate function
src/qemu/qemu_driver.c | 23 +++------
src/util/virprocess.c | 5 +-
tools/virsh-domain.c | 134 +++++++++++++++++++++++++++----------------------
3 files changed, 82 insertions(+), 80 deletions(-)
--
2.6.2
8 years, 8 months
[libvirt] [PATCH 0/3] domain: AddImplicitControllers in PostParse
by Cole Robinson
Move virDomainDefAddImplicitControllers to virDomainDefPostParse
so PostParse users don't need to open code it.
Patch #1 makes the change, and adjusts some xen output to match
Patch #2 is an unrelated cleanup, but it will clash with patch #3
Patch #3 drops a now redundant AddImplicitControllers call in
qemu_parse_command.c, which reorders the test output a bit
Cole Robinson (3):
domain: add implicit controllers from post parse
qemu: parse: rename qemuCaps->caps
qemu: parse: drop redundant AddImplicitControllers
src/conf/domain_conf.c | 7 +++----
src/qemu/qemu_parse_command.c | 19 ++++++++-----------
src/qemu/qemu_parse_command.h | 4 ++--
tests/qemuargv2xmldata/qemuargv2xml-boot-cdrom.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-boot-floppy.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-boot-network.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-clock-localtime.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-clock-utc.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-console-compat.xml | 2 +-
.../qemuargv2xml-disk-cdrom-empty.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-cdrom.xml | 2 +-
.../qemuargv2xml-disk-drive-boot-cdrom.xml | 2 +-
.../qemuargv2xml-disk-drive-boot-disk.xml | 2 +-
.../qemuargv2xml-disk-drive-cache-directsync.xml | 2 +-
.../qemuargv2xml-disk-drive-cache-unsafe.xml | 2 +-
.../qemuargv2xml-disk-drive-cache-v2-none.xml | 2 +-
.../qemuargv2xml-disk-drive-cache-v2-wb.xml | 2 +-
.../qemuargv2xml-disk-drive-cache-v2-wt.xml | 2 +-
.../qemuargv2xml-disk-drive-error-policy-enospace.xml | 2 +-
.../qemuargv2xml-disk-drive-error-policy-stop.xml | 2 +-
...gv2xml-disk-drive-error-policy-wreport-rignore.xml | 2 +-
.../qemuargv2xml-disk-drive-fmt-qcow.xml | 2 +-
.../qemuargv2xml-disk-drive-network-nbd-export.xml | 2 +-
...emuargv2xml-disk-drive-network-nbd-ipv6-export.xml | 2 +-
.../qemuargv2xml-disk-drive-network-nbd-ipv6.xml | 2 +-
.../qemuargv2xml-disk-drive-network-nbd-unix.xml | 2 +-
.../qemuargv2xml-disk-drive-network-nbd.xml | 2 +-
.../qemuargv2xml-disk-drive-network-rbd-auth.xml | 2 +-
.../qemuargv2xml-disk-drive-network-rbd-ceph-env.xml | 2 +-
.../qemuargv2xml-disk-drive-network-rbd-ipv6.xml | 2 +-
.../qemuargv2xml-disk-drive-network-rbd.xml | 2 +-
.../qemuargv2xml-disk-drive-network-sheepdog.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-floppy.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-many.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-usb.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-virtio.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml | 2 +-
.../qemuargv2xml-graphics-sdl-fullscreen.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-graphics-sdl.xml | 2 +-
.../qemuargv2xml-graphics-vnc-policy.xml | 2 +-
.../qemuargv2xml-graphics-vnc-sasl.xml | 2 +-
.../qemuargv2xml-graphics-vnc-socket.xml | 2 +-
.../qemuargv2xml-graphics-vnc-tls.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-graphics-vnc.xml | 2 +-
.../qemuargv2xml-hostdev-pci-address.xml | 2 +-
.../qemuargv2xml-hostdev-usb-address.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-input-usbmouse.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-input-usbtablet.xml | 2 +-
.../qemuargv2xml-machine-core-off.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-machine-core-on.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-migrate.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-misc-acpi.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml | 2 +-
.../qemuargv2xml-misc-disable-suspends.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-misc-no-reboot.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-misc-uuid.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-net-eth-ifname.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-net-eth.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-net-user.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-net-virtio.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-nographics-vga.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-nosharepages.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-parallel-tcp.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-qemu-ns-no-env.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-restore-v2.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml | 2 +-
.../qemuargv2xml-serial-tcp-telnet.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-smp.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-sound.xml | 2 +-
tests/qemuargv2xmldata/qemuargv2xml-watchdog.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml | 1 +
.../sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml | 1 +
.../sexpr2xml-fv-serial-dev-2nd-port.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml | 1 +
.../sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-sound.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-vif-rate.xml | 1 +
.../test-fullvirt-direct-kernel-boot-bogus-extra.xml | 1 +
.../test-fullvirt-direct-kernel-boot-extra.xml | 1 +
.../xlconfigdata/test-fullvirt-direct-kernel-boot.xml | 1 +
tests/xlconfigdata/test-fullvirt-multiusb.xml | 1 +
tests/xlconfigdata/test-new-disk.xml | 1 +
tests/xlconfigdata/test-spice-features.xml | 1 +
tests/xlconfigdata/test-spice.xml | 1 +
tests/xlconfigdata/test-vif-rate.xml | 1 +
tests/xmconfigdata/test-escape-paths.xml | 1 +
tests/xmconfigdata/test-fullvirt-default-feature.xml | 1 +
tests/xmconfigdata/test-fullvirt-force-hpet.xml | 1 +
tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 1 +
tests/xmconfigdata/test-fullvirt-localtime.xml | 1 +
tests/xmconfigdata/test-fullvirt-net-netfront.xml | 1 +
tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 1 +
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 1 +
.../xmconfigdata/test-fullvirt-serial-dev-2-ports.xml | 1 +
.../test-fullvirt-serial-dev-2nd-port.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-file.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-null.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-pty.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 1 +
.../xmconfigdata/test-fullvirt-serial-tcp-telnet.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-udp.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-unix.xml | 1 +
tests/xmconfigdata/test-fullvirt-sound.xml | 1 +
tests/xmconfigdata/test-fullvirt-usbmouse.xml | 1 +
tests/xmconfigdata/test-fullvirt-usbtablet.xml | 1 +
tests/xmconfigdata/test-fullvirt-utc.xml | 1 +
tests/xmconfigdata/test-no-source-cdrom.xml | 1 +
tests/xmconfigdata/test-pci-devs.xml | 1 +
139 files changed, 149 insertions(+), 93 deletions(-)
--
2.5.0
8 years, 8 months
[libvirt] [PATCH 0/9] Fix race conditions with qemuProcessStop
by Jiri Denemark
Jiri Denemark (9):
qemu: Export qemuDomainObjBeginNestedJob
qemu: End nested jobs properly
qemu: Pass async job to qemuProcessInit
qemu: Introduce qemuProcessBeginStopJob
qemu: Start an async job for processGuestPanicEvent
qemu: Process monitor EOF in a job
qemu: Simplify error handling in qemuProcessReconnect
qemu: Avoid calling qemuProcessStop without a job
Check for active domain in virDomainObjWait
src/conf/domain_conf.c | 7 ++
src/qemu/qemu_domain.c | 9 +--
src/qemu/qemu_domain.h | 5 ++
src/qemu/qemu_driver.c | 179 +++++++++++++++++++++++--------------------
src/qemu/qemu_migration.c | 9 ++-
src/qemu/qemu_monitor.c | 14 +++-
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_process.c | 191 +++++++++++++++++++++++++++++-----------------
src/qemu/qemu_process.h | 6 ++
9 files changed, 254 insertions(+), 168 deletions(-)
--
2.7.1
8 years, 8 months
[libvirt] [PATCH] test: qemuxml2argv: Drop QEMU_CAPS_DEVICE uses
by Andrea Bolognani
Since commit 51045df01b3c, the QEMU_CAPS_DEVICE capability is enabled
automatically and shouldn't be passed as an argument to DO_TEST();
however, commit 998a936c4c1a accidentally introduced few such uses.
---
tests/qemuxml2argvtest.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 349e6ed..bb80c22 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1700,18 +1700,18 @@ mymain(void)
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
DO_TEST_FAILURE("aarch64-gic-v3",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
- DO_TEST("aarch64-gic-host", QEMU_CAPS_DEVICE,
+ DO_TEST("aarch64-gic-host",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
- DO_TEST_FAILURE("aarch64-gic-host", QEMU_CAPS_DEVICE,
+ DO_TEST_FAILURE("aarch64-gic-host",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
- DO_TEST_PARSE_ERROR("aarch64-gic-invalid", QEMU_CAPS_DEVICE,
+ DO_TEST_PARSE_ERROR("aarch64-gic-invalid",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
- DO_TEST_FAILURE("aarch64-gic-not-virt", QEMU_CAPS_DEVICE,
+ DO_TEST_FAILURE("aarch64-gic-not-virt",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
- DO_TEST_FAILURE("aarch64-gic-not-arm", QEMU_CAPS_DEVICE,
+ DO_TEST_FAILURE("aarch64-gic-not-arm",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
--
2.5.0
8 years, 8 months
[libvirt] [PATCH] qemu: add spice opengl support
by Marc-André Lureau
Add Spice graphics gl attribute. qemu 2.6 should have -spice gl=on argument to
enable opengl rendering context (patches on the ML). This is necessary to
actually enable virgl rendering.
Add a qemuxml2argv test for virtio-gpu + spice with virgl.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
docs/formatdomain.html.in | 6 +++
docs/schemas/domaincommon.rng | 5 +++
src/conf/domain_conf.c | 19 ++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 ++++++
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4 ++
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 24 ++++++++++++
.../qemuxml2argv-video-virtio-gpu-spice-gl.xml | 36 ++++++++++++++++++
tests/qemuxml2argvtest.c | 6 +++
.../qemuxml2xmlout-video-virtio-gpu-spice-gl.xml | 43 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
14 files changed, 160 insertions(+)
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/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e96798f..cb2c178 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4991,6 +4991,12 @@ qemu-kvm -net nic,model=? /dev/null
0.8.8</span>); and <code>usbredir</code>
(<span class="since">since 0.9.12</span>).
</p>
+ <p>
+ Spice may provide accelerated server-side rendering with
+ OpenGL. You can enable or disable OpenGL support explicitly with
+ the <code>gl</code> attribute.
+ (<span class="since">since 1.3.2</span>).
+ </p>
<pre>
<graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
<channel name='main' mode='secure'/>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 67af93a..d4672d0 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2711,6 +2711,11 @@
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="gl">
+ <ref name="virYesNo"/>
+ </attribute>
+ </optional>
<interleave>
<ref name="listenElements"/>
<zeroOrMore>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index acd58a1..0976e09 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10779,6 +10779,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
char *port = virXMLPropString(node, "port");
char *tlsPort;
char *autoport;
+ char *gl;
char *defaultMode;
int defaultModeVal;
@@ -10813,6 +10814,20 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
VIR_FREE(autoport);
}
+ if ((gl = virXMLPropString(node, "gl")) != NULL) {
+ int glVal;
+
+ if ((glVal = virTristateBoolTypeFromString(gl)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown gl value '%s'"), gl);
+ VIR_FREE(gl);
+ goto error;
+ }
+
+ def->data.spice.gl = glVal;
+ VIR_FREE(gl);
+ }
+
def->data.spice.defaultMode = VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY;
if ((defaultMode = virXMLPropString(node, "defaultMode")) != NULL) {
@@ -21032,6 +21047,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
break;
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ if (def->data.spice.gl)
+ virBufferAsprintf(buf, " gl='%s'",
+ virTristateBoolTypeToString(def->data.spice.gl));
+
if (def->data.spice.port)
virBufferAsprintf(buf, " port='%d'",
def->data.spice.port);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1de3be3..d3b3ed2 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1586,6 +1586,7 @@ struct _virDomainGraphicsDef {
int streaming;
int copypaste; /* enum virTristateBool */
int filetransfer; /* enum virTristateBool */
+ int gl; /* enum virTristateBool */
} spice;
} data;
/* nListens, listens, and *port are only useful if type is vnc,
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3099e34..cab4d7d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -314,6 +314,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"vserport-change-event", /* 210 */
"virtio-balloon-pci.deflate-on-oom",
+ "spice-gl",
);
@@ -2625,6 +2626,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
{ "machine", "aes-key-wrap", QEMU_CAPS_AES_KEY_WRAP },
{ "machine", "dea-key-wrap", QEMU_CAPS_DEA_KEY_WRAP },
{ "chardev", "append", QEMU_CAPS_CHARDEV_FILE_APPEND },
+ { "spice", "gl", QEMU_CAPS_SPICE_GL },
};
static int
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e5353de..0c857d2 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -343,6 +343,7 @@ typedef enum {
QEMU_CAPS_VSERPORT_CHANGE, /* VSERPORT_CHANGE event */
QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE, /* virtio-balloon-{device,pci,ccw}.
* deflate-on-oom */
+ QEMU_CAPS_SPICE_GL, /* -spice gl */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b751f04..666dfc6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6047,6 +6047,17 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
}
+ if (graphics->data.spice.gl) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_GL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This QEMU doesn't support spice OpenGL"));
+ goto error;
+ }
+
+ virBufferAsprintf(&opt, ",gl=%s",
+ virTristateSwitchTypeToString(graphics->data.spice.gl));
+ }
+
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION)) {
/* If qemu supports seamless migration turn it
* unconditionally on. If migration destination
diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps
index 931bc4f..679d65a 100644
--- a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps
@@ -172,4 +172,5 @@
<flag name='ich9-disable-s4'/>
<flag name='vserport-change-event'/>
<flag name='virtio-balloon-pci.deflate-on-oom'/>
+ <flag name='spice-gl'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies
index 7b692b5..07aadba 100644
--- a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies
+++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies
@@ -3345,6 +3345,10 @@
{
"parameters": [
{
+ "name": "gl",
+ "type": "boolean"
+ },
+ {
"name": "seamless-migration",
"type": "boolean"
},
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args
new file mode 100644
index 0000000..1361784
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args
@@ -0,0 +1,24 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=spice \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 1024 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,\
+if=none,id=drive-ide0-0-0,cache=none \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-spice port=0,gl=on \
+-device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml
new file mode 100644
index 0000000..07afad2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</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='file' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source file='/var/lib/libvirt/images/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'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='spice' gl='yes' autoport='no'/>
+ <video>
+ <model type='virtio' heads='1'>
+ <acceleration accel3d='yes'/>
+ </model>
+ </video>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 349e6ed..542141a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1458,6 +1458,12 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ DO_TEST("video-virtio-gpu-spice-gl", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_SPICE,
+ QEMU_CAPS_SPICE_GL,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
DO_TEST_PARSE_ERROR("video-invalid", NONE);
DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG,
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml
new file mode 100644
index 0000000..51b8a1e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</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='file' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source file='/var/lib/libvirt/images/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'/>
+ <graphics type='spice' gl='yes' autoport='no'/>
+ <video>
+ <model type='virtio' heads='1'>
+ <acceleration accel3d='yes'/>
+ </model>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </video>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 56dc821..d24ad2b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -751,6 +751,7 @@ mymain(void)
DO_TEST("video-virtio-gpu-device");
DO_TEST("video-virtio-gpu-virgl");
+ DO_TEST("video-virtio-gpu-spice-gl");
DO_TEST("virtio-input");
DO_TEST("virtio-input-passthrough");
--
2.5.0
8 years, 8 months
[libvirt] [PATCH] Use correct pci addresses during interface-detach[v2]
by Nitesh Konkar
The virsh attach virsh detach interface command fails when both live and config
are set and when the interface gets attached to different pci slots
on live and config xml respectively.
When we attach an interface with both --live and --config,
the first time they get the same PCI slots, but the second time
onwards it differs and hence the virsh detach-interface --live
--config command fails. This patch makes sure that when both
--live --config are set , qemuDomainDetachDeviceFlags is called
twice, once with config xml and once with live xml.
Steps to see the issue:
virsh attach-interface --domain DomainName --type network --source default --mac 52:54:00:4b:76:5f --live --config
virsh detach-interface --domain DomainName --type network --mac 52:54:00:4b:76:5f --live --config
virsh attach-interface --domain DomainName --type network --source default --mac 52:54:00:4b:76:5f --live --config
virsh detach-interface --domain DomainName --type network --mac 52:54:00:4b:76:5f --live --config
Signed-off-by:nitkon12@linux.vnet.ibm.com
---
tools/virsh-domain.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 62acecb..43c8436 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10815,7 +10815,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
char buf[64];
int diff_mac;
size_t i;
- int ret;
+ int ret, flag_live_config_both = 0;
bool functionReturn = false;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
bool current = vshCommandOptBool(cmd, "current");
@@ -10830,7 +10830,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
if (config || persistent)
flags |= VIR_DOMAIN_AFFECT_CONFIG;
- if (live)
+ if (!(config || persistent) && live) // Only Live
flags |= VIR_DOMAIN_AFFECT_LIVE;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
@@ -10851,6 +10851,8 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
else
doc = virDomainGetXMLDesc(dom, 0);
+ forlivexml:
+
if (!doc)
goto cleanup;
@@ -10921,6 +10923,14 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
if (ret != 0) {
vshError(ctl, "%s", _("Failed to detach interface"));
} else {
+ if ((config || persistent) && live && flag_live_config_both == 0) {//executed only when live config both in cmd.
+ doc = virDomainGetXMLDesc(dom, 0);
+ flag_live_config_both=1; //Need to execute this code only once
+ flags |= VIR_DOMAIN_AFFECT_LIVE; //set live flag
+ flags &= (~VIR_DOMAIN_AFFECT_CONFIG ); // need to unset config flag as config xml detach is already done.
+ mac=NULL;
+ goto forlivexml;
+ }
vshPrint(ctl, "%s", _("Interface detached successfully\n"));
functionReturn = true;
}
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH v2] 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 is fixed.
---
src/admin/admin_remote.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index e634fa7..3745b9e 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -180,7 +180,9 @@ remoteAdminConnectClose(virAdmConnectPtr conn)
goto done;
}
- virNetClientSetCloseCallback(priv->client, NULL, NULL, NULL);
+ virNetClientSetCloseCallback(priv->client, NULL, conn->closeCallback,
+ virObjectFreeCallback);
+ virNetClientClose(priv->client);
rv = 0;
--
2.4.3
8 years, 8 months
[libvirt] VMware driver: SessionIsActive API / Sessions.ValidateSession permission
by Richard W.M. Jones
The VMware driver currently calls the SessionIsActive API, which
requires the vCenter Sessions.ValidateSession permission.
https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/esx/esx_vi.c;h=af822b...
This causes a problem that you have to give this permission to any
libvirt client accessing VMware, and you have to give it from the very
top level of vCenter, all the way down through the Cluster, Folder,
hypervisor levels. This has caused a bit of pushback from virt-v2v
users who consider that the SessionIsActive API is an "admin" API
which they don't want to give out to roles using v2v.
Is calling SessionIsActive necessary? From my (very limited)
understanding, it seems as if we might use 'SessionManager.
currentSession' property instead, which doesn't require admin
permissions. Actually the code [see link above] already does this
when ctx->hasSessionIsActive is false, but that doesn't apply to
modern vCenter.
See also
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=5699034b65afd49d91d...
which doesn't really explain why this was added.
Also, why is it even necessary to check if the session is active here?
Shouldn't we just log in unconditionally?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
8 years, 8 months