All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 6/6] monitor: convert do_cpu_set() to QObject, QError
Date: Wed, 27 Jan 2010 09:00:37 +0100	[thread overview]
Message-ID: <m3tyu8ugd6.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <4B5F5D4C.2020605@codemonkey.ws> (Anthony Liguori's message of "Tue, 26 Jan 2010 15:23:24 -0600")

Anthony Liguori <anthony@codemonkey.ws> writes:

> On 01/20/2010 06:07 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster<armbru@redhat.com>
>> ---
>>   monitor.c       |    4 ++--
>>   qemu-monitor.hx |    3 ++-
>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/monitor.c b/monitor.c
>> index 816f6fd..b9166c3 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -808,11 +808,11 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data)
>>       *ret_data = QOBJECT(cpu_list);
>>   }
>>
>> -static void do_cpu_set(Monitor *mon, const QDict *qdict)
>> +static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
>>   {
>>       int index = qdict_get_int(qdict, "index");
>>       if (mon_set_cpu(index)<  0)
>> -        monitor_printf(mon, "Invalid CPU index\n");
>> +        qemu_error_new(QERR_INVALID_CPU_INDEX);
>>    
>
> Just out of curiousity, why introduce a new error verses using
> (QERR_INVALID_PARAMETER, "index")?

To avoid changing the non-QMP monitor.  If you don't care about that, I
can revert 5/6 and update 6/6.

Alternatively, here's a trick to reduce the number of client visible QMP
errors while still keeping the old diagnostic on the non-QMP monitor:

    +#define QERR_INVALID_CPU_INDEX \
    +    "{ 'class': 'InvalidParameter, 'data': { 'name': 'index' } }"
    +
     #define QERR_INVALID_PARAMETER \
         "{ 'class': 'InvalidParameter', 'data': { 'name': %s } }"

  reply	other threads:[~2010-01-27  8:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 12:07 [Qemu-devel] [PATCH v2 0/6] Convert memsave, pmemsave, cpu to QObject+QError Markus Armbruster
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 1/6] monitor: Don't check for mon_get_cpu() failure Markus Armbruster
2010-01-26 21:34   ` Anthony Liguori
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 2/6] QError: New QERR_OPEN_FILE_FAILED Markus Armbruster
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 3/6] monitor: convert do_memory_save() to QError Markus Armbruster
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 4/6] monitor: convert do_physical_memory_save() " Markus Armbruster
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 5/6] QError: New QERR_INVALID_CPU_INDEX Markus Armbruster
2010-01-20 12:07 ` [Qemu-devel] [PATCH v2 6/6] monitor: convert do_cpu_set() to QObject, QError Markus Armbruster
2010-01-26 21:23   ` Anthony Liguori
2010-01-27  8:00     ` Markus Armbruster [this message]
2010-01-28 22:50       ` Anthony Liguori
2010-01-20 13:24 ` [Qemu-devel] [PATCH v2 0/6] Convert memsave, pmemsave, cpu to QObject+QError Luiz Capitulino

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=m3tyu8ugd6.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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.