qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-binfmt-conf.sh: add CPUS, add --reset, mak


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] qemu-binfmt-conf.sh: add CPUS, add --reset, make -p and -c boolean (no arg)
Date: Tue, 5 Mar 2019 13:20:11 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/5/19 1:15 PM, Unai Martinez Corral wrote:

+      find /proc/sys/fs/binfmt_misc/ -type f -name 'qemu-*' -exec sh -c
'echo -1 > {}' \;

echo -1 is not portable (you are not guaranteed that echo won't try to
treat it as an option); better would be using printf.

Incidentally, I tried with MSYS2 and fedora:29 docker container. On
both of them , 'echo -1' works, while 'printf -1' does not. Anyway, I
replaced it with 'printf %s -1'. Hope it is ok.

You are correct that 'printf -1' is likely to fail, 'printf -- -1' is portable but unusual, and 'printf %s\\n -1' is identical to the common (but non-portable) behavior of 'echo -1'. Is the newline important?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]