[PATCH 01/18] migration/vmstate: Document vmstate_dummy

Philippe Mathieu-Daudé posted 18 patches 5 years, 3 months ago
There is a newer version of this series
[PATCH 01/18] migration/vmstate: Document vmstate_dummy
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
vmstate_dummy is special and restricted to linux-user. See commit
c71c3e99b8 ("Add a vmstate_dummy struct for CONFIG_USER_ONLY").

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/migration/vmstate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index f68ed7db13..af7d80cd4e 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -194,7 +194,7 @@ struct VMStateDescription {
     const VMStateDescription **subsections;
 };
 
-extern const VMStateDescription vmstate_dummy;
+extern const VMStateDescription vmstate_dummy; /* Exclusively for linux-user */
 
 extern const VMStateInfo vmstate_info_bool;
 
-- 
2.21.3


Re: [PATCH 01/18] migration/vmstate: Document vmstate_dummy
Posted by Dr. David Alan Gilbert 5 years, 2 months ago
* Philippe Mathieu-Daudé (f4bug@amsat.org) wrote:
> vmstate_dummy is special and restricted to linux-user. See commit
> c71c3e99b8 ("Add a vmstate_dummy struct for CONFIG_USER_ONLY").
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/migration/vmstate.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index f68ed7db13..af7d80cd4e 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -194,7 +194,7 @@ struct VMStateDescription {
>      const VMStateDescription **subsections;
>  };
>  
> -extern const VMStateDescription vmstate_dummy;
> +extern const VMStateDescription vmstate_dummy; /* Exclusively for linux-user */

Which does mean it's a unfortunate name I guess for something so
specific.
(It's also very weird having a vmsd defined with no VMSTATE_END_OF_LIST
marker).

Dave

>  extern const VMStateInfo vmstate_info_bool;
>  
> -- 
> 2.21.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


Re: [PATCH 01/18] migration/vmstate: Document vmstate_dummy
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Fri, Jul 03, 2020 at 10:18:54PM +0200, Philippe Mathieu-Daudé wrote:
> vmstate_dummy is special and restricted to linux-user. See commit
> c71c3e99b8 ("Add a vmstate_dummy struct for CONFIG_USER_ONLY").
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/migration/vmstate.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index f68ed7db13..af7d80cd4e 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -194,7 +194,7 @@ struct VMStateDescription {
>      const VMStateDescription **subsections;
>  };
>  
> -extern const VMStateDescription vmstate_dummy;
> +extern const VMStateDescription vmstate_dummy; /* Exclusively for linux-user */

Originally in the commit mentioned above, this was enforced at build time:

  +#ifdef CONFIG_USER_ONLY
  +extern const VMStateDescription vmstate_dummy;
  +#endif


but this was removed in

  commit 6afc14e92ac81b29c25f097468f7751d5df1b5bc
  Author: Stefan Weil <sw@weilnetz.de>
  Date:   Fri Feb 6 22:43:10 2015 +0100

    migration: Fix warning caused by missing declaration of vmstate_dummy
    
    Warning from the Sparse static analysis tool:
    
    stubs/vmstate.c:4:26: warning:
     symbol 'vmstate_dummy' was not declared. Should it be static?


So if this is really intended to only be used by linux-user, then I
suggest we put CONFIG_USER_ONLY back, and figure out a different
way to address the undeclared symbol problem. I guess the problem
was that stub code is shared both both user/softmmu builds. So
perhaps we need to stub this in linux-user only code, instead of
having it in the main stub library that is common.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Re: [PATCH 01/18] migration/vmstate: Document vmstate_dummy
Posted by Philippe Mathieu-Daudé 5 years, 2 months ago
On 7/16/20 11:52 AM, Daniel P. Berrangé wrote:
> On Fri, Jul 03, 2020 at 10:18:54PM +0200, Philippe Mathieu-Daudé wrote:
>> vmstate_dummy is special and restricted to linux-user. See commit
>> c71c3e99b8 ("Add a vmstate_dummy struct for CONFIG_USER_ONLY").
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  include/migration/vmstate.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
>> index f68ed7db13..af7d80cd4e 100644
>> --- a/include/migration/vmstate.h
>> +++ b/include/migration/vmstate.h
>> @@ -194,7 +194,7 @@ struct VMStateDescription {
>>      const VMStateDescription **subsections;
>>  };
>>  
>> -extern const VMStateDescription vmstate_dummy;
>> +extern const VMStateDescription vmstate_dummy; /* Exclusively for linux-user */
> 
> Originally in the commit mentioned above, this was enforced at build time:
> 
>   +#ifdef CONFIG_USER_ONLY
>   +extern const VMStateDescription vmstate_dummy;
>   +#endif
> 
> 
> but this was removed in
> 
>   commit 6afc14e92ac81b29c25f097468f7751d5df1b5bc
>   Author: Stefan Weil <sw@weilnetz.de>
>   Date:   Fri Feb 6 22:43:10 2015 +0100
> 
>     migration: Fix warning caused by missing declaration of vmstate_dummy
>     
>     Warning from the Sparse static analysis tool:
>     
>     stubs/vmstate.c:4:26: warning:
>      symbol 'vmstate_dummy' was not declared. Should it be static?
> 
> 
> So if this is really intended to only be used by linux-user, then I
> suggest we put CONFIG_USER_ONLY back, and figure out a different
> way to address the undeclared symbol problem. I guess the problem
> was that stub code is shared both both user/softmmu builds. So
> perhaps we need to stub this in linux-user only code, instead of
> having it in the main stub library that is common.

Good idea, I'll look at it.

Thanks,

Phil.