From: Stefan Hajnoczi <stefanha@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <famz@redhat.com>,
kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] Block layer complexity: what to do to keep it under control?
Date: Mon, 4 Dec 2017 10:16:36 +0000 [thread overview]
Message-ID: <20171204101636.GA11502@stefanha-x1.localdomain> (raw)
In-Reply-To: <48c19394-6a8d-e2c1-3380-7f27c2f63909@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]
On Fri, Dec 01, 2017 at 01:27:37PM -0600, Eric Blake wrote:
> On 12/01/2017 11:03 AM, Paolo Bonzini wrote:
> > Just my 2 cents on the language topic, as in general I agree completely
> > with Stefan.
> >
>
> > Luckily, several benefits don't require a full rewrite or language switch:
> >
> > - readability from RAII-style code. If this is important enough, we
> > could actually use GCC __attribute__((cleanup)) or, heaven forbid,
> > slowly introduce C++ in QEMU's code base.
>
> This one is cool, and supported by both gcc and clang (and we really don't
> have any example of anyone clamoring for a different compiler). For example,
> here's what I recently added to nbdkit to make it MUCH easier to properly
> remember to unlock a mutex on all exit paths from a scope:
>
> https://github.com/libguestfs/nbdkit/commit/0f24d66648
> https://github.com/libguestfs/nbdkit/commit/b5ab4835e1
Yes, please! __attribute__((cleanup)) is great and we should use it in
QEMU.
I haven't looked at compiler support though... :)
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2017-12-04 10:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 3:55 [Qemu-devel] Block layer complexity: what to do to keep it under control? Fam Zheng
2017-11-29 6:30 ` Jeff Cody
2017-11-29 12:16 ` Stefan Hajnoczi
2017-11-29 12:22 ` Paolo Bonzini
2017-11-29 12:00 ` Stefan Hajnoczi
2017-11-29 12:24 ` Paolo Bonzini
2017-11-29 13:24 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-11-29 13:41 ` [Qemu-devel] " Kevin Wolf
2017-11-29 19:58 ` Dr. David Alan Gilbert
2017-11-30 9:47 ` Fam Zheng
2017-11-30 14:19 ` Stefan Hajnoczi
2017-12-01 10:16 ` Fam Zheng
2017-12-01 14:08 ` Stefan Hajnoczi
2017-12-01 15:00 ` Fam Zheng
2017-12-01 17:03 ` Paolo Bonzini
2017-12-01 19:03 ` Peter Maydell
2017-12-04 10:41 ` Stefan Hajnoczi
2017-12-01 19:27 ` Eric Blake
2017-12-04 10:16 ` Stefan Hajnoczi [this message]
2017-12-04 10:32 ` Peter Maydell
2017-11-29 12:32 ` Daniel P. Berrange
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=20171204101636.GA11502@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--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 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).