qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] virtio-console: Add a in-qemu api for open/read/write/close ports
Date: Wed, 23 Sep 2009 11:12:36 +0200	[thread overview]
Message-ID: <4AB9E684.1080500@redhat.com> (raw)
In-Reply-To: <1253636627-12746-5-git-send-email-amit.shah@redhat.com>

> diff --git a/hw/virtio-console.c b/hw/virtio-console.c
> index d750c8e..c41f13c 100644
> --- a/hw/virtio-console.c
> +++ b/hw/virtio-console.c
> @@ -58,6 +58,11 @@ struct VirtIOConsolePort {
> +    size_t (*read_callback)(const uint8_t *buf, const size_t len);

> +    if (port->read_callback) {
> +        ret = port->read_callback(buf, len);
> +    } else if (port->hd) {
> +        ret = qemu_chr_write(port->hd, buf, len);
>       }
> -    return qemu_chr_write(port->hd, buf, len);

No.  port->info->data_for_you() again ;)

> +/* Functions for use inside qemu to open and read from/write to ports */
> +VirtIOConsolePort *virtio_console_open(uint32_t id,
> +                                       size_t(*read_callback)(const uint8_t*buf,
> +                                                              const size_t len))

Anyone who wants talk using a port should be a port driver.

cheers,
   Gerd

  reply	other threads:[~2009-09-23  9:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 16:23 [Qemu-devel] Multiple port support for virtio-console Amit Shah
2009-09-22 16:23 ` [Qemu-devel] [PATCH 1/4] char: Emit 'OPENED' events on char device open Amit Shah
2009-09-22 16:23   ` [Qemu-devel] [PATCH 2/4] qdev: add string property Amit Shah
2009-09-22 16:23     ` [Qemu-devel] [PATCH 3/4] virtio-console: Add support for multiple ports for generic guest-host communication Amit Shah
2009-09-22 16:23       ` [Qemu-devel] [PATCH 4/4] virtio-console: Add a in-qemu api for open/read/write/close ports Amit Shah
2009-09-23  9:12         ` Gerd Hoffmann [this message]
2009-09-23  9:07       ` [Qemu-devel] [PATCH 3/4] virtio-console: Add support for multiple ports for generic guest-host communication Gerd Hoffmann
2009-09-23  9:43         ` Amit Shah
2009-09-23 11:20           ` Gerd Hoffmann
2009-09-23 11:50             ` Amit Shah
2009-09-23 12:30               ` Gerd Hoffmann
2009-09-23 12:40                 ` Amit Shah
2009-09-23 13:04                   ` Gerd Hoffmann
2009-09-23 13:17                     ` Amit Shah

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=4AB9E684.1080500@redhat.com \
    --to=kraxel@redhat.com \
    --cc=amit.shah@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).