[libvirt] [PATCH v2 01/10] conf: store snapshot source as pointer, for easier manipulation

Peter Krempa pkrempa at redhat.com
Fri Jun 6 06:37:15 UTC 2014


On 06/06/14 00:52, Eric Blake wrote:
> 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.

Agreed, that can be done later as it's really just a micro optimization.

> 
> * 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 at redhat.com>
> ---
>  src/conf/snapshot_conf.c |  56 +++++++++++++------------
>  src/conf/snapshot_conf.h |   2 +-
>  src/qemu/qemu_conf.c     |   2 +-
>  src/qemu/qemu_driver.c   | 104 +++++++++++++++++++++++------------------------
>  4 files changed, 85 insertions(+), 79 deletions(-)
> 

ACK.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140606/9b8076f8/attachment-0001.sig>


More information about the libvir-list mailing list