All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	qemu-block@nongnu.org, Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 2/4] qdev-properties-system: Change set_pointer's parse callback to use Error
Date: Mon, 22 Jun 2015 13:18:30 +0200	[thread overview]
Message-ID: <87mvzst2ih.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA_bjLxGhTb3VB-Pdg-5cZup=5HBSgf=Kjq6bNi2aEBJNw@mail.gmail.com> (Peter Maydell's message of "Mon, 22 Jun 2015 11:11:51 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> On 22 June 2015 at 10:39, Markus Armbruster <armbru@redhat.com> wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> Instead of having set_pointer() call a parse callback which returns
>>> an error number that we then convert to an Error string with
>>> error_set_from_qdev_prop_error(), make the parse callback take an
>>> Error** and set the error itself. This will allow parse routines
>>> to provide more helpful error messages than the generic ones.
>
>> The error messages are faithfully copied from
>> error_set_from_qdev_prop_error().  The next patch will improve
>> parse_drive()'s messages, and that's why you got this patch.
>
> That's right.
>
>> The next patch takes special care of the if=T, T!=none case.  That case
>> only exists for drives, because only for drives did we mix up old-style
>> (one option to configure front- and backend) and new-style (one option
>> to configure backend, -device to configure frontend) configuration.
>>
>> It also changes the if=none case, from
>>
>>     Property 'TYPE.PROP' can't take value 'VAL', it's in use
>>
>> to
>>
>>     "Property 'TYPE.PROP' can't be set to drive ID 'VAL'; that drive
>> has already been connected to another device."
>>
>> More explicit.  Rather long, though.
>
> Do you have a proposed better phrasing? In general I feel that the problem
> with the current error message is that:
>  (1) it is phrased from the point of view of QEMU's internal implementation
>  (2) it is extremely terse
>
> So the lengthiness is in my opinion an improvement. Better not to
> leave the user in the dark about why we just refused to run...

Perhaps

    Drive VAL is already used by another device

Relies on the fact that the context is either blatantly obvious (monitor
command), or the actual message makes it obvious, e.g.

    qemu-system-arm: -device virtio-blk-pci,drive=foo: Drive foo is already used by another device

[...]

  reply	other threads:[~2015-06-22 11:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 13:26 [Qemu-devel] [PATCH 0/4] block: Improve warnings for doubly-connected drives Peter Maydell
2015-06-12 13:26 ` [Qemu-devel] [PATCH 1/4] block: Warn if an if=<something> drive was also connected manually Peter Maydell
2015-06-22  9:59   ` Markus Armbruster
2015-06-22 13:39     ` Peter Maydell
2015-06-22 14:44       ` Markus Armbruster
2015-06-22 15:20     ` Peter Maydell
2015-06-12 13:26 ` [Qemu-devel] [PATCH 2/4] qdev-properties-system: Change set_pointer's parse callback to use Error Peter Maydell
2015-06-22  9:39   ` Markus Armbruster
2015-06-22 10:11     ` Peter Maydell
2015-06-22 11:18       ` Markus Armbruster [this message]
2015-06-12 13:26 ` [Qemu-devel] [PATCH 3/4] qdev-properties-system: Improve error message for drive assignment conflict Peter Maydell
2015-06-22  9:12   ` Markus Armbruster
2015-06-22 10:13     ` Peter Maydell
2015-06-22 11:11       ` Markus Armbruster
2015-06-12 13:26 ` [Qemu-devel] [PATCH 4/4] hw/arm/virt: Make block devices default to virtio Peter Maydell
2015-06-19 11:08 ` [Qemu-devel] [PATCH 0/4] block: Improve warnings for doubly-connected drives Peter Maydell

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=87mvzst2ih.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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.