• E
    conf: store snapshot source as pointer, for easier manipulation · 00c6327a
    Eric Blake 提交于
    As part of the work on backing chains, I'm finding that it would
    be easier to directly manipulate chains of pointers (adding a
    snapshot merely adjusts pointers to form the correct list) rather
    than copy data from one struct to another. This patch converts
    snapshot source to be a pointer.
    
    In this patch, the pointer is ALWAYS allocated (any code that
    increases ndisks now also allocates a source pointer for each
    new disk), and all other changes are just mechanical fallout of
    the new type; there should be no functional change.  It is
    possible that we may want to leave the pointer NULL for internal
    snapshots in a later patch, but as that requires a closer audit
    of the source to ensure we don't fault on a null dereference, I
    didn't do it here.
    
    * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Change
    type of src.
    * src/conf/snapshot_conf.c: Adjust all clients.
    * src/qemu/qemu_conf.c: Likewise.
    * src/qemu/qemu_driver.c: Likewise.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    00c6327a
snapshot_conf.c 42.6 KB