[PATCH v3 00/18] Clipboard fixes (for 6.1?)

marcandre.lureau@redhat.com posted 18 patches 2 years, 9 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210805135715.857938-1-marcandre.lureau@redhat.com
include/ui/clipboard.h |  33 ++++++
include/ui/gtk.h       |   1 -
ui/clipboard.c         |  41 +++++++
ui/gtk-clipboard.c     |  24 ++---
ui/vdagent.c           | 239 ++++++++++++++++++++++++++---------------
ui/trace-events        |   1 +
6 files changed, 240 insertions(+), 99 deletions(-)
[PATCH v3 00/18] Clipboard fixes (for 6.1?)
Posted by marcandre.lureau@redhat.com 2 years, 9 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Here is a few fixes I have collected while working on clipboard-related code.

There are some obvious code improvements/fixes, and better handling of release &
unregister to avoid dangling pointers and improve user experience.

v3:
 - add a migration blocker
 - improve the code by using a few helpers

v2:
 - replaced "ui/vdagent: unregister clipboard peer on finalize" with "ui/vdagent: disconnect handlers and reset state on finalize" patch.
 - added "ui/vdagent: reset outbuf on disconnect"
 - commit message tweaks

Marc-André Lureau (18):
  ui/vdagent: fix leak on error path
  ui/vdagent: remove copy-pasta comment
  ui/gtk-clipboard: use existing macros
  ui/gtk-clipboard: fix clipboard enum typo
  ui/clipboard: add helper to retrieve current clipboard
  ui/clipboard: add qemu_clipboard_peer_owns() helper
  ui/clipboard: add qemu_clipboard_peer_release() helper
  ui/clipboard: release owned grabs on unregister
  ui/vdagent: disconnect handlers and reset state on finalize
  ui/vdagent: reset outbuf on disconnect
  ui/vdagent: split clipboard recv message handling
  ui/vdagent: use qemu_clipboard_peer_release helper
  ui/vdagent: use qemu_clipboard_info helper
  ui/vdagent: send empty clipboard when unhandled
  ui/gtk-clipboard: use qemu_clipboard_info helper
  ui/vdagent: send release when no clipboard owner
  ui/gtk-clipboard: emit release clipboard events
  ui/vdagent: add a migration blocker

 include/ui/clipboard.h |  33 ++++++
 include/ui/gtk.h       |   1 -
 ui/clipboard.c         |  41 +++++++
 ui/gtk-clipboard.c     |  24 ++---
 ui/vdagent.c           | 239 ++++++++++++++++++++++++++---------------
 ui/trace-events        |   1 +
 6 files changed, 240 insertions(+), 99 deletions(-)

-- 
2.32.0.264.g75ae10bc75



Re: [PATCH v3 00/18] Clipboard fixes (for 6.1?)
Posted by Marc-André Lureau 2 years, 8 months ago
Hi

On Thu, Aug 5, 2021 at 5:59 PM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Hi,
>
> Here is a few fixes I have collected while working on clipboard-related
> code.
>
> There are some obvious code improvements/fixes, and better handling of
> release &
> unregister to avoid dangling pointers and improve user experience.
>
> v3:
>  - add a migration blocker
>  - improve the code by using a few helpers
>
> v2:
>  - replaced "ui/vdagent: unregister clipboard peer on finalize" with
> "ui/vdagent: disconnect handlers and reset state on finalize" patch.
>  - added "ui/vdagent: reset outbuf on disconnect"
>  - commit message tweaks
>
> Marc-André Lureau (18):
>   ui/vdagent: fix leak on error path
>   ui/vdagent: remove copy-pasta comment
>   ui/gtk-clipboard: use existing macros
>   ui/gtk-clipboard: fix clipboard enum typo
>   ui/clipboard: add helper to retrieve current clipboard
>   ui/clipboard: add qemu_clipboard_peer_owns() helper
>   ui/clipboard: add qemu_clipboard_peer_release() helper
>   ui/clipboard: release owned grabs on unregister
>   ui/vdagent: disconnect handlers and reset state on finalize
>   ui/vdagent: reset outbuf on disconnect
>   ui/vdagent: split clipboard recv message handling
>   ui/vdagent: use qemu_clipboard_peer_release helper
>   ui/vdagent: use qemu_clipboard_info helper
>   ui/vdagent: send empty clipboard when unhandled
>   ui/gtk-clipboard: use qemu_clipboard_info helper
>   ui/vdagent: send release when no clipboard owner
>   ui/gtk-clipboard: emit release clipboard events
>   ui/vdagent: add a migration blocker
>
>  include/ui/clipboard.h |  33 ++++++
>  include/ui/gtk.h       |   1 -
>  ui/clipboard.c         |  41 +++++++
>  ui/gtk-clipboard.c     |  24 ++---
>  ui/vdagent.c           | 239 ++++++++++++++++++++++++++---------------
>  ui/trace-events        |   1 +
>  6 files changed, 240 insertions(+), 99 deletions(-)
>
> --
> 2.32.0.264.g75ae10bc75
>
>
>
>

Ping

Since Gerd is lowering his maintainer responsibilities, is anyone else
interested?

-- 
Marc-André Lureau
Re: [PATCH v3 00/18] Clipboard fixes (for 6.1?)
Posted by Gerd Hoffmann 2 years, 8 months ago
  Hi,

> > Marc-André Lureau (18):
> >   ui/vdagent: fix leak on error path
> >   ui/vdagent: remove copy-pasta comment
> >   ui/gtk-clipboard: use existing macros
> >   ui/gtk-clipboard: fix clipboard enum typo
> >   ui/clipboard: add helper to retrieve current clipboard
> >   ui/clipboard: add qemu_clipboard_peer_owns() helper
> >   ui/clipboard: add qemu_clipboard_peer_release() helper
> >   ui/clipboard: release owned grabs on unregister
> >   ui/vdagent: disconnect handlers and reset state on finalize
> >   ui/vdagent: reset outbuf on disconnect
> >   ui/vdagent: split clipboard recv message handling
> >   ui/vdagent: use qemu_clipboard_peer_release helper
> >   ui/vdagent: use qemu_clipboard_info helper
> >   ui/vdagent: send empty clipboard when unhandled
> >   ui/gtk-clipboard: use qemu_clipboard_info helper
> >   ui/vdagent: send release when no clipboard owner
> >   ui/gtk-clipboard: emit release clipboard events
> >   ui/vdagent: add a migration blocker

Looks all sane to me.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

> Ping
> 
> Since Gerd is lowering his maintainer responsibilities, is anyone else
> interested?

Don't be shy, send a pull request?

take care,
  Gerd


Re: [PATCH v3 00/18] Clipboard fixes (for 6.1?)
Posted by Marc-André Lureau 2 years, 8 months ago
Hi

On Tue, Aug 31, 2021 at 4:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

>   Hi,
>
> > > Marc-André Lureau (18):
> > >   ui/vdagent: fix leak on error path
> > >   ui/vdagent: remove copy-pasta comment
> > >   ui/gtk-clipboard: use existing macros
> > >   ui/gtk-clipboard: fix clipboard enum typo
> > >   ui/clipboard: add helper to retrieve current clipboard
> > >   ui/clipboard: add qemu_clipboard_peer_owns() helper
> > >   ui/clipboard: add qemu_clipboard_peer_release() helper
> > >   ui/clipboard: release owned grabs on unregister
> > >   ui/vdagent: disconnect handlers and reset state on finalize
> > >   ui/vdagent: reset outbuf on disconnect
> > >   ui/vdagent: split clipboard recv message handling
> > >   ui/vdagent: use qemu_clipboard_peer_release helper
> > >   ui/vdagent: use qemu_clipboard_info helper
> > >   ui/vdagent: send empty clipboard when unhandled
> > >   ui/gtk-clipboard: use qemu_clipboard_info helper
> > >   ui/vdagent: send release when no clipboard owner
> > >   ui/gtk-clipboard: emit release clipboard events
> > >   ui/vdagent: add a migration blocker
>
> Looks all sane to me.
>
> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
>
>
thanks

> Ping
> >
> > Since Gerd is lowering his maintainer responsibilities, is anyone else
> > interested?
>
> Don't be shy, send a pull request?
>

Ok!


-- 
Marc-André Lureau