qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH COLO-Frame v11 38/39] colo: Use default buffer-filte


From: zhanghailiang
Subject: [Qemu-devel] [PATCH COLO-Frame v11 38/39] colo: Use default buffer-filter to buffer and release packets
Date: Tue, 24 Nov 2015 17:25:48 +0800

Enable default filter to buffer packets and release the
packets after a checkpoint.

Signed-off-by: zhanghailiang <address@hidden>
Cc: Jason Wang <address@hidden>
Cc: Yang Hongyang <address@hidden>
---
v11:
- Use new helper functions to buffer and release packets.
---
 migration/colo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/migration/colo.c b/migration/colo.c
index 79a8d6b..b1b7905 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -19,6 +19,7 @@
 #include "qemu/sockets.h"
 #include "migration/failover.h"
 #include "qapi-event.h"
+#include "net/filter.h"
 
 /*
  * The delay time before qemu begin the procedure of default failover 
treatment.
@@ -131,6 +132,8 @@ static void primary_vm_do_failover(void)
                      "old_state: %d", old_state);
         return;
     }
+    /* Don't buffer any packets while exited COLO */
+    qemu_set_default_filter_buffers(false);
 }
 
 void colo_do_failover(MigrationState *s)
@@ -290,6 +293,8 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
         goto out;
     }
 
+    qemu_release_default_filters_packets();
+
     if (colo_shutdown) {
         colo_ctl_put(s->to_dst_file, COLO_COMMAND_GUEST_SHUTDOWN, 0);
         qemu_fflush(s->to_dst_file);
@@ -367,6 +372,8 @@ static void colo_process_checkpoint(MigrationState *s)
         error_report("Failed to allocate colo buffer!");
         goto out;
     }
+    /* Begin to buffer packets that sent by VM */
+    qemu_set_default_filter_buffers(true);
 
     qemu_mutex_lock_iothread();
     vm_start();
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]