|
@@ -17,6 +17,8 @@
|
|
|
#include "net/vhost_net.h"
|
|
|
#include "qom/object_interfaces.h"
|
|
|
#include "qemu/iov.h"
|
|
|
+#include "net/colo.h"
|
|
|
+#include "migration/colo.h"
|
|
|
|
|
|
static inline bool qemu_can_skip_netfilter(NetFilterState *nf)
|
|
|
{
|
|
@@ -245,11 +247,26 @@ static void netfilter_finalize(Object *obj)
|
|
|
g_free(nf->netdev_id);
|
|
|
}
|
|
|
|
|
|
+static void default_handle_event(NetFilterState *nf, int event, Error **errp)
|
|
|
+{
|
|
|
+ switch (event) {
|
|
|
+ case COLO_EVENT_CHECKPOINT:
|
|
|
+ break;
|
|
|
+ case COLO_EVENT_FAILOVER:
|
|
|
+ object_property_set_str(OBJECT(nf), "off", "status", errp);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void netfilter_class_init(ObjectClass *oc, void *data)
|
|
|
{
|
|
|
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
|
|
|
+ NetFilterClass *nfc = NETFILTER_CLASS(oc);
|
|
|
|
|
|
ucc->complete = netfilter_complete;
|
|
|
+ nfc->handle_event = default_handle_event;
|
|
|
}
|
|
|
|
|
|
static const TypeInfo netfilter_info = {
|