[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v18 QEMU 05/18] vfio: Add migration region initialization and
From: |
Cornelia Huck |
Subject: |
Re: [PATCH v18 QEMU 05/18] vfio: Add migration region initialization and finalize function |
Date: |
Tue, 5 May 2020 11:42:14 +0200 |
On Tue, 5 May 2020 04:14:40 +0530
Kirti Wankhede <address@hidden> wrote:
> - Migration functions are implemented for VFIO_DEVICE_TYPE_PCI device in this
> patch series.
I would drop this sentence; people looking at this patch in the future
are unlikely to care.
> - VFIO device supports migration or not is decided based of migration region
"Whether the VFIO device..."
s/based of/based on/
> query. If migration region query is successful and migration region
> initialization is successful then migration is supported else migration is
> blocked.
>
> Signed-off-by: Kirti Wankhede <address@hidden>
> Reviewed-by: Neo Jia <address@hidden>
> ---
> hw/vfio/Makefile.objs | 2 +-
> hw/vfio/migration.c | 138
> ++++++++++++++++++++++++++++++++++++++++++
> hw/vfio/trace-events | 3 +
> include/hw/vfio/vfio-common.h | 9 +++
> 4 files changed, 151 insertions(+), 1 deletion(-)
> create mode 100644 hw/vfio/migration.c
> +int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
> +{
> + struct vfio_region_info *info;
> + Error *local_err = NULL;
> + int ret;
> +
> + ret = vfio_get_dev_region_info(vbasedev, VFIO_REGION_TYPE_MIGRATION,
> + VFIO_REGION_SUBTYPE_MIGRATION, &info);
> + if (ret) {
> + goto add_blocker;
> + }
> +
> + ret = vfio_migration_init(vbasedev, info);
> + if (ret) {
> + goto add_blocker;
> + }
> +
> + trace_vfio_migration_probe(vbasedev->name, info->index);
> + return 0;
> +
> +add_blocker:
> + error_setg(&vbasedev->migration_blocker,
> + "VFIO device doesn't support migration");
> + ret = migrate_add_blocker(vbasedev->migration_blocker, &local_err);
> + if (local_err) {
Rather check for ret?
> + error_propagate(errp, local_err);
> + error_free(vbasedev->migration_blocker);
vbasedev->migration_blocker = NULL; ?
> + }
> + return ret;
I think you also need to free info somewhere?
> +}
- [PATCH v18 QEMU 00/18] Add migration support for VFIO devices, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 01/18] vfio: KABI for migration interface - Kernel header placeholder, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 03/18] vfio: Add vfio_get_object callback to VFIODeviceOps, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 02/18] vfio: Add function to unmap VFIO region, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 04/18] vfio: Add save and load functions for VFIO PCI devices, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 05/18] vfio: Add migration region initialization and finalize function, Kirti Wankhede, 2020/05/04
- Re: [PATCH v18 QEMU 05/18] vfio: Add migration region initialization and finalize function,
Cornelia Huck <=
- [PATCH v18 QEMU 06/18] vfio: Add VM state change handler to know state of VM, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 07/18] vfio: Add migration state change notifier, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 08/18] vfio: Register SaveVMHandlers for VFIO device, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 10/18] vfio: Add load state functions to SaveVMHandlers, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 11/18] iommu: add callback to get address limit IOMMU supports, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 09/18] vfio: Add save state functions to SaveVMHandlers, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 12/18] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled, Kirti Wankhede, 2020/05/04
- [PATCH v18 QEMU 13/18] vfio: Add function to start and stop dirty pages tracking, Kirti Wankhede, 2020/05/04