Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virnetdevvportprofile.c | 16 ++++++++++++++++
src/util/virnetdevvportprofile.h | 2 ++
3 files changed, 19 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0694db7089..1e405cbe5f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2490,6 +2490,7 @@ virNetDevVlanFree;
virNetDevVPortProfileAssociate;
virNetDevVPortProfileCheckComplete;
virNetDevVPortProfileCheckNoExtras;
+virNetDevVPortProfileCopy;
virNetDevVPortProfileDisassociate;
virNetDevVPortProfileEqual;
virNetDevVPortProfileMerge3;
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index fb05190c02..b6e8365e61 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -125,6 +125,22 @@ virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a,
virNetDevVPortProfilePtr
return true;
}
+
+int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst, const virNetDevVPortProfile
*src)
+{
+ if (!src) {
+ *dst = NULL;
+ return 0;
+ }
+
+ if (VIR_ALLOC(*dst) < 0)
+ return -1;
+
+ memcpy(*dst, src, sizeof(*src));
+ return 0;
+}
+
+
/* virNetDevVPortProfileCheckComplete() checks that all attributes
* required for the type of virtport are specified. When
* generateMissing is true, any missing attribute that can be
diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h
index 65b4779861..503c44e086 100644
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -79,6 +79,8 @@ struct _virNetDevVPortProfile {
bool virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a,
virNetDevVPortProfilePtr b);
+int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst,
+ const virNetDevVPortProfile *src);
int virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport,
bool generateMissing);
--
2.20.1