提交 12207fcf 编写于 作者: L Laine Stump

conf: make virDomainNetGetActualVlan arg/return val const

This is needed if we want to call the function when the
virDomainNetDef* we have is a const.

Since virDomainNetGetActualVlan returns a pointer to memory that is
within the virDomainNetDefPtr arg, the returned pointer must also be
made const. This leads to a cascade of other virNetDevVlanPtr's that
must be changed to "const virNetDevVlan *".
Signed-off-by: NLaine Stump <laine@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 1b029a92
......@@ -29566,10 +29566,10 @@ virDomainNetGetActualBandwidth(virDomainNetDefPtr iface)
return iface->bandwidth;
}
virNetDevVlanPtr
virDomainNetGetActualVlan(virDomainNetDefPtr iface)
const virNetDevVlan *
virDomainNetGetActualVlan(const virDomainNetDef *iface)
{
virNetDevVlanPtr vlan = &iface->vlan;
const virNetDevVlan *vlan = &iface->vlan;
/* if there is an ActualNetDef, *always* return
* its vlan rather than the NetDef's vlan.
......
......@@ -3217,7 +3217,7 @@ virNetDevVPortProfilePtr
virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface);
virNetDevBandwidthPtr
virDomainNetGetActualBandwidth(virDomainNetDefPtr iface);
virNetDevVlanPtr virDomainNetGetActualVlan(virDomainNetDefPtr iface);
const virNetDevVlan *virDomainNetGetActualVlan(const virDomainNetDef *iface);
bool virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface);
const char *virDomainNetGetModelString(const virDomainNetDef *net);
int virDomainNetSetModelString(virDomainNetDefPtr et,
......
......@@ -1204,7 +1204,7 @@ libxlMakeNic(virDomainDefPtr def,
virConnectPtr conn = NULL;
virNetDevBandwidthPtr actual_bw;
virNetDevVPortProfilePtr port_profile;
virNetDevVlanPtr virt_vlan;
const virNetDevVlan *virt_vlan;
virBuffer buf = VIR_BUFFER_INITIALIZER;
size_t i;
const char *script = NULL;
......
......@@ -1668,7 +1668,7 @@ xenFormatNet(virConnectPtr conn,
case VIR_DOMAIN_NET_TYPE_BRIDGE:
{
virNetDevVPortProfilePtr port_profile = virDomainNetGetActualVirtPortProfile(net);
virNetDevVlanPtr virt_vlan = virDomainNetGetActualVlan(net);
const virNetDevVlan *virt_vlan = virDomainNetGetActualVlan(net);
const char *script = net->script;
size_t i;
......
......@@ -497,7 +497,7 @@ virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev,
const unsigned char *uuid)
{
g_autofree char *linkdev = NULL;
virNetDevVlanPtr vlan;
const virNetDevVlan *vlan;
virNetDevVPortProfilePtr virtPort;
int vf = -1;
bool port_profile_associate = true;
......
......@@ -2168,7 +2168,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
int
virNetDevSetNetConfig(const char *linkdev, int vf,
const virMacAddr *adminMAC,
virNetDevVlanPtr vlan,
const virNetDevVlan *vlan,
const virMacAddr *MAC,
bool setVlan)
{
......@@ -2391,7 +2391,7 @@ int
virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
int vf G_GNUC_UNUSED,
const virMacAddr *adminMAC G_GNUC_UNUSED,
virNetDevVlanPtr vlan G_GNUC_UNUSED,
const virNetDevVlan *vlan G_GNUC_UNUSED,
const virMacAddr *MAC G_GNUC_UNUSED,
bool setVlan G_GNUC_UNUSED)
{
......
......@@ -253,7 +253,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
int
virNetDevSetNetConfig(const char *linkdev, int vf,
const virMacAddr *adminMAC,
virNetDevVlanPtr vlan,
const virNetDevVlan *vlan,
const virMacAddr *MAC,
bool setVLan)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
......
......@@ -893,7 +893,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
const virMacAddr *macaddress,
const char *linkdev,
virNetDevMacVLanMode mode,
virNetDevVlanPtr vlan,
const virNetDevVlan *vlan,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
char **ifnameResult,
......@@ -1222,7 +1222,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname G_GNUC_UNUSED,
const virMacAddr *macaddress G_GNUC_UNUSED,
const char *linkdev G_GNUC_UNUSED,
virNetDevMacVLanMode mode G_GNUC_UNUSED,
virNetDevVlanPtr vlan G_GNUC_UNUSED,
const virNetDevVlan *vlan G_GNUC_UNUSED,
const unsigned char *vmuuid G_GNUC_UNUSED,
virNetDevVPortProfilePtr virtPortProfile G_GNUC_UNUSED,
char **res_ifname G_GNUC_UNUSED,
......
......@@ -76,7 +76,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
const virMacAddr *macaddress,
const char *linkdev,
virNetDevMacVLanMode mode,
virNetDevVlanPtr vlan,
const virNetDevVlan *vlan,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
char **res_ifname,
......
......@@ -68,7 +68,7 @@ virNetDevOpenvswitchAddTimeout(virCommandPtr cmd)
* Returns 0 in case of success or -1 in case of failure.
*/
static int
virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, virNetDevVlanPtr virtVlan)
virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan)
{
int ret = -1;
size_t i = 0;
......@@ -133,7 +133,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr ovsport,
virNetDevVlanPtr virtVlan)
const virNetDevVlan *virtVlan)
{
char macaddrstr[VIR_MAC_STRING_BUFLEN];
char ifuuidstr[VIR_UUID_STRING_BUFLEN];
......@@ -538,7 +538,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
* Returns 0 in case of success or -1 in case of failure.
*/
int virNetDevOpenvswitchUpdateVlan(const char *ifname,
virNetDevVlanPtr virtVlan)
const virNetDevVlan *virtVlan)
{
g_autoptr(virCommand) cmd = NULL;
......
......@@ -33,7 +33,7 @@ int virNetDevOpenvswitchAddPort(const char *brname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr ovsport,
virNetDevVlanPtr virtVlan)
const virNetDevVlan *virtVlan)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
G_GNUC_WARN_UNUSED_RESULT;
......@@ -65,5 +65,5 @@ int virNetDevOpenvswitchGetVhostuserIfname(const char *path,
ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_NO_INLINE;
int virNetDevOpenvswitchUpdateVlan(const char *ifname,
virNetDevVlanPtr virtVlan)
const virNetDevVlan *virtVlan)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
......@@ -500,7 +500,7 @@ virNetDevTapAttachBridge(const char *tapname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
{
......@@ -572,7 +572,7 @@ virNetDevTapReattachBridge(const char *tapname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
{
......@@ -658,7 +658,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
int *tapfd,
size_t tapfdSize,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
virNetDevCoalescePtr coalesce,
unsigned int mtu,
unsigned int *actualMTU,
......
......@@ -64,7 +64,7 @@ virNetDevTapAttachBridge(const char *tapname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
......@@ -76,7 +76,7 @@ virNetDevTapReattachBridge(const char *tapname,
const virMacAddr *macaddr,
const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
unsigned int mtu,
unsigned int *actualMTU)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
......@@ -90,7 +90,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
int *tapfd,
size_t tapfdSize,
virNetDevVPortProfilePtr virtPortProfile,
virNetDevVlanPtr virtVlan,
const virNetDevVlan *virtVlan,
virNetDevCoalescePtr coalesce,
unsigned int mtu,
unsigned int *actualMTU,
......
......@@ -27,7 +27,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED,
int *tapfd G_GNUC_UNUSED,
size_t tapfdSize G_GNUC_UNUSED,
virNetDevVPortProfilePtr virtPortProfile G_GNUC_UNUSED,
virNetDevVlanPtr virtVlan G_GNUC_UNUSED,
const virNetDevVlan *virtVlan G_GNUC_UNUSED,
virNetDevCoalescePtr coalesce G_GNUC_UNUSED,
unsigned int mtu G_GNUC_UNUSED,
unsigned int *actualMTU G_GNUC_UNUSED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册