On Wed, Jul 21, 2021 at 11:39:37AM +0100, Dr. David Alan Gilbert wrote: > > +/* > > + * Return the ioc object if it's a migration channel. Note: it can return > > NULL > > + * for callers passing in a non-migration qemufile. E.g. see > > qemu_fopen_bdrv() > > + * and its usage in e.g. load_snapshot(). So we need to check against NULL > > + * before using it. If without the check, > > migration_incoming_state_destroy() > > + * could fail for load_snapshot(). > > + */ > > +QIOChannel *migration_file_get_ioc(QEMUFile *file) > > +{ > > + return file->has_ioc ? QIO_CHANNEL(file->opaque) : NULL; > > +} > > Do you think this should go in the previous patch where you created > has_ioc? Also the name is weird, qemu_file is probably right for > everything in here.
Sure; let me just move it over with it renamed. Thanks, -- Peter Xu