On 10/05/18 21:17, John Ferlan wrote:
On 05/10/2018 06:53 AM, Maciej Wolny wrote:
> Support OpenGL acceleration capability when using SDL graphics.
>
> Signed-off-by: Maciej Wolny <maciej.wolny(a)codethink.co.uk>
> ---
> src/qemu/qemu_capabilities.c | 2 ++
> src/qemu/qemu_capabilities.h | 1 +
> tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 9 +++++++++
> tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 3 ++-
> 4 files changed, 14 insertions(+), 1 deletion(-)
>
As I rather lengthily noted in the v1 - I'm assuming you handed
edited the .replies file. What that perhaps works and gets you
the answer, the fact that none of other files were adjusted leads
me to the hand editing belief.
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 920a59617..23f917b66 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -475,6 +475,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
> "disk-write-cache",
> "nbd-tls",
> "tpm-crb",
> + "sdl-gl",
> );
>
>
> @@ -2456,6 +2457,7 @@ static struct virQEMUCapsCommandLineProps
virQEMUCapsCommandLine[] = {
> { "vnc", "vnc", QEMU_CAPS_VNC_MULTI_SERVERS },
> { "chardev", "reconnect", QEMU_CAPS_CHARDEV_RECONNECT },
> { "sandbox", "elevateprivileges",
QEMU_CAPS_SECCOMP_BLACKLIST },
> + { "sdl", "gl", QEMU_CAPS_SDL_GL },
> };
Rather than this, I'll apply the following diff:
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 23f917b66e..28079fa7ab 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2457,7 +2457,6 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[]
= {
{ "vnc", "vnc", QEMU_CAPS_VNC_MULTI_SERVERS },
{ "chardev", "reconnect", QEMU_CAPS_CHARDEV_RECONNECT },
{ "sandbox", "elevateprivileges", QEMU_CAPS_SECCOMP_BLACKLIST
},
- { "sdl", "gl", QEMU_CAPS_SDL_GL },
};
static int
@@ -3828,6 +3827,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
if (qemuCaps->version >= 2004000)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT);
+ /* sdl -gl option is supported from v2.4.0 (qemu commit id 0b71a5d5) */
+ if (qemuCaps->version >= 2004000)
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_SDL_GL);
+
/* Since 2.4.50 ARM virt machine supports gic-version option */
if (qemuCaps->version >= 2004050)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACH_VIRT_GIC_VERSION);
>
> static int
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index abd6eff14..01d6be818 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -459,6 +459,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for
syntax-check */
> QEMU_CAPS_DISK_WRITE_CACHE, /* qemu block frontends support write-cache param
*/
> QEMU_CAPS_NBD_TLS, /* NBD server supports TLS transport */
> QEMU_CAPS_DEVICE_TPM_CRB, /* -device tpm-crb */
> + QEMU_CAPS_SDL_GL, /* -sdl gl */
>
> QEMU_CAPS_LAST /* this must always be the last item */
> } virQEMUCapsFlags;
> diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies
b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies
> index 68ecb0c17..5614fc63c 100644
> --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies
> +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies
> @@ -3575,6 +3575,15 @@
> },
> {
> "parameters": [
> + {
> + "name": "gl",
> + "type": "boolean"
> + }
> + ],
> + "option": "sdl"
> + },
> + {
> + "parameters": [
> ],
> "option": "acpi"
> },
I'll remove this hand edit...
> diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
> index f3834d5bc..3a968542b 100644
> --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
> +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
> @@ -153,9 +153,10 @@
> <flag name='chardev-reconnect'/>
> <flag name='virtio-gpu.max_outputs'/>
> <flag name='isa-serial'/>
> + <flag name='sdl-gl'/>
> <version>2004000</version>
> <kvmVersion>0</kvmVersion>
> - <microcodeVersion>75406</microcodeVersion>
> + <microcodeVersion>75544</microcodeVersion>
This hunk would be reverted
> <package></package>
> <arch>x86_64</arch>
> <cpu type='kvm' name='Opteron_G5'/>
>
and run VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiestest to generate
a bunch of caps_2*.*.xml files across all the arches.
I've made the adjustments, but just need to make sure you're OK with that and
that no one else has some sort of agita over the solution or some other way
to try and get the answer without changing virQEMUCapsInitQMPMonitor.
I'm OK with that.
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John