On 13/02/2017 16:14, Dr. David Alan Gilbert wrote: > * Dr. David Alan Gilbert (dgilb...@redhat.com) wrote: >> * Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: >>> Commit a3a3d8c7 introduced a segfault bug while checking for >>> 'dc->vmsd->unmigratable' which caused QEMU to crash when trying to add >>> devices which do no set their 'dc->vmsd' yet while initialization. >>> Place a 'dc->vmsd' check prior to it so that we do not segfault for >>> such devices. >>> >>> NOTE: This doesn't compromise the functioning of --only-migratable >>> option as all the unmigratable devices do set their 'dc->vmsd'. >>> >>> Also, move the only_migratable check inside device_set_realized() to avoid >>> code duplication and fix the bug to display only_migratable error message >>> only if the device constructuon is right. >>> >>> Signed-off-by: Ashijeet Acharya <ashijeetacha...@gmail.com> >> >> Queued > > I've had to remove this; it fails to build user-mode qemu's. > I think the problem is only_migratable is in vl.c and doesn't > get linked in user mode qemu; I tried adding a #ifndef CONFIG_USER_ONLY > around the block and it didn't help, so back to you.\
It doesn't help because the file is compiled just once. You can add it to stubs/ (for example stubs/vmstate.c). Paolo