qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Volker Rümelin" <vr_qemu@t-online.de>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [PATCH v4 12/12] pckbd: clear outport_present in outer pre_load()
Date: Tue, 25 May 2021 20:14:41 +0200	[thread overview]
Message-ID: <20210525181441.27768-12-vr_qemu@t-online.de> (raw)
In-Reply-To: <79355790-0f6f-7a3f-3525-4846c88ba8e2@t-online.de>

The variable outport_present is a flag to show if the outport
subsection was loaded. Clear the outport_present flag in the
outer pre_load() function. This method is recommended in the QEMU
manual for developers in the chapter "Migration, Subsections".

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 hw/input/pckbd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index de867abc06..baba62f357 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -457,7 +457,6 @@ static void kbd_reset(void *opaque)
     s->mode = KBD_MODE_KBD_INT | KBD_MODE_MOUSE_INT;
     s->status = KBD_STAT_CMD | KBD_STAT_UNLOCKED;
     s->outport = KBD_OUT_RESET | KBD_OUT_A20 | KBD_OUT_ONES;
-    s->outport_present = false;
     s->pending = 0;
     kbd_deassert_irq(s);
     if (s->throttle_timer) {
@@ -564,6 +563,7 @@ static int kbd_pre_load(void *opaque)
 {
     KBDState *s = opaque;
 
+    s->outport_present = false;
     s->extended_state_loaded = false;
     return 0;
 }
@@ -574,7 +574,6 @@ static int kbd_post_load(void *opaque, int version_id)
     if (!s->outport_present) {
         s->outport = kbd_outport_default(s);
     }
-    s->outport_present = false;
     s->pending = s->pending_tmp;
     if (!s->extended_state_loaded) {
         s->obsrc = s->status & KBD_STAT_OBF ?
-- 
2.26.2



      parent reply	other threads:[~2021-05-25 18:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 18:13 [PATCH v4 00/12] PS/2 controller related fixes Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 01/12] ps2: fix mouse stream corruption Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 02/12] ps2: don't raise an interrupt if queue is full Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 03/12] ps2: don't deassert irq twice if queue is empty Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 04/12] pckbd: split out interrupt line changing code Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 05/12] pckbd: don't update OBF flags if KBD_STAT_OBF is set Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 06/12] pckbd: PS/2 keyboard throttle Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 07/12] pckbd: add state variable for interrupt source Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 08/12] pckbd: add controller response queue Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 09/12] pckbd: add function kbd_pending() Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 10/12] pckbd: correctly disable PS/2 communication Volker Rümelin
2021-05-25 18:14 ` [PATCH v4 11/12] pckbd: remove duplicated keyboard and mouse defines Volker Rümelin
2021-05-25 18:14 ` Volker Rümelin [this message]

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=20210525181441.27768-12-vr_qemu@t-online.de \
    --to=vr_qemu@t-online.de \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).