All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"dvaleev@suse.de" <dvaleev@suse.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"agraf@suse.de" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 1/3] bootdevice: remove the check about boot_set_handler
Date: Fri, 6 Feb 2015 17:17:58 +0800	[thread overview]
Message-ID: <54D486C6.9050208@huawei.com> (raw)
In-Reply-To: <87oap7wh85.fsf@blackfin.pond.sub.org>

On 2015/2/6 16:56, Markus Armbruster wrote:

> <arei.gonglei@huawei.com> writes:
> 
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> The reset logic can be done by both machine reset and
>> boot handler. So we shouldn't return error when the boot
>> handler callback don't be set.
>>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> Reviewed-by: Alexander Graf <agraf@suse.de>
>> ---
>>  bootdevice.c | 10 +++-------
>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/bootdevice.c b/bootdevice.c
>> index 5914417..52d3f9e 100644
>> --- a/bootdevice.c
>> +++ b/bootdevice.c
>> @@ -51,19 +51,15 @@ void qemu_boot_set(const char *boot_order, Error **errp)
>>  {
>>      Error *local_err = NULL;
>>  
>> -    if (!boot_set_handler) {
>> -        error_setg(errp, "no function defined to set boot device list for"
>> -                         " this architecture");
>> -        return;
>> -    }
>> -
>>      validate_bootdevices(boot_order, &local_err);
>>      if (local_err) {
>>          error_propagate(errp, local_err);
>>          return;
>>      }
>>  
>> -    boot_set_handler(boot_set_opaque, boot_order, errp);
>> +    if (boot_set_handler) {
>> +        boot_set_handler(boot_set_opaque, boot_order, errp);
>> +    }
>>  }
>>  
>>  void validate_bootdevices(const char *devices, Error **errp)
> 
> Two callers:
> 
> * HMP command boot_set
> 
>   Before your patch: command fails when the target doesn't support
>   changing the boot order.
> 
>   After your patch: command silently does nothing.  I'm afraid that's a
>   regression.
> 

>   Aside: looks like there's no QMP command.

Yes.

> 
> * restore_boot_order()
> 
>   No change yet, because restore_boot_order() ignores errors.  But PATCH
>   3 will make it abort on error.  I guess that's why you make the change
>   here.

Actually, I add this patch based on the previous conversation:
It duplicates the reset logic as well as information holder
locality (machine struct vs parameter).
http://lists.gnu.org/archive/html/qemu-devel/2015-01/msg04172.html
and
http://lists.gnu.org/archive/html/qemu-devel/2015-01/msg04292.html

Regards,
-Gonglei

> 
> To avoid the regression, you could drop PATCH 1, and change PATCH 3 to
> something like
> 
> -    qemu_boot_set(normal_boot_order, NULL);
> +    if (boot_set_handler) {
> +        qemu_boot_set(normal_boot_order, &error_abort);
> +    }
> 
> There are other ways, but this looks like the simplest one.

  reply	other threads:[~2015-02-06  9:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 12:34 [Qemu-devel] [PATCH v2 0/3] bootdevcie: change the boot order validation logic arei.gonglei
2015-02-03 12:34 ` [Qemu-devel] [PATCH v2 1/3] bootdevice: remove the check about boot_set_handler arei.gonglei
2015-02-06  8:56   ` Markus Armbruster
2015-02-06  9:17     ` Gonglei [this message]
2015-02-03 12:34 ` [Qemu-devel] [PATCH v2 2/3] bootdevice: check boot order argument validation before vm running arei.gonglei
2015-02-06  9:06   ` Markus Armbruster
2015-02-06  9:26     ` Gonglei
2015-02-03 12:34 ` [Qemu-devel] [PATCH v2 3/3] bootdevice: add check in restore_boot_order() arei.gonglei
2015-02-06  8:05 ` [Qemu-devel] [PATCH v2 0/3] bootdevcie: change the boot order validation logic Gonglei

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=54D486C6.9050208@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=dvaleev@suse.de \
    --cc=peter.huangpeng@huawei.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.