[PATCH V2] migration: fix populate_vfio_info

Steve Sistare posted 1 patch 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1675796553-235469-1-git-send-email-steven.sistare@oracle.com
Maintainers: Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
migration/target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH V2] migration: fix populate_vfio_info
Posted by Steve Sistare 1 year, 2 months ago
Include CONFIG_DEVICES so that populate_vfio_info is instantiated for
CONFIG_VFIO.  Without it, the 'info migrate' command never returns
info about vfio.

Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file")
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 migration/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/target.c b/migration/target.c
index 907ebf0..00ca007 100644
--- a/migration/target.c
+++ b/migration/target.c
@@ -8,6 +8,7 @@
 #include "qemu/osdep.h"
 #include "qapi/qapi-types-migration.h"
 #include "migration.h"
+#include CONFIG_DEVICES
 
 #ifdef CONFIG_VFIO
 #include "hw/vfio/vfio-common.h"
@@ -17,7 +18,6 @@ void populate_vfio_info(MigrationInfo *info)
 {
 #ifdef CONFIG_VFIO
     if (vfio_mig_active()) {
-        info->has_vfio = true;
         info->vfio = g_malloc0(sizeof(*info->vfio));
         info->vfio->transferred = vfio_mig_bytes_transferred();
     }
-- 
1.8.3.1


Re: [PATCH V2] migration: fix populate_vfio_info
Posted by Dr. David Alan Gilbert 1 year, 1 month ago
* Steve Sistare (steven.sistare@oracle.com) wrote:
> Include CONFIG_DEVICES so that populate_vfio_info is instantiated for
> CONFIG_VFIO.  Without it, the 'info migrate' command never returns
> info about vfio.
> 
> Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file")
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  migration/target.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/target.c b/migration/target.c
> index 907ebf0..00ca007 100644
> --- a/migration/target.c
> +++ b/migration/target.c
> @@ -8,6 +8,7 @@
>  #include "qemu/osdep.h"
>  #include "qapi/qapi-types-migration.h"
>  #include "migration.h"
> +#include CONFIG_DEVICES
>  
>  #ifdef CONFIG_VFIO
>  #include "hw/vfio/vfio-common.h"
> @@ -17,7 +18,6 @@ void populate_vfio_info(MigrationInfo *info)
>  {
>  #ifdef CONFIG_VFIO
>      if (vfio_mig_active()) {
> -        info->has_vfio = true;

Why this removal?

Dave

>          info->vfio = g_malloc0(sizeof(*info->vfio));
>          info->vfio->transferred = vfio_mig_bytes_transferred();
>      }
> -- 
> 1.8.3.1
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Re: [PATCH V2] migration: fix populate_vfio_info
Posted by Steven Sistare 1 year, 1 month ago
On 3/7/2023 6:32 AM, Dr. David Alan Gilbert wrote:
> * Steve Sistare (steven.sistare@oracle.com) wrote:
>> Include CONFIG_DEVICES so that populate_vfio_info is instantiated for
>> CONFIG_VFIO.  Without it, the 'info migrate' command never returns
>> info about vfio.
>>
>> Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file")
>> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  migration/target.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/migration/target.c b/migration/target.c
>> index 907ebf0..00ca007 100644
>> --- a/migration/target.c
>> +++ b/migration/target.c
>> @@ -8,6 +8,7 @@
>>  #include "qemu/osdep.h"
>>  #include "qapi/qapi-types-migration.h"
>>  #include "migration.h"
>> +#include CONFIG_DEVICES
>>  
>>  #ifdef CONFIG_VFIO
>>  #include "hw/vfio/vfio-common.h"
>> @@ -17,7 +18,6 @@ void populate_vfio_info(MigrationInfo *info)
>>  {
>>  #ifdef CONFIG_VFIO
>>      if (vfio_mig_active()) {
>> -        info->has_vfio = true;
> 
> Why this removal?

The has_vfio member was removed by:
  720a252c2651 ("qapi migration: Elide redundant has_FOO in generated C")
The stale reference was not noticed at the time because the ifdef was never true.

- Steve

Re: [PATCH V2] migration: fix populate_vfio_info
Posted by Dr. David Alan Gilbert 1 year, 1 month ago
* Steven Sistare (steven.sistare@oracle.com) wrote:
> On 3/7/2023 6:32 AM, Dr. David Alan Gilbert wrote:
> > * Steve Sistare (steven.sistare@oracle.com) wrote:
> >> Include CONFIG_DEVICES so that populate_vfio_info is instantiated for
> >> CONFIG_VFIO.  Without it, the 'info migrate' command never returns
> >> info about vfio.
> >>
> >> Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file")
> >> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> >> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >> ---
> >>  migration/target.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/migration/target.c b/migration/target.c
> >> index 907ebf0..00ca007 100644
> >> --- a/migration/target.c
> >> +++ b/migration/target.c
> >> @@ -8,6 +8,7 @@
> >>  #include "qemu/osdep.h"
> >>  #include "qapi/qapi-types-migration.h"
> >>  #include "migration.h"
> >> +#include CONFIG_DEVICES
> >>  
> >>  #ifdef CONFIG_VFIO
> >>  #include "hw/vfio/vfio-common.h"
> >> @@ -17,7 +18,6 @@ void populate_vfio_info(MigrationInfo *info)
> >>  {
> >>  #ifdef CONFIG_VFIO
> >>      if (vfio_mig_active()) {
> >> -        info->has_vfio = true;
> > 
> > Why this removal?
> 
> The has_vfio member was removed by:
>   720a252c2651 ("qapi migration: Elide redundant has_FOO in generated C")
> The stale reference was not noticed at the time because the ifdef was never true.

Oh ok, that makes sense,


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> - Steve
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK