Hi,
@@ -321,13 +321,9 @@ void qdev_machine_creation_done(void)
CharDriverState *qdev_init_chardev(DeviceState *dev)
{
static int next_serial;
- static int next_virtconsole;
+
/* FIXME: This is a nasty hack that needs to go away. */
- if (strncmp(dev->info->name, "virtio", 6) == 0) {
- return virtcon_hds[next_virtconsole++];
- } else {
- return serial_hds[next_serial++];
- }
+ return serial_hds[next_serial++];
}
I believe the FIXME is about the nasty special case for "virtio". Since
you fix that, better remove the FIXME.
I did that in a previous submission and Gerd asked me to keep it. Even
the serial init can be changed, I guess.
Okay, Gerd's the authority on this.
Yes, serial drivers should use a chardev property instead of
qdev_init_chardev(). You can try to zap this function altogether, but I
think there are still serial drivers using this so this would break the
(full, all archs) build.
cheers,
Gerd