Patchwork [v5] vl.c: Output error on invalid machine type provided

login
register
mail settings
Submitter Michal Novotny
Date July 31, 2013, 7:04 a.m.
Message ID <0dadf52d6235d364e4e81d6b8b7c8d22ab029bdc.1375254226.git.minovotn@redhat.com>
Download mbox | patch
Permalink /patch/263608/
State New
Headers show

Comments

Michal Novotny - July 31, 2013, 7:04 a.m.
Output error message using qemu's error_report() function when user
provides the invalid machine type on the command line. This also saves
time to find what issue is when you downgrade from one version of qemu
to another that doesn't support required machine type yet (the version
user downgraded to have to have this patch applied too, of course).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 vl.c | 5 +++++
 1 file changed, 5 insertions(+)
Eric Blake - Aug. 12, 2013, 3:55 p.m.
On 07/31/2013 01:04 AM, Michal Novotny wrote:
> Output error message using qemu's error_report() function when user
> provides the invalid machine type on the command line. This also saves
> time to find what issue is when you downgrade from one version of qemu
> to another that doesn't support required machine type yet (the version
> user downgraded to have to have this patch applied too, of course).
> 
> Signed-off-by: Michal Novotny <minovotn@redhat.com>
> ---
>  vl.c | 5 +++++
>  1 file changed, 5 insertions(+)

Are you trying to get this in 1.6?

Reviewed-by: Eric Blake <eblake@redhat.com>
Michal Novotny - Aug. 12, 2013, 3:58 p.m.
On 08/12/2013 05:55 PM, Eric Blake wrote:
> On 07/31/2013 01:04 AM, Michal Novotny wrote:
>> Output error message using qemu's error_report() function when user
>> provides the invalid machine type on the command line. This also saves
>> time to find what issue is when you downgrade from one version of qemu
>> to another that doesn't support required machine type yet (the version
>> user downgraded to have to have this patch applied too, of course).
>>
>> Signed-off-by: Michal Novotny <minovotn@redhat.com>
>> ---
>>  vl.c | 5 +++++
>>  1 file changed, 5 insertions(+)
> Are you trying to get this in 1.6?
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>

It's ok for 1.6. It applies cleanly. So if it's fine with you please
push it to the repository.

Thanks,
Michal
Eric Blake - Aug. 12, 2013, 4:16 p.m.
On 08/12/2013 09:58 AM, Michal Novotny wrote:
> 
> On 08/12/2013 05:55 PM, Eric Blake wrote:
>> On 07/31/2013 01:04 AM, Michal Novotny wrote:
>>> Output error message using qemu's error_report() function when user
>>> provides the invalid machine type on the command line. This also saves
>>> time to find what issue is when you downgrade from one version of qemu
>>> to another that doesn't support required machine type yet (the version
>>> user downgraded to have to have this patch applied too, of course).
>>>
>>> Signed-off-by: Michal Novotny <minovotn@redhat.com>
>>> ---
>>>  vl.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>> Are you trying to get this in 1.6?
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>
> 
> It's ok for 1.6. It applies cleanly. So if it's fine with you please
> push it to the repository.

I'm not the maintainer, so I'm not the one that can push it.  At this
phase in the game, it helps if you resend a patch with 'for 1.6' inside
the [] as part of the subject line, as well as cc the maintainer listed
by ./scripts/get_maintainer.pl, to make sure the actual maintainer sees
it and can make a more-informed decision on whether it qualifies as a
bug fix.

Patch

diff --git a/vl.c b/vl.c
index f422a1c..9b4a3f9 100644
--- a/vl.c
+++ b/vl.c
@@ -2671,6 +2671,11 @@  static QEMUMachine *machine_parse(const char *name)
     if (machine) {
         return machine;
     }
+
+    if (name && !is_help_option(name)) {
+        error_report("Unsupported machine type");
+    }
+
     printf("Supported machines are:\n");
     for (m = first_machine; m != NULL; m = m->next) {
         if (m->alias) {