From 9e112021fcfa5bdcd042a74478ccfd5ff3ad0a33 Mon Sep 17 00:00:00 2001
Message-Id: <9e112021fcfa5bdcd042a74478ccfd5ff3ad0a33@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:54:46 +0100
Subject: [PATCH] conf: Export disk source formatter and parser
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
This code will be reused in the snapshot disk definition parser.
(cherry picked from commit 5f86d11e4a54276aba34bfbe237bf79d0c97e2e7)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/conf/domain_conf.c | 4 ++--
src/conf/domain_conf.h | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e4e3f6b..cec0236 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4832,7 +4832,7 @@ cleanup:
}
-static int
+int
virDomainDiskSourceDefParse(xmlNodePtr node,
int type,
char **source,
@@ -14488,7 +14488,7 @@ virDomainDiskSourceDefFormatSeclabel(virBufferPtr buf,
}
}
-static int
+int
virDomainDiskSourceDefFormatInternal(virBufferPtr buf,
int type,
const char *src,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 0a4316b..fa81fa1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2344,6 +2344,18 @@ int virDomainDefFormatInternal(virDomainDefPtr def,
unsigned int flags,
virBufferPtr buf);
+int virDomainDiskSourceDefFormatInternal(virBufferPtr buf,
+ int type,
+ const char *src,
+ int policy,
+ int protocol,
+ size_t nhosts,
+ virDomainDiskHostDefPtr hosts,
+ size_t nseclabels,
+ virSecurityDeviceLabelDefPtr *seclabels,
+ virDomainDiskSourcePoolDefPtr srcpool,
+ unsigned int flags);
+
int virDomainDefCompatibleDevice(virDomainDefPtr def,
virDomainDeviceDefPtr dev);
@@ -2377,6 +2389,14 @@ virDomainDiskDefPtr
virDomainDiskRemove(virDomainDefPtr def, size_t i);
virDomainDiskDefPtr
virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
+int virDomainDiskSourceDefParse(xmlNodePtr node,
+ int type,
+ char **source,
+ int *proto,
+ size_t *nhosts,
+ virDomainDiskHostDefPtr *hosts,
+ virDomainDiskSourcePoolDefPtr *srcpool);
+
bool virDomainHasDiskMirror(virDomainObjPtr vm);
int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
--
1.9.0