qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option


From: Tomáš Golembiovský
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option
Date: Sun, 2 Oct 2016 21:33:44 +0200


On Tue, 20 Sep 2016 13:45:08 +0200
Paolo Bonzini <address@hidden> wrote:

> On 20/09/2016 13:12, Daniel P. Berrange wrote:
> > On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote:  
> >>
> >>
> >> On 20/09/2016 11:41, Tomáš Golembiovský wrote:  
> >>> When image is part of the file it makes sense to limit the length of the
> >>> image in the file. Otherwise it is assumed that the image spans to the
> >>> end of the file. This assumption may lead to reads/writes outside of the
> >>> image and thus lead to errors or data corruption.
> >>>
> >>> To limit the assumed image size new option is introduced.  
> >>
> >> The patch makes sense, but I think the commit message is incorrect
> >> because this bug is already fixed by patch 1.  Also, the option in the
> >> help is --device-size, not --image-size; I would just call it --size.  
> > 
> > I don't think it makes sense as a special case in qemu-nbd.
> > 
> > It feels like this is better done by extending the 'raw'
> > block driver with 'offset' and 'length' parameters. You
> > can then layer the 'raw' block driver over any existing
> > QEMU blocker driver, anywhere in QEMU / tools that accept
> > a block device description. No need to add extra parameters
> > to any of the programs.  
> 
> This makes sense too (and then --offset and partitions can be
> implemented on top).

OK. Let's drop this change then. I have sent an initial attempt to
implement this in raw block driver here [1]. The change only covers
files opened in read-only mode for the moment so it will take a little
bit more effort before it can be used in qemu-nbd.

That being said, I believe the first [2] part of the series still should
be considered for merging. Unless there is something intrinsically wrong
with the patch. Once the necessary stuff is in the raw driver we can
change the related code in qemu-nbd.

Regards,

    Tomas


[1] https://lists.nongnu.org/archive/html/qemu-block/2016-10/msg00008.html
[2] https://lists.nongnu.org/archive/html/qemu-devel/2016-09/msg04554.html


-- 
Tomáš Golembiovský <address@hidden>



reply via email to

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