qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [patch 3/3] UHCI: Substate section for migration of remote wakeup feature
Date: Wed, 01 Dec 2010 14:47:07 -0200	[thread overview]
Message-ID: <20101201164743.090538903@redhat.com> (raw)
In-Reply-To: 20101201164704.729398122@redhat.com

[-- Attachment #1: usb-uhci-save --]
[-- Type: text/plain, Size: 1604 bytes --]

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

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

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 */
+        }
     }
 };
 

  parent reply	other threads:[~2010-12-01 16:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 15:34 [Qemu-devel] PATCH: QEMU support for UHCI suspend / remote wake up Marcelo Tosatti
2010-11-25 16:15 ` [Qemu-devel] " Gerd Hoffmann
2010-11-25 17:04   ` [Qemu-devel] [patch 0/2] USB UHCI global suspend / remote wakeup Marcelo Tosatti
2010-11-25 17:04     ` [Qemu-devel] [patch 1/2] add USBBusOps to USBBus Marcelo Tosatti
2010-11-25 17:04     ` [Qemu-devel] [patch 2/2] support for UHCI suspend / remote wake up Marcelo Tosatti
2010-12-01 15:12       ` [Qemu-devel] " Gerd Hoffmann
2010-12-01 16:58         ` Marcelo Tosatti
2010-12-01 17:17           ` Gerd Hoffmann
2010-11-26  0:38     ` [Qemu-devel] [patch 0/2] USB UHCI global suspend / remote wakeup Paul Brook
2010-11-26  2:15       ` Marcelo Tosatti
2010-11-26  8:49         ` Gerd Hoffmann
2010-11-26 12:09           ` Paul Brook
2010-12-01 16:47     ` [Qemu-devel] [patch 0/3] QEMU support for UHCI suspend / remote wake up (v3) Marcelo Tosatti
2010-12-01 16:47       ` [Qemu-devel] [patch 1/3] add USBPortOps to USBPort Marcelo Tosatti
2010-12-01 17:10         ` [Qemu-devel] " Gerd Hoffmann
2010-12-01 16:47       ` [Qemu-devel] [patch 2/3] support for UHCI suspend / remote wake up Marcelo Tosatti
2010-12-01 17:12         ` [Qemu-devel] " Gerd Hoffmann
2010-12-01 16:47       ` Marcelo Tosatti [this message]
2010-12-01 17:16         ` [Qemu-devel] Re: [patch 3/3] UHCI: Substate section for migration of remote wakeup feature Gerd Hoffmann
2010-12-01 19:14           ` Juan Quintela
2010-12-01 20:56             ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101201164743.090538903@redhat.com \
    --to=mtosatti@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).