Re: Question about VIR_ALLOC vs vshMalloc

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

 



On 03/20/2014 12:02 PM, Solly Ross wrote:
> I was wondering what the reason was for seemingly near-duplicate code.  VIR_ALLOC and vshMalloc (and similar methods for calloc, etc), seem to be roughly identical in function, with the only difference being that VIR_ALLOC and friends are used in libvirt proper, whereas vshMalloc and friends are used in the virsh code.  Is there a reason why virsh does not simply use VIR_ALLOC and friends?

vshMalloc calls exit() on failure, VIR_ALLOC returns NULL to the caller.
 libvirt.so (anything in src/) cannot call exit, but virsh is an
executable not a library, so exiting is sometimes easier than dealing
with failed allocations.

-- 
Eric Blake   eblake redhat com    +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]