Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
These changes are the raw update to qemu-2.6.
[kvmfornfv.git]
/
qemu
/
migration
/
qemu-file-stdio.c
diff --git
a/qemu/migration/qemu-file-stdio.c
b/qemu/migration/qemu-file-stdio.c
index
285068b
..
f402e8f
100644
(file)
--- a/
qemu/migration/qemu-file-stdio.c
+++ b/
qemu/migration/qemu-file-stdio.c
@@
-21,8
+21,9
@@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu-common.h"
-#include "
block
/coroutine.h"
+#include "
qemu
/coroutine.h"
#include "migration/qemu-file.h"
typedef struct QEMUFileStdio {
#include "migration/qemu-file.h"
typedef struct QEMUFileStdio {
@@
-37,11
+38,11
@@
static int stdio_get_fd(void *opaque)
return fileno(s->stdio_file);
}
return fileno(s->stdio_file);
}
-static
in
t stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
-
in
t size)
+static
ssize_
t stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
+
size_
t size)
{
QEMUFileStdio *s = opaque;
{
QEMUFileStdio *s = opaque;
-
in
t res;
+
size_
t res;
res = fwrite(buf, 1, size, s->stdio_file);
res = fwrite(buf, 1, size, s->stdio_file);
@@
-51,11
+52,12
@@
static int stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
return res;
}
return res;
}
-static int stdio_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
+static ssize_t stdio_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
+ size_t size)
{
QEMUFileStdio *s = opaque;
FILE *fp = s->stdio_file;
{
QEMUFileStdio *s = opaque;
FILE *fp = s->stdio_file;
-
in
t bytes;
+
ssize_
t bytes;
for (;;) {
clearerr(fp);
for (;;) {
clearerr(fp);
@@
-143,7
+145,7
@@
QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
return NULL;
}
return NULL;
}
- s = g_
malloc0(sizeof(QEMUFileStdio)
);
+ s = g_
new0(QEMUFileStdio, 1
);
s->stdio_file = stdio_file;
s->stdio_file = stdio_file;
@@
-175,7
+177,7
@@
QEMUFile *qemu_fopen(const char *filename, const char *mode)
return NULL;
}
return NULL;
}
- s = g_
malloc0(sizeof(QEMUFileStdio)
);
+ s = g_
new0(QEMUFileStdio, 1
);
s->stdio_file = fopen(filename, mode);
if (!s->stdio_file) {
s->stdio_file = fopen(filename, mode);
if (!s->stdio_file) {