On 10/21/2012 08:09 PM, Doug Goldstein wrote: > On Sun, Oct 21, 2012 at 7:53 PM, liguang <[email protected]> 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 [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
