All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: kwolf@redhat.com, qemu-block@nongnu.org,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, mreitz@redhat.com,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: Re: [Qemu-devel] [PATCH v2 8/8] hw: Drop superfluous special checks for orphaned -drive
Date: Mon, 30 Jan 2017 09:10:05 +0100	[thread overview]
Message-ID: <87a8a9vuhu.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <e0f2369d-6ebf-ae73-abf1-7021b257748c@redhat.com> (John Snow's message of "Sat, 28 Jan 2017 03:53:08 -0500")

John Snow <jsnow@redhat.com> writes:

> On 01/27/2017 11:04 AM, Markus Armbruster wrote:
>> John Snow <jsnow@redhat.com> writes:
>> 
>>> On 01/27/2017 06:51 AM, Markus Armbruster wrote:
>>>> John Snow <jsnow@redhat.com> writes:
>>>>
>>>>> On 01/26/2017 10:09 AM, Markus Armbruster wrote:
>>>>>> We've traditionally rejected orphans here and there, but not
>>>>>> systematically.  For instance, the sun4m machines have an onboard SCSI
>>>>>> HBA (bus=0), and have always rejected bus>0.  Other machines with an
>>>>>> onboard SCSI HBA don't.
>>>>>>
>>>>>> Commit a66c9dc made all orphans trigger a warning, and the previous
>>>>>> commit turned this into an error.  The checks "here and there" are now
>>>>>> redundant.  Drop them.
>>>>>>
>>>>>> Note that the one in mips_jazz.c was wrong: it rejected bus > MAX_FD,
>>>>>> but MAX_FD is the number of floppy drives per bus.
>>>>>>
>>>>>> Error messages change from
>>>>>>
>>>>>>     $ qemu-system-x86_64 -drive if=ide,bus=2
>>>>>>     qemu-system-x86_64: Too many IDE buses defined (3 > 2)
>>>>>>     $ qemu-system-mips64 -M magnum,accel=qtest -drive if=floppy,bus=2,id=fd1
>>>>>>     qemu: too many floppy drives
>>>>>>     $ qemu-system-sparc -M LX -drive if=scsi,bus=1
>>>>>>     qemu: too many SCSI bus
>>>>>>
>>>>>> to
>>>>>>
>>>>>>     $ qemu-system-x86_64 -drive if=ide,bus=2
>>>>>>     qemu-system-x86_64: -drive if=ide,bus=2: machine type does not support this drive
>>>>>>     $ qemu-system-mips64 -M magnum,accel=qtest -drive if=floppy,bus=2,id=fd1
>>>>>>     qemu-system-mips64: -drive if=floppy,bus=2,id=fd1: machine type does not support this drive
>>>>>>     $ qemu-system-sparc -M LX -drive if=scsi,bus=1
>>>>>>     qemu-system-sparc: -drive if=scsi,bus=1: machine type does not support this drive
>>>>>>
>>>>>
>>>>> Hm, that's a lot less helpful, isn't it? Can we augment with hints?
>>>>
>>>> The message itself may be less specific, but it now comes with a precise
>>>> location.  Personally, I'd even find
>>>>
>>>>     qemu-system-sparc: -drive if=scsi,bus=1: *mumble* *mumble*
>>>>
>>>> more helpful than
>>>>
>>>>     qemu: too many SCSI bus
>>>>
>>>> because the former tells me *which* of the options is bad.  We tend to
>>>> have lots and lots of them.
>>>>
>>>> The deleted special case errors cover only a minority of "orphan"
>>>> -drive.  If these cases need improvement, then so will the general case.
>>>> If you can come up with a hint that makes the general case message more
>>>> useful, I'm more than happy to squash it into PATCH 6.
>>>>
>>>
>>> The old error had "why" and the new error has "where" but neither has
>>> both. I would suggest that from the "why" you can divine the "where,"
>>> but the opposite is not as easily true.
>> 
>> Some users will be able to divine more easily than others.  Consider my
>> "too many floppy drives" example.  There's just one, and the machine
>> actually supports two.  The user has to make the connection to "bus=2"
>> somehow.  Now, anybody crazy enough to mess with bus= can probably be
>> expected to figure this out, but still, the deleted error messages
>> aren't exactly wonderful.
>> 
>>> The new error even suggests information I think is wrong and misleading:
>>> We do support SCSI! (Just not this many of them.)
>> 
>> Well, the error doesn't say "machine doesn't support SCSI", only
>> "doesn't support this particular -drive".  Perhaps it could be worded
>> more clearly.  Ideas?
>> 
>
> Ah, I see what you mean now. I interpreted "this drive" to mean SCSI,
> not this SCSI *instance*.

Uh, I would've written "does not support if=scsi" then.  But I see where
you come from.

>                           If it can be made clearer that QEMU is simply
> unable to instantiate this particular instance, that'd be fine.
>
> Instead of "Machine type does not support this drive,"
>
> how about
>
> "Machine type cannot instantiate this drive instance"

Hmm.

> Or ... follow your own best judgement. This is really YOUR wheelhouse.
> My example is a little wordy.

All I can come up with is even wordier: "Machine type doesn't support
this combination of if, bus, unit", or "if=scsi,bus=%d,unit=%d not
supported with this machine type".  Could also be confusing when the
user specified index instead of bus, unit.

Good error messages are hard...

  reply	other threads:[~2017-01-30  8:10 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 15:09 [Qemu-devel] [PATCH v2 0/8] More sensible default for -drive interface type Markus Armbruster
2017-01-26 15:09 ` [Qemu-devel] [PATCH v2 1/8] hw: Default -drive to if=ide explicitly where it works Markus Armbruster
2017-01-26 20:02   ` Thomas Huth
2017-01-27  6:55     ` Markus Armbruster
2017-01-27 10:21       ` Yongbok Kim
2017-01-27 10:31         ` [Qemu-devel] MIPS machines (was: [PATCH v2 1/8] hw: Default -drive to if=ide explicitly where it works) Thomas Huth
2017-01-27 11:01           ` [Qemu-devel] MIPS machines Yongbok Kim
2017-01-26 15:09 ` [Qemu-arm] [PATCH v2 2/8] hw/arm/cubieboard hw/arm/xlnx-ep108: Fix units_per_default_bus Markus Armbruster
2017-01-26 15:09   ` [Qemu-devel] " Markus Armbruster
2017-01-27 18:33   ` [Qemu-arm] " Alistair Francis
2017-01-27 18:33     ` Alistair Francis
2017-01-26 15:09 ` [Qemu-arm] [PATCH v2 3/8] hw: Default -drive to if=none instead of ide when ide cannot work Markus Armbruster
2017-01-26 15:09   ` Markus Armbruster
2017-01-26 15:09   ` [Qemu-devel] " Markus Armbruster
2017-01-26 15:22   ` [Qemu-arm] " Laurent Vivier
2017-01-26 15:22     ` Laurent Vivier
2017-01-26 15:22     ` [Qemu-devel] " Laurent Vivier
2017-01-26 16:00   ` [Qemu-arm] " Thomas Huth
2017-01-26 16:00     ` Thomas Huth
2017-01-26 16:00     ` Thomas Huth
2017-01-26 15:09 ` [Qemu-arm] [PATCH v2 4/8] hw: Default -drive to if=none instead of scsi when scsi " Markus Armbruster
2017-01-26 15:09   ` [Qemu-devel] " Markus Armbruster
2017-01-26 17:59   ` [Qemu-arm] " Thomas Huth
2017-01-26 17:59     ` Thomas Huth
2017-01-27 18:31     ` [Qemu-arm] " Alistair Francis
2017-01-27 18:31       ` Alistair Francis
2017-01-26 15:09 ` [Qemu-arm] [PATCH v2 5/8] hw/arm/highbank: Default -drive to if=ide instead of if=scsi Markus Armbruster
2017-01-26 15:09   ` [Qemu-devel] " Markus Armbruster
2017-01-26 18:10   ` [Qemu-arm] " Thomas Huth
2017-01-26 18:10     ` Thomas Huth
2017-01-26 15:09 ` [Qemu-devel] [PATCH v2 6/8] blockdev: Improve message for orphaned -drive Markus Armbruster
2017-01-26 15:09 ` [Qemu-devel] [PATCH v2 7/8] blockdev: Make orphaned -drive fatal Markus Armbruster
2017-01-31 12:37   ` [Qemu-devel] [Qemu-block] " John Snow
2017-01-31 14:37     ` Markus Armbruster
2017-01-31 15:37       ` John Snow
2017-02-01  9:00         ` Markus Armbruster
2017-01-26 15:09 ` [Qemu-devel] [PATCH v2 8/8] hw: Drop superfluous special checks for orphaned -drive Markus Armbruster
2017-01-27 11:00   ` John Snow
2017-01-27 11:51     ` Markus Armbruster
2017-01-27 14:15       ` John Snow
2017-01-27 16:04         ` Markus Armbruster
2017-01-28  8:53           ` John Snow
2017-01-30  8:10             ` Markus Armbruster [this message]
2017-01-30  8:28               ` John Snow
2017-02-03 11:04               ` Fam Zheng
2017-02-03 13:35                 ` Markus Armbruster
2017-02-03 14:07                   ` Fam Zheng
2017-02-03 15:38                     ` Markus Armbruster

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=87a8a9vuhu.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.