[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 23/23] COLO nic: setup/teardown colo nic devi
From: |
Yang Hongyang |
Subject: |
[Qemu-devel] [RFC PATCH v2 23/23] COLO nic: setup/teardown colo nic devices |
Date: |
Tue, 23 Sep 2014 17:23:55 +0800 |
setup/teardown colo nic devices when enter/leave
colo process.
Signed-off-by: Yang Hongyang <address@hidden>
---
migration-colo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/migration-colo.c b/migration-colo.c
index 1da5629..13f55d9 100644
--- a/migration-colo.c
+++ b/migration-colo.c
@@ -17,6 +17,7 @@
#include "migration/migration-colo.h"
#include <sys/ioctl.h>
#include "qemu/error-report.h"
+#include "net/colo-nic.h"
/*
* checkpoint timer: unit ms
@@ -121,6 +122,7 @@ static void ctl_error_handler(void *opaque, int err)
/* TODO: determine whether we need to failover */
/* FIXME: we will not failover currently, just kill slave */
error_report("error: colo transmission failed!");
+ colo_teardown_nic(true);
exit(1);
} else if (colo_is_master()) {
/* Master still alive, do not failover */
@@ -301,6 +303,7 @@ static void *colo_thread(void *opaque)
qdev_hotplug = 0;
+ colo_configure_nic(false);
/*
* Wait for slave finish loading vm states and enter COLO
* restore.
@@ -343,6 +346,7 @@ out:
}
colo_compare_destroy();
+ colo_teardown_nic(false);
migrate_set_state(s, MIG_STATE_COLO, MIG_STATE_COMPLETED);
@@ -442,6 +446,7 @@ void colo_process_incoming_checkpoints(QEMUFile *f)
}
create_and_init_ram_cache();
+ colo_configure_nic(true);
ret = colo_ctl_put(ctl, COLO_READY);
if (ret) {
@@ -521,6 +526,7 @@ out:
}
release_ram_cache();
+ colo_teardown_nic(true);
if (ctl) {
qemu_fclose(ctl);
--
1.9.1
- [Qemu-devel] [RFC PATCH v2 14/23] COLO ctl: implement colo restore, (continued)
- [Qemu-devel] [RFC PATCH v2 14/23] COLO ctl: implement colo restore, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 16/23] COLO ram cache: implement colo ram cache on slave, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 17/23] HACK: trigger checkpoint every 500ms, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 15/23] COLO save: reuse migration bitmap under colo checkpoint, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 18/23] COLO nic: add command line switch, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 19/23] COLO nic: init/remove colo nic devices when add/cleanup tap devices, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 20/23] COLO nic: implement colo nic device interface support_colo(), Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 21/23] COLO nic: implement colo nic device interface configure(), Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 22/23] COLO nic: export colo nic APIs, Yang Hongyang, 2014/09/23
- [Qemu-devel] [RFC PATCH v2 23/23] COLO nic: setup/teardown colo nic devices,
Yang Hongyang <=