[libvirt] [PATCH v2] blockjob: use stable disk string in job event

Eric Blake eblake at redhat.com
Tue Jun 17 18:36:37 UTC 2014


On 06/17/2014 01:58 AM, Peter Krempa wrote:
> On 06/16/14 23:58, Eric Blake wrote:
>> When the block job event was first added, it was for block pull,
>> where the active layer of the disk remains the same name.  It was
>> also in a day where we only cared about local files, and so we
>> always had a canonical absolute file name.  But two things have
>> changed since then: we now have network disks, where determining
>> a single absolute string does not really make sense; and we have
>> two-phase jobs (copy and active commit) where the name of the
>> active layer changes between the first event (ready, on the old
>> name) and second (complete, on the pivoted name).
>>

>> +++ b/daemon/remote.c
>> @@ -558,7 +558,7 @@ remoteRelayDomainEventGraphics(virConnectPtr conn,
>>  static int
>>  remoteRelayDomainEventBlockJob(virConnectPtr conn,
>>                                 virDomainPtr dom,
>> -                               const char *path,
>> +                               const char *disk,
>>                                 int type,
>>                                 int status,
>>                                 void *opaque)
> 
> The original event will still return the path, so I think this hunk
> should be dropped.

True enough - anywhere where there are sibling functions, I can use
const char *path for the old one, and const char *dst for the new one,
to make it apparent which string to pass; while leaving *disk as the
name of the variable for code shared by both events.

>> +++ b/include/libvirt/libvirt.h.in
>> @@ -4852,13 +4852,24 @@ typedef enum {
>>   * virConnectDomainEventBlockJobCallback:
>>   * @conn: connection object
>>   * @dom: domain on which the event occurred
>> - * @disk: fully-qualified filename of the affected disk
>> + * @disk: name associated with the affected disk
> 
> The two possible values stored here should also be mentioned here or a
> note to read the text below. I would have skipped the blob below if I'd
> find something that looks relevant here.

Okay, I'll try again in v3.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list