diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 221e1d0a25e685193e2911d2210680685ff9b5a1..8d80f3b01710d64087c94ed53e4a5628a7408ac7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11265,6 +11265,22 @@ virDomainControllerDefFormat(virBufferPtr buf, return 0; } + +int +virDomainFSIndexByName(virDomainDefPtr def, const char *name) +{ + virDomainFSDefPtr fs; + int i; + + for (i = 0; i < def->nfss; i++) { + fs = def->fss[i]; + if (STREQ(fs->dst, name)) + return i; + } + return -1; +} + + static int virDomainFSDefFormat(virBufferPtr buf, virDomainFSDefPtr def, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8d5b35a2b2cf8d75418a65a3f3a4a6cbc3b5fa24..d627ad82e88c5709dec0e5dc1cd3e2eca7d9dc54 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2085,6 +2085,7 @@ int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk, int *devIdx); virDomainFSDefPtr virDomainGetRootFilesystem(virDomainDefPtr def); +int virDomainFSIndexByName(virDomainDefPtr def, const char *name); int virDomainVideoDefaultType(virDomainDefPtr def); int virDomainVideoDefaultRAM(virDomainDefPtr def, int type); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index ef8047d75ddcc68308a84e380a44792b1946d6d5..ea0e59b659ecce75b6f12edd66e4baee0db6998b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -320,6 +320,7 @@ virDomainDiskSnapshotTypeToString; virDomainDiskTypeFromString; virDomainDiskTypeToString; virDomainFSDefFree; +virDomainFSIndexByName; virDomainFSTypeFromString; virDomainFSTypeToString; virDomainFSWrpolicyTypeFromString;