]> git.proxmox.com Git - qemu.git/commitdiff
Merge remote-tracking branch 'stefanha/block' into staging
authorAnthony Liguori <aliguori@us.ibm.com>
Mon, 15 Apr 2013 13:02:41 +0000 (08:02 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 15 Apr 2013 13:02:41 +0000 (08:02 -0500)
* 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 <aliguori@us.ibm.com>
1  2 
savevm.c

diff --cc savevm.c
index 63f4c828a9973980d5cfc9abd7b5ef22ac7691bd,88fe985f939bcc8da097decc0c53128c775719bc..53515cb794c80d6cc9c6e149e72d77d06ec55cf9
+++ 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);
      }