mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vbox_tmpl.c: remove useless array-is-non-NULL comparisons
* src/vbox/vbox_tmpl.c (vboxStorageVolDelete): Remove always-true array-is-non-NULL test. git grep 'key\[.*\];'|grep -F .h src/datatypes.h: char key[PATH_MAX]; (vboxStorageVolGetInfo): Likewise. (vboxStorageVolGetXMLDesc): Likewise. (vboxStorageVolGetPath): Likewise. (vboxDomainDefineXML): Likewise. (but now with "mac[]")
This commit is contained in:
parent
0a6a6f5e61
commit
1867004ed1
@ -4084,9 +4084,7 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VBOX_UTF8_TO_UTF16(macaddrvbox, &MACAddress);
|
VBOX_UTF8_TO_UTF16(macaddrvbox, &MACAddress);
|
||||||
if (def->nets[i]->mac) {
|
|
||||||
adapter->vtbl->SetMACAddress(adapter, MACAddress);
|
adapter->vtbl->SetMACAddress(adapter, MACAddress);
|
||||||
}
|
|
||||||
VBOX_UTF16_FREE(MACAddress);
|
VBOX_UTF16_FREE(MACAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6645,9 +6643,6 @@ static int vboxStorageVolDelete(virStorageVolPtr vol,
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
if (!vol->key)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
||||||
if (!hddIID)
|
if (!hddIID)
|
||||||
return ret;
|
return ret;
|
||||||
@ -6774,8 +6769,7 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info
|
|||||||
vboxIID *hddIID = NULL;
|
vboxIID *hddIID = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
|
|
||||||
if ( !vol->key
|
if (!info)
|
||||||
|| !info)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
||||||
@ -6824,9 +6818,6 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags A
|
|||||||
int defOk = 0;
|
int defOk = 0;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
|
|
||||||
if (!vol->key)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
memset(&pool, 0, sizeof(pool));
|
memset(&pool, 0, sizeof(pool));
|
||||||
memset(&def, 0, sizeof(def));
|
memset(&def, 0, sizeof(def));
|
||||||
|
|
||||||
@ -6919,9 +6910,6 @@ static char *vboxStorageVolGetPath(virStorageVolPtr vol) {
|
|||||||
vboxIID *hddIID = NULL;
|
vboxIID *hddIID = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
|
|
||||||
if (!vol->key)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
vboxUtf8toIID(vol->conn, vol->key, &hddIID);
|
||||||
if (!hddIID)
|
if (!hddIID)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user