|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] Re: [PATCH v2 9/9] Add -kvm option |
Date: | Tue, 13 Oct 2009 10:33:46 -0500 |
User-agent: | Thunderbird 2.0.0.23 (X11/20090825) |
Gerd Hoffmann wrote:
qemu should not have the concept of a default nic.Well, right now it has (likewise for serial, vga, ...). And it causes problems with the qdev way of managing devices, so we have to find a way to deal with it.
There are a few separate issues that should be treated differently. For vga, it should just be a default device in the machine description. A special id should be used for the default vga card and -vga std should have the effect of modifying the a vga device of that id to be std. IOW, it should be -device-remove id=default_vga -device stdvga,id=default_vga.
For serial, we default to having one port. Again, it should have a well known id and -serial none should be -device-remove id=default_serial. For nics, it's a bit complicated by the fact that -net nic doesn't require a model and by default, each machine may have a default model. We will likely have to preserve this as a config option which is unfortunate.
That said, without -net none, we get a single network device. Again, it should have a well known id and -net none should remove that device.
Right now the default devices are tied to a command line switch, i.e. in case there isn't a -serial switch specified qemu will add a default serial device, even in case one was added via -device isa-serial.
I don't think -device has to have the same property of -serial. That is, -device isa-serial doesn't need to replace the default serial device which is connected to a vc. Rather, we should allow a user to modify the char device associated with that default serial device via -set.
We shouldn't think of it like we add a default -serial device if no -serial switch was used. Instead, there has always been a default isa-serial device. You can modify it via -set or you can remove it. -serial none removes it. For the first occurrence of -serial, it behaves like -set. Future occurrences of -set behave like -device isa-serial.
-- Regards, Anthony Liguori
[Prev in Thread] | Current Thread | [Next in Thread] |