This also isn't required (due to the vportprofile being stored in the
NetDef as a pointer rather than being directly contained), but it
seemed dishonest to not mark it as const (and thus permit users to
modify its contents)
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
src/conf/domain_conf.h | 2 +-
src/conf/netdev_vport_profile_conf.c | 2 +-
src/conf/netdev_vport_profile_conf.h | 2 +-
src/libxl/libxl_conf.c | 2 +-
src/libxl/xen_common.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/lxc/lxc_process.c | 8 ++++----
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration_cookie.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/util/virhostdev.c | 6 +++---
src/util/virnetdevmacvlan.c | 16 ++++++++--------
src/util/virnetdevmacvlan.h | 8 ++++----
src/util/virnetdevmidonet.c | 4 ++--
src/util/virnetdevmidonet.h | 4 ++--
src/util/virnetdevopenvswitch.c | 2 +-
src/util/virnetdevopenvswitch.h | 2 +-
src/util/virnetdevtap.c | 6 +++---
src/util/virnetdevtap.h | 6 +++---
src/util/virnetdevvportprofile.c | 12 ++++++------
src/util/virnetdevvportprofile.h | 12 ++++++------
tests/bhyvexml2argvmock.c | 2 +-
24 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 76e036c48e..af8c0af7c7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29665,7 +29665,7 @@ virDomainNetGetActualHostdev(virDomainNetDefPtr iface)
return NULL;
}
-virNetDevVPortProfilePtr
+const virNetDevVPortProfile *
virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface)
{
switch (iface->type) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 44d5fb8e16..b08202b092 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3209,7 +3209,7 @@ int virDomainNetGetActualBridgeMACTableManager(virDomainNetDefPtr
iface);
const char *virDomainNetGetActualDirectDev(virDomainNetDefPtr iface);
int virDomainNetGetActualDirectMode(virDomainNetDefPtr iface);
virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr iface);
-virNetDevVPortProfilePtr
+const virNetDevVPortProfile *
virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface);
const virNetDevBandwidth *
virDomainNetGetActualBandwidth(const virDomainNetDef *iface);
diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c
index 660478d128..1dd8439adb 100644
--- a/src/conf/netdev_vport_profile_conf.c
+++ b/src/conf/netdev_vport_profile_conf.c
@@ -197,7 +197,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
int
-virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort,
+virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBufferPtr buf)
{
enum virNetDevVPortProfile type;
diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_profile_conf.h
index a2989af81e..6a99a42ee8 100644
--- a/src/conf/netdev_vport_profile_conf.h
+++ b/src/conf/netdev_vport_profile_conf.h
@@ -40,5 +40,5 @@ virNetDevVPortProfilePtr
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
int
-virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort,
+virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBufferPtr buf);
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index b0d67c7b83..113999b7b5 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1217,7 +1217,7 @@ libxlMakeNic(virDomainDefPtr def,
virNetworkPtr network = NULL;
virConnectPtr conn = NULL;
const virNetDevBandwidth *actual_bw;
- virNetDevVPortProfilePtr port_profile;
+ const virNetDevVPortProfile *port_profile;
const virNetDevVlan *virt_vlan;
virBuffer buf = VIR_BUFFER_INITIALIZER;
size_t i;
diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
index 6e77921333..140a122fa1 100644
--- a/src/libxl/xen_common.c
+++ b/src/libxl/xen_common.c
@@ -1680,7 +1680,7 @@ xenFormatNet(virConnectPtr conn,
switch (net->type) {
case VIR_DOMAIN_NET_TYPE_BRIDGE:
{
- virNetDevVPortProfilePtr port_profile =
virDomainNetGetActualVirtPortProfile(net);
+ const virNetDevVPortProfile *port_profile =
virDomainNetGetActualVirtPortProfile(net);
const virNetDevVlan *virt_vlan = virDomainNetGetActualVlan(net);
const char *script = net->script;
size_t i;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 34c70240cb..1a1239b1bd 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4351,7 +4351,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm,
int detachidx, ret = -1;
virDomainNetType actualType;
virDomainNetDefPtr detach = NULL;
- virNetDevVPortProfilePtr vport = NULL;
+ const virNetDevVPortProfile *vport = NULL;
virErrorPtr save_err = NULL;
if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 323f3632c0..1a565b6358 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -163,7 +163,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver,
{
size_t i;
virLXCDomainObjPrivatePtr priv = vm->privateData;
- virNetDevVPortProfilePtr vport = NULL;
+ const virNetDevVPortProfile *vport = NULL;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
virConnectPtr conn = NULL;
@@ -284,7 +284,7 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm,
char *ret = NULL;
char *parentVeth;
char *containerVeth = NULL;
- virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
+ const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
VIR_DEBUG("calling vethCreate()");
parentVeth = net->ifname;
@@ -339,7 +339,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
char *res_ifname = NULL;
virLXCDriverPtr driver = conn->privateData;
const virNetDevBandwidth *bw;
- virNetDevVPortProfilePtr prof;
+ const virNetDevVPortProfile *prof;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
const char *linkdev = virDomainNetGetActualDirectDev(net);
unsigned int macvlan_create_flags = VIR_NETDEV_MACVLAN_CREATE_IFUP;
@@ -645,7 +645,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
virErrorPreserveLast(&save_err);
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr iface = def->nets[i];
- virNetDevVPortProfilePtr vport =
virDomainNetGetActualVirtPortProfile(iface);
+ const virNetDevVPortProfile *vport =
virDomainNetGetActualVirtPortProfile(iface);
if (vport && vport->virtPortType ==
VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
ignore_value(virNetDevOpenvswitchRemovePort(
virDomainNetGetActualBridgeName(iface),
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b2e8759da7..0181b62602 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5420,7 +5420,7 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net,
* a <virtualport> element in the config)
*/
if (net->filter) {
- virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
+ const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
if (!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4cbe7b0060..8c5f516ab2 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1108,7 +1108,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
static void
qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net)
{
- virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
+ const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
const char *brname;
if (!vport)
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index f625c7086b..a3de9180ea 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -243,7 +243,7 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver
G_GNUC_UNUSED,
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr netptr;
- virNetDevVPortProfilePtr vport;
+ const virNetDevVPortProfile *vport;
netptr = def->nets[i];
vport = virDomainNetGetActualVirtPortProfile(netptr);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7e0dc26658..a387341c8e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7384,7 +7384,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
qemuDomainObjPrivatePtr priv = vm->privateData;
virErrorPtr orig_err;
virDomainDefPtr def;
- virNetDevVPortProfilePtr vport = NULL;
+ const virNetDevVPortProfile *vport = NULL;
size_t i;
char *timestamp;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 223a78bd34..8922a01d4b 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -406,7 +406,7 @@ virHostdevIsVFIODevice(const virDomainHostdevDef *hostdev)
static int
virHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
- virNetDevVPortProfilePtr virtPort,
+ const virNetDevVPortProfile *virtPort,
const virMacAddr *macaddr,
const unsigned char *uuid,
bool associate)
@@ -502,7 +502,7 @@ virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev,
{
g_autofree char *linkdev = NULL;
const virNetDevVlan *vlan;
- virNetDevVPortProfilePtr virtPort;
+ const virNetDevVPortProfile *virtPort;
int vf = -1;
bool port_profile_associate = true;
@@ -552,7 +552,7 @@ virHostdevRestoreNetConfig(virDomainHostdevDefPtr hostdev,
g_autofree virMacAddrPtr MAC = NULL;
g_autofree virMacAddrPtr adminMAC = NULL;
g_autoptr(virNetDevVlan) vlan = NULL;
- virNetDevVPortProfilePtr virtPort;
+ const virNetDevVPortProfile *virtPort;
int vf = -1;
bool port_profile_associate = false;
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index c530cb75ed..e343dad923 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -828,7 +828,7 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const virMacAddr *macaddress,
const char *linkdev,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile
*virtPortProfile,
virNetDevVPortProfileOp vmOp)
{
virNetlinkCallbackDataPtr calld = NULL;
@@ -897,7 +897,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
virNetDevMacVLanMode mode,
const virNetDevVlan *vlan,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
char **ifnameResult,
virNetDevVPortProfileOp vmOp,
char *stateDir,
@@ -1094,7 +1094,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
const virMacAddr *macaddr,
const char *linkdev,
int mode,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
char *stateDir)
{
int ret = 0;
@@ -1149,7 +1149,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const virMacAddr *macaddress,
const char *linkdev,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile
*virtPortProfile,
virNetDevVPortProfileOp vmOp)
{
int rc = 0;
@@ -1226,7 +1226,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname
G_GNUC_UNUSED,
virNetDevMacVLanMode mode G_GNUC_UNUSED,
const virNetDevVlan *vlan G_GNUC_UNUSED,
const unsigned char *vmuuid G_GNUC_UNUSED,
- virNetDevVPortProfilePtr virtPortProfile
G_GNUC_UNUSED,
+ const virNetDevVPortProfile *virtPortProfile
G_GNUC_UNUSED,
char **res_ifname G_GNUC_UNUSED,
virNetDevVPortProfileOp vmop G_GNUC_UNUSED,
char *stateDir G_GNUC_UNUSED,
@@ -1243,7 +1243,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname
G_GNUC_UNUSED,
const virMacAddr *macaddress G_GNUC_UNUSED,
const char *linkdev G_GNUC_UNUSED,
int mode G_GNUC_UNUSED,
- virNetDevVPortProfilePtr virtPortProfile
G_GNUC_UNUSED,
+ const virNetDevVPortProfile *virtPortProfile
G_GNUC_UNUSED,
char *stateDir G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
@@ -1255,7 +1255,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname
G_GNUC_UNUSED,
const virMacAddr *macaddress G_GNUC_UNUSED,
const char *linkdev G_GNUC_UNUSED,
const unsigned char *vmuuid G_GNUC_UNUSED,
- virNetDevVPortProfilePtr virtPortProfile
G_GNUC_UNUSED,
+ const virNetDevVPortProfile *virtPortProfile
G_GNUC_UNUSED,
virNetDevVPortProfileOp vmOp G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
@@ -1267,7 +1267,7 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname
G_GNUC_UNUSE
const virMacAddr *macaddress
G_GNUC_UNUSED,
const char *linkdev G_GNUC_UNUSED,
const unsigned char *vmuuid
G_GNUC_UNUSED,
- virNetDevVPortProfilePtr virtPortProfile
G_GNUC_UNUSED,
+ const virNetDevVPortProfile
*virtPortProfile G_GNUC_UNUSED,
virNetDevVPortProfileOp vmOp
G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index f455ec3384..fc1bb018a2 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -78,7 +78,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
virNetDevMacVLanMode mode,
const virNetDevVlan *vlan,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
char **res_ifname,
virNetDevVPortProfileOp vmop,
char *stateDir,
@@ -101,7 +101,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
const virMacAddr *macaddress,
const char *linkdev,
int mode,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
char *stateDir)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(6) G_GNUC_WARN_UNUSED_RESULT;
@@ -110,7 +110,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const virMacAddr *macaddress,
const char *linkdev,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile
*virtPortProfile,
virNetDevVPortProfileOp vmOp)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT;
@@ -119,7 +119,7 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const virMacAddr *macaddress,
const char *linkdev,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr
virtPortProfile,
+ const virNetDevVPortProfile
*virtPortProfile,
virNetDevVPortProfileOp vmOp)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT;
diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c
index e50cceaef5..354350ce1b 100644
--- a/src/util/virnetdevmidonet.c
+++ b/src/util/virnetdevmidonet.c
@@ -37,7 +37,7 @@
*/
int
virNetDevMidonetBindPort(const char *ifname,
- virNetDevVPortProfilePtr virtualport)
+ const virNetDevVPortProfile *virtualport)
{
int ret = -1;
virCommandPtr cmd = NULL;
@@ -71,7 +71,7 @@ virNetDevMidonetBindPort(const char *ifname,
* Returns 0 in case of success or -1 in case of failure.
*/
int
-virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport)
+virNetDevMidonetUnbindPort(const virNetDevVPortProfile *virtualport)
{
int ret = -1;
virCommandPtr cmd = NULL;
diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h
index 61927c3edd..87ac3d74a1 100644
--- a/src/util/virnetdevmidonet.h
+++ b/src/util/virnetdevmidonet.h
@@ -23,8 +23,8 @@
int virNetDevMidonetBindPort(const char *ifname,
- virNetDevVPortProfilePtr virtualport)
+ const virNetDevVPortProfile *virtualport)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
-int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport)
+int virNetDevMidonetUnbindPort(const virNetDevVPortProfile *virtualport)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 9aa2c5ad84..81898057b1 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -135,7 +135,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const
virNetDevVlan *virtV
int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr ovsport,
+ const virNetDevVPortProfile *ovsport,
const virNetDevVlan *virtVlan)
{
char macaddrstr[VIR_MAC_STRING_BUFLEN];
diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h
index dddb21a5a2..c9ea592058 100644
--- a/src/util/virnetdevopenvswitch.h
+++ b/src/util/virnetdevopenvswitch.h
@@ -32,7 +32,7 @@ int virNetDevOpenvswitchAddPort(const char *brname,
const char *ifname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr ovsport,
+ const virNetDevVPortProfile *ovsport,
const virNetDevVlan *virtVlan)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
G_GNUC_WARN_UNUSED_RESULT;
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index fa1626d6ba..d012c5e210 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -502,7 +502,7 @@ virNetDevTapAttachBridge(const char *tapname,
const char *brname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
@@ -574,7 +574,7 @@ virNetDevTapReattachBridge(const char *tapname,
const char *brname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
@@ -660,7 +660,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
const char *tunpath,
int *tapfd,
size_t tapfdSize,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
virNetDevCoalescePtr coalesce,
unsigned int mtu,
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
index 4fc734fd5e..cae8e61861 100644
--- a/src/util/virnetdevtap.h
+++ b/src/util/virnetdevtap.h
@@ -63,7 +63,7 @@ virNetDevTapAttachBridge(const char *tapname,
const char *brname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
@@ -75,7 +75,7 @@ virNetDevTapReattachBridge(const char *tapname,
const char *brname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
@@ -89,7 +89,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
const char *tunpath,
int *tapfd,
size_t tapfdSize,
- virNetDevVPortProfilePtr virtPortProfile,
+ const virNetDevVPortProfile *virtPortProfile,
const virNetDevVlan *virtVlan,
virNetDevCoalescePtr coalesce,
unsigned int mtu,
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index 6442c2a2cf..593bd6e2d6 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -85,7 +85,7 @@ enum virNetDevVPortProfileLinkOp {
#endif
bool
-virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a, virNetDevVPortProfilePtr b)
+virNetDevVPortProfileEqual(const virNetDevVPortProfile *a, const virNetDevVPortProfile
*b)
{
/* NULL resistant */
if (!a && !b)
@@ -226,7 +226,7 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport,
* an error is logged and -1 is returned.
*/
int
-virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfilePtr virtport)
+virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport)
{
const char *extra = NULL;
@@ -283,7 +283,7 @@ virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfilePtr virtport)
*/
static int
virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig,
- virNetDevVPortProfilePtr mods)
+ const virNetDevVPortProfile *mods)
{
enum virNetDevVPortProfile otype;
@@ -423,9 +423,9 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig,
*/
int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
- virNetDevVPortProfilePtr fromInterface,
- virNetDevVPortProfilePtr fromNetwork,
- virNetDevVPortProfilePtr fromPortgroup)
+ const virNetDevVPortProfile *fromInterface,
+ const virNetDevVPortProfile *fromNetwork,
+ const virNetDevVPortProfile *fromPortgroup)
{
int ret = -1;
*result = NULL;
diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h
index 5fdd019a09..88a42a1816 100644
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -77,19 +77,19 @@ struct _virNetDevVPortProfile {
};
-bool virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a,
- virNetDevVPortProfilePtr b);
+bool virNetDevVPortProfileEqual(const virNetDevVPortProfile *a,
+ const virNetDevVPortProfile *b);
int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst,
const virNetDevVPortProfile *src);
int virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport,
bool generateMissing);
-int virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfilePtr virtport);
+int virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport);
int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
- virNetDevVPortProfilePtr fromInterface,
- virNetDevVPortProfilePtr fromNetwork,
- virNetDevVPortProfilePtr fromPortgroup);
+ const virNetDevVPortProfile *fromInterface,
+ const virNetDevVPortProfile *fromNetwork,
+ const virNetDevVPortProfile *fromPortgroup);
int virNetDevVPortProfileAssociate(const char *ifname,
const virNetDevVPortProfile *virtPort,
diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c
index ac4ffe8596..2a552f9f47 100644
--- a/tests/bhyvexml2argvmock.c
+++ b/tests/bhyvexml2argvmock.c
@@ -26,7 +26,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED,
const char *tunpath G_GNUC_UNUSED,
int *tapfd G_GNUC_UNUSED,
size_t tapfdSize G_GNUC_UNUSED,
- virNetDevVPortProfilePtr virtPortProfile
G_GNUC_UNUSED,
+ const virNetDevVPortProfile *virtPortProfile
G_GNUC_UNUSED,
const virNetDevVlan *virtVlan G_GNUC_UNUSED,
virNetDevCoalescePtr coalesce G_GNUC_UNUSED,
unsigned int mtu G_GNUC_UNUSED,
--
2.21.0