]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: add API for copying virtual port profile data
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 3 Sep 2018 16:02:35 +0000 (17:02 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 17 Apr 2019 13:12:56 +0000 (14:12 +0100)
Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt_private.syms
src/util/virnetdevvportprofile.c
src/util/virnetdevvportprofile.h

index a3d480d84629ec665d532d1a0db48f2eeacbedc9..aa123978fa91846f4a1ce30e89371e66186dfa55 100644 (file)
@@ -2510,6 +2510,7 @@ virNetDevVlanFree;
 virNetDevVPortProfileAssociate;
 virNetDevVPortProfileCheckComplete;
 virNetDevVPortProfileCheckNoExtras;
+virNetDevVPortProfileCopy;
 virNetDevVPortProfileDisassociate;
 virNetDevVPortProfileEqual;
 virNetDevVPortProfileMerge3;
index 32a366d4da3a472c3a153ff5041c29a976a94dd2..a5ecd783f23b49dbfe79f5dc306fa3d1fce4fa97 100644 (file)
@@ -127,6 +127,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
index 5506194001bb2e961defc676978d20d3fb520d6d..afa982f2e3cfdb1a4e5de4dbfd21d1a956000efc 100644 (file)
@@ -80,6 +80,8 @@ struct _virNetDevVPortProfile {
 
 bool virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a,
                                 virNetDevVPortProfilePtr b);
+int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst,
+                              const virNetDevVPortProfile *src);
 
 int virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport,
                                        bool generateMissing);