Re: [PATCH RFC] helper of copy-storage-* features

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

 



On 10/21/2012 08:09 PM, Doug Goldstein wrote:
> On Sun, Oct 21, 2012 at 7:53 PM, liguang <lig.fnst@xxxxxxxxxxxxxx> wrote:
>> help to create disk images copy-storage-* required,
>> try to do non-shared migration without bothering to
>> create disk images at target by hand.
>>

>> +        } else
>> +            cmd = virCommandNewArgList("rm", "-f", def->disks[i]->src, NULL);
>> +
>> +        if (virCommandRun(cmd, NULL) < 0) {
>> +            goto cleanup;
>> +            virReportSystemError(errno, "%s",
>> +            _("unable create disk images by qemu-img"));
>> +        }
> 
> The error message reported doesn't match what happened when the rm -f
> fails. Also 'cmd' is being leaked here.

Not to mention virCommandRun() is overkill.  Use unlink() here instead,
rather than forking out to an external program.

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

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]