aboutsummaryrefslogtreecommitdiff
path: root/migration/qemu-file-channel.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-08-16 12:00:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-08-16 12:00:18 +0100
commit27608c7c66bd923eb5e5faab80e795408cbe2b51 (patch)
treeece1982460bc4a1f53833838337cb9fcb9fe5061 /migration/qemu-file-channel.c
parentf8f2eac4e5de8ce8ef17591ee1b84904437be25b (diff)
parent7dd59d01ddcc4a4ba0c44c2cc9e3b35c79aa7a29 (diff)
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20190814a' into staging
Migration pull 2019-08-15 Marcel's vmxnet3 live migraiton fix (that breaks vmxnet3 compatibility but makes it work) Error description improvements from Yury. Multifd fixes from Ivan and Juan. A load of small cleanups from Wei. A small cleanup from Marc-André for a future patch. # gpg: Signature made Wed 14 Aug 2019 19:00:39 BST # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20190814a: (33 commits) migration: add some multifd traces migration: Make global sem_sync semaphore by channel migration: Add traces for multifd terminate threads qemu-file: move qemu_{get,put}_counted_string() declarations migration/postcopy: use mis->bh instead of allocating a QEMUBH migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap migration: update ram_counters for multifd sync packet migration: add speed limit for multifd migration migration: add qemu_file_update_transfer interface migration: always initialise ram_counters for a new migration migration: remove unused field bytes_xfer hmp: Remove migration capabilities from "info migrate" migration/postcopy: use QEMU_IS_ALIGNED to replace host_offset migration/postcopy: simplify calculation of run_start and fixup_start_addr migration/postcopy: make PostcopyDiscardState a static variable migration: extract ram_load_precopy migration: return -EINVAL directly when version_id mismatch migration: equation is more proper than and to check LOADVM_QUIT migration: just pass RAMBlock is enough migration: use migration_in_postcopy() to check POSTCOPY_ACTIVE ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/qemu-file-channel.c')
-rw-r--r--migration/qemu-file-channel.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index 8e639eb496..c382ea2d78 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -33,7 +33,8 @@
static ssize_t channel_writev_buffer(void *opaque,
struct iovec *iov,
int iovcnt,
- int64_t pos)
+ int64_t pos,
+ Error **errp)
{
QIOChannel *ioc = QIO_CHANNEL(opaque);
ssize_t done = 0;
@@ -47,7 +48,7 @@ static ssize_t channel_writev_buffer(void *opaque,
while (nlocal_iov > 0) {
ssize_t len;
- len = qio_channel_writev(ioc, local_iov, nlocal_iov, NULL);
+ len = qio_channel_writev(ioc, local_iov, nlocal_iov, errp);
if (len == QIO_CHANNEL_ERR_BLOCK) {
if (qemu_in_coroutine()) {
qio_channel_yield(ioc, G_IO_OUT);
@@ -57,7 +58,6 @@ static ssize_t channel_writev_buffer(void *opaque,
continue;
}
if (len < 0) {
- /* XXX handle Error objects */
done = -EIO;
goto cleanup;
}
@@ -75,13 +75,14 @@ static ssize_t channel_writev_buffer(void *opaque,
static ssize_t channel_get_buffer(void *opaque,
uint8_t *buf,
int64_t pos,
- size_t size)
+ size_t size,
+ Error **errp)
{
QIOChannel *ioc = QIO_CHANNEL(opaque);
ssize_t ret;
do {
- ret = qio_channel_read(ioc, (char *)buf, size, NULL);
+ ret = qio_channel_read(ioc, (char *)buf, size, errp);
if (ret < 0) {
if (ret == QIO_CHANNEL_ERR_BLOCK) {
if (qemu_in_coroutine()) {
@@ -90,7 +91,6 @@ static ssize_t channel_get_buffer(void *opaque,
qio_channel_wait(ioc, G_IO_IN);
}
} else {
- /* XXX handle Error * object */
return -EIO;
}
}
@@ -100,18 +100,20 @@ static ssize_t channel_get_buffer(void *opaque,
}
-static int channel_close(void *opaque)
+static int channel_close(void *opaque, Error **errp)
{
+ int ret;
QIOChannel *ioc = QIO_CHANNEL(opaque);
- qio_channel_close(ioc, NULL);
+ ret = qio_channel_close(ioc, errp);
object_unref(OBJECT(ioc));
- return 0;
+ return ret;
}
static int channel_shutdown(void *opaque,
bool rd,
- bool wr)
+ bool wr,
+ Error **errp)
{
QIOChannel *ioc = QIO_CHANNEL(opaque);
@@ -125,8 +127,7 @@ static int channel_shutdown(void *opaque,
} else {
mode = QIO_CHANNEL_SHUTDOWN_WRITE;
}
- if (qio_channel_shutdown(ioc, mode, NULL) < 0) {
- /* XXX handler Error * object */
+ if (qio_channel_shutdown(ioc, mode, errp) < 0) {
return -EIO;
}
}
@@ -135,11 +136,12 @@ static int channel_shutdown(void *opaque,
static int channel_set_blocking(void *opaque,
- bool enabled)
+ bool enabled,
+ Error **errp)
{
QIOChannel *ioc = QIO_CHANNEL(opaque);
- if (qio_channel_set_blocking(ioc, enabled, NULL) < 0) {
+ if (qio_channel_set_blocking(ioc, enabled, errp) < 0) {
return -1;
}
return 0;