[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/3] Introduce virDomainFSIndexByName



On 03.06.2012 22:55, Guido Günther wrote:
> for containers matching virDomainDiskIndexByName.
> ---
>  src/conf/domain_conf.c |   16 ++++++++++++++++
>  src/conf/domain_conf.h |    1 +
>  2 files changed, 17 insertions(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index bd7b520..c34ce26 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 7642720..e2f56fb 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -2087,6 +2087,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);
>  

ACK with adding virDomainFSIndexByName into libvirt_private.syms:

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index fdf2186..a452e62 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -319,6 +319,7 @@ virDomainDiskSnapshotTypeToString;
 virDomainDiskTypeFromString;
 virDomainDiskTypeToString;
 virDomainFSDefFree;
+virDomainFSIndexByName;
 virDomainFSTypeFromString;
 virDomainFSTypeToString;
 virDomainFSWrpolicyTypeFromString;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]