All callers pass NULL as the value. Remove the argument.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
* @def: domain definition to look for the disk
* @nodename: block backend node name to find
* @src: filled with the specific backing store element if provided
- * @idx: index of @src in the backing chain, if provided
*
* Looks up the disk in the domain via @nodename and returns its definition.
* Optionally fills @src and @idx if provided with the specific backing chain
virDomainDiskDefPtr
qemuDomainDiskLookupByNodename(virDomainDefPtr def,
const char *nodename,
- virStorageSourcePtr *src,
- unsigned int *idx)
+ virStorageSourcePtr *src)
{
size_t i;
- unsigned int srcindex;
virStorageSourcePtr tmp = NULL;
- if (!idx)
- idx = &srcindex;
-
if (src)
*src = NULL;
- *idx = 0;
-
for (i = 0; i < def->ndisks; i++) {
if ((tmp = virStorageSourceFindByNodeName(def->disks[i]->src,
- nodename, idx))) {
+ nodename, NULL))) {
if (src)
*src = tmp;
virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def,
const char *nodename,
- virStorageSourcePtr *src,
- unsigned int *idx);
+ virStorageSourcePtr *src);
char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
unsigned int idx);
if (diskAlias)
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL);
else if (nodename)
- disk = qemuDomainDiskLookupByNodename(vm->def, nodename, NULL, NULL);
+ disk = qemuDomainDiskLookupByNodename(vm->def, nodename, NULL);
else
disk = NULL;
"threshold '%llu' exceeded by '%llu'",
nodename, vm, vm->def->name, threshold, excess);
- if ((disk = qemuDomainDiskLookupByNodename(vm->def, nodename, &src, NULL))) {
+ if ((disk = qemuDomainDiskLookupByNodename(vm->def, nodename, &src))) {
if (virStorageSourceIsLocalStorage(src))
path = src->path;