• J
    vmstate: Add support for alias ID · 4d2ffa08
    Jan Kiszka 提交于
    Some legacy users (mostly PC devices) of vmstate_register manage
    instance IDs on their own, and that unfortunately in a way that is
    incompatible with automatically generated ones. This so far prevents
    switching those users to vmstates that are registered by qdev.
    
    To establish a migration path, this patch introduces the concept of
    alias IDs. They can be passed to an extended vmstate registration
    service, and qdev provides a set service to be used during device init.
    find_se will consider the alias in addition to the default ID. We can
    then start generating the default ID automatically and writing it on
    vmsave, thus converting that format without breaking support for upward
    migration.
    
    The user is required specify the highest vmstate version for which the
    alias is required. Once this version falls behind the minimum required
    for a specific vmstate, an assertion triggers to motivate cleaning up
    the obsolete alias.
    Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
    4d2ffa08
qdev.c 21.9 KB