qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/3] ps2: migration support for command reply queue


From: Volker Rümelin
Subject: Re: [PATCH 3/3] ps2: migration support for command reply queue
Date: Tue, 10 Aug 2021 10:38:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0

   Hi,

this part actually works. .needed is only evaluated on the sending side. For
the receiving side subsections are optional.  Migration doesn't fail if a
subsection isn't loaded. Before I sent this patch series one of the
migration tests was a migration from 6.0.92 to 6.0.92 with one byte in the
command reply queue and 3 bytes in the scancode queue. The migration didn't
fail.
Hmm, ok.  If you actually tested it you are probably right.  My memory
tells me ->needed() is evaluated on both sending and receiving side as
the migration data stream does not carry the information whenever a
subsection is present or not.  But maybe my memories are wrong, or
things have changed, I don't follow migration changes that closely.

If we can't find something we can add a property simliar to the one
for the extended keyboard state.
What is the best way to add such a compat property? The ps2 keyboard isn't a
qdev device. I can't just add a property to the device class. Do I have to
add a property to the i8042 and the pl050 device and propagate the property
value with the ps2_kbd_init() call to the PS2KbdState?
Yes, I think so.  But double-check the migration thing first, if your
approach works that is the easier way of course.

take care,
   Gerd


Hi Gerd,

this are the results of 5 migrations. I added a trace statement to function ps2_common_post_load() in my qemu-master. The first trace line is for ps2kbd, the second for ps2mouse.

#1 Migrate qemu 6.0.92 to qemu 6.0.92
  2 scancodes in ps2 keyboard queue

ps2_common_post_load: count 2, ccount 0
ps2_common_post_load: count 0, ccount 0

migration OK

./scripts/analyze-migration.py -f /var/tmp/qemu-state -d desc | less
        {
            "name": "ps2kbd",
            "instance_id": 0,
            "vmsd_name": "ps2kbd",
            "version": 3,
            "fields": [
                {
                    "name": "common",
                    "type": "struct",
                    "struct": {
                        "vmsd_name": "PS2 Common State",
                        "version": 3,
                        "fields": [
                            {
                                "name": "write_cmd",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.rptr",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.wptr",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.count",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.data",
                                "type": "buffer",
                                "size": 256
                            }
                        ]
                    },
                    "size": 272
                },

#2 Migrate qemu 6.0.92 to qemu 6.0.92
  1 command reply and 2 scancodes in ps2 keyboard queue

ps2_common_post_load: count 3, ccount 1
ps2_common_post_load: count 0, ccount 0

migration OK

./scripts/analyze-migration.py -f /var/tmp/qemu-state -d desc | less
        {
            "name": "ps2kbd",
            "instance_id": 0,
            "vmsd_name": "ps2kbd",
            "version": 3,
            "fields": [
                {
                    "name": "common",
                    "type": "struct",
                    "struct": {
                        "vmsd_name": "PS2 Common State",
                        "version": 3,
                        "fields": [
                            {
                                "name": "write_cmd",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.rptr",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.wptr",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.count",
                                "type": "int32",
                                "size": 4
                            },
                            {
                                "name": "queue.data",
                                "type": "buffer",
                                "size": 256
                            }
                        ]
                    },
                    "size": 272
                },
                {
                    "name": "scan_enabled",
                    "type": "int32",
                    "size": 4
                },
                {
                    "name": "translate",
                    "type": "int32",
                    "size": 4
                },
                {
                    "name": "scancode_set",
                    "type": "int32",
                    "size": 4
                }
            ],
            "subsections": [
                {
                    "vmsd_name": "ps2kbd/command_reply_queue",
                    "version": 0,
                    "fields": [
                        {
                            "name": "common.queue.cwptr",
                            "type": "int32",
                            "size": 4
                        }
                    ]
                }
            ]
        },

#3 Migrate qemu 5.2.0 to qemu 6.0.92
  4 scancodes in ps2 keyboard queue

ps2_common_post_load: count 4, ccount 0
ps2_common_post_load: count 0, ccount 0

Migration OK

#4 Migrate qemu 6.0.92 to qemu 5.2.0
  2 scancodes in ps2 keyboard queue

Migration OK

#5 Migrate qemu 6.0.92 to qemu 5.2.0
  1 command reply and 2 scancodes in ps2 keyboard queue

qemu-system-x86_64: error while loading state for instance 0x0 of device 'ps2kbd'
qemu-system-x86_64: load of migration failed: No such file or directory

Migration FAILED

With best regards,
Volker



reply via email to

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