]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: store snapshot source as pointer, for easier manipulation
authorEric Blake <eblake@redhat.com>
Wed, 21 May 2014 21:21:02 +0000 (15:21 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 6 Jun 2014 15:56:27 +0000 (09:56 -0600)
commit00c6327a12b1ef63889984074a18de1a3b273615
treed758a3a71501769e57bf728a654324a8d2d8538f
parent61c44f589b18c0120bfd0485183ceccb89abd9b7
conf: store snapshot source as pointer, for easier manipulation

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: Eric Blake <eblake@redhat.com>
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c