[PATCH] lib: Specify domain redefinition requirements

Roman Bolshakov posted 1 patch 2 years, 10 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210630161633.37591-1-r.bolshakov@yadro.com
src/libvirt-domain.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] lib: Specify domain redefinition requirements
Posted by Roman Bolshakov 2 years, 10 months ago
There might be misunderstanding [1] when libvirt permits domain
redefinition and if it's a valid case at all.

1. https://github.com/ansible-collections/community.libvirt/blob/b973d7c4b405818b9fe77bbb0432c67acc12e82f/plugins/modules/virt.py#L533

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 src/libvirt-domain.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 750e32f0ca..e48f3cdb02 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -6290,8 +6290,8 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *disk,
  *
  * Define a domain, but does not start it.
  * This definition is persistent, until explicitly undefined with
- * virDomainUndefine(). A previous definition for this domain would be
- * overridden if it already exists.
+ * virDomainUndefine(). A previous definition for this domain with the same
+ * UUID and name would be overridden if it already exists.
  *
  * virDomainFree should be used to free the resources after the
  * domain object is no longer needed.
@@ -6333,8 +6333,8 @@ virDomainDefineXML(virConnectPtr conn, const char *xml)
  *
  * Defines a domain, but does not start it.
  * This definition is persistent, until explicitly undefined with
- * virDomainUndefine(). A previous definition for this domain would be
- * overridden if it already exists.
+ * virDomainUndefine(). A previous definition for this domain with the same
+ * UUID and name would be overridden if it already exists.
  *
  * virDomainFree should be used to free the resources after the
  * domain object is no longer needed.
-- 
2.32.0


Re: [PATCH] lib: Specify domain redefinition requirements
Posted by Michal Prívozník 2 years, 10 months ago
On 6/30/21 6:16 PM, Roman Bolshakov wrote:
> There might be misunderstanding [1] when libvirt permits domain
> redefinition and if it's a valid case at all.
> 
> 1. https://github.com/ansible-collections/community.libvirt/blob/b973d7c4b405818b9fe77bbb0432c67acc12e82f/plugins/modules/virt.py#L533
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  src/libvirt-domain.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
> index 750e32f0ca..e48f3cdb02 100644
> --- a/src/libvirt-domain.c
> +++ b/src/libvirt-domain.c
> @@ -6290,8 +6290,8 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *disk,
>   *
>   * Define a domain, but does not start it.
>   * This definition is persistent, until explicitly undefined with
> - * virDomainUndefine(). A previous definition for this domain would be
> - * overridden if it already exists.
> + * virDomainUndefine(). A previous definition for this domain with the same
> + * UUID and name would be overridden if it already exists.
>   *
>   * virDomainFree should be used to free the resources after the
>   * domain object is no longer needed.
> @@ -6333,8 +6333,8 @@ virDomainDefineXML(virConnectPtr conn, const char *xml)
>   *
>   * Defines a domain, but does not start it.
>   * This definition is persistent, until explicitly undefined with
> - * virDomainUndefine(). A previous definition for this domain would be
> - * overridden if it already exists.
> + * virDomainUndefine(). A previous definition for this domain with the same
> + * UUID and name would be overridden if it already exists.
>   *
>   * virDomainFree should be used to free the resources after the
>   * domain object is no longer needed.
> 

This is true for other objects too, btw (like networks, pools, ...). Anyway:

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and pushed.

Michal