* [PATCH] vfio/migration: Rename entry points
@ 2023-03-07 16:57 Alex Williamson
2023-03-07 16:58 ` Cédric Le Goater
2023-03-07 17:13 ` [PATCH v2] " Alex Williamson
0 siblings, 2 replies; 5+ messages in thread
From: Alex Williamson @ 2023-03-07 16:57 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson, clg, yishaih, jgg, joao.m.martins, avihaih
Pick names that align with the section drivers should use them from,
avoiding the confusion of calling a _finalize() function from _exit()
and generalizing the actual _finalize() to handle removing the viommu
blocker.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
A minor follow-up to Joao's v5 series.
hw/vfio/common.c | 2 +-
hw/vfio/migration.c | 4 ++--
hw/vfio/pci.c | 6 +++---
include/hw/vfio/vfio-common.h | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 2b9bcf70aa36..dddd7a8e40f8 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -447,7 +447,7 @@ int vfio_block_giommu_migration(Error **errp)
return ret;
}
-void vfio_unblock_giommu_migration(void)
+void vfio_migration_finalize(void)
{
if (!giommu_migration_blocker ||
vfio_viommu_preset()) {
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 5d1e66f69194..40f5f3d0b194 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -631,7 +631,7 @@ int64_t vfio_mig_bytes_transferred(void)
return bytes_transferred;
}
-int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
+int vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
{
int ret = -ENOTSUP;
@@ -669,7 +669,7 @@ add_blocker:
return ret;
}
-void vfio_migration_finalize(VFIODevice *vbasedev)
+void vfio_migration_exit(VFIODevice *vbasedev)
{
if (vbasedev->migration) {
VFIOMigration *migration = vbasedev->migration;
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 30a271eab38c..ec9a854361ac 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3145,7 +3145,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
}
if (!pdev->failover_pair_id) {
- ret = vfio_migration_probe(vbasedev, errp);
+ ret = vfio_migration_realize(vbasedev, errp);
if (ret) {
error_report("%s: Migration disabled", vbasedev->name);
}
@@ -3185,7 +3185,7 @@ static void vfio_instance_finalize(Object *obj)
*/
vfio_put_device(vdev);
vfio_put_group(group);
- vfio_unblock_giommu_migration();
+ vfio_migration_finalize();
}
static void vfio_exitfn(PCIDevice *pdev)
@@ -3204,7 +3204,7 @@ static void vfio_exitfn(PCIDevice *pdev)
}
vfio_teardown_msi(vdev);
vfio_bars_exit(vdev);
- vfio_migration_finalize(&vdev->vbasedev);
+ vfio_migration_exit(&vdev->vbasedev);
}
static void vfio_pci_reset(DeviceState *dev)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 009bec34c4bc..eed244f25f34 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -223,7 +223,6 @@ bool vfio_mig_active(void);
int vfio_block_multiple_devices_migration(Error **errp);
void vfio_unblock_multiple_devices_migration(void);
int vfio_block_giommu_migration(Error **errp);
-void vfio_unblock_giommu_migration(void);
int64_t vfio_mig_bytes_transferred(void);
#ifdef CONFIG_LINUX
@@ -247,7 +246,8 @@ int vfio_spapr_create_window(VFIOContainer *container,
int vfio_spapr_remove_window(VFIOContainer *container,
hwaddr offset_within_address_space);
-int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
-void vfio_migration_finalize(VFIODevice *vbasedev);
+int vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
+void vfio_migration_exit(VFIODevice *vbasedev);
+void vfio_migration_finalize(void);
#endif /* HW_VFIO_VFIO_COMMON_H */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] vfio/migration: Rename entry points
2023-03-07 16:57 [PATCH] vfio/migration: Rename entry points Alex Williamson
@ 2023-03-07 16:58 ` Cédric Le Goater
2023-03-07 17:13 ` [PATCH v2] " Alex Williamson
1 sibling, 0 replies; 5+ messages in thread
From: Cédric Le Goater @ 2023-03-07 16:58 UTC (permalink / raw)
To: Alex Williamson, qemu-devel; +Cc: yishaih, jgg, joao.m.martins, avihaih
On 3/7/23 17:57, Alex Williamson wrote:
> Pick names that align with the section drivers should use them from,
> avoiding the confusion of calling a _finalize() function from _exit()
> and generalizing the actual _finalize() to handle removing the viommu
> blocker.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
LGTM !
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
>
> A minor follow-up to Joao's v5 series.
>
> hw/vfio/common.c | 2 +-
> hw/vfio/migration.c | 4 ++--
> hw/vfio/pci.c | 6 +++---
> include/hw/vfio/vfio-common.h | 6 +++---
> 4 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 2b9bcf70aa36..dddd7a8e40f8 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -447,7 +447,7 @@ int vfio_block_giommu_migration(Error **errp)
> return ret;
> }
>
> -void vfio_unblock_giommu_migration(void)
> +void vfio_migration_finalize(void)
> {
> if (!giommu_migration_blocker ||
> vfio_viommu_preset()) {
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 5d1e66f69194..40f5f3d0b194 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -631,7 +631,7 @@ int64_t vfio_mig_bytes_transferred(void)
> return bytes_transferred;
> }
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
> {
> int ret = -ENOTSUP;
>
> @@ -669,7 +669,7 @@ add_blocker:
> return ret;
> }
>
> -void vfio_migration_finalize(VFIODevice *vbasedev)
> +void vfio_migration_exit(VFIODevice *vbasedev)
> {
> if (vbasedev->migration) {
> VFIOMigration *migration = vbasedev->migration;
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 30a271eab38c..ec9a854361ac 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -3145,7 +3145,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
> }
>
> if (!pdev->failover_pair_id) {
> - ret = vfio_migration_probe(vbasedev, errp);
> + ret = vfio_migration_realize(vbasedev, errp);
> if (ret) {
> error_report("%s: Migration disabled", vbasedev->name);
> }
> @@ -3185,7 +3185,7 @@ static void vfio_instance_finalize(Object *obj)
> */
> vfio_put_device(vdev);
> vfio_put_group(group);
> - vfio_unblock_giommu_migration();
> + vfio_migration_finalize();
> }
>
> static void vfio_exitfn(PCIDevice *pdev)
> @@ -3204,7 +3204,7 @@ static void vfio_exitfn(PCIDevice *pdev)
> }
> vfio_teardown_msi(vdev);
> vfio_bars_exit(vdev);
> - vfio_migration_finalize(&vdev->vbasedev);
> + vfio_migration_exit(&vdev->vbasedev);
> }
>
> static void vfio_pci_reset(DeviceState *dev)
> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
> index 009bec34c4bc..eed244f25f34 100644
> --- a/include/hw/vfio/vfio-common.h
> +++ b/include/hw/vfio/vfio-common.h
> @@ -223,7 +223,6 @@ bool vfio_mig_active(void);
> int vfio_block_multiple_devices_migration(Error **errp);
> void vfio_unblock_multiple_devices_migration(void);
> int vfio_block_giommu_migration(Error **errp);
> -void vfio_unblock_giommu_migration(void);
> int64_t vfio_mig_bytes_transferred(void);
>
> #ifdef CONFIG_LINUX
> @@ -247,7 +246,8 @@ int vfio_spapr_create_window(VFIOContainer *container,
> int vfio_spapr_remove_window(VFIOContainer *container,
> hwaddr offset_within_address_space);
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
> -void vfio_migration_finalize(VFIODevice *vbasedev);
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
> +void vfio_migration_exit(VFIODevice *vbasedev);
> +void vfio_migration_finalize(void);
>
> #endif /* HW_VFIO_VFIO_COMMON_H */
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] vfio/migration: Rename entry points
2023-03-07 16:57 [PATCH] vfio/migration: Rename entry points Alex Williamson
2023-03-07 16:58 ` Cédric Le Goater
@ 2023-03-07 17:13 ` Alex Williamson
2023-03-07 17:17 ` Cédric Le Goater
2023-03-07 18:17 ` Joao Martins
1 sibling, 2 replies; 5+ messages in thread
From: Alex Williamson @ 2023-03-07 17:13 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson, clg, yishaih, jgg, joao.m.martins, avihaih
Pick names that align with the section drivers should use them from,
avoiding the confusion of calling a _finalize() function from _exit()
and generalizing the actual _finalize() to handle removing the viommu
blocker.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
v2: ...but there's already a vfio_migration_exit(), it should really
just be inlined, but for minimally invasive change, just rename to
vfio_migration_free().
hw/vfio/common.c | 2 +-
hw/vfio/migration.c | 8 ++++----
hw/vfio/pci.c | 6 +++---
include/hw/vfio/vfio-common.h | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 2b9bcf70aa36..dddd7a8e40f8 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -447,7 +447,7 @@ int vfio_block_giommu_migration(Error **errp)
return ret;
}
-void vfio_unblock_giommu_migration(void)
+void vfio_migration_finalize(void)
{
if (!giommu_migration_blocker ||
vfio_viommu_preset()) {
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 5d1e66f69194..1a1a8659c859 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -521,7 +521,7 @@ static void vfio_migration_state_notifier(Notifier *notifier, void *data)
}
}
-static void vfio_migration_exit(VFIODevice *vbasedev)
+static void vfio_migration_free(VFIODevice *vbasedev)
{
g_free(vbasedev->migration);
vbasedev->migration = NULL;
@@ -631,7 +631,7 @@ int64_t vfio_mig_bytes_transferred(void)
return bytes_transferred;
}
-int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
+int vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
{
int ret = -ENOTSUP;
@@ -669,7 +669,7 @@ add_blocker:
return ret;
}
-void vfio_migration_finalize(VFIODevice *vbasedev)
+void vfio_migration_exit(VFIODevice *vbasedev)
{
if (vbasedev->migration) {
VFIOMigration *migration = vbasedev->migration;
@@ -677,7 +677,7 @@ void vfio_migration_finalize(VFIODevice *vbasedev)
remove_migration_state_change_notifier(&migration->migration_state);
qemu_del_vm_change_state_handler(migration->vm_state);
unregister_savevm(VMSTATE_IF(vbasedev->dev), "vfio", vbasedev);
- vfio_migration_exit(vbasedev);
+ vfio_migration_free(vbasedev);
vfio_unblock_multiple_devices_migration();
}
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 30a271eab38c..ec9a854361ac 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3145,7 +3145,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
}
if (!pdev->failover_pair_id) {
- ret = vfio_migration_probe(vbasedev, errp);
+ ret = vfio_migration_realize(vbasedev, errp);
if (ret) {
error_report("%s: Migration disabled", vbasedev->name);
}
@@ -3185,7 +3185,7 @@ static void vfio_instance_finalize(Object *obj)
*/
vfio_put_device(vdev);
vfio_put_group(group);
- vfio_unblock_giommu_migration();
+ vfio_migration_finalize();
}
static void vfio_exitfn(PCIDevice *pdev)
@@ -3204,7 +3204,7 @@ static void vfio_exitfn(PCIDevice *pdev)
}
vfio_teardown_msi(vdev);
vfio_bars_exit(vdev);
- vfio_migration_finalize(&vdev->vbasedev);
+ vfio_migration_exit(&vdev->vbasedev);
}
static void vfio_pci_reset(DeviceState *dev)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 009bec34c4bc..eed244f25f34 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -223,7 +223,6 @@ bool vfio_mig_active(void);
int vfio_block_multiple_devices_migration(Error **errp);
void vfio_unblock_multiple_devices_migration(void);
int vfio_block_giommu_migration(Error **errp);
-void vfio_unblock_giommu_migration(void);
int64_t vfio_mig_bytes_transferred(void);
#ifdef CONFIG_LINUX
@@ -247,7 +246,8 @@ int vfio_spapr_create_window(VFIOContainer *container,
int vfio_spapr_remove_window(VFIOContainer *container,
hwaddr offset_within_address_space);
-int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
-void vfio_migration_finalize(VFIODevice *vbasedev);
+int vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
+void vfio_migration_exit(VFIODevice *vbasedev);
+void vfio_migration_finalize(void);
#endif /* HW_VFIO_VFIO_COMMON_H */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] vfio/migration: Rename entry points
2023-03-07 17:13 ` [PATCH v2] " Alex Williamson
@ 2023-03-07 17:17 ` Cédric Le Goater
2023-03-07 18:17 ` Joao Martins
1 sibling, 0 replies; 5+ messages in thread
From: Cédric Le Goater @ 2023-03-07 17:17 UTC (permalink / raw)
To: Alex Williamson, qemu-devel; +Cc: yishaih, jgg, joao.m.martins, avihaih
On 3/7/23 18:13, Alex Williamson wrote:
> Pick names that align with the section drivers should use them from,
> avoiding the confusion of calling a _finalize() function from _exit()
> and generalizing the actual _finalize() to handle removing the viommu
> blocker.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>
> v2: ...but there's already a vfio_migration_exit(), it should really
> just be inlined, but for minimally invasive change, just rename to
> vfio_migration_free().
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
>
> hw/vfio/common.c | 2 +-
> hw/vfio/migration.c | 8 ++++----
> hw/vfio/pci.c | 6 +++---
> include/hw/vfio/vfio-common.h | 6 +++---
> 4 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 2b9bcf70aa36..dddd7a8e40f8 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -447,7 +447,7 @@ int vfio_block_giommu_migration(Error **errp)
> return ret;
> }
>
> -void vfio_unblock_giommu_migration(void)
> +void vfio_migration_finalize(void)
> {
> if (!giommu_migration_blocker ||
> vfio_viommu_preset()) {
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 5d1e66f69194..1a1a8659c859 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -521,7 +521,7 @@ static void vfio_migration_state_notifier(Notifier *notifier, void *data)
> }
> }
>
> -static void vfio_migration_exit(VFIODevice *vbasedev)
> +static void vfio_migration_free(VFIODevice *vbasedev)
> {
> g_free(vbasedev->migration);
> vbasedev->migration = NULL;
> @@ -631,7 +631,7 @@ int64_t vfio_mig_bytes_transferred(void)
> return bytes_transferred;
> }
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
> {
> int ret = -ENOTSUP;
>
> @@ -669,7 +669,7 @@ add_blocker:
> return ret;
> }
>
> -void vfio_migration_finalize(VFIODevice *vbasedev)
> +void vfio_migration_exit(VFIODevice *vbasedev)
> {
> if (vbasedev->migration) {
> VFIOMigration *migration = vbasedev->migration;
> @@ -677,7 +677,7 @@ void vfio_migration_finalize(VFIODevice *vbasedev)
> remove_migration_state_change_notifier(&migration->migration_state);
> qemu_del_vm_change_state_handler(migration->vm_state);
> unregister_savevm(VMSTATE_IF(vbasedev->dev), "vfio", vbasedev);
> - vfio_migration_exit(vbasedev);
> + vfio_migration_free(vbasedev);
> vfio_unblock_multiple_devices_migration();
> }
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 30a271eab38c..ec9a854361ac 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -3145,7 +3145,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
> }
>
> if (!pdev->failover_pair_id) {
> - ret = vfio_migration_probe(vbasedev, errp);
> + ret = vfio_migration_realize(vbasedev, errp);
> if (ret) {
> error_report("%s: Migration disabled", vbasedev->name);
> }
> @@ -3185,7 +3185,7 @@ static void vfio_instance_finalize(Object *obj)
> */
> vfio_put_device(vdev);
> vfio_put_group(group);
> - vfio_unblock_giommu_migration();
> + vfio_migration_finalize();
> }
>
> static void vfio_exitfn(PCIDevice *pdev)
> @@ -3204,7 +3204,7 @@ static void vfio_exitfn(PCIDevice *pdev)
> }
> vfio_teardown_msi(vdev);
> vfio_bars_exit(vdev);
> - vfio_migration_finalize(&vdev->vbasedev);
> + vfio_migration_exit(&vdev->vbasedev);
> }
>
> static void vfio_pci_reset(DeviceState *dev)
> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
> index 009bec34c4bc..eed244f25f34 100644
> --- a/include/hw/vfio/vfio-common.h
> +++ b/include/hw/vfio/vfio-common.h
> @@ -223,7 +223,6 @@ bool vfio_mig_active(void);
> int vfio_block_multiple_devices_migration(Error **errp);
> void vfio_unblock_multiple_devices_migration(void);
> int vfio_block_giommu_migration(Error **errp);
> -void vfio_unblock_giommu_migration(void);
> int64_t vfio_mig_bytes_transferred(void);
>
> #ifdef CONFIG_LINUX
> @@ -247,7 +246,8 @@ int vfio_spapr_create_window(VFIOContainer *container,
> int vfio_spapr_remove_window(VFIOContainer *container,
> hwaddr offset_within_address_space);
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
> -void vfio_migration_finalize(VFIODevice *vbasedev);
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
> +void vfio_migration_exit(VFIODevice *vbasedev);
> +void vfio_migration_finalize(void);
>
> #endif /* HW_VFIO_VFIO_COMMON_H */
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] vfio/migration: Rename entry points
2023-03-07 17:13 ` [PATCH v2] " Alex Williamson
2023-03-07 17:17 ` Cédric Le Goater
@ 2023-03-07 18:17 ` Joao Martins
1 sibling, 0 replies; 5+ messages in thread
From: Joao Martins @ 2023-03-07 18:17 UTC (permalink / raw)
To: Alex Williamson; +Cc: clg, yishaih, jgg, avihaih, qemu-devel
On 07/03/2023 17:13, Alex Williamson wrote:
> Pick names that align with the section drivers should use them from,
> avoiding the confusion of calling a _finalize() function from _exit()
> and generalizing the actual _finalize() to handle removing the viommu
> blocker.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
> ---
>
> v2: ...but there's already a vfio_migration_exit(), it should really
> just be inlined, but for minimally invasive change, just rename to
> vfio_migration_free().
>
> hw/vfio/common.c | 2 +-
> hw/vfio/migration.c | 8 ++++----
> hw/vfio/pci.c | 6 +++---
> include/hw/vfio/vfio-common.h | 6 +++---
> 4 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 2b9bcf70aa36..dddd7a8e40f8 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -447,7 +447,7 @@ int vfio_block_giommu_migration(Error **errp)
> return ret;
> }
>
> -void vfio_unblock_giommu_migration(void)
> +void vfio_migration_finalize(void)
> {
> if (!giommu_migration_blocker ||
> vfio_viommu_preset()) {
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 5d1e66f69194..1a1a8659c859 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -521,7 +521,7 @@ static void vfio_migration_state_notifier(Notifier *notifier, void *data)
> }
> }
>
> -static void vfio_migration_exit(VFIODevice *vbasedev)
> +static void vfio_migration_free(VFIODevice *vbasedev)
> {
> g_free(vbasedev->migration);
> vbasedev->migration = NULL;
> @@ -631,7 +631,7 @@ int64_t vfio_mig_bytes_transferred(void)
> return bytes_transferred;
> }
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
> {
> int ret = -ENOTSUP;
>
> @@ -669,7 +669,7 @@ add_blocker:
> return ret;
> }
>
> -void vfio_migration_finalize(VFIODevice *vbasedev)
> +void vfio_migration_exit(VFIODevice *vbasedev)
> {
> if (vbasedev->migration) {
> VFIOMigration *migration = vbasedev->migration;
> @@ -677,7 +677,7 @@ void vfio_migration_finalize(VFIODevice *vbasedev)
> remove_migration_state_change_notifier(&migration->migration_state);
> qemu_del_vm_change_state_handler(migration->vm_state);
> unregister_savevm(VMSTATE_IF(vbasedev->dev), "vfio", vbasedev);
> - vfio_migration_exit(vbasedev);
> + vfio_migration_free(vbasedev);
> vfio_unblock_multiple_devices_migration();
> }
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 30a271eab38c..ec9a854361ac 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -3145,7 +3145,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
> }
>
> if (!pdev->failover_pair_id) {
> - ret = vfio_migration_probe(vbasedev, errp);
> + ret = vfio_migration_realize(vbasedev, errp);
> if (ret) {
> error_report("%s: Migration disabled", vbasedev->name);
> }
> @@ -3185,7 +3185,7 @@ static void vfio_instance_finalize(Object *obj)
> */
> vfio_put_device(vdev);
> vfio_put_group(group);
> - vfio_unblock_giommu_migration();
> + vfio_migration_finalize();
> }
>
> static void vfio_exitfn(PCIDevice *pdev)
> @@ -3204,7 +3204,7 @@ static void vfio_exitfn(PCIDevice *pdev)
> }
> vfio_teardown_msi(vdev);
> vfio_bars_exit(vdev);
> - vfio_migration_finalize(&vdev->vbasedev);
> + vfio_migration_exit(&vdev->vbasedev);
> }
>
> static void vfio_pci_reset(DeviceState *dev)
> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
> index 009bec34c4bc..eed244f25f34 100644
> --- a/include/hw/vfio/vfio-common.h
> +++ b/include/hw/vfio/vfio-common.h
> @@ -223,7 +223,6 @@ bool vfio_mig_active(void);
> int vfio_block_multiple_devices_migration(Error **errp);
> void vfio_unblock_multiple_devices_migration(void);
> int vfio_block_giommu_migration(Error **errp);
> -void vfio_unblock_giommu_migration(void);
> int64_t vfio_mig_bytes_transferred(void);
>
> #ifdef CONFIG_LINUX
> @@ -247,7 +246,8 @@ int vfio_spapr_create_window(VFIOContainer *container,
> int vfio_spapr_remove_window(VFIOContainer *container,
> hwaddr offset_within_address_space);
>
> -int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
> -void vfio_migration_finalize(VFIODevice *vbasedev);
> +int vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
> +void vfio_migration_exit(VFIODevice *vbasedev);
> +void vfio_migration_finalize(void);
>
> #endif /* HW_VFIO_VFIO_COMMON_H */
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-07 18:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07 16:57 [PATCH] vfio/migration: Rename entry points Alex Williamson
2023-03-07 16:58 ` Cédric Le Goater
2023-03-07 17:13 ` [PATCH v2] " Alex Williamson
2023-03-07 17:17 ` Cédric Le Goater
2023-03-07 18:17 ` Joao Martins
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).