kvm: update for: savevm: Allow vmsd->pre_save to return error
From: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/i8254-kvm.c | 3 ++-
hw/i8259.c | 3 ++-
hw/ioapic.c | 3 ++-
qemu-kvm-x86.c | 4 +++-
4 files changed, 9 insertions(+), 4 deletions(-)
@@ -32,7 +32,7 @@ extern VMStateDescription vmstate_pit;
static PITState pit_state;
-static void kvm_pit_pre_save(void *opaque)
+static int kvm_pit_pre_save(void *opaque)
{
PITState *s = (void *)opaque;
struct kvm_pit_state2 pit2;
@@ -64,6 +64,7 @@ static void kvm_pit_pre_save(void *opaque)
sc->gate = c->gate;
sc->count_load_time = c->count_load_time;
}
+ return 0;
}
static int kvm_pit_post_load(void *opaque, int version_id)
@@ -470,13 +470,14 @@ static uint32_t elcr_ioport_read(void *opaque, uint32_t addr1)
static void kvm_kernel_pic_save_to_user(PicState *s);
static int kvm_kernel_pic_load_from_user(PicState *s);
-static void pic_pre_save(void *opaque)
+static int pic_pre_save(void *opaque)
{
PicState *s = opaque;
if (kvm_enabled() && kvm_irqchip_in_kernel()) {
kvm_kernel_pic_save_to_user(s);
}
+ return 0;
}
static int pic_post_load(void *opaque, int version_id)
@@ -249,13 +249,14 @@ static void kvm_kernel_ioapic_load_from_user(IOAPICState *s)
#endif
}
-static void ioapic_pre_save(void *opaque)
+static int ioapic_pre_save(void *opaque)
{
IOAPICState *s = (void *)opaque;
if (kvm_enabled() && kvm_irqchip_in_kernel()) {
kvm_kernel_ioapic_save_to_user(s);
}
+ return 0;
}
static int ioapic_pre_load(void *opaque)
@@ -561,11 +561,13 @@ static int kvm_enable_tpr_access_reporting(CPUState *env)
#ifdef KVM_CAP_ADJUST_CLOCK
static struct kvm_clock_data kvmclock_data;
-static void kvmclock_pre_save(void *opaque)
+static int kvmclock_pre_save(void *opaque)
{
struct kvm_clock_data *cl = opaque;
kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, cl);
+
+ return 0;
}
static int kvmclock_post_load(void *opaque, int version_id)