[libvirt] [PATCH v2 1/9] libvirt: Export libvirt config getters by moving them to util

Martin Kletzander mkletzan at redhat.com
Mon Oct 19 15:13:49 UTC 2015


On Fri, Oct 16, 2015 at 08:12:18PM +0200, Erik Skultety wrote:
>virConnectGetConfig and virConnectGetConfigPath were static libvirt
>methods, merely because there hasn't been any need for having them
>internally exported yet. Since libvirt-admin also needs to reference
>libvirt config file, 'xGetConfig' should be exported.
>Besides moving, this patch also renames the methods accordingly,
>as they are libvirt config specific.
>---
> src/libvirt.c            | 55 +-----------------------------------------------
> src/libvirt_private.syms |  1 +
> src/util/virconf.c       | 52 +++++++++++++++++++++++++++++++++++++++++++++
> src/util/virconf.h       |  2 +-
> 4 files changed, 55 insertions(+), 55 deletions(-)
>
>diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
>index be6ee19..b72a0ee 100644
>--- a/src/libvirt_private.syms
>+++ b/src/libvirt_private.syms
>@@ -1332,6 +1332,7 @@ virConfTypeToString;
> virConfWalk;
> virConfWriteFile;
> virConfWriteMem;
>+virGetLibvirtConfigFile;

I would name it virConf... to go with the rest of the file.  How about
virConfLoad() or virConfLoadDefault().  We don't necessarily need over
20 characters long names for each function in our source =D

>diff --git a/src/util/virconf.h b/src/util/virconf.h
>index 8037956..dad7dba 100644
>--- a/src/util/virconf.h
>+++ b/src/util/virconf.h
>@@ -96,5 +96,5 @@ int virConfWriteFile(const char *filename,
> int virConfWriteMem(char *memory,
>                     int *len,
>                     virConfPtr conf);
>-
>+int virGetLibvirtConfigFile(virConfPtr *conf);
> #endif /* __VIR_CONF_H__ */

Keep the space between the declaration and the #endif.

ACK with those things fixed.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151019/db28ecb6/attachment-0001.sig>


More information about the libvir-list mailing list