[libvirt] [PATCH v3] qemuDomainUndefineFlags: Fix error message

Michal Privoznik posted 1 patch 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/ff03b701a42a708186ad24bab97f4cc8b2603a35.1512993278.git.mprivozn@redhat.com
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH v3] qemuDomainUndefineFlags: Fix error message
Posted by Michal Privoznik 6 years, 4 months ago
https://bugzilla.redhat.com/show_bug.cgi?id=1522706

If domain is active, but the undefine API was called without the
VIR_DOMAIN_UNDEFINE_KEEP_NVRAM flag set, the following incorrect
error message is produced:

error: Requested operation is not valid: cannot delete inactive domain with nvram

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

Diff to v2:
- Drop state from the message completely

 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index aa30b119a..d18cea4d0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7538,7 +7538,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
             }
         } else if (!(flags & VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)) {
             virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                           _("cannot delete inactive domain with nvram"));
+                           _("cannot delete domain with nvram"));
             goto endjob;
         }
     }
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3] qemuDomainUndefineFlags: Fix error message
Posted by Jiri Denemark 6 years, 4 months ago
On Mon, Dec 11, 2017 at 12:55:32 +0100, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1522706
> 
> If domain is active, but the undefine API was called without the
> VIR_DOMAIN_UNDEFINE_KEEP_NVRAM flag set, the following incorrect
> error message is produced:
> 
> error: Requested operation is not valid: cannot delete inactive domain with nvram
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> 
> Diff to v2:
> - Drop state from the message completely
> 
>  src/qemu/qemu_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index aa30b119a..d18cea4d0 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -7538,7 +7538,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
>              }
>          } else if (!(flags & VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)) {
>              virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> -                           _("cannot delete inactive domain with nvram"));
> +                           _("cannot delete domain with nvram"));
>              goto endjob;
>          }
>      }

ACK if s/delete/undefine/ as suggested in my reply to v2.

Jirka

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