[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [RFC PATCH] block: local qiov helper
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-block] [RFC PATCH] block: local qiov helper |
Date: |
Wed, 30 Jan 2019 11:10:53 +0800 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Tue, Jan 29, 2019 at 01:34:48PM +0100, Kevin Wolf wrote:
> 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
> > > <address@hidden> 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.
Sounds good.
Stefan
signature.asc
Description: PGP signature