qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hostmem-file: add a property 'notrunc' to avoid


From: Haozhong Zhang
Subject: Re: [Qemu-devel] [PATCH] hostmem-file: add a property 'notrunc' to avoid data corruption
Date: Tue, 25 Oct 2016 14:42:41 +0800
User-agent: NeoMutt/20161014 (1.7.1)

On 10/24/16 11:10 -0200, Eduardo Habkost wrote:
On Thu, Oct 20, 2016 at 03:55:22PM +0200, Kevin Wolf wrote:
Am 20.10.2016 um 14:34 hat Igor Mammedov geschrieben:
> >  #ifdef __linux__
> > +static uint64_t get_file_size(const char *path, Error **errp)
> Maybe QEMU laredy has an utility to do it that could be shared,
> CCing block maintainers.

We have quite a bit of code for determining the right size of a file
(including block devices) on different platforms and devices. See the
.bdrv_getlength implementations in raw-posix.c and raw-win32.c.

However, none of them are made for consumption outside the block layer.

There's a patch on qemu-devel archives from 2015:
 Subject [PATCH v7 11/35] util: introduce qemu_file_getlength()
it could be reused here.


My new version patches
(https://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg05519.html)
use the same approach to get the file size except that I didn't make
it a common function. I'll move it to a common function in the next
version.

Thanks,
Haozhong




reply via email to

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