On Mon, Apr 29, 2024 at 08:55:16AM -0700, Steve Sistare wrote: > Define a type for the 256 byte id string to guarantee the same length is > used and enforced everywhere. > > Signed-off-by: Steve Sistare <steven.sist...@oracle.com> > --- > include/exec/ramblock.h | 3 ++- > include/migration/vmstate.h | 2 ++ > migration/savevm.c | 8 ++++---- > migration/vmstate.c | 3 ++- > 4 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/include/exec/ramblock.h b/include/exec/ramblock.h > index 0babd10..61deefe 100644 > --- a/include/exec/ramblock.h > +++ b/include/exec/ramblock.h > @@ -23,6 +23,7 @@ > #include "cpu-common.h" > #include "qemu/rcu.h" > #include "exec/ramlist.h" > +#include "migration/vmstate.h" > > struct RAMBlock { > struct rcu_head rcu; > @@ -35,7 +36,7 @@ struct RAMBlock { > void (*resized)(const char*, uint64_t length, void *host); > uint32_t flags; > /* Protected by the BQL. */ > - char idstr[256]; > + VMStateId idstr; > /* RCU-enabled, writes protected by the ramlist lock */ > QLIST_ENTRY(RAMBlock) next; > QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers;
Hmm.. Don't look like a good idea to include a migration header in ramblock.h? Is this ramblock change needed for this work? -- Peter Xu