Jason Baron 1de5345927 pcie: drop version_id field for live migration
While testing q35 live migration, I found that the migration would abort with
the following error: "Unknown savevm section type 76".

The error is due to this check failing in 'vmstate_load_state()':

    while(field->name) {
        if ((field->field_exists &&
             field->field_exists(opaque, version_id)) ||
            (!field->field_exists &&
             field->version_id <= version_id)) {

The VMSTATE_PCIE_DEVICE() currently has a 'version_id' set to 2. However,
'version_id' in the above check is 1. And thus we fail to load the pcie device
field. Further the code returns to 'qemu_loadvm_state()' which produces the
error that I saw.

I'm proposing to fix this by simply dropping the 'version_id' field from
VMSTATE_PCIE_DEVICE(). VMSTATE_PCI_DEVICE() defines no such field and further
the vmstate_pcie_device that VMSTATE_PCI_DEVICE() refers to is already
versioned. Thus, any versioning issues could be detected at the vmsd level.

Taking a step back, I think that the 'field->version_id' should be compared
against a saved version number for the field not the 'version_id'. Futhermore,
once vmstate_load_state() is called recursively on another vmsd, the check of:

    if (version_id > vmsd->version_id) {
        return -EINVAL;
    }

Will never fail since version_id is always equal to vmsd->version_id. So I'm
wondering why we aren't storing the vmsd version id of the source in the
migration stream?

This patch also renames the 'name' field of vmstate_pcie_device from:
PCIDevice -> PCIEDevice to differentiate it from vmstate_pci_device.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-09-07 09:02:44 +03:00
..
2012-08-13 16:13:02 +01:00
2012-06-21 16:06:11 +00:00
2012-08-31 15:47:57 +02:00
2012-07-04 15:52:55 +03:00
2012-08-13 16:10:18 -03:00
2012-02-07 22:11:04 +04:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-08-22 10:47:17 -05:00
2012-03-14 22:20:26 +01:00
2012-03-17 16:30:06 +00:00
2012-06-21 16:06:11 +00:00
2012-01-13 10:55:56 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-03-24 13:06:41 +00:00
2011-12-06 09:56:41 +00:00
2012-07-28 09:23:11 +00:00
2012-03-14 22:20:26 +01:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-22 10:47:17 -05:00
2012-01-04 02:48:14 +01:00
2011-10-17 15:59:18 +02:00
2012-02-15 09:39:21 -06:00
2012-03-19 10:52:52 +00:00
2012-03-14 22:20:26 +01:00
2012-01-13 10:55:56 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-28 14:49:59 +02:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-08-01 12:56:15 +01:00
2012-07-17 16:48:32 +02:00
2012-02-10 10:44:52 +00:00
2012-02-15 09:39:21 -06:00
2012-08-22 10:47:17 -05:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-08-22 10:47:17 -05:00
2012-02-15 09:39:21 -06:00
2011-12-06 09:56:41 +00:00
2011-12-14 11:09:12 +00:00
2012-04-26 12:54:17 +04:00
2012-08-01 12:56:15 +01:00
2012-06-18 15:14:38 +02:00
2012-03-07 12:27:41 +02:00
2012-03-07 12:27:41 +02:00
2012-08-21 15:18:24 -05:00
2012-07-04 10:43:33 +00:00
2012-07-04 10:43:33 +00:00
2012-07-04 10:43:33 +00:00
2012-07-04 10:43:33 +00:00
2012-08-01 12:56:15 +01:00
2012-07-29 17:05:35 +03:00
2012-02-15 09:39:21 -06:00
2012-03-19 11:30:56 +00:00
2011-10-16 11:10:48 +00:00
2012-03-30 08:14:11 -05:00
2012-03-30 08:14:11 -05:00
2012-02-24 13:36:04 -06:00
2012-03-14 22:20:26 +01:00
2012-08-01 12:56:15 +01:00
2012-06-04 23:00:45 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2011-12-14 11:08:23 +00:00
2011-12-14 11:08:23 +00:00
2012-06-24 01:04:51 +02:00
2011-10-21 18:14:29 +02:00
2011-10-21 18:14:29 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-08-01 12:56:15 +01:00
2012-03-14 22:20:26 +01:00
2011-11-28 15:38:42 +02:00
2012-03-14 22:20:26 +01:00
2012-08-28 12:48:39 +02:00
2012-08-03 10:04:37 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-06-04 23:00:41 +02:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-08-01 12:56:15 +01:00
2012-08-01 12:56:15 +01:00
2012-03-14 22:20:26 +01:00
2012-02-22 09:02:19 -06:00
2012-03-14 22:20:26 +01:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-01 13:32:10 +01:00
2011-11-28 15:38:41 +02:00
2012-02-15 09:39:21 -06:00
2012-03-15 16:54:21 +00:00
2012-02-15 09:39:21 -06:00
2012-03-24 13:06:41 +00:00
2011-11-28 15:38:41 +02:00
2012-02-15 09:39:21 -06:00
2012-08-15 19:43:17 +02:00
2012-07-27 21:13:01 +00:00
2012-08-01 12:56:15 +01:00
2012-02-15 09:39:21 -06:00
2012-06-15 14:03:42 +02:00
2012-07-29 17:05:35 +03:00
2012-07-29 17:05:35 +03:00
2012-08-09 18:21:47 +00:00
2012-07-29 17:05:35 +03:00
2012-01-27 10:50:50 -06:00
2012-02-15 09:39:21 -06:00
2012-02-17 09:58:22 -06:00
2012-02-17 09:58:22 -06:00
2012-02-15 09:39:21 -06:00
2012-08-22 10:47:17 -05:00
2012-03-30 10:31:23 +00:00
2012-02-15 09:39:21 -06:00
2011-12-14 11:08:23 +00:00
2011-12-14 11:08:23 +00:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-09-06 17:04:33 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-22 10:47:17 -05:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-08-22 10:47:17 -05:00
2012-08-22 10:47:17 -05:00
2012-04-07 14:00:45 +00:00
2012-04-12 11:14:29 +01:00
2012-02-15 09:39:21 -06:00
2012-06-11 00:23:04 +02:00
2012-08-31 10:16:11 +02:00
2012-06-22 10:49:55 +02:00
2012-06-22 10:49:45 +02:00
2012-06-04 23:00:43 +02:00
2011-11-24 18:31:59 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-18 08:50:09 +00:00
2012-08-13 11:04:07 +01:00
2012-08-13 11:04:07 +01:00
2012-02-15 09:39:21 -06:00
2011-12-06 09:56:41 +00:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2012-03-16 00:41:15 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-03-16 00:41:28 +02:00
2012-03-16 00:41:28 +02:00
2012-01-13 10:55:56 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-06-24 01:04:45 +02:00
2012-08-22 10:47:17 -05:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-06-18 15:14:38 +02:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-09 18:34:57 +00:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-22 10:47:17 -05:00
2012-08-31 11:57:23 +02:00
2012-02-15 09:39:21 -06:00
2012-08-01 12:56:15 +01:00
2012-02-04 12:45:10 +00:00
2012-06-22 10:46:12 +02:00
2012-06-22 10:46:12 +02:00
2012-02-04 12:45:10 +00:00
2012-02-15 09:39:21 -06:00
2012-03-16 00:45:23 +02:00
2012-08-06 14:01:44 -05:00
2012-08-06 14:01:44 -05:00
2012-02-15 09:39:21 -06:00
2012-03-14 22:20:26 +01:00
2012-07-28 09:23:11 +00:00
2012-01-22 07:27:06 +00:00
2012-02-15 09:39:21 -06:00
2012-02-15 09:39:21 -06:00
2012-08-01 08:43:37 -05:00
2012-06-21 16:06:11 +00:00
2012-05-16 18:04:44 -03:00
2012-06-15 13:08:13 +02:00
2012-03-14 22:20:26 +01:00
2012-02-15 09:39:21 -06:00
2012-03-09 07:02:50 -06:00