qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-1.4] qapi: Improve chardev-add documentation


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH for-1.4] qapi: Improve chardev-add documentation
Date: Tue, 12 Feb 2013 11:35:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130108 Thunderbird/10.0.12

  Hi,

> Now let's take another step back: a character device is just a file.
> Why can't we use plain ChardevFile for it?

It's not.

First, the file backend allows input and output being different files,
and the input file is optional.  That doesn't make sense for the
parallel/serial port case.

Second, it's actually more than a file.  The guest can change device
parameters such as the baudrate on the virtual device and qemu will
apply those changes to the host device.

IMO it is different enough to have its own type.

> File type could be determined automatically.  If we don't want to do
> that, we have to make the user specify it via parameter.  The parameter
> could be optional and default to "regular file".

Well, not really.

I don't feel like doing guesswork based on the filename.  If we have one
in the first place, we can also get passed in a file handle (via
/dev/fdset/name).

And I also don't feel like invoking random ioctls on the file handle we
got, trying to figure whenever the device at hand is a serial port or
parallel port or something else.

>> So, if you have a better name suggestion in time for 1.4 ...
> 
> I believe the cautious choice is disabling type port for 1.4, so we can
> figure out the design we want without undue time pressure.

I fail to see what is to terribly bad on the design.

> If we decide to keep it for 1.4, I'd suggest to rename from 'port' to
> 'hostdev' or similar.

I don't care that much what the actual name of the beast is.
Feel free to submit a patch changing the name.

cheers,
  Gerd



reply via email to

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