qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Qemu-devel] [PATCH 2/2] xen: Don't peek behind the BlockDriverState abstraction
Date: Thu, 7 Jun 2012 01:07:45 +0100	[thread overview]
Message-ID: <CAFEAcA85CHTc_gioLZ-2Wxiko7Qutjia2nHLPgs2kpYLXR-PCw@mail.gmail.com> (raw)
In-Reply-To: <m37gvkd2gb.fsf@blackfin.pond.sub.org>

On 6 June 2012 13:55, Markus Armbruster <armbru@redhat.com> wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> On 5 June 2012 13:51, Markus Armbruster <armbru@redhat.com> wrote:
>>> @@ -554,6 +553,7 @@ static int blk_init(struct XenDevice *xendev)
>>>  {
>>>     struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
>>>     int index, qflags, info = 0;
>>> +    char fmt_name[128];
>>
>> Fixed length array with a hardcoded magic number size ?
>> If the block layer guarantees that format names are going to be
>> less than 128 bytes it ought to provide a suitable #define for
>> people to set array sizes to...
>
> Maybe it should, but it doesn't.  Does it really matter in this
> particular case?  If somebody insists on giving his driver a name longer
> than 127 characters, we'll silently log it truncated, that's all.

I think it matters in the general case, yours is just the first
usage of this API which has caught my attention. We should fix
the API before adding more uses of it (at the moment it seems to
be only used in two places).

Alternatively, we could have the function return a const char* rather
than taking a buffer to be filled in.

-- PMM

  reply	other threads:[~2012-06-07  0:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05 12:51 [Qemu-devel] [PATCH 0/2] xen: Clean up BlockDriverState use Markus Armbruster
2012-06-05 12:51 ` [Qemu-devel] [PATCH 1/2] xen: Don't change -drive if=xen device name during machine init Markus Armbruster
2012-06-05 12:51 ` [Qemu-devel] [PATCH 2/2] xen: Don't peek behind the BlockDriverState abstraction Markus Armbruster
2012-06-05 16:59   ` Stefano Stabellini
2012-06-06 11:39     ` Markus Armbruster
2012-06-06 12:23       ` Stefano Stabellini
2012-06-06 11:52   ` Peter Maydell
2012-06-06 12:55     ` Markus Armbruster
2012-06-07  0:07       ` Peter Maydell [this message]
2012-06-07  8:13         ` Markus Armbruster
2012-06-07 12:49           ` Peter Maydell
2012-06-13  7:35             ` Markus Armbruster

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=CAFEAcA85CHTc_gioLZ-2Wxiko7Qutjia2nHLPgs2kpYLXR-PCw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.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).