From: Markus Armbruster <armbru@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: Pradeep Jagadeesh <pradeepkiruvale@gmail.com>,
qemu-devel@nongnu.org, greg kurz <groug@kaod.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com>,
jani kokkonen <jani.kokkonen@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v10 5/6] fsdev: QMP interface for throttling
Date: Fri, 08 Sep 2017 14:51:29 +0200 [thread overview]
Message-ID: <8760ct8ib2.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <w51mv652zmt.fsf@maestria.local.igalia.com> (Alberto Garcia's message of "Fri, 08 Sep 2017 13:33:46 +0200")
Alberto Garcia <berto@igalia.com> writes:
> On Fri 08 Sep 2017 12:02:14 PM CEST, Markus Armbruster wrote:
>
>>> + fse = get_fsdev_fsentry(arg->has_id ? arg->id : NULL);
>>
>> !arg->has_id implies !arg->id.
>
> Hey Markus,
>
> I have the impression that I've also written code that never uses
> arg->foo when arg->has_foo is false.
>
> Can we then assume that to be NULL/0 in all cases? Also for other data
> types (int, bool, ...)?
QAPI code always passes zero FOOs along with false has_FOOs. Anything
that doesn't is a bug. This is particular important when FOO is a
pointer; we don't want to pass around pointers pointing to random junk
in the hope that everybody will obediently check their has_FOO before
dereferencing.
Other code might not always be as well-behaved. In random context,
checking has_FOO is probably safer.
I still want to eliminate has_FOO for pointer-valued FOO. So much to
do, so little time!
next prev parent reply other threads:[~2017-09-08 12:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 16:07 [Qemu-devel] [PATCH v10 0/6] fsdev: qmp interface for io throttling Pradeep Jagadeesh
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 1/6] throttle: factor out duplicate code Pradeep Jagadeesh
2017-09-06 9:49 ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 2/6] qmp: Create IOThrottle structure Pradeep Jagadeesh
2017-09-08 9:37 ` Markus Armbruster
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 3/6] throttle: move out function to reuse the code Pradeep Jagadeesh
2017-09-08 12:27 ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 4/6] hmp: create a throttle initialization function for code reusability Pradeep Jagadeesh
2017-09-05 12:03 ` Alberto Garcia
2017-09-08 12:31 ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 5/6] fsdev: QMP interface for throttling Pradeep Jagadeesh
2017-09-08 10:02 ` Markus Armbruster
2017-09-08 11:33 ` Alberto Garcia
2017-09-08 12:51 ` Markus Armbruster [this message]
2017-09-08 12:19 ` Pradeep Jagadeesh
2017-09-08 12:34 ` Markus Armbruster
2017-09-08 12:49 ` Pradeep Jagadeesh
2017-09-11 9:23 ` Pradeep Jagadeesh
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 6/6] fsdev: hmp " Pradeep Jagadeesh
2017-09-05 7:53 ` Alberto Garcia
2017-09-05 8:28 ` Pradeep Jagadeesh
2017-09-05 8:57 ` Greg Kurz
2017-09-05 9:07 ` Alberto Garcia
2017-09-05 9:13 ` Pradeep Jagadeesh
2017-09-05 9:34 ` Alberto Garcia
2017-09-05 9:36 ` Pradeep Jagadeesh
2017-09-05 17:57 ` Dr. David Alan Gilbert
2017-09-05 21:19 ` [Qemu-devel] [PATCH v10 0/6] fsdev: qmp interface for io throttling Eric Blake
2017-09-06 10:12 ` Pradeep Jagadeesh
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=8760ct8ib2.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=dgilbert@redhat.com \
--cc=groug@kaod.org \
--cc=jani.kokkonen@huawei.com \
--cc=pradeep.jagadeesh@huawei.com \
--cc=pradeepkiruvale@gmail.com \
--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.