[libvirt] [PATCH] xml: namespaces: use uri instead of href

Jiri Denemark jdenemar at redhat.com
Wed Aug 21 08:44:46 UTC 2019


On Wed, Aug 21, 2019 at 10:37:33 +0200, Ján Tomko wrote:
> Store the namespace URI as const char*, instead of in a function.
> 
> Suggested-by: Jiri Denemark <jdenemar at redhat.com>
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>  src/bhyve/bhyve_domain.c          | 11 ++---------
>  src/lxc/lxc_domain.c              |  9 +--------
>  src/network/bridge_driver.c       | 11 +----------
>  src/qemu/qemu_domain.c            | 10 +---------
>  src/storage/storage_backend_fs.c  |  9 +--------
>  src/storage/storage_backend_rbd.c | 11 +----------
>  src/test/test_driver.c            | 11 ++---------
>  src/util/virxml.c                 |  6 +++---
>  src/util/virxml.h                 |  2 +-
>  src/vmx/vmx.c                     |  8 +-------
>  10 files changed, 14 insertions(+), 74 deletions(-)
> 
...
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 57d54c05b3..6a694d8b1f 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -167,8 +167,6 @@ testDriverDispose(void *obj)
>      virObjectUnref(driver->eventState);
>  }
>  
> -#define TEST_NAMESPACE_HREF "http://libvirt.org/schemas/domain/test/1.0"
> -
>  typedef struct _testDomainNamespaceDef testDomainNamespaceDef;
>  typedef testDomainNamespaceDef *testDomainNamespaceDefPtr;
>  struct _testDomainNamespaceDef {
> @@ -180,12 +178,6 @@ struct _testDomainNamespaceDef {
>      xmlNodePtr *snap_nodes;
>  };
>  
> -static const char*
> -testDomainDefNamespaceHref(void)
> -{
> -    return TEST_NAMESPACE_HREF;
> -}
> -
>  static void
>  testDomainDefNamespaceFree(void *data)
>  {
> @@ -427,7 +419,8 @@ testDriverNew(void)
>          .parse = testDomainDefNamespaceParse,
>          .free = testDomainDefNamespaceFree,
>          .prefix = "test",
> -        .href = testDomainDefNamespaceHref,
> +        .uri = "http://libvirt.org/schemas/domain/test/1.0",
> +

Drop this extra empty line, please.
>      };
>      virDomainDefParserConfig config = {
>          .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
...

Reviewed-by: Jiri Denemark <jdenemar at redhat.com>




More information about the libvir-list mailing list