From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 558B0633B7 for ; Tue, 24 Nov 2020 17:33:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4A87C112A3 for ; Tue, 24 Nov 2020 17:33:01 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 8019111297 for ; Tue, 24 Nov 2020 17:32:59 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 4841F43A0C for ; Tue, 24 Nov 2020 17:32:59 +0100 (CET) Date: Tue, 24 Nov 2020 17:32:50 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20201110161615.23702-1-s.reiter@proxmox.com> In-Reply-To: <20201110161615.23702-1-s.reiter@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1606235454.nwpjebgsaz.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.023 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH pve-qemu] update patches with some pbs-state migration cleanups X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 16:33:01 -0000 Tested-by: Fabian Gr=C3=BCnbichler requires now updated patch from <20201124154122.22202-2-s.reiter@proxmox.co= m>: "[PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library v= ersion'" On November 10, 2020 5:16 pm, Stefan Reiter wrote: > ...and literal cleanup, as in, call save_cleanup after success or error. >=20 > Signed-off-by: Stefan Reiter > --- >=20 > I found it more confusing to set opaque to a value and then never use it,= so I > put it back to NULL and documented it. >=20 > Behaviour tested to be the same. >=20 > ...igrate-dirty-bitmap-state-via-savevm.patch | 33 ++++++++++++------- > 1 file changed, 21 insertions(+), 12 deletions(-) >=20 > diff --git a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-s= avevm.patch b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-sa= vevm.patch > index 77c0c76..a39e3ca 100644 > --- a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.p= atch > +++ b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.p= atch > @@ -13,13 +13,13 @@ safe migration is possible and makes sense. > =20 > Signed-off-by: Stefan Reiter > --- > - include/migration/misc.h | 3 ++ > - migration/Makefile.objs | 1 + > - migration/pbs-state.c | 97 ++++++++++++++++++++++++++++++++++++++++ > - pve-backup.c | 1 + > - qapi/block-core.json | 6 +++ > - softmmu/vl.c | 1 + > - 6 files changed, 109 insertions(+) > + include/migration/misc.h | 3 ++ > + migration/Makefile.objs | 1 + > + migration/pbs-state.c | 106 +++++++++++++++++++++++++++++++++++++++ > + pve-backup.c | 1 + > + qapi/block-core.json | 6 +++ > + softmmu/vl.c | 1 + > + 6 files changed, 118 insertions(+) > create mode 100644 migration/pbs-state.c > =20 > diff --git a/include/migration/misc.h b/include/migration/misc.h > @@ -48,10 +48,10 @@ index 0fc619e380..20b3792599 100644 > common-obj-$(CONFIG_RDMA) +=3D rdma.o > diff --git a/migration/pbs-state.c b/migration/pbs-state.c > new file mode 100644 > -index 0000000000..c711498c3e > +index 0000000000..29f2b3860d > --- /dev/null > +++ b/migration/pbs-state.c > -@@ -0,0 +1,97 @@ > +@@ -0,0 +1,106 @@ > +/* > + * PBS (dirty-bitmap) state migration > + */ > @@ -67,6 +67,7 @@ index 0000000000..c711498c3e > + bool active; > +} PBSState; > + > ++/* state is accessed via this static variable directly, 'opaque' is NUL= L */ > +static PBSState pbs_state; > + > +static void pbs_state_save_pending(QEMUFile *f, void *opaque, > @@ -115,8 +116,9 @@ index 0000000000..c711498c3e > + > +static bool pbs_state_is_active(void *opaque) > +{ > -+ // we need to be return active once, else .save_setup is never call= ed, but, > -+ // if we'd just would return true, we'd freeze the migration for ~ = 5 - 10s > ++ /* we need to return active exactly once, else .save_setup is never= called, > ++ * but if we'd just return true the migration doesn't make progress= since > ++ * it'd be waiting for us */ > + return pbs_state.active; > +} > + > @@ -133,6 +135,12 @@ index 0000000000..c711498c3e > + return false; > +} > + > ++static void pbs_state_save_cleanup(void *opaque) > ++{ > ++ /* reset active after migration succeeds or fails */ > ++ pbs_state.active =3D false; > ++} > ++ > +static SaveVMHandlers savevm_pbs_state_handlers =3D { > + .save_setup =3D pbs_state_save_setup, > + .has_postcopy =3D pbs_state_has_postcopy, > @@ -140,6 +148,7 @@ index 0000000000..c711498c3e > + .is_active_iterate =3D pbs_state_is_active_iterate, > + .load_state =3D pbs_state_load, > + .is_active =3D pbs_state_is_active, > ++ .save_cleanup =3D pbs_state_save_cleanup, > +}; > + > +void pbs_state_mig_init(void) > @@ -147,7 +156,7 @@ index 0000000000..c711498c3e > + pbs_state.active =3D true; > + register_savevm_live("pbs-state", 0, 1, > + &savevm_pbs_state_handlers, > -+ &pbs_state); > ++ NULL); > +} > diff --git a/pve-backup.c b/pve-backup.c > index c7cde0fb0e..f65f1dda26 100644 > --=20 > 2.20.1 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20 =