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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]