* [PATCH] vfio/migration: Fix wrong enum usage
@ 2022-10-16 8:57 Avihai Horon
2022-10-18 2:37 ` Zhang, Chen
0 siblings, 1 reply; 3+ messages in thread
From: Avihai Horon @ 2022-10-16 8:57 UTC (permalink / raw)
To: =, Alex Williamson, Kunkun Jiang; +Cc: Avihai Horon
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>
---
hw/vfio/migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index d9598ce070..8dbbfa2c56 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -803,7 +803,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,
--
2.21.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] vfio/migration: Fix wrong enum usage
2022-10-16 8:57 [PATCH] vfio/migration: Fix wrong enum usage Avihai Horon
@ 2022-10-18 2:37 ` Zhang, Chen
2022-10-18 6:07 ` Avihai Horon
0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Chen @ 2022-10-18 2:37 UTC (permalink / raw)
To: Avihai Horon, qemu-devel@nongnu.org, Alex Williamson,
Kunkun Jiang
> -----Original Message-----
> From: Qemu-devel <qemu-devel-bounces+chen.zhang=intel.com@nongnu.org>
> On Behalf Of Avihai Horon
> Sent: Sunday, October 16, 2022 4:58 PM
> To: qemu-devel@nongnu.org; Alex Williamson
> <alex.williamson@redhat.com>; Kunkun Jiang <jiangkunkun@huawei.com>
> Cc: Avihai Horon <avihaih@nvidia.com>
> Subject: [PATCH] vfio/migration: Fix wrong enum usage
>
> 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>
Looks good to me.
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
But I found nowhere using the enum of VFIO migration protocol v2 (vfio_device_mig_state).
I don't know more about the background, should we remove the redundancy definition or add full support for
the VFIO migration protocol v2 ?
Thanks
Chen
> ---
> hw/vfio/migration.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index
> d9598ce070..8dbbfa2c56 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -803,7 +803,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,
> --
> 2.21.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vfio/migration: Fix wrong enum usage
2022-10-18 2:37 ` Zhang, Chen
@ 2022-10-18 6:07 ` Avihai Horon
0 siblings, 0 replies; 3+ messages in thread
From: Avihai Horon @ 2022-10-18 6:07 UTC (permalink / raw)
To: Zhang, Chen, qemu-devel@nongnu.org, Alex Williamson, Kunkun Jiang
On 18/10/2022 5:37, Zhang, Chen wrote:
> External email: Use caution opening links or attachments
>
>
>> -----Original Message-----
>> From: Qemu-devel <qemu-devel-bounces+chen.zhang=intel.com@nongnu.org>
>> On Behalf Of Avihai Horon
>> Sent: Sunday, October 16, 2022 4:58 PM
>> To: qemu-devel@nongnu.org; Alex Williamson
>> <alex.williamson@redhat.com>; Kunkun Jiang <jiangkunkun@huawei.com>
>> Cc: Avihai Horon <avihaih@nvidia.com>
>> Subject: [PATCH] vfio/migration: Fix wrong enum usage
>>
>> 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>
> Looks good to me.
> Reviewed-by: Zhang Chen <chen.zhang@intel.com>
>
> But I found nowhere using the enum of VFIO migration protocol v2 (vfio_device_mig_state).
> I don't know more about the background, should we remove the redundancy definition or add full support for
> the VFIO migration protocol v2 ?
We are currently in the process of adding support for v2 protocol that
will replace v1.
Once v2 is added, v1 will be removed.
Thanks.
>
> Thanks
> Chen
>
>> ---
>> hw/vfio/migration.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index
>> d9598ce070..8dbbfa2c56 100644
>> --- a/hw/vfio/migration.c
>> +++ b/hw/vfio/migration.c
>> @@ -803,7 +803,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,
>> --
>> 2.21.3
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-18 6:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-16 8:57 [PATCH] vfio/migration: Fix wrong enum usage Avihai Horon
2022-10-18 2:37 ` Zhang, Chen
2022-10-18 6:07 ` Avihai Horon
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).