qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [PATCH for-10.1 06/10] ui/vdagent: replace Buffer with GByteArray
Date: Fri, 9 May 2025 12:30:59 +0100	[thread overview]
Message-ID: <aB3nc9Dd0HDAFbTQ@redhat.com> (raw)
In-Reply-To: <20250311155932.1472092-7-marcandre.lureau@redhat.com>

On Tue, Mar 11, 2025 at 07:59:28PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Buffer is slightly more advanced than GByteArray, since it has a
> cursor/position. But vdagent code doesn't need it. This simplify a bit
> the code, and migration state.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/vdagent.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/ui/vdagent.c b/ui/vdagent.c
> index 724eff972f..ddd8990318 100644
> --- a/ui/vdagent.c
> +++ b/ui/vdagent.c

> @@ -177,9 +177,8 @@ static void vdagent_send_msg(VDAgentChardev *vd, VDAgentMessage *msg)
>          if (chunk.size > 1024) {
>              chunk.size = 1024;
>          }
> -        buffer_reserve(&vd->outbuf, sizeof(chunk) + chunk.size);
> -        buffer_append(&vd->outbuf, &chunk, sizeof(chunk));
> -        buffer_append(&vd->outbuf, msgbuf + msgoff, chunk.size);
> +        g_byte_array_append(vd->outbuf, (void*)&chunk, sizeof (chunk));

nit-pick, QEMU style doesn't usually have a space between 'sizeof' and '('

> +        g_byte_array_append(vd->outbuf, msgbuf + msgoff, chunk.size);
>          msgoff += chunk.size;
>      }
>      vdagent_send_buf(vd);

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-05-09 11:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 15:59 [PATCH for-10.1 00/10] Support vdagent migration marcandre.lureau
2025-03-11 15:59 ` [PATCH for-10.1 01/10] ui/gtk: warn if setting the clipboard failed marcandre.lureau
2025-05-09 11:24   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 02/10] ui/clipboard: use int for selection field marcandre.lureau
2025-05-09 11:25   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 03/10] ui/clipboard: split out QemuClipboardContent marcandre.lureau
2025-05-09 11:25   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 04/10] ui/clipboard: add vmstate_cbinfo marcandre.lureau
2025-05-09 11:26   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 05/10] ui/clipboard: delay clipboard update when not running marcandre.lureau
2025-05-09 11:29   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 06/10] ui/vdagent: replace Buffer with GByteArray marcandre.lureau
2025-05-09 11:30   ` Daniel P. Berrangé [this message]
2025-05-09 14:49     ` Marc-André Lureau
2025-03-11 15:59 ` [PATCH for-10.1 07/10] ui/vdagent: keep "connected" state marcandre.lureau
2025-05-09 11:31   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 08/10] ui/vdagent: factor out clipboard peer registration marcandre.lureau
2025-05-09 11:32   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 09/10] ui/vdagent: add migration support marcandre.lureau
2025-05-09 11:38   ` Daniel P. Berrangé
2025-03-11 15:59 ` [PATCH for-10.1 10/10] ui/vdagent: remove migration blocker marcandre.lureau
2025-03-20  8:38   ` Prasad Pandit
2025-03-20  9:05     ` Marc-André Lureau
2025-05-09 11:39   ` Daniel P. Berrangé
2025-03-11 16:12 ` [PATCH for-10.1 00/10] Support vdagent migration Daniel P. Berrangé
2025-05-06 10:38   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aB3nc9Dd0HDAFbTQ@redhat.com \
    --to=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).