From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"fam@euphon.net" <fam@euphon.net>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"mreitz@redhat.com" <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [RFC PATCH] block: local qiov helper
Date: Tue, 29 Jan 2019 13:34:48 +0100 [thread overview]
Message-ID: <20190129123448.GD4467@dhcp-200-176.str.redhat.com> (raw)
In-Reply-To: <49f1af0b-a245-3b17-7e74-6b3837e42406@virtuozzo.com>
Am 29.01.2019 um 12:18 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 29.01.2019 13:32, Stefan Hajnoczi wrote:
> > On Tue, Jan 29, 2019 at 6:24 PM Vladimir Sementsov-Ogievskiy
> > <vsementsov@virtuozzo.com> wrote:
> >> 29.01.2019 6:31, Stefan Hajnoczi wrote:
> >>> On Fri, Jan 25, 2019 at 07:46:01PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> >> Hmm. In this case we definitely will have tiny extra memory usage, but we gain beautiful
> >> readability.
> >>
> >> So, like this:
> >>
> >> diff --git a/include/qemu/iov.h b/include/qemu/iov.h
> >> index 5f433c7768..53de1b38bb 100644
> >> --- a/include/qemu/iov.h
> >> +++ b/include/qemu/iov.h
> >> @@ -134,9 +134,31 @@ typedef struct QEMUIOVector {
> >> struct iovec *iov;
> >> int niov;
> >> int nalloc;
> >> - size_t size;
> >> + union {
> >> + struct {
> >> + void *__unused_iov_base;
> >
> > This could be struct iovec *iov for nalloc > 0 users. Must resist hackiness! :)
>
> can't be iov, gcc complains:
> include/qemu/iov.h:139:27: error: duplicate member ‘iov’
> struct iovec *iov;
I think Stefan meant moving the existing iov here. But then we would
have to make sure that it's never used for local qiovs, which would
probably involve touching a lot more code.
Your original suggestion to put nalloc there looks a bit more practical
if we want to save those bytes.
Kevin
next prev parent reply other threads:[~2019-01-29 12:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 16:46 [Qemu-devel] [RFC PATCH] block: local qiov helper Vladimir Sementsov-Ogievskiy
2019-01-29 3:31 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-01-29 10:24 ` Vladimir Sementsov-Ogievskiy
2019-01-29 10:32 ` Stefan Hajnoczi
2019-01-29 11:18 ` Vladimir Sementsov-Ogievskiy
2019-01-29 12:34 ` Kevin Wolf [this message]
2019-01-30 3:10 ` Stefan Hajnoczi
2019-02-03 5:54 ` [Qemu-devel] " no-reply
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=20190129123448.GD4467@dhcp-200-176.str.redhat.com \
--to=kwolf@redhat.com \
--cc=fam@euphon.net \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
--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).