Re: [Qemu-devel] [PATCH] vmdk: Allow vmdk_create to work with protocol

2013-12-19 Thread Fam Zheng
On 2013年12月19日 21:12, Stefan Hajnoczi wrote: On Tue, Dec 17, 2013 at 08:00:00PM +0800, Fam Zheng wrote: @@ -1511,48 +1521,55 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, header.check_bytes[3] = 0xa; /* write all the data */ -ret = qemu_write_full(fd,

Re: [Qemu-devel] [PATCH] vmdk: Allow vmdk_create to work with protocol

2013-12-19 Thread Stefan Hajnoczi
On Tue, Dec 17, 2013 at 08:00:00PM +0800, Fam Zheng wrote: > @@ -1511,48 +1521,55 @@ static int vmdk_create_extent(const char *filename, > int64_t filesize, > header.check_bytes[3] = 0xa; > > /* write all the data */ > -ret = qemu_write_full(fd, &magic, sizeof(magic)); > -if (r

[Qemu-devel] [PATCH] vmdk: Allow vmdk_create to work with protocol

2013-12-17 Thread Fam Zheng
This changes vmdk_create to use bdrv_* functions to replace qemu_open and other fd functions. The error handling are improved as well. One difference is that bdrv_pwrite will round up buffer to sectors, so for description file, an extra bdrv_truncate is used in the end to drop ending zeros. I test