qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support
Date: Tue, 08 Jun 2010 12:23:33 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4


One "smart way to implement default devices" could be an inclusion mechanism where a machine can ask qemu to read other config files. Then you'd have config files for the default serial/parallel/etc. This could also be implemented on top of choices 2/3/4 though.

Defaults are tough because there are multiple ways to create devices today. Here's something that could potentially address the problem. I'll focus on -serial but it's equally applicable to the other default devices.

We would introduce serial0, serial1, serial2, serial3 MachineCore properties. These properties would be chardev names.

The pc machine types would do:
   QOPT_VALUE("serial0", "__default_serial0");

In vl.c, we would always create a __default_serial0 chardev of 'vc'.

The -serial option would keep a counter and:

  -serial mon:stdio -serial vc

Would be equivalent to:

 -chardev mon:stdio,id=__serial0 -machine serial0=__serial0 \
 -chardev vc,id=__serial1 -machine serial1=__serial1

-nodefaults simply suppresses the creation of the default serial devices.

It's the job of the MachineCore to try to find each of the serialN properties and if the chardevs have been created, use qdev to create an appropriate serial port device.

This would apply equally well to parallel and virtcon.

Networking is a bit of a nightmare as many boards simply ignore the networking options. Floppy and cdrom can work in this way too.

Regards,

Anthony Liguori

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]