提交 335f6bc2 编写于 作者: L Laine Stump 提交者: Daniel Veillard

Rename variable for compilation in Mingw32 (end)

* qemud/remote.c src/interface_conf.[ch] src/veth.[ch]: more renaming
  from interface to iface
上级 e4c48e02
......@@ -61,7 +61,7 @@
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);
static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface interface);
static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface iface);
static virStoragePoolPtr get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool);
static virStorageVolPtr get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol);
static void make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src);
......
......@@ -1207,51 +1207,51 @@ virInterfaceObjPtr virInterfaceAssignDef(virConnectPtr conn,
virInterfaceObjListPtr interfaces,
const virInterfaceDefPtr def)
{
virInterfaceObjPtr interface;
virInterfaceObjPtr iface;
if ((interface = virInterfaceFindByName(interfaces, def->name))) {
if (interface->def)
virInterfaceDefFree(interface->def);
interface->def = def;
if ((iface = virInterfaceFindByName(interfaces, def->name))) {
if (iface->def)
virInterfaceDefFree(iface->def);
iface->def = def;
return interface;
return iface;
}
if (VIR_ALLOC(interface) < 0) {
if (VIR_ALLOC(iface) < 0) {
virReportOOMError(conn);
return NULL;
}
if (virMutexInit(&interface->lock) < 0) {
if (virMutexInit(&iface->lock) < 0) {
virInterfaceReportError(conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot initialize mutex"));
VIR_FREE(interface);
VIR_FREE(iface);
return NULL;
}
virInterfaceObjLock(interface);
interface->def = def;
virInterfaceObjLock(iface);
iface->def = def;
if (VIR_REALLOC_N(interfaces->objs, interfaces->count + 1) < 0) {
virReportOOMError(conn);
VIR_FREE(interface);
VIR_FREE(iface);
return NULL;
}
interfaces->objs[interfaces->count] = interface;
interfaces->objs[interfaces->count] = iface;
interfaces->count++;
return interface;
return iface;
}
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
const virInterfaceObjPtr interface)
const virInterfaceObjPtr iface)
{
unsigned int i;
virInterfaceObjUnlock(interface);
virInterfaceObjUnlock(iface);
for (i = 0 ; i < interfaces->count ; i++) {
virInterfaceObjLock(interfaces->objs[i]);
if (interfaces->objs[i] == interface) {
if (interfaces->objs[i] == iface) {
virInterfaceObjUnlock(interfaces->objs[i]);
virInterfaceObjFree(interfaces->objs[i]);
......
......@@ -186,14 +186,14 @@ virInterfaceObjPtr virInterfaceFindByName(const virInterfaceObjListPtr
void virInterfaceDefFree(virInterfaceDefPtr def);
void virInterfaceObjFree(virInterfaceObjPtr interface);
void virInterfaceObjFree(virInterfaceObjPtr iface);
void virInterfaceObjListFree(virInterfaceObjListPtr vms);
virInterfaceObjPtr virInterfaceAssignDef(virConnectPtr conn,
virInterfaceObjListPtr interfaces,
const virInterfaceDefPtr def);
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
const virInterfaceObjPtr interface);
const virInterfaceObjPtr iface);
virInterfaceDefPtr virInterfaceDefParseString(virConnectPtr conn,
const char *xmlStr);
......
......@@ -191,16 +191,16 @@ error_out:
*
* Returns 0 on success or -1 in case of error
*/
int moveInterfaceToNetNs(const char* interface, int pidInNs)
int moveInterfaceToNetNs(const char* iface, int pidInNs)
{
int rc = -1;
char *pid = NULL;
const char *argv[] = {
"ip", "link", "set", interface, "netns", NULL, NULL
"ip", "link", "set", iface, "netns", NULL, NULL
};
int cmdResult;
if (NULL == interface) {
if (NULL == iface) {
goto error_out;
}
......
......@@ -19,6 +19,6 @@ int vethCreate(char* veth1, int veth1MaxLen, char* veth2,
int veth2MaxLen);
int vethDelete(const char* veth);
int vethInterfaceUpOrDown(const char* veth, int upOrDown);
int moveInterfaceToNetNs(const char *interface, int pidInNs);
int moveInterfaceToNetNs(const char *iface, int pidInNs);
#endif /* VETH_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册