qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [patch 3/3] UHCI: Substate section for migration of remote


From: Marcelo Tosatti
Subject: [Qemu-devel] [patch 3/3] UHCI: Substate section for migration of remote wakeup feature
Date: Wed, 01 Dec 2010 14:47:07 -0200
User-agent: quilt/0.47-1

Use a subsection to migrate remote wakeup feature only when used by the guest. 

Signed-off-by: Marcelo Tosatti <address@hidden>

Index: qemu-kvm/hw/usb-uhci.c
===================================================================
--- qemu-kvm.orig/hw/usb-uhci.c
+++ qemu-kvm/hw/usb-uhci.c
@@ -363,6 +363,39 @@ static void uhci_pre_save(void *opaque)
     uhci_async_cancel_all(s);
 }
 
+static bool uhci_port_wakeup_state_needed(void *opaque)
+{
+    UHCIPort *port = opaque;
+
+    if (port->port.dev) {
+        return port->port.dev->remote_wakeup;
+    }
+
+    return false;
+}
+
+static int uhci_port_wakeup_post_load(void *opaque, int version_id)
+{
+    UHCIPort *port = opaque;
+
+    if (port->port.dev) {
+        port->port.dev->remote_wakeup = 1;
+    }
+
+    return 0;
+}
+
+const VMStateDescription vmstate_uhci_wakeup_state = {
+    .name = "uhci port/wakeup",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = uhci_port_wakeup_post_load,
+    .fields      = (VMStateField []) {
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static const VMStateDescription vmstate_uhci_port = {
     .name = "uhci port",
     .version_id = 1,
@@ -371,6 +404,14 @@ static const VMStateDescription vmstate_
     .fields      = (VMStateField []) {
         VMSTATE_UINT16(ctrl, UHCIPort),
         VMSTATE_END_OF_LIST()
+    },
+    .subsections = (VMStateSubsection []) {
+        {
+            .vmsd = &vmstate_uhci_wakeup_state,
+            .needed = uhci_port_wakeup_state_needed,
+        }, {
+            /* empty */
+        }
     }
 };
 





reply via email to

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