From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Programmingkid <programmingkidx@gmail.com>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>,
Qemu-block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host
Date: Wed, 3 Feb 2016 11:37:10 +0100 [thread overview]
Message-ID: <20160203103710.GA4754@noname.redhat.com> (raw)
In-Reply-To: <56B1039B.5020104@redhat.com>
Am 02.02.2016 um 20:29 hat Eric Blake geschrieben:
> On 02/02/2016 10:28 AM, Programmingkid wrote:
>
> >> Whats the rationale here ? Using pre-allocated fixed
> >> length arrays is pretty bad practice in general, but
> >> especially so for filenames
> >
> > With an automatic variable there is no worry about when to release it.
>
> Yeah, but it comes with the downside of having to worry about exhausting
> stack space (there are platforms where MAXPATHLEN is intentionally
> undefined [hello, GNU Hurd]), or with the downside of arbitrary
> limitations. And at the same time, MAXPATHLEN is usually wasteful -
> allocating 1k or 4k of stack to store what is typically less than 100
> bytes is dumb. Really, storing file names in fixed length arrays is
> better off to avoid, and just get used to dynamic management.
Just let me add that while it's probably harmless here in .bdrv_open(),
other paths in the block layer which run in a coroutine have a much more
limited stack size and the danger of stack overflows is very real there.
Kevin
prev parent reply other threads:[~2016-02-03 10:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 17:08 [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host Programmingkid
2016-02-02 17:16 ` Daniel P. Berrange
2016-02-02 17:28 ` Programmingkid
2016-02-02 17:31 ` Daniel P. Berrange
2016-02-02 19:10 ` Programmingkid
2016-02-02 19:24 ` Eric Blake
2016-02-02 19:46 ` Programmingkid
2016-02-02 21:23 ` Programmingkid
2016-02-02 22:04 ` Eric Blake
2016-02-03 1:15 ` Programmingkid
2016-02-03 2:30 ` Eric Blake
2016-02-03 4:21 ` Programmingkid
2016-02-03 4:36 ` Eric Blake
2016-02-03 15:54 ` Programmingkid
2016-02-04 20:58 ` Eric Blake
2016-02-02 19:29 ` Eric Blake
2016-02-03 10:37 ` Kevin Wolf [this message]
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=20160203103710.GA4754@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=programmingkidx@gmail.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 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.