From: Anthony Liguori Date: Mon, 15 Apr 2013 13:02:41 +0000 (-0500) Subject: Merge remote-tracking branch 'stefanha/block' into staging X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~900^2~59^2~403 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db08dc213ba87d16c34c235f5c83f70f0239f023;p=sdk%2Femulator%2Fqemu.git Merge remote-tracking branch 'stefanha/block' into staging * stefanha/block: rbd: add an asynchronous flush iotests: Add 'check -ssh' option to test Secure Shell block device. block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk. block: Add support for Secure Shell (ssh) block device. ide: refuse WIN_READ_NATIVE_MAX on empty device qemu-iotests: filter QEMU_PROG in 051.out qemu-iotests: Add test for -drive options qemu-iotests: A few more bdrv_pread/pwrite tests block: Introduce bdrv_pwritev() for qcow2_save_vmstate savevm: Implement block_writev_buffer() block: Introduce bdrv_writev_vmstate Conflicts: savevm.c aliguori: add f->pos parameter to writev_buffer(). Signed-off-by: Anthony Liguori --- db08dc213ba87d16c34c235f5c83f70f0239f023 diff --cc savevm.c index 63f4c828a9,88fe985f93..53515cb794 --- a/savevm.c +++ b/savevm.c @@@ -533,20 -548,24 +550,20 @@@ static void qemu_fflush(QEMUFile *f return; } - if (f->is_write && f->iovcnt > 0) { - if (f->ops->writev_buffer) { + if (f->ops->writev_buffer) { + if (f->iovcnt > 0) { - ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt); + ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt, f->pos); - if (ret >= 0) { - f->pos += ret; - } - } else { - for (i = 0; i < f->iovcnt && ret >= 0; i++) { - ret = f->ops->put_buffer(f->opaque, f->iov[i].iov_base, f->pos, - f->iov[i].iov_len); - if (ret >= 0) { - f->pos += ret; - } - } } - f->buf_index = 0; - f->iovcnt = 0; + } else { + if (f->buf_index > 0) { + ret = f->ops->put_buffer(f->opaque, f->buf, f->pos, f->buf_index); + } + } + if (ret >= 0) { + f->pos += ret; } + f->buf_index = 0; + f->iovcnt = 0; if (ret < 0) { qemu_file_set_error(f, ret); }