qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: spice-devel@lists.freedesktop.org, qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 02/12] char: add qemu_chr_fe_event()
Date: Fri, 21 Jun 2013 09:35:13 +0200	[thread overview]
Message-ID: <51C40231.2070503@redhat.com> (raw)
In-Reply-To: <1371750371-18491-3-git-send-email-marcandre.lureau@redhat.com>

  Hi,

> +static void spice_chr_fe_event(struct CharDriverState *chr, int event)
> +{
> +#if SPICE_SERVER_VERSION >= 0x000c02
> +    SpiceCharDriver *s = chr->opaque;
> +
> +    spice_server_port_event(&s->sin, event);
> +#endif
> +}

No way.  You are passing an qemu-internal value (event) to an external
library here.  That is going to cause major grief in case the internal
change some day, so please don't.

I'd suggest to have something like this instead:

    switch (event) {
    case OPEN:
        spice_server_port_open()
        break;
    [ ... ]
    }

cheers,
  Gerd

PS: Small historical lesson:  spice-server 0.4.x (IIRC) was full of
    these, which was a major blocker of the upstream merge of spice
    support.  spice-server 0.6.x got a radically different library
    interface to fix that.  A few places escaped review, so we still
    have this in a few minor places, mouse button numbering for
    example.  Luckily this is a place where changes are unlikely.
    But please don't let us add new ones.

  reply	other threads:[~2013-06-21  7:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 17:45 [Qemu-devel] [PATCH 00/12] RFC: add Spice block device Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 01/12] include: add missing config-host.h include Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 02/12] char: add qemu_chr_fe_event() Marc-André Lureau
2013-06-21  7:35   ` Gerd Hoffmann [this message]
2013-06-21  8:40     ` Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 03/12] nbd: don't change socket block during negotiate Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 04/12] Split nbd block client code Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 05/12] nbd: pass export name as init argument Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 06/12] nbd: make session_close() idempotent Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 07/12] block: save the associated child in BlockDriverState Marc-André Lureau
2013-06-20 22:25   ` Paolo Bonzini
2013-06-21  8:36     ` Marc-André Lureau
2013-06-21 11:57       ` Paolo Bonzini
2013-06-21 13:30         ` Marc-André Lureau
2013-06-21 13:39           ` Paolo Bonzini
2013-06-20 17:46 ` [Qemu-devel] [PATCH 08/12] block: extract make_snapshot() from bdrv_open() Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 09/12] block: add "snapshot.size" option to avoid extra bdrv_open() Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 10/12] block: learn to open a driver with a given opaque Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 11/12] block: allow to call bdrv_open() with an opaque Marc-André Lureau
2013-06-20 17:46 ` [Qemu-devel] [PATCH 12/12] block: add spice block device backend 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=51C40231.2070503@redhat.com \
    --to=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.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).