Re: [libvirt-glib 23/37] Add test for adding a disk device

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

 



On Thu, Nov 10, 2011 at 9:33 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
>  devices = g_list_append(devices, disk);
> +    gvir_config_domain_set_devices(domain, devices);
> +    g_list_free(devices);
> +    devices = NULL;


Hmm, I realize this is a bit more tricky. You give up devices element
owner ship but no the container.. I think this is bad, as the list
contains invalid objects after leaving the functions. Insead, the
set_devices () function should ref the element, and the caller should
unref too with g_list_free_full (devices, g_object_unref)


-- 
Marc-André Lureau

--
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]