mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
util: add API for copying virtual port profile data
Reviewed-by: Laine Stump <laine@laine.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4bdce1219f
commit
80772a58b6
@ -2510,6 +2510,7 @@ virNetDevVlanFree;
|
||||
virNetDevVPortProfileAssociate;
|
||||
virNetDevVPortProfileCheckComplete;
|
||||
virNetDevVPortProfileCheckNoExtras;
|
||||
virNetDevVPortProfileCopy;
|
||||
virNetDevVPortProfileDisassociate;
|
||||
virNetDevVPortProfileEqual;
|
||||
virNetDevVPortProfileMerge3;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user