[libvirt] [PATCH v2 07/12] qemu: refactor blockinfo data gathering
Eric Blake
eblake at redhat.com
Wed Dec 17 06:29:27 UTC 2014
On 12/16/2014 07:56 AM, Peter Krempa wrote:
> On 12/16/14 09:04, Eric Blake wrote:
>> Create a helper function that can be reused for gathering block
>> info from virDomainListGetStats.
>>
>> * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Split guts...
>> (qemuStorageLimitsRefresh): ...into new helper function.
>>
>> +qemuStorageLimitsRefresh(virQEMUDriverPtr driver, virQEMUDriverConfigPtr cfg,
>> + virDomainObjPtr vm, virDomainDiskDefPtr disk,
>> + virStorageSourcePtr src)
>
> One argument per line please.
Fixed (which included dropping 'disk' as it was no longer used),
>> + if (virStorageSourceIsLocalStorage(src)) {
>> /* Yes, this is a mild TOCTTOU race, but if someone is
>> * changing files in the background behind libvirt's back,
>> * they deserve bogus information. */
>> - if (stat(disk->src->path, &sb) < 0) {
>> + if (stat(src->path, &sb) < 0) {
>
> Here you'll get a context conflict after fixing earlier patch.
retested that my adjustments were sane,
>
>> virReportSystemError(errno,
>> - _("cannot stat file '%s'"), disk->src->path);
>> - goto endjob;
>> + _("cannot stat file '%s'"), src->path);
>> + goto cleanup;
>> }
>>
>
> [...]
>
> ACK,
and pushed through here.
--
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: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141216/5aa3031b/attachment-0001.sig>
More information about the libvir-list
mailing list