Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- 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 c63e204c61..a9c465ba5f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2466,6 +2466,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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list