diff mbox series

[v3,05/17] vfio/migration: Fix wrong enum usage

Message ID 20221103161620.13120-6-avihaih@nvidia.com (mailing list archive)
State New, archived
Headers show
Series vfio/migration: Implement VFIO migration protocol v2 | expand

Commit Message

Avihai Horon Nov. 3, 2022, 4:16 p.m. UTC
vfio_migration_init() initializes VFIOMigration->device_state using enum
of VFIO migration protocol v2. Current implemented protocol is v1 so v1
enum should be used. Fix it.

Fixes: 429c72800654 ("vfio/migration: Fix incorrect initialization value for parameters in VFIOMigration")
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
---
 hw/vfio/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Sementsov-Ogievskiy Nov. 8, 2022, 7:05 p.m. UTC | #1
On 11/3/22 19:16, Avihai Horon wrote:
> vfio_migration_init() initializes VFIOMigration->device_state using enum
> of VFIO migration protocol v2. Current implemented protocol is v1 so v1
> enum should be used. Fix it.
> 
> Fixes: 429c72800654 ("vfio/migration: Fix incorrect initialization value for parameters in VFIOMigration")
> Signed-off-by: Avihai Horon<avihaih@nvidia.com>
> Reviewed-by: Zhang Chen<chen.zhang@intel.com>

the commit is already in master branch
Avihai Horon Nov. 10, 2022, 1:47 p.m. UTC | #2
On 08/11/2022 21:05, Vladimir Sementsov-Ogievskiy wrote:
> External email: Use caution opening links or attachments
>
>
> On 11/3/22 19:16, Avihai Horon wrote:
>> vfio_migration_init() initializes VFIOMigration->device_state using enum
>> of VFIO migration protocol v2. Current implemented protocol is v1 so v1
>> enum should be used. Fix it.
>>
>> Fixes: 429c72800654 ("vfio/migration: Fix incorrect initialization 
>> value for parameters in VFIOMigration")
>> Signed-off-by: Avihai Horon<avihaih@nvidia.com>
>> Reviewed-by: Zhang Chen<chen.zhang@intel.com>
>
> the commit is already in master branch
>
Yes, I will drop it in next version.

Thanks!

> -- 
> Best regards,
> Vladimir
>
diff mbox series

Patch

diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 760d5f3c5c..8ae1bd31a8 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -802,7 +802,7 @@  static int vfio_migration_init(VFIODevice *vbasedev,
     }
 
     vbasedev->migration = g_new0(VFIOMigration, 1);
-    vbasedev->migration->device_state = VFIO_DEVICE_STATE_RUNNING;
+    vbasedev->migration->device_state = VFIO_DEVICE_STATE_V1_RUNNING;
     vbasedev->migration->vm_running = runstate_is_running();
 
     ret = vfio_region_setup(obj, vbasedev, &vbasedev->migration->region,