[libvirt] [PATCH 13/16] snapshot: Rename file for virDomainMomentObj

Eric Blake eblake at redhat.com
Fri Mar 22 00:47:03 UTC 2019


On 3/21/19 6:56 PM, John Ferlan wrote:
> 
> 
> On 3/20/19 1:41 AM, Eric Blake wrote:
>> Now that we have made virDomainMomentObj sufficiently generic to
>> support both snapshots and checkpoints, it is time to rename the file
>> that it lives in. The split between a generic object and a list of the
>> generic objects doesn't buy us as much, so it will be easier to stick
>> all the moment list code in one file, with more code moving in the
>> next patch.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>  ...snapshotobj.h => virdomainmomentobjlist.h} | 26 ++++++++++---------
>>  src/conf/virdomainsnapshotobjlist.h           |  7 ++++-
>>  src/conf/Makefile.inc.am                      |  4 +--
>>  ...snapshotobj.c => virdomainmomentobjlist.c} | 12 ++++-----
>>  src/libvirt_private.syms                      | 18 ++++++-------
>>  5 files changed, 37 insertions(+), 30 deletions(-)
>>  rename src/conf/{virdomainsnapshotobj.h => virdomainmomentobjlist.h} (72%)
>>  rename src/conf/{virdomainsnapshotobj.c => virdomainmomentobjlist.c} (95%)
>>
> 
> I have to say it's "weird" the order that occurs in gitk and the patches
> is different...  IIRC you have some hook that places the .h files up
> front in the sent patch, but for some reason gitk has it's own freaking
> mind /-|

Teach gitk who's boss:

$ echo /.order >> .git/info/exclude
$ git config diff.orderFile .order
$ cat > .order <<\EOF
*err*
*.h
*
$

Now, any diff you perform in your directory will hoist error files
first, .h second, and all remaining files at the end. Make .order as
fancy as you want for favoring particular files earlier, if it makes
reviews easier to see certain files first.


>>
>> -#define VIR_FROM_THIS VIR_FROM_DOMAIN_SNAPSHOT
>> +#define VIR_FROM_THIS VIR_FROM_DOMAIN
> 
> Hmm... Almost feels like we should have a VIR_FROM_DOMAIN_MOMENT, but
> there's only one virReportError and it's a hash lookup.  Maybe something
> for the future.

Well, 'moment' is an internal implementation detail, so external users
aren't going to benefit from it. And when the code is shared between
snapshot and checkpoint, reporting a "domain snapshot" error on a
checkpoint object is going to sound weird, but reporting a "domain"
error for either a snapshot or a checkpoint associated with a domain
sounds plausible.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

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


More information about the libvir-list mailing list