From: Amit Shah <amit.shah@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@linux-foundation.org
Subject: Re: [PATCH 8/8] virtio: console: struct ports for multiple ports per device.
Date: Tue, 10 Nov 2009 15:03:28 +0530 [thread overview]
Message-ID: <20091110093328.GA22563@amit-x200.redhat.com> (raw)
In-Reply-To: <1257834450..rusty@rustcorp.com.au>
On (Tue) Nov 10 2009 [16:57:30], Rusty Russell wrote:
>
> Rather than assume a single port, add a 'struct ports' with an array
> of ports. Currently, there's always only one, but that will change.
Hey Rusty,
> static void virtcons_apply_config(struct virtio_device *dev)
> {
> - struct port *port = dev->priv;
> + struct ports *ports = dev->priv;
> struct winsize ws;
>
> if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) {
> @@ -158,7 +168,9 @@ static void virtcons_apply_config(struct
> dev->config->get(dev,
> offsetof(struct virtio_console_config, rows),
> &ws.ws_row, sizeof(u16));
> - hvc_resize(port->hvc, ws);
> + /* This is the pre-multiport style: we use control messages
> + * these days which specify the port. So this means port 0. */
> + hvc_resize(ports->port[0].hvc, ws);
I've fixed a bug in the latest patches that I have (just on git so far;
not sent to lists) -- this function is also called from hvc's
notifier_add, so instead of passing vdev here, we can just pass the port
and look up the port in the notifier_add_vio() function via
get_port_from_vtermno().
> -static struct port *__devinit alloc_port(u32 vtermno)
> +static struct ports *__devinit alloc_ports(unsigned int num)
This will have to be changed when we add support for hotplug. So instead
of doing this, just have a linked list from the start?
> {
> - struct port *port = kmalloc(sizeof *port, GFP_KERNEL);
> + struct ports *ports;
> + int i;
>
> - if (!port)
> + ports = kmalloc(sizeof *ports + sizeof(ports->port[0]) * num,
> + GFP_KERNEL);
> + if (!ports)
> return NULL;
Other than this, the series is good; I can base my patches on top of
these.
I guess we can also assign a number to each vdev that gets probed so
that sysfs and debugfs entries for ports can be put in their
vdev-specific directories, like
/sys/class/virtio-console0/vcon0/name
etc.
Also, if you think the send/receive workqueues are fine and we move to
those, they will have to be introduced slightly earlier in this patch
series.
(I'll send out my patches to the list in a while; some polishing is
required still but they're all style issues rather than functionality
ones.)
Amit
next prev parent reply other threads:[~2009-11-10 9:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1257834450..rusty@rustcorp.com.au>
2009-11-10 6:57 ` [PATCH 8/8] virtio: console: struct ports for multiple ports per device Rusty Russell
2009-11-10 7:24 ` Amit Shah
2009-11-10 13:14 ` Rusty Russell
2009-11-10 8:56 ` [PATCH 3/8] hvc_console: make the ops pointer const Christian Borntraeger
2009-11-10 9:33 ` Amit Shah [this message]
2009-11-10 12:51 ` [PATCH 8/8] virtio: console: struct ports for multiple ports per device Rusty Russell
2009-11-10 6:27 Rusty Russell
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=20091110093328.GA22563@amit-x200.redhat.com \
--to=amit.shah@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@linux-foundation.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).