mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
Remove unnecessary check for non-NULL uuid
The first thing we do in all these functions is to check uuid != NULL and fail if it isn't.
This commit is contained in:
parent
30ec755ecb
commit
c5ec45a3a4
@ -369,7 +369,6 @@ virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
|
|||||||
ret->magic = VIR_DOMAIN_MAGIC;
|
ret->magic = VIR_DOMAIN_MAGIC;
|
||||||
ret->conn = conn;
|
ret->conn = conn;
|
||||||
ret->id = -1;
|
ret->id = -1;
|
||||||
if (uuid != NULL)
|
|
||||||
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
||||||
ret->snapshots = virHashCreate(20);
|
ret->snapshots = virHashCreate(20);
|
||||||
|
|
||||||
@ -515,7 +514,6 @@ virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) {
|
|||||||
}
|
}
|
||||||
ret->magic = VIR_NETWORK_MAGIC;
|
ret->magic = VIR_NETWORK_MAGIC;
|
||||||
ret->conn = conn;
|
ret->conn = conn;
|
||||||
if (uuid != NULL)
|
|
||||||
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
if (virHashAddEntry(conn->networks, uuidstr, ret) < 0) {
|
if (virHashAddEntry(conn->networks, uuidstr, ret) < 0) {
|
||||||
@ -837,7 +835,6 @@ virGetStoragePool(virConnectPtr conn, const char *name, const unsigned char *uui
|
|||||||
}
|
}
|
||||||
ret->magic = VIR_STORAGE_POOL_MAGIC;
|
ret->magic = VIR_STORAGE_POOL_MAGIC;
|
||||||
ret->conn = conn;
|
ret->conn = conn;
|
||||||
if (uuid != NULL)
|
|
||||||
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
if (virHashAddEntry(conn->storagePools, uuidstr, ret) < 0) {
|
if (virHashAddEntry(conn->storagePools, uuidstr, ret) < 0) {
|
||||||
@ -1452,7 +1449,6 @@ virGetNWFilter(virConnectPtr conn, const char *name, const unsigned char *uuid)
|
|||||||
}
|
}
|
||||||
ret->magic = VIR_NWFILTER_MAGIC;
|
ret->magic = VIR_NWFILTER_MAGIC;
|
||||||
ret->conn = conn;
|
ret->conn = conn;
|
||||||
if (uuid != NULL)
|
|
||||||
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
if (virHashAddEntry(conn->nwfilterPools, uuidstr, ret) < 0) {
|
if (virHashAddEntry(conn->nwfilterPools, uuidstr, ret) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user