Re: [PATCH] virtio_console: Add support for multiple ports for generic guest and host communication

From: Christian Borntraeger
Date: Thu Oct 01 2009 - 05:02:10 EST


Am Mittwoch 30 September 2009 19:13:21 schrieb Amit Shah:
> - uses port->id instead of a static hvc_vtermno to pass on a value to
> hvc_alloc(). Motivation explained within comments in the code.

[...]
> + * The first argument of hvc_alloc() is the virtual console
> + * number. hvc_alloc() checks if a console with the same value
> + * was used in hvc_instantiate(). We may not end up passing
> + * the same value here (we use the value 0 in
> + * hvc_instantiate() but the console port may not be at id
> + * 0). This isn't a problem, though. Nothing in hvc really
> + * depends on these numbers and since this number is passed on
> + * to us when cons_get/put_chars() is called, it's preferable
> + * to pass on the port->id so that we can get the port struct
> + * via get_port_from_id().
[...]
> + port->hvc = hvc_alloc(port->id, 0, &virtio_cons, PAGE_SIZE);

I am not sure if this is going to be ok.

When I change the old code (without your patch) to use vtermno=0 in
hvc_instantiate and vtermno=1 in hvc_alloc I get
"Warning: unable to open an initial console."

It seems to me that we have to pass the same values.

Christian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/