qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] gtk: add devices menu to allow changing rem


From: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH 3/3] gtk: add devices menu to allow changing removable block devices
Date: Thu, 2 May 2013 09:53:11 -0400

On Thu, 02 May 2013 08:41:50 -0500
Anthony Liguori <address@hidden> wrote:

> >> +
> >> +        if (strcmp(type, "ide-cd") == 0) {
> >> +            disk_type = DT_CDROM;
> >> +        } else if (strcmp(type, "isa-fdc") == 0) {
> >> +            disk_type = DT_FLOPPY;
> >> +        } else {
> >> +            disk_type = DT_NORMAL;
> >> +        }
> >
> > Same thing here, comparing against strings is a hack. Devices should
> > probably have a property that says what kind of device they are.
> 
> Ack, this is nasty.  I would like to eliminate this.  There is a type
> field in BlockInfo but:
> 
> # @type: This field is returned only for compatibility reasons, it should
> #        not be used (always returns 'unknown')
> 
> I vaguely remember this happening but I don't remember the specific
> reason why.  I would definitely prefer that we filled out type
> correctly.
> 
> I think Markus was involved in this.  Markus or Luiz, do you remember
> the story here?

IIRC, we had a type field which was a string and Markus eliminated it
because it was unreliable. I was afraid that dropping fields from a QMP
output would be incompatible, so Markus maintained the field but it's
always set to 'unknown'.

It seems totally fine to me to have a new field with the device type
as an enum, but of course it has to be reliable.

PS: For more information about the reliableness of this field please
    contact Markus :)



reply via email to

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