qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-


From: Kevin Wolf
Subject: Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-img
Date: Fri, 8 May 2020 13:37:53 +0200

Am 30.04.2020 um 16:50 hat Eric Blake geschrieben:
> On 4/30/20 8:59 AM, Max Reitz wrote:
> > On 21.04.20 23:20, Eric Blake wrote:
> > > Upcoming patches want to add some basic bitmap manipulation abilities
> > > to qemu-img.  But blockdev.o is too heavyweight to link into qemu-img
> > > (among other things, it would drag in block jobs and transaction
> > > support - qemu-img does offline manipulation, where atomicity is less
> > > important because there are no concurrent modifications to compete
> > > with), so it's time to split off the bare bones of what we will need
> > > into a new file blockbitmaps.o.
> > > 
> > > In addition to exposing 6 QMP commands for use by qemu-img (add,
> > > remove, clear, enable, disable, merge), this also has to export three
> > > previously-static functions for use by blockdev.c transactions.
> > > 
> > > Signed-off-by: Eric Blake <address@hidden>
> > > ---
> > >   Makefile.objs             |   2 +-
> > >   include/sysemu/blockdev.h |  14 ++
> > >   blockbitmaps.c            | 324 ++++++++++++++++++++++++++++++++++++++
> > 
> > Hm.  Can we get a better name?  blockdev-bitmaps.c, for example?
> 
> Sure, I'm open to bike-shed suggestions.  I'd also _really_ love to make the
> new file NOT live in the top-level, but that's a harder task that I'm not
> sure how to do (it's easy to tweak Makefile.objs for another file in the
> same directory, but harder to see through the magic to figure out how to
> relocate things).

Yes, please move it somewhere else. I'd suggest something like
block/monitor/bitmap-qmp-cmds.c for the QMP command handlers, and if
there are functions that are more generally useful, block/bitmaps.c.

Instead of modifying the top-level Makefile.objs, you would just edit
block/monitor/Makefile.objs instead and add the filename there. I don't
think you need to understand any magic apart from knowing that is exists
and does what you would expect.

Kevin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]