[libvirt] [PATCH] vz: correct error message

Mikhail Feoktistov posted 1 patch 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1487590856-299787-1-git-send-email-mfeoktistov@virtuozzo.com
src/vz/vz_sdk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[libvirt] [PATCH] vz: correct error message
Posted by Mikhail Feoktistov 7 years, 1 month ago
---
 src/vz/vz_sdk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index e16bb0c..84e89a5 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2601,8 +2601,10 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
         def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) {
 
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("on_reboot, on_poweroff and on_crash parameters "
-                         "are not supported by vz driver"));
+                       _("The following parameters must be "
+                         "on_reboot = restart, on_poweroff = destroy, "
+                         "on_crash = destroy. "
+                         "Different actions are not supported by vz driver"));
         return -1;
     }
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] vz: correct error message
Posted by John Ferlan 7 years, 1 month ago

On 02/20/2017 06:40 AM, Mikhail Feoktistov wrote:
> ---
>  src/vz/vz_sdk.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Not sure you can take this route since "destroy" and "restart" are
translatable from domain_conf POV.

If you really wanted to make this ugly...  Using
virDomainLifecycleTypeToString to convert VIR_DOMAIN_LIFECYCLE_RESTART
and VIR_DOMAIN_LIFECYCLE_DESTROY

Perhaps wording such as "lifecycle settings for vz driver must be '%s'
for on_reboot and '%s' for on_poweroff and on_crash".

John

> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index e16bb0c..84e89a5 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -2601,8 +2601,10 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
>          def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) {
>  
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -                       _("on_reboot, on_poweroff and on_crash parameters "
> -                         "are not supported by vz driver"));
> +                       _("The following parameters must be "
> +                         "on_reboot = restart, on_poweroff = destroy, "
> +                         "on_crash = destroy. "
> +                         "Different actions are not supported by vz driver"));
>          return -1;
>      }
>  
> 

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