qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org, vsementsov@virtuozzo.com,
	mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v6 1/6] iotests: allow Valgrind checking all QEMU processes
Date: Wed, 28 Aug 2019 19:30:48 -0500	[thread overview]
Message-ID: <dd9f0ef8-d24c-29c3-6c48-809c9a4ac5d8@redhat.com> (raw)
In-Reply-To: <d04202ac-87ab-f226-0fc9-490d20f571fd@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1952 bytes --]

On 8/28/19 5:58 PM, John Snow wrote:

>> +++ b/tests/qemu-iotests/common.rc
>> @@ -60,61 +60,132 @@ if ! . ./common.config
>>      exit 1
>>  fi
>>  
>> +# Unset the variables to turn Valgrind off for specific processes, e.g.

That's not unsetting, that's setting to the empty string.

>> +# $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015
>> +
>> +: ${VALGRIND_QEMU_VM='y'}
>> +: ${VALGRIND_QEMU_IMG='y'}
>> +: ${VALGRIND_QEMU_IO='y'}
>> +: ${VALGRIND_QEMU_NBD='y'}
>> +: ${VALGRIND_QEMU_VXHS='y'}
>> +
> 
> I have to admit to you that I'm not familiar with this trick. I'm
> looking it up and I see := documented, but not = alone.

It's been a repeated complaint to the bash developer that the manual is
doing a disservice to its users by not documenting ${var=val} in an
easily searchable form.  It IS documented, but only by virtue of
${var:=val} occurring under a section header that states:

       When not performing substring expansion,  using  the  forms
documented
       below  (e.g.,  :-),  bash  tests for a parameter that is unset or
null.
       Omitting the colon results in a test  only  for  a  parameter
that  is
       unset.

So the choice is whether you want to special case a variable set to an
empty string the same as an unset variable, or the same as a variable
with a non-empty value.

> 
> It doesn't seem documented here at all:
> https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
> 
> I see it here, though:
> https://www.tldp.org/LDP/abs/html/parameter-substitution.html
> 
> And it seems to work, but I'm not sure if this works with BSD or OSX's
> sh. I see Eric comment on that compatibility a lot, so maybe I'll let
> him chime in.

It's quite portable; POSIX requires it, and autoconf relies on it.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-29  0:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 15:50 [Qemu-devel] [PATCH v6 0/6] Allow Valgrind checking all QEMU processes Andrey Shinkevich
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 1/6] iotests: allow " Andrey Shinkevich
2019-08-28 22:58   ` John Snow
2019-08-29  0:30     ` Eric Blake [this message]
2019-08-29 10:50       ` Andrey Shinkevich
2019-08-29 17:33         ` John Snow
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 2/6] iotests: exclude killed processes from running under Valgrind Andrey Shinkevich
2019-08-28 23:00   ` John Snow
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 3/6] iotests: Add casenotrun report to bash tests Andrey Shinkevich
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 4/6] iotests: Valgrind fails with nonexistent directory Andrey Shinkevich
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 5/6] iotests: extended timeout under Valgrind Andrey Shinkevich
2019-08-26 15:50 ` [Qemu-devel] [PATCH v6 6/6] iotests: extend sleeping time " Andrey Shinkevich
2019-08-28 23:02   ` John Snow

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=dd9f0ef8-d24c-29c3-6c48-809c9a4ac5d8@redhat.com \
    --to=eblake@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).