[Qemu-devel] [PATCH] vl: Fix error location of positional arguments

Markus Armbruster posted 1 patch 5 years ago
Test docker-clang@ubuntu passed
Test asan passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190318183312.4684-1-armbru@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
vl.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] vl: Fix error location of positional arguments
Posted by Markus Armbruster 5 years ago
We blame badness in positional arguments on the last option argument:

    $ qemu-system-x86_64 -vnc :1 bad.img
    qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory

I believe we've done this ever since we reported locations.  Fix it to

    qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 vl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vl.c b/vl.c
index c1d5484e12..9b215341a3 100644
--- a/vl.c
+++ b/vl.c
@@ -3119,6 +3119,7 @@ int main(int argc, char **argv, char **envp)
         if (optind >= argc)
             break;
         if (argv[optind][0] != '-') {
+            loc_set_cmdline(argv, optind, 1);
             drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
         } else {
             const QEMUOption *popt;
-- 
2.17.2


Re: [Qemu-devel] [PATCH] vl: Fix error location of positional arguments
Posted by Daniel P. Berrangé 5 years ago
On Mon, Mar 18, 2019 at 07:33:12PM +0100, Markus Armbruster wrote:
> We blame badness in positional arguments on the last option argument:
> 
>     $ qemu-system-x86_64 -vnc :1 bad.img
>     qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory
> 
> I believe we've done this ever since we reported locations.  Fix it to
> 
>     qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory
> 
> Reported-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  vl.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [PATCH] vl: Fix error location of positional arguments
Posted by Stefano Garzarella 5 years ago
On Mon, Mar 18, 2019 at 07:33:12PM +0100, Markus Armbruster wrote:
> We blame badness in positional arguments on the last option argument:
> 
>     $ qemu-system-x86_64 -vnc :1 bad.img
>     qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory
> 
> I believe we've done this ever since we reported locations.  Fix it to
> 
>     qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory
> 
> Reported-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  vl.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>