From: Luiz Capitulino <lcapitulino@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
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 [thread overview]
Message-ID: <20130502095311.00192c06@redhat.com> (raw)
In-Reply-To: <878v3x4hy9.fsf@codemonkey.ws>
On Thu, 02 May 2013 08:41:50 -0500
Anthony Liguori <aliguori@us.ibm.com> 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 :)
next prev parent reply other threads:[~2013-05-02 13:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 19:43 [Qemu-devel] [PATCH 0/3] gtk: add Devices menu Anthony Liguori
2013-04-26 19:43 ` [Qemu-devel] [PATCH 1/3] ide: add drive-id property Anthony Liguori
2013-05-02 10:05 ` Andreas Färber
2013-05-02 12:59 ` Anthony Liguori
2013-04-26 19:43 ` [Qemu-devel] [PATCH 2/3] monitor: add notifier list for monitor events Anthony Liguori
2013-04-26 19:43 ` [Qemu-devel] [PATCH 3/3] gtk: add devices menu to allow changing removable block devices Anthony Liguori
2013-05-02 8:49 ` Kevin Wolf
2013-05-02 13:41 ` Anthony Liguori
2013-05-02 13:53 ` Luiz Capitulino [this message]
2013-05-02 14:06 ` Kevin Wolf
2013-05-02 15:29 ` Markus Armbruster
2013-05-02 15:40 ` Anthony Liguori
2013-05-03 12:31 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2013-05-03 13:52 ` Anthony Liguori
2013-05-03 13:57 ` Daniel P. Berrange
2013-05-02 15:47 ` [Qemu-devel] " Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130502095311.00192c06@redhat.com \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.