[PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()

Cédric Le Goater posted 32 patches 2 weeks, 2 days ago
There is a newer version of this series
[PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()
Posted by Cédric Le Goater 2 weeks, 2 days ago
Enforce a 'vfio_mig_' prefix for the VFIO migration API to better
reflect the namespace these routines belong to.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 include/hw/vfio/vfio-common.h | 2 +-
 hw/vfio/migration.c           | 2 +-
 migration/target.c            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 04b123a6c929a8f47d740fc5433b54dadd32f731..9cfb3fb6931e71395ef1d67b0a743d8bc1433fdc 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -295,7 +295,7 @@ int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp);
 void vfio_unblock_multiple_devices_migration(void);
 bool vfio_viommu_preset(VFIODevice *vbasedev);
 int64_t vfio_mig_bytes_transferred(void);
-void vfio_reset_bytes_transferred(void);
+void vfio_mig_reset_bytes_transferred(void);
 void vfio_mig_add_bytes_transferred(unsigned long val);
 bool vfio_device_state_is_running(VFIODevice *vbasedev);
 bool vfio_device_state_is_precopy(VFIODevice *vbasedev);
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index b5fb0d218808d010d8210612d3182dde8f33514b..8bf65b8e11094b8363692dba3084b762362c7dd6 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -1052,7 +1052,7 @@ int64_t vfio_mig_bytes_transferred(void)
     return MIN(qatomic_read(&bytes_transferred), INT64_MAX);
 }
 
-void vfio_reset_bytes_transferred(void)
+void vfio_mig_reset_bytes_transferred(void)
 {
     qatomic_set(&bytes_transferred, 0);
 }
diff --git a/migration/target.c b/migration/target.c
index a6ffa9a5ce312d1e64157b650827aa726eb4d364..f5d8cfe7c2a3473f4bd3f5068145598c60973c58 100644
--- a/migration/target.c
+++ b/migration/target.c
@@ -25,7 +25,7 @@ void migration_populate_vfio_info(MigrationInfo *info)
 
 void migration_reset_vfio_bytes_transferred(void)
 {
-    vfio_reset_bytes_transferred();
+    vfio_mig_reset_bytes_transferred();
 }
 #else
 void migration_populate_vfio_info(MigrationInfo *info)
-- 
2.48.1


Re: [PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()
Posted by Avihai Horon 2 weeks ago
On 18/03/2025 11:53, Cédric Le Goater wrote:
> External email: Use caution opening links or attachments
>
>
> Enforce a 'vfio_mig_' prefix for the VFIO migration API to better
> reflect the namespace these routines belong to.
>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>

Reviewed-by: Avihai Horon <avihaih@nvidia.com>

Same nit as patch #1, maybe use vfio_migration_* prefix instead of vfio_mig_*?

Thanks.

> ---
>   include/hw/vfio/vfio-common.h | 2 +-
>   hw/vfio/migration.c           | 2 +-
>   migration/target.c            | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
> index 04b123a6c929a8f47d740fc5433b54dadd32f731..9cfb3fb6931e71395ef1d67b0a743d8bc1433fdc 100644
> --- a/include/hw/vfio/vfio-common.h
> +++ b/include/hw/vfio/vfio-common.h
> @@ -295,7 +295,7 @@ int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp);
>   void vfio_unblock_multiple_devices_migration(void);
>   bool vfio_viommu_preset(VFIODevice *vbasedev);
>   int64_t vfio_mig_bytes_transferred(void);
> -void vfio_reset_bytes_transferred(void);
> +void vfio_mig_reset_bytes_transferred(void);
>   void vfio_mig_add_bytes_transferred(unsigned long val);
>   bool vfio_device_state_is_running(VFIODevice *vbasedev);
>   bool vfio_device_state_is_precopy(VFIODevice *vbasedev);
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index b5fb0d218808d010d8210612d3182dde8f33514b..8bf65b8e11094b8363692dba3084b762362c7dd6 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -1052,7 +1052,7 @@ int64_t vfio_mig_bytes_transferred(void)
>       return MIN(qatomic_read(&bytes_transferred), INT64_MAX);
>   }
>
> -void vfio_reset_bytes_transferred(void)
> +void vfio_mig_reset_bytes_transferred(void)
>   {
>       qatomic_set(&bytes_transferred, 0);
>   }
> diff --git a/migration/target.c b/migration/target.c
> index a6ffa9a5ce312d1e64157b650827aa726eb4d364..f5d8cfe7c2a3473f4bd3f5068145598c60973c58 100644
> --- a/migration/target.c
> +++ b/migration/target.c
> @@ -25,7 +25,7 @@ void migration_populate_vfio_info(MigrationInfo *info)
>
>   void migration_reset_vfio_bytes_transferred(void)
>   {
> -    vfio_reset_bytes_transferred();
> +    vfio_mig_reset_bytes_transferred();
>   }
>   #else
>   void migration_populate_vfio_info(MigrationInfo *info)
> --
> 2.48.1
>

Re: [PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()
Posted by John Levon 2 weeks, 1 day ago
On Tue, Mar 18, 2025 at 10:53:45AM +0100, Cédric Le Goater wrote:

> Enforce a 'vfio_mig_' prefix for the VFIO migration API to better
> reflect the namespace these routines belong to.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>

Reviewed-by: John Levon <john.levon@nutanix.com>

regards
john
Re: [PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()
Posted by Philippe Mathieu-Daudé 2 weeks, 1 day ago
On 18/3/25 10:53, Cédric Le Goater wrote:
> Enforce a 'vfio_mig_' prefix for the VFIO migration API to better
> reflect the namespace these routines belong to.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   include/hw/vfio/vfio-common.h | 2 +-
>   hw/vfio/migration.c           | 2 +-
>   migration/target.c            | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>