|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] Re: [PATCH 1/10] Refactor QEMUFile for live migration |
Date: | Wed, 10 Sep 2008 18:05:19 +0300 |
User-agent: | Thunderbird 2.0.0.16 (X11/20080723) |
Glauber Costa wrote:
+static int fd_put_buffer(void *opaque, const uint8_t *buf, + int64_t pos, int size) +{ + QEMUFileFD *s = opaque; + ssize_t len; + + do { + len = write(s->fd, buf, size); + } while (len == -1 && errno == EINTR);What about the len == size case ?
Should work, no?
+ +QEMUFile *qemu_fopen_fd(int fd) +{ + QEMUFileFD *s = qemu_mallocz(sizeof(QEMUFileFD));can't it fail?
If it does, the entire world will disappear in a black hole. Qemu isn't prepared to handle allocation failures.
Isn't it possible to abstract the differences between bdrv and file so to have a common implementation between them? Do you think it's worthwhile ?
They're very different. bdrvs are sector-granularity, random access, concurrent, and want dma. QEMUFiles are byte-granularity, sequential access, serial, and aren't too worried about dma (though it could be nice).
-- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |