[Qemu-devel] [PATCH] spice: Use proper enum type for kbd led state

Jonathon Jongsma posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170510202006.31737-1-jjongsma@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
ui/spice-input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] spice: Use proper enum type for kbd led state
Posted by Jonathon Jongsma 6 years, 11 months ago
Although the Qemu and spice flags currently have the same value, it
seems more correct to pass the spice flag values to
spice_server_kbd_leds(), especially considering that this function
already makes an effort to convert between the QEMU_*_LED and
SPICE_KEYBOARD_MODIFIER_* values.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
 ui/spice-input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/spice-input.c b/ui/spice-input.c
index 8eeebdb..7fd283b 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -87,7 +87,7 @@ static void kbd_leds(void *opaque, int ledstate)
     if (ledstate & QEMU_CAPS_LOCK_LED) {
         kbd->ledstate |= SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK;
     }
-    spice_server_kbd_leds(&kbd->sin, ledstate);
+    spice_server_kbd_leds(&kbd->sin, kbd->ledstate);
 }
 
 /* mouse bits */
-- 
2.9.3


Re: [Qemu-devel] [PATCH] spice: Use proper enum type for kbd led state
Posted by Marc-André Lureau 6 years, 11 months ago
On Thu, May 11, 2017 at 6:16 AM Jonathon Jongsma <jjongsma@redhat.com>
wrote:

> Although the Qemu and spice flags currently have the same value, it
> seems more correct to pass the spice flag values to
> spice_server_kbd_leds(), especially considering that this function
> already makes an effort to convert between the QEMU_*_LED and
> SPICE_KEYBOARD_MODIFIER_* values.
>
> Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  ui/spice-input.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/spice-input.c b/ui/spice-input.c
> index 8eeebdb..7fd283b 100644
> --- a/ui/spice-input.c
> +++ b/ui/spice-input.c
> @@ -87,7 +87,7 @@ static void kbd_leds(void *opaque, int ledstate)
>      if (ledstate & QEMU_CAPS_LOCK_LED) {
>          kbd->ledstate |= SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK;
>      }
> -    spice_server_kbd_leds(&kbd->sin, ledstate);
> +    spice_server_kbd_leds(&kbd->sin, kbd->ledstate);
>  }
>
>  /* mouse bits */
> --
> 2.9.3
>
>
> --
Marc-André Lureau
Re: [Qemu-devel] [PATCH] spice: Use proper enum type for kbd led state
Posted by Gerd Hoffmann 6 years, 11 months ago
On Thu, 2017-05-25 at 12:50 +0000, Marc-André Lureau wrote:
> 
> 
> On Thu, May 11, 2017 at 6:16 AM Jonathon Jongsma <jjongsma@redhat.com
> > wrote:
> > Although the Qemu and spice flags currently have the same value, it
> > seems more correct to pass the spice flag values to
> > spice_server_kbd_leds(), especially considering that this function
> > already makes an effort to convert between the QEMU_*_LED and
> > SPICE_KEYBOARD_MODIFIER_* values.
> > 
> > Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
> 
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
>  

Added to ui queue.

thanks,
  Gerd