[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/13] s390x/flic: fail migration on source already
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 03/13] s390x/flic: fail migration on source already |
Date: |
Fri, 24 Feb 2017 10:22:49 +0100 |
Current code puts a 'FLIC_FAILED' marker into the migration stream
to indicate something went wrong while saving flic state and fails
load if it encounters that marker. VMState's put routine recently
gained the ability to return error codes (but did not wire it up
yet).
In order to be able to reap the benefits of returning an error and
failing migration on the source already once this gets wired up
in core, return an error in addition to storing 'FLIC_FAILED'.
Suggested-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Jens Freimann <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
---
hw/intc/s390_flic_kvm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
index e86a84e49a..cc44bc4e1e 100644
--- a/hw/intc/s390_flic_kvm.c
+++ b/hw/intc/s390_flic_kvm.c
@@ -293,6 +293,7 @@ static int kvm_flic_save(QEMUFile *f, void *opaque, size_t
size,
int len = FLIC_SAVE_INITIAL_SIZE;
void *buf;
int count;
+ int r = 0;
flic_disable_wait_pfault((struct KVMS390FLICState *) opaque);
@@ -303,7 +304,7 @@ static int kvm_flic_save(QEMUFile *f, void *opaque, size_t
size,
* migration state */
error_report("flic: couldn't allocate memory");
qemu_put_be64(f, FLIC_FAILED);
- return 0;
+ return -ENOMEM;
}
count = __get_all_irqs(flic, &buf, len);
@@ -314,6 +315,7 @@ static int kvm_flic_save(QEMUFile *f, void *opaque, size_t
size,
* target system to fail when attempting to load irqs from the
* migration state */
qemu_put_be64(f, FLIC_FAILED);
+ r = count;
} else {
qemu_put_be64(f, count);
qemu_put_buffer(f, (uint8_t *) buf,
@@ -321,7 +323,7 @@ static int kvm_flic_save(QEMUFile *f, void *opaque, size_t
size,
}
g_free(buf);
- return 0;
+ return r;
}
/**
--
2.11.0
- [Qemu-devel] [PULL 00/13] s390x patches for 2.9, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 01/13] s390x/s390-virtio: get rid of DPRINTF, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 05/13] virtio-ccw: add virtio-crypto-ccw device, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 02/13] s390x/kvm: detect some program check loops, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 03/13] s390x/flic: fail migration on source already,
Cornelia Huck <=
- [Qemu-devel] [PULL 06/13] virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 04/13] virtio-ccw: handle virtio 1 only devices, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 07/13] s390x: add property adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 09/13] s390x: bump ADAPTER_ROUTES_MAX_GSI, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 08/13] virtio-ccw: check flic->adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 10/13] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 12/13] s390x/arch_dump: pass cpuid into notes sections, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 13/13] s390x/css: handle format-0 TIC CCW correctly, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 11/13] s390x/arch_dump: use proper note name and note size, Cornelia Huck, 2017/02/24
- Re: [Qemu-devel] [PULL 00/13] s390x patches for 2.9, Peter Maydell, 2017/02/25