qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v9 3/3] virtio-console: Add a new virtserialport device for generic serial port support
Date: Tue, 20 Oct 2009 15:18:06 +0530	[thread overview]
Message-ID: <20091020094806.GA4405@amit-x200.redhat.com> (raw)
In-Reply-To: <4ADD7A12.1040305@redhat.com>

On (Tue) Oct 20 2009 [10:51:30], Gerd Hoffmann wrote:
>> @@ -107,3 +107,41 @@ static void virtcon_register(void)
>>       virtio_serial_port_qdev_register(&virtcon_info);
>>   }
>>   device_init(virtcon_register)
>
>> +static VirtIOSerialPortInfo virtserial_port_info = {
>> +    .qdev.name     = "virtserialport",
>> +    .qdev.size     = sizeof(VirtConsole),
>> +    .init          = virtserial_port_initfn,
>> +    .have_data     = flush_buf,
>> +    .qdev.props = (Property[]) {
>> +        DEFINE_PROP_CHR("chardev", VirtConsole, chr),
>> +        DEFINE_PROP_STRING("name", VirtIOSerialPort, name),
>
> likewise: DEFINE_PROP_STRING("name", VirtConsole, port.name),

The 'name' field is common to all ports, so it makes sense to put it in
the VirtIOSerialPort struct. (Internal users can pre-define it to their
liking, eg, org.qemu.vnc)

>> +static void virtserial_port_register(void)
>> +{
>> +    virtio_serial_port_qdev_register(&virtserial_port_info);
>> +}
>> +device_init(virtserial_port_register)
>
> You can simply stick two register calls into the existing init function ...

The console init function has extra init'ing to do, like disable buffer
caching, set is_console to true, etc., so there are two init fns.

		Amit

  reply	other threads:[~2009-10-20  9:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20  7:13 [Qemu-devel] [PATCH v9 0/3] virtio-console: Add support for multiple ports for generic guest-host communication Amit Shah
2009-10-20  7:13 ` [Qemu-devel] [PATCH v9 1/3] qdev: add string property Amit Shah
2009-10-20  7:13   ` [Qemu-devel] [PATCH v9 2/3] virtio-console: Add a virtio-serial bus, support for multiple ports Amit Shah
2009-10-20  7:13     ` [Qemu-devel] [PATCH v9 3/3] virtio-console: Add a new virtserialport device for generic serial port support Amit Shah
2009-10-20  8:51       ` Gerd Hoffmann
2009-10-20  9:48         ` Amit Shah [this message]
2009-10-20 14:02           ` Gerd Hoffmann
2009-10-21  3:44             ` Amit Shah
2009-10-20  8:49     ` [Qemu-devel] [PATCH v9 2/3] virtio-console: Add a virtio-serial bus, support for multiple ports Gerd Hoffmann
2009-10-20 11:08     ` Richard W.M. Jones
2009-10-20 12:01       ` Amit Shah
2009-10-20 12:05         ` Richard W.M. Jones
2009-10-20 12:16           ` Amit Shah
2009-10-20  8:56 ` [Qemu-devel] [PATCH v9 0/3] virtio-console: Add support for multiple ports for generic guest-host communication Gerd Hoffmann
2009-10-20  9:50   ` Amit Shah
2009-10-20 11:54 ` Dor Laor
2009-10-20 12:03   ` 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=20091020094806.GA4405@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=kraxel@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).