Skip to content

Commit

Permalink
migration: Use VMSTATE_INSTANCE_ID_ANY for slirp
Browse files Browse the repository at this point in the history
Each user network conection create a new slirp instance.  We register
more than one slirp instance for number 0.

qemu-system-x86_64: -netdev user,id=hs1: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=slirp, instance_id=0x0
Broken pipe
../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
Aborted (core dumped)

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231020090731.28701-6-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed Oct 24, 2023
1 parent f5c544c commit 0e9e4a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/slirp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "qapi/qmp/qdict.h"
#include "util.h"
#include "migration/register.h"
#include "migration/vmstate.h"
#include "migration/qemu-file-types.h"

static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
Expand Down Expand Up @@ -659,8 +660,8 @@ 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(),
&savevm_slirp_state, s->slirp);
register_savevm_live("slirp", VMSTATE_INSTANCE_ID_ANY,
slirp_state_version(), &savevm_slirp_state, s->slirp);

s->poll_notifier.notify = net_slirp_poll_notify;
main_loop_poll_add_notifier(&s->poll_notifier);
Expand Down

0 comments on commit 0e9e4a4

Please sign in to comment.