[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/2] util: Introduce qemu_get_host_name()
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v2 1/2] util: Introduce qemu_get_host_name() |
Date: |
Mon, 22 Jun 2020 18:49:01 +0100 |
User-agent: |
Mutt/1.14.0 (2020-05-02) |
On Mon, Jun 22, 2020 at 07:46:08PM +0200, Philippe Mathieu-Daudé wrote:
> On 6/22/20 7:26 PM, Michal Privoznik wrote:
> > This function offers operating system agnostic way to fetch host
> > name. It is implemented for both POSIX-like and Windows systems.
> >
> > Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> > ---
> > include/qemu/osdep.h | 10 ++++++++++
> > util/oslib-posix.c | 32 ++++++++++++++++++++++++++++++++
> > util/oslib-win32.c | 13 +++++++++++++
> > 3 files changed, 55 insertions(+)
> >
> > diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> > index ff7c17b857..a795d46b28 100644
> > --- a/include/qemu/osdep.h
> > +++ b/include/qemu/osdep.h
> > @@ -607,4 +607,14 @@ static inline void qemu_reset_optind(void)
> > #endif
> > }
> >
> > +/**
> > + * qemu_get_host_name:
> > + * @errp: Error object
> > + *
> > + * Operating system agnostic way of querying host name.
> > + *
> > + * Returns allocated hostname (caller should free), NULL on failure.
>
> free -> g_free?
free & g_free are guaranteed interchangable, given our min glib2 version.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|