'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up remaining offenders in src/conf, and their fallout.
* src/conf/snapshot_conf.h (virDomainSnapshotAssignDef)
(virDomainSnapshotFindByName): Drop attempt at const.
* src/conf/interface_conf.h (virInterfaceObjIsActive)
(virInterfaceDefFormat): Use intended type.
(virInterfaceFindByMACString, virInterfaceFindByName)
(virInterfaceAssignDef, virInterfaceRemove): Drop attempt at
const.
* src/conf/network_conf.h (virNetworkObjIsActive)
(virNetworkDefFormat, virNetworkDefForwardIf)
(virNetworkDefGetIpByIndex, virNetworkIpDefPrefix)
(virNetworkIpDefNetmask): Use intended type.
(virNetworkFindByUUID, virNetworkFindByName, virNetworkAssignDef)
(virNetworkObjAssignDef, virNetworkRemoveInactive)
(virNetworkBridgeInUse, virNetworkSetBridgeName)
(virNetworkAllocateBridge): Drop attempt at const.
* src/conf/netdev_vlan_conf.h (virNetDevVlanFormat): Make
const-correct.
* src/conf/node_device_conf.h (virNodeDeviceHasCap)
(virNodeDeviceDefFormat): Use intended type.
(virNodeDeviceFindByName, virNodeDeviceFindBySysfsPath)
(virNodeDeviceAssignDef, virNodeDeviceObjRemove)
(virNodeDeviceGetParentHost): Drop attempt at const.
* src/conf/secret_conf.h (virSecretDefFormat): Use intended type.
* src/conf/snapshot_conf.c (virDomainSnapshotAssignDef)
(virDomainSnapshotFindByName): Fix fallout.
* src/conf/interface_conf.c (virInterfaceBridgeDefFormat)
(virInterfaceBondDefFormat, virInterfaceVlanDefFormat)
(virInterfaceProtocolDefFormat, virInterfaceDefDevFormat)
(virInterfaceDefFormat, virInterfaceFindByMACString)
(virInterfaceFindByName, virInterfaceAssignDef)
(virInterfaceRemove): Likewise.
* src/conf/network_conf.c
(VIR_ENUM_IMPL, virNetworkFindByName, virNetworkObjAssignDef)
(virNetworkAssignDef, virNetworkRemoveInactive)
(virNetworkDefGetIpByIndex, virNetworkIpDefPrefix)
(virNetworkIpDefNetmask, virNetworkDHCPHostDefParseXML)
(virNetworkIpDefFormat, virNetworkRouteDefFormat)
(virPortGroupDefFormat, virNetworkForwardNatDefFormat)
(virNetworkDefFormatInternal, virNetworkBridgeInUse)
(virNetworkAllocateBridge, virNetworkSetBridgeName)
(virNetworkDNSDefFormat, virNetworkDefFormat): Likewise.
* src/conf/netdev_vlan_conf.c (virNetDevVlanFormat): Likewise.
* src/conf/node_device_conf.c (virNodeDeviceHasCap)
(virNodeDeviceFindBySysfsPath, virNodeDeviceFindByName)
(virNodeDeviceAssignDef, virNodeDeviceObjRemove)
(virNodeDeviceDefFormat, virNodeDeviceGetParentHost): Likewise.
* src/conf/secret_conf.c (virSecretDefFormatUsage)
(virSecretDefFormat): Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/conf/interface_conf.c | 30 +++++++++++++++++-------------
src/conf/interface_conf.h | 15 +++++++--------
src/conf/netdev_vlan_conf.c | 4 ++--
src/conf/netdev_vlan_conf.h | 4 ++--
src/conf/network_conf.c | 44 ++++++++++++++++++++++----------------------
src/conf/network_conf.h | 28 ++++++++++++++--------------
src/conf/node_device_conf.c | 14 +++++++-------
src/conf/node_device_conf.h | 14 +++++++-------
src/conf/secret_conf.c | 8 ++++----
src/conf/secret_conf.h | 4 ++--
src/conf/snapshot_conf.c | 6 +++---
src/conf/snapshot_conf.h | 6 +++---
12 files changed, 90 insertions(+), 87 deletions(-)
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 79aab6e..fd2e25e 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -42,7 +42,7 @@ static virInterfaceDefPtr
virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType);
static int
virInterfaceDefDevFormat(virBufferPtr buf,
- const virInterfaceDefPtr def, int level);
+ const virInterfaceDef *def, int level);
static
void virInterfaceIpDefFree(virInterfaceIpDefPtr def) {
@@ -858,7 +858,8 @@ virInterfaceDefPtr virInterfaceDefParseFile(const char *filename)
static int
virInterfaceBridgeDefFormat(virBufferPtr buf,
- const virInterfaceDefPtr def, int level) {
+ const virInterfaceDef *def, int level)
+{
size_t i;
int ret = 0;
@@ -883,7 +884,8 @@ virInterfaceBridgeDefFormat(virBufferPtr buf,
static int
virInterfaceBondDefFormat(virBufferPtr buf,
- const virInterfaceDefPtr def, int level) {
+ const virInterfaceDef *def, int level)
+{
size_t i;
int ret = 0;
@@ -944,7 +946,8 @@ virInterfaceBondDefFormat(virBufferPtr buf,
static int
virInterfaceVlanDefFormat(virBufferPtr buf,
- const virInterfaceDefPtr def, int level) {
+ const virInterfaceDef *def, int level)
+{
if (def->data.vlan.tag == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("vlan misses the tag name"));
@@ -964,8 +967,9 @@ virInterfaceVlanDefFormat(virBufferPtr buf,
}
static int
-virInterfaceProtocolDefFormat(virBufferPtr buf, const virInterfaceDefPtr def,
- int level) {
+virInterfaceProtocolDefFormat(virBufferPtr buf, const virInterfaceDef *def,
+ int level)
+{
size_t i, j;
for (i = 0; i < def->nprotos; i++) {
@@ -1038,7 +1042,8 @@ virInterfaceStartmodeDefFormat(virBufferPtr buf,
static int
virInterfaceDefDevFormat(virBufferPtr buf,
- const virInterfaceDefPtr def, int level) {
+ const virInterfaceDef *def, int level)
+{
const char *type = NULL;
if (def == NULL) {
@@ -1115,7 +1120,7 @@ cleanup:
return -1;
}
-char *virInterfaceDefFormat(const virInterfaceDefPtr def)
+char *virInterfaceDefFormat(const virInterfaceDef *def)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -1150,7 +1155,7 @@ void virInterfaceObjFree(virInterfaceObjPtr iface)
/* virInterfaceObjList manipulation */
-int virInterfaceFindByMACString(const virInterfaceObjListPtr interfaces,
+int virInterfaceFindByMACString(virInterfaceObjListPtr interfaces,
const char *mac,
virInterfaceObjPtr *matches, int maxmatches)
{
@@ -1175,8 +1180,7 @@ int virInterfaceFindByMACString(const virInterfaceObjListPtr
interfaces,
return matchct;
}
-virInterfaceObjPtr virInterfaceFindByName(const virInterfaceObjListPtr
- interfaces,
+virInterfaceObjPtr virInterfaceFindByName(virInterfaceObjListPtr interfaces,
const char *name)
{
size_t i;
@@ -1242,7 +1246,7 @@ cleanup:
}
virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
- const virInterfaceDefPtr def)
+ virInterfaceDefPtr def)
{
virInterfaceObjPtr iface;
@@ -1277,7 +1281,7 @@ virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr
interfaces,
}
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
- const virInterfaceObjPtr iface)
+ virInterfaceObjPtr iface)
{
size_t i;
diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h
index d60867b..4857822 100644
--- a/src/conf/interface_conf.h
+++ b/src/conf/interface_conf.h
@@ -1,7 +1,7 @@
/*
* interface_conf.h: interface XML handling entry points
*
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2009, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -176,16 +176,15 @@ struct _virInterfaceObjList {
};
static inline int
-virInterfaceObjIsActive(const virInterfaceObjPtr iface)
+virInterfaceObjIsActive(const virInterfaceObj *iface)
{
return iface->active;
}
-int virInterfaceFindByMACString(const virInterfaceObjListPtr interfaces,
+int virInterfaceFindByMACString(virInterfaceObjListPtr interfaces,
const char *mac,
virInterfaceObjPtr *matches, int maxmatches);
-virInterfaceObjPtr virInterfaceFindByName(const virInterfaceObjListPtr
- interfaces,
+virInterfaceObjPtr virInterfaceFindByName(virInterfaceObjListPtr interfaces,
const char *name);
@@ -197,16 +196,16 @@ int virInterfaceObjListClone(virInterfaceObjListPtr src,
virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
- const virInterfaceDefPtr def);
+ virInterfaceDefPtr def);
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
- const virInterfaceObjPtr iface);
+ virInterfaceObjPtr iface);
virInterfaceDefPtr virInterfaceDefParseString(const char *xmlStr);
virInterfaceDefPtr virInterfaceDefParseFile(const char *filename);
virInterfaceDefPtr virInterfaceDefParseNode(xmlDocPtr xml,
xmlNodePtr root);
-char *virInterfaceDefFormat(const virInterfaceDefPtr def);
+char *virInterfaceDefFormat(const virInterfaceDef *def);
void virInterfaceObjLock(virInterfaceObjPtr obj);
void virInterfaceObjUnlock(virInterfaceObjPtr obj);
diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c
index 24e1000..b2ed2b0 100644
--- a/src/conf/netdev_vlan_conf.c
+++ b/src/conf/netdev_vlan_conf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2009-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -140,7 +140,7 @@ cleanup:
}
int
-virNetDevVlanFormat(virNetDevVlanPtr def, virBufferPtr buf)
+virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf)
{
size_t i;
diff --git a/src/conf/netdev_vlan_conf.h b/src/conf/netdev_vlan_conf.h
index 480d6c6..ceef78e 100644
--- a/src/conf/netdev_vlan_conf.h
+++ b/src/conf/netdev_vlan_conf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2009-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,6 @@
# include "virxml.h"
int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def);
-int virNetDevVlanFormat(virNetDevVlanPtr def, virBufferPtr buf);
+int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf);
#endif /* __VIR_NETDEV_VPORT_PROFILE_CONF_H__ */
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index c877a6d..447eca4 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -66,7 +66,7 @@ VIR_ENUM_IMPL(virNetworkForwardDriverName,
"kvm",
"vfio")
-virNetworkObjPtr virNetworkFindByUUID(const virNetworkObjListPtr nets,
+virNetworkObjPtr virNetworkFindByUUID(virNetworkObjListPtr nets,
const unsigned char *uuid)
{
size_t i;
@@ -81,7 +81,7 @@ virNetworkObjPtr virNetworkFindByUUID(const virNetworkObjListPtr nets,
return NULL;
}
-virNetworkObjPtr virNetworkFindByName(const virNetworkObjListPtr nets,
+virNetworkObjPtr virNetworkFindByName(virNetworkObjListPtr nets,
const char *name)
{
size_t i;
@@ -291,7 +291,7 @@ void virNetworkObjListFree(virNetworkObjListPtr nets)
*/
int
virNetworkObjAssignDef(virNetworkObjPtr network,
- const virNetworkDefPtr def,
+ virNetworkDefPtr def,
bool live)
{
if (virNetworkObjIsActive(network)) {
@@ -337,7 +337,7 @@ virNetworkObjAssignDef(virNetworkObjPtr network,
*/
virNetworkObjPtr
virNetworkAssignDef(virNetworkObjListPtr nets,
- const virNetworkDefPtr def,
+ virNetworkDefPtr def,
bool live)
{
virNetworkObjPtr network;
@@ -543,7 +543,7 @@ cleanup:
}
void virNetworkRemoveInactive(virNetworkObjListPtr nets,
- const virNetworkObjPtr net)
+ virNetworkObjPtr net)
{
size_t i;
@@ -571,7 +571,7 @@ void virNetworkRemoveInactive(virNetworkObjListPtr nets,
/* return ips[index], or NULL if there aren't enough ips */
virNetworkIpDefPtr
-virNetworkDefGetIpByIndex(const virNetworkDefPtr def,
+virNetworkDefGetIpByIndex(const virNetworkDef *def,
int family, size_t n)
{
size_t i;
@@ -597,7 +597,7 @@ virNetworkDefGetIpByIndex(const virNetworkDefPtr def,
/* return number of 1 bits in netmask for the network's ipAddress,
* or -1 on error
*/
-int virNetworkIpDefPrefix(const virNetworkIpDefPtr def)
+int virNetworkIpDefPrefix(const virNetworkIpDef *def)
{
return virSocketAddrGetIpPrefix(&def->address,
&def->netmask,
@@ -608,7 +608,7 @@ int virNetworkIpDefPrefix(const virNetworkIpDefPtr def)
* definition, based on either the definition's netmask, or its
* prefix. Return -1 on error (and set the netmask family to AF_UNSPEC)
*/
-int virNetworkIpDefNetmask(const virNetworkIpDefPtr def,
+int virNetworkIpDefNetmask(const virNetworkIpDef *def,
virSocketAddrPtr netmask)
{
if (VIR_SOCKET_ADDR_IS_FAMILY(&def->netmask, AF_INET)) {
@@ -667,7 +667,7 @@ cleanup:
static int
virNetworkDHCPHostDefParseXML(const char *networkName,
- const virNetworkIpDefPtr def,
+ virNetworkIpDefPtr def,
xmlNodePtr node,
virNetworkDHCPHostDefPtr host,
bool partialOkay)
@@ -2293,7 +2293,7 @@ cleanup:
static int
virNetworkDNSDefFormat(virBufferPtr buf,
- virNetworkDNSDefPtr def)
+ const virNetworkDNSDef *def)
{
int result = 0;
size_t i, j;
@@ -2369,7 +2369,7 @@ out:
static int
virNetworkIpDefFormat(virBufferPtr buf,
- const virNetworkIpDefPtr def)
+ const virNetworkIpDef *def)
{
int result = -1;
@@ -2466,7 +2466,7 @@ error:
static int
virNetworkRouteDefFormat(virBufferPtr buf,
- const virNetworkRouteDefPtr def)
+ const virNetworkRouteDef *def)
{
int result = -1;
@@ -2513,7 +2513,7 @@ error:
static int
virPortGroupDefFormat(virBufferPtr buf,
- const virPortGroupDefPtr def)
+ const virPortGroupDef *def)
{
virBufferAsprintf(buf, "<portgroup name='%s'", def->name);
if (def->isDefault) {
@@ -2533,7 +2533,7 @@ virPortGroupDefFormat(virBufferPtr buf,
static int
virNetworkForwardNatDefFormat(virBufferPtr buf,
- const virNetworkForwardDefPtr fwd)
+ const virNetworkForwardDef *fwd)
{
char *addrStart = NULL;
char *addrEnd = NULL;
@@ -2583,10 +2583,10 @@ cleanup:
static int
virNetworkDefFormatInternal(virBufferPtr buf,
- const virNetworkDefPtr def,
+ const virNetworkDef *def,
unsigned int flags)
{
- unsigned char *uuid;
+ const unsigned char *uuid;
char uuidstr[VIR_UUID_STRING_BUFLEN];
size_t i;
bool shortforward;
@@ -2746,7 +2746,7 @@ error:
}
char *
-virNetworkDefFormat(virNetworkDefPtr def,
+virNetworkDefFormat(const virNetworkDef *def,
unsigned int flags)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -3149,7 +3149,7 @@ char *virNetworkConfigFile(const char *dir,
return ret;
}
-int virNetworkBridgeInUse(const virNetworkObjListPtr nets,
+int virNetworkBridgeInUse(virNetworkObjListPtr nets,
const char *bridge,
const char *skipname)
{
@@ -3168,7 +3168,7 @@ int virNetworkBridgeInUse(const virNetworkObjListPtr nets,
return ret;
}
-char *virNetworkAllocateBridge(const virNetworkObjListPtr nets,
+char *virNetworkAllocateBridge(virNetworkObjListPtr nets,
const char *template)
{
@@ -3195,10 +3195,10 @@ char *virNetworkAllocateBridge(const virNetworkObjListPtr nets,
return NULL;
}
-int virNetworkSetBridgeName(const virNetworkObjListPtr nets,
+int virNetworkSetBridgeName(virNetworkObjListPtr nets,
virNetworkDefPtr def,
- int check_collision) {
-
+ int check_collision)
+{
int ret = -1;
if (def->bridge && !strstr(def->bridge, "%d")) {
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index b425986..e3ef285 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -284,14 +284,14 @@ struct _virNetworkObjList {
};
static inline int
-virNetworkObjIsActive(const virNetworkObjPtr net)
+virNetworkObjIsActive(const virNetworkObj *net)
{
return net->active;
}
-virNetworkObjPtr virNetworkFindByUUID(const virNetworkObjListPtr nets,
+virNetworkObjPtr virNetworkFindByUUID(virNetworkObjListPtr nets,
const unsigned char *uuid);
-virNetworkObjPtr virNetworkFindByName(const virNetworkObjListPtr nets,
+virNetworkObjPtr virNetworkFindByName(virNetworkObjListPtr nets,
const char *name);
@@ -304,10 +304,10 @@ typedef bool (*virNetworkObjListFilter)(virConnectPtr conn,
virNetworkDefPtr def);
virNetworkObjPtr virNetworkAssignDef(virNetworkObjListPtr nets,
- const virNetworkDefPtr def,
+ virNetworkDefPtr def,
bool live);
int virNetworkObjAssignDef(virNetworkObjPtr network,
- const virNetworkDefPtr def,
+ virNetworkDefPtr def,
bool live);
int virNetworkObjSetDefTransient(virNetworkObjPtr network, bool live);
void virNetworkObjUnsetDefTransient(virNetworkObjPtr network);
@@ -318,16 +318,16 @@ virNetworkDefPtr virNetworkDefCopy(virNetworkDefPtr def, unsigned
int flags);
int virNetworkConfigChangeSetup(virNetworkObjPtr dom, unsigned int flags);
void virNetworkRemoveInactive(virNetworkObjListPtr nets,
- const virNetworkObjPtr net);
+ virNetworkObjPtr net);
virNetworkDefPtr virNetworkDefParseString(const char *xmlStr);
virNetworkDefPtr virNetworkDefParseFile(const char *filename);
virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml,
xmlNodePtr root);
-char *virNetworkDefFormat(const virNetworkDefPtr def, unsigned int flags);
+char *virNetworkDefFormat(const virNetworkDef *def, unsigned int flags);
static inline const char *
-virNetworkDefForwardIf(const virNetworkDefPtr def, size_t n)
+virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
{
return ((def->forward.ifs && (def->forward.nifs > n) &&
def->forward.ifs[n].type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
@@ -338,10 +338,10 @@ virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net,
const char *portgroup);
virNetworkIpDefPtr
-virNetworkDefGetIpByIndex(const virNetworkDefPtr def,
+virNetworkDefGetIpByIndex(const virNetworkDef *def,
int family, size_t n);
-int virNetworkIpDefPrefix(const virNetworkIpDefPtr def);
-int virNetworkIpDefNetmask(const virNetworkIpDefPtr def,
+int virNetworkIpDefPrefix(const virNetworkIpDef *def);
+int virNetworkIpDefNetmask(const virNetworkIpDef *def,
virSocketAddrPtr netmask);
int virNetworkSaveXML(const char *configDir,
@@ -377,14 +377,14 @@ int virNetworkDeleteConfig(const char *configDir,
char *virNetworkConfigFile(const char *dir,
const char *name);
-int virNetworkBridgeInUse(const virNetworkObjListPtr nets,
+int virNetworkBridgeInUse(virNetworkObjListPtr nets,
const char *bridge,
const char *skipname);
-char *virNetworkAllocateBridge(const virNetworkObjListPtr nets,
+char *virNetworkAllocateBridge(virNetworkObjListPtr nets,
const char *template);
-int virNetworkSetBridgeName(const virNetworkObjListPtr nets,
+int virNetworkSetBridgeName(virNetworkObjListPtr nets,
virNetworkDefPtr def,
int check_collision);
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 799405e..171cd7c 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -72,7 +72,7 @@ virNodeDevCapsDefParseString(const char *xpath,
return 0;
}
-int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap)
+int virNodeDeviceHasCap(const virNodeDeviceObj *dev, const char *cap)
{
virNodeDevCapsDefPtr caps = dev->def->caps;
while (caps) {
@@ -85,7 +85,7 @@ int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap)
virNodeDeviceObjPtr
-virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
+virNodeDeviceFindBySysfsPath(virNodeDeviceObjListPtr devs,
const char *sysfs_path)
{
size_t i;
@@ -103,7 +103,7 @@ virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
}
-virNodeDeviceObjPtr virNodeDeviceFindByName(const virNodeDeviceObjListPtr devs,
+virNodeDeviceObjPtr virNodeDeviceFindByName(virNodeDeviceObjListPtr devs,
const char *name)
{
size_t i;
@@ -166,7 +166,7 @@ void virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs)
}
virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs,
- const virNodeDeviceDefPtr def)
+ virNodeDeviceDefPtr def)
{
virNodeDeviceObjPtr device;
@@ -201,7 +201,7 @@ virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr
devs,
}
void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
- const virNodeDeviceObjPtr dev)
+ virNodeDeviceObjPtr dev)
{
size_t i;
@@ -228,7 +228,7 @@ void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
}
}
-char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def)
+char *virNodeDeviceDefFormat(const virNodeDeviceDef *def)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
virNodeDevCapsDefPtr caps;
@@ -1394,7 +1394,7 @@ cleanup:
* Return the NPIV dev's parent device name
*/
int
-virNodeDeviceGetParentHost(const virNodeDeviceObjListPtr devs,
+virNodeDeviceGetParentHost(virNodeDeviceObjListPtr devs,
const char *dev_name,
const char *parent_name,
int *parent_host)
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index 1fa61b5..af8fedc 100644
--- a/src/conf/node_device_conf.h
+++ b/src/conf/node_device_conf.h
@@ -218,22 +218,22 @@ struct _virNodeDeviceDriverState {
};
-int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap);
+int virNodeDeviceHasCap(const virNodeDeviceObj *dev, const char *cap);
-virNodeDeviceObjPtr virNodeDeviceFindByName(const virNodeDeviceObjListPtr devs,
+virNodeDeviceObjPtr virNodeDeviceFindByName(virNodeDeviceObjListPtr devs,
const char *name);
virNodeDeviceObjPtr
-virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
+virNodeDeviceFindBySysfsPath(virNodeDeviceObjListPtr devs,
const char *sysfs_path)
ATTRIBUTE_NONNULL(2);
virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs,
- const virNodeDeviceDefPtr def);
+ virNodeDeviceDefPtr def);
void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
- const virNodeDeviceObjPtr dev);
+ virNodeDeviceObjPtr dev);
-char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def);
+char *virNodeDeviceDefFormat(const virNodeDeviceDef *def);
virNodeDeviceDefPtr virNodeDeviceDefParseString(const char *str,
int create,
@@ -250,7 +250,7 @@ int virNodeDeviceGetWWNs(virNodeDeviceDefPtr def,
char **wwnn,
char **wwpn);
-int virNodeDeviceGetParentHost(const virNodeDeviceObjListPtr devs,
+int virNodeDeviceGetParentHost(virNodeDeviceObjListPtr devs,
const char *dev_name,
const char *parent_name,
int *parent_host);
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index 335884e..282bc6e 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -1,7 +1,7 @@
/*
* secret_conf.c: internal <secret> XML handling
*
- * Copyright (C) 2009, 2011 Red Hat, Inc.
+ * Copyright (C) 2009, 2011, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -243,7 +243,7 @@ virSecretDefParseFile(const char *filename)
static int
virSecretDefFormatUsage(virBufferPtr buf,
- const virSecretDefPtr def)
+ const virSecretDef *def)
{
const char *type;
@@ -291,10 +291,10 @@ virSecretDefFormatUsage(virBufferPtr buf,
}
char *
-virSecretDefFormat(const virSecretDefPtr def)
+virSecretDefFormat(const virSecretDef *def)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
- unsigned char *uuid;
+ const unsigned char *uuid;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virBufferAsprintf(&buf, "<secret ephemeral='%s'
private='%s'>\n",
diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h
index a2ae0bc..54d7e76 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -1,7 +1,7 @@
/*
* secret_conf.h: internal <secret> XML handling API
*
- * Copyright (C) 2009-2010 Red Hat, Inc.
+ * Copyright (C) 2009-2010, 2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -46,7 +46,7 @@ struct _virSecretDef {
void virSecretDefFree(virSecretDefPtr def);
virSecretDefPtr virSecretDefParseString(const char *xml);
virSecretDefPtr virSecretDefParseFile(const char *filename);
-char *virSecretDefFormat(const virSecretDefPtr def);
+char *virSecretDefFormat(const virSecretDef *def);
# define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \
(VIR_CONNECT_LIST_SECRETS_EPHEMERAL | \
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 12c09b7..94a74d2 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -1,7 +1,7 @@
/*
* snapshot_conf.c: domain snapshot XML processing
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -689,7 +689,7 @@ static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr
snapshot)
}
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr
snapshots,
- const virDomainSnapshotDefPtr def)
+ virDomainSnapshotDefPtr def)
{
virDomainSnapshotObjPtr snap;
@@ -876,7 +876,7 @@ virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
}
virDomainSnapshotObjPtr
-virDomainSnapshotFindByName(const virDomainSnapshotObjListPtr snapshots,
+virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots,
const char *name)
{
return name ? virHashLookup(snapshots->objs, name) : &snapshots->metaroot;
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index e8f8179..ff3dca2 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -1,7 +1,7 @@
/*
* snapshot_conf.h: domain snapshot XML processing
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -119,7 +119,7 @@ int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot,
int default_snapshot,
bool require_match);
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr
snapshots,
- const virDomainSnapshotDefPtr def);
+ virDomainSnapshotDefPtr def);
int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from,
@@ -128,7 +128,7 @@ int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr
snapshots,
int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from,
unsigned int flags);
-virDomainSnapshotObjPtr virDomainSnapshotFindByName(const virDomainSnapshotObjListPtr
snapshots,
+virDomainSnapshotObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr
snapshots,
const char *name);
void virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot);
--
1.8.3.1