Re: [sandbox PATCH 08/10] Init-util : Common directory functions for init-common and init-qemu

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

 



On Thu, Jun 25, 2015 at 01:27:28PM +0200, Eren Yagdiran wrote:
> Init-util provides common functions for creating directories for both
> Init-common and Init-qemu. Error handling needs to be done in calling
> function.
> ---
>  libvirt-sandbox/Makefile.am                 |  4 +-
>  libvirt-sandbox/libvirt-sandbox-init-qemu.c | 57 +++++++++-------------------
>  libvirt-sandbox/libvirt-sandbox-init-util.c | 58 +++++++++++++++++++++++++++++
>  libvirt-sandbox/libvirt-sandbox-init-util.h | 41 ++++++++++++++++++++
>  4 files changed, 119 insertions(+), 41 deletions(-)
>  create mode 100644 libvirt-sandbox/libvirt-sandbox-init-util.c
>  create mode 100644 libvirt-sandbox/libvirt-sandbox-init-util.h

Creating a shared file for these two functions is not really
required. They are needed in init-qemu because that file only relies
on POSIX APIs. In init-common we have the ability to use glib, so
we you can just use


> +int gvir_sandbox_init_util_mkdir(const char *dir, int mode, int debug);

  g_mkdir_with_parents(dir)

> +int gvir_sandbox_init_util_mkparent(const char *dir, int mode, int debug);

   parent = g_path_get_dirname(dir)
   g_mkdir_with_parents(parent)
   g_free(parent)

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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