From 581f08bac22bdd5e081ae07f68071a0fc3c5c2c7 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Thu, 2 Feb 2017 12:59:55 +0000 Subject: migration: Check for ID length The qdev id of a device can be huge if it's on the end of a chain of bridges; in reality such chains shouldn't occur but they can be made to by chaining PCIe bridges together. The migration format has a number of 256 character long format limits; check we don't hit them (we already use pstrcat/cpy but that just protects us from buffer overruns, we fairly quickly hit an assert). Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Message-Id: <20170202125956.21942-3-dgilbert@redhat.com> Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/migration/vmstate.h') diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index c38b00a6f1..6233fe2e5b 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -985,12 +985,14 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, bool vmstate_save_needed(const VMStateDescription *vmsd, void *opaque); +/* Returns: 0 on success, -1 on failure */ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id, const VMStateDescription *vmsd, void *base, int alias_id, int required_for_version, Error **errp); +/* Returns: 0 on success, -1 on failure */ static inline int vmstate_register(DeviceState *dev, int instance_id, const VMStateDescription *vmsd, void *opaque) -- cgit v1.2.3