[libvirt] [PATCH 05/11] conf: Add function description for virDomainDefPostParse

Marc Hartmayer posted 11 patches 7 years, 4 months ago
[libvirt] [PATCH 05/11] conf: Add function description for virDomainDefPostParse
Posted by Marc Hartmayer 7 years, 4 months ago
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
---
 src/conf/domain_conf.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a3f2fcb0a001..3c307d325a89 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5215,6 +5215,19 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def,
 }
 
 
+/**
+ * virDomainDefPostParse:
+ * @def: domain definition
+ * @caps: driver capabilities object
+ * @parseFlags: virDomainDefParseFlags
+ * @xmlopt: XML parser option object
+ * @parseOpaque: opaque data and it might be NULL (for QEMU driver it's qemuCaps)
+ *
+ * This function does various common and hypervisor specific auto
+ * generation, verification, and validation.
+ *
+ * Returns 0 on success, -1 on error
+ */
 int
 virDomainDefPostParse(virDomainDefPtr def,
                       virCapsPtr caps,
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 05/11] conf: Add function description for virDomainDefPostParse
Posted by John Ferlan 7 years, 4 months ago

On 9/20/18 1:44 PM, Marc Hartmayer wrote:
> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
> ---
>  src/conf/domain_conf.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index a3f2fcb0a001..3c307d325a89 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -5215,6 +5215,19 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def,
>  }
>  
>  
> +/**
> + * virDomainDefPostParse:
> + * @def: domain definition
> + * @caps: driver capabilities object
> + * @parseFlags: virDomainDefParseFlags
> + * @xmlopt: XML parser option object
> + * @parseOpaque: opaque data and it might be NULL (for QEMU driver it's qemuCaps)
> + *
> + * This function does various common and hypervisor specific auto
> + * generation, verification, and validation.

I think this is a good start. I'd really like to see what the
"expectations" are for various @parseFlags. By far one of the more
confusing things. Also while we're at it - @parseOpaque details and/or
assumptions w/r/t whether it should be provided or not.

I also note a few callers use the comment "/* callback to fill driver
specific domain aspects */", so that maybe good to pull in...

John

> + *
> + * Returns 0 on success, -1 on error
> + */
>  int
>  virDomainDefPostParse(virDomainDefPtr def,
>                        virCapsPtr caps,
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 05/11] conf: Add function description for virDomainDefPostParse
Posted by Marc Hartmayer 7 years, 4 months ago
On Sat, Sep 29, 2018 at 04:08 AM +0200, John Ferlan <jferlan@redhat.com> wrote:
> On 9/20/18 1:44 PM, Marc Hartmayer wrote:
>> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
>> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
>> ---
>>  src/conf/domain_conf.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index a3f2fcb0a001..3c307d325a89 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -5215,6 +5215,19 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def,
>>  }
>>
>>
>> +/**
>> + * virDomainDefPostParse:
>> + * @def: domain definition
>> + * @caps: driver capabilities object
>> + * @parseFlags: virDomainDefParseFlags
>> + * @xmlopt: XML parser option object
>> + * @parseOpaque: opaque data and it might be NULL (for QEMU driver it's qemuCaps)
>> + *
>> + * This function does various common and hypervisor specific auto
>> + * generation, verification, and validation.
>
> I think this is a good start. I'd really like to see what the
> "expectations" are for various @parseFlags. By far one of the more
> confusing things. Also while we're at it - @parseOpaque details and/or
> assumptions w/r/t whether it should be provided or not.

I really hope this function will be divided into separate functions in
some time… Currently, it does way _too_ many things.

>
> I also note a few callers use the comment "/* callback to fill driver
> specific domain aspects */", so that maybe good to pull in...

Okay.

>
> John
>
>> + *
>> + * Returns 0 on success, -1 on error
>> + */
>>  int
>>  virDomainDefPostParse(virDomainDefPtr def,
>>                        virCapsPtr caps,
>>
>
--
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list