mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
phyp: prefer memcpy over memmove when legal
* src/phyp/phyp_driver.c (phypUUIDTable_AddLpar) (phypGetLparUUID, phypGetStoragePoolUUID, phypVolumeGetXMLDesc) (phypGetStoragePoolXMLDesc): Use faster method.
This commit is contained in:
parent
f61785225d
commit
e00c892f0b
@ -624,7 +624,7 @@ phypUUIDTable_AddLpar(virConnectPtr conn, unsigned char *uuid, int id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuid_table->lpars[i]->id = id;
|
uuid_table->lpars[i]->id = id;
|
||||||
memmove(uuid_table->lpars[i]->uuid, uuid, VIR_UUID_BUFLEN);
|
memcpy(uuid_table->lpars[i]->uuid, uuid, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
if (phypUUIDTable_WriteFile(conn) == -1)
|
if (phypUUIDTable_WriteFile(conn) == -1)
|
||||||
goto err;
|
goto err;
|
||||||
@ -1388,7 +1388,7 @@ phypGetLparUUID(unsigned char *uuid, int lpar_id, virConnectPtr conn)
|
|||||||
|
|
||||||
for (i = 0; i < uuid_table->nlpars; i++) {
|
for (i = 0; i < uuid_table->nlpars; i++) {
|
||||||
if (lpars[i]->id == lpar_id) {
|
if (lpars[i]->id == lpar_id) {
|
||||||
memmove(uuid, lpars[i]->uuid, VIR_UUID_BUFLEN);
|
memcpy(uuid, lpars[i]->uuid, VIR_UUID_BUFLEN);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2609,7 +2609,7 @@ phypGetStoragePoolUUID(virConnectPtr conn, unsigned char *uuid,
|
|||||||
if (exit_status < 0 || ret == NULL)
|
if (exit_status < 0 || ret == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (memmove(uuid, ret, VIR_UUID_BUFLEN) == NULL)
|
if (memcpy(uuid, ret, VIR_UUID_BUFLEN) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
result = 0;
|
result = 0;
|
||||||
@ -2657,7 +2657,7 @@ phypVolumeGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memmove(pool.uuid, sp->uuid, VIR_UUID_BUFLEN) == NULL) {
|
if (memcpy(pool.uuid, sp->uuid, VIR_UUID_BUFLEN) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage sp's uuid."));
|
VIR_ERROR0(_("Unable to determine storage sp's uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@ -3241,7 +3241,7 @@ phypGetStoragePoolXMLDesc(virStoragePoolPtr pool, unsigned int flags)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memmove(def.uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
if (memcpy(def.uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's uuid."));
|
VIR_ERROR0(_("Unable to determine storage pool's uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user