Re: [PATCH 07/28] virtio: console: don't assume a single console port.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 28 Nov 2009 05:20:30 pm Amit Shah wrote:
> Keep a list of all ports being used as a console, and provide a lock
> and a lookup function.  The hvc callbacks only give us a vterm number,
> so we need to map this.

OK, I think we can do better than this.

How about we introduce a 'struct console_port', like so:

	/* A port which is used as a console. */
	struct console_port {
		struct port port;

		u32 vtermno;
		struct list_head list;
	};

	static DEFINE_SPINLOCK(console_lock);
	static LIST_HEAD(consoles);

ie. now we have nicely partitioned off the console-specific parts, and
can use ->port and container_of() to get from this to a generic port and
vice-versa.

It will make allocations a little more complex, since we need to allocate
a 'struct console_port' or a 'struct port' depending on what we want, but the
rest should be significantly cleaner.

Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux