[PATCH v2 3/9] net/slirp: use different IDs for each instance

marcandre.lureau@redhat.com posted 9 patches 2 years, 3 months ago
Maintainers: Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Leonardo Bras <leobras@redhat.com>, John Snow <jsnow@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Jason Wang <jasowang@redhat.com>
[PATCH v2 3/9] net/slirp: use different IDs for each instance
Posted by marcandre.lureau@redhat.com 2 years, 3 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Using always 0, QEMU will end up loading the same instance, even if
multiple have been saved.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 net/slirp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/slirp.c b/net/slirp.c
index c33b3e02e7..af1451b60f 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -47,6 +47,7 @@
 #include "util.h"
 #include "migration/register.h"
 #include "migration/qemu-file-types.h"
+#include "migration/vmstate.h"
 
 static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
 {
@@ -659,7 +660,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
      * specific version?
      */
     g_assert(slirp_state_version() == 4);
-    register_savevm_live("slirp", 0, slirp_state_version(),
+    register_savevm_live("slirp", VMSTATE_INSTANCE_ID_ANY, slirp_state_version(),
                          &savevm_slirp_state, s->slirp);
 
     s->poll_notifier.notify = net_slirp_poll_notify;
-- 
2.41.0


Re: [PATCH v2 3/9] net/slirp: use different IDs for each instance
Posted by Juan Quintela 2 years, 3 months ago
marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Using always 0, QEMU will end up loading the same instance, even if
> multiple have been saved.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Similar (but different) fix on next Migration PULL request.

Later, Juan.

> ---
>  net/slirp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/slirp.c b/net/slirp.c
> index c33b3e02e7..af1451b60f 100644
> --- a/net/slirp.c
> +++ b/net/slirp.c
> @@ -47,6 +47,7 @@
>  #include "util.h"
>  #include "migration/register.h"
>  #include "migration/qemu-file-types.h"
> +#include "migration/vmstate.h"
>  
>  static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
>  {
> @@ -659,7 +660,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>       * specific version?
>       */
>      g_assert(slirp_state_version() == 4);
> -    register_savevm_live("slirp", 0, slirp_state_version(),
> +    register_savevm_live("slirp", VMSTATE_INSTANCE_ID_ANY, slirp_state_version(),
>                           &savevm_slirp_state, s->slirp);
>  
>      s->poll_notifier.notify = net_slirp_poll_notify;