[libvirt] [PATCH] qemu: Provide a much clearer message on device hot-plug

Erik Skultety posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/b354563123bc63ea58408a00eb67b759eaf7a50c.1494509996.git.eskultet@redhat.com
src/qemu/qemu_hotplug.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
[libvirt] [PATCH] qemu: Provide a much clearer message on device hot-plug
Posted by Erik Skultety 6 years, 11 months ago
Adjust the current message to make it clear, that it is the hot-plug
operation that is unsupported with the given host device type.

https://bugzilla.redhat.com/show_bug.cgi?id=1450072

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
 src/qemu/qemu_hotplug.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4ca10863c..1b8504b13 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2674,7 +2674,7 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
 {
     if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("hostdev mode '%s' not supported"),
+                       _("hot-plug is not supported for hostdev mode '%s'"),
                        virDomainHostdevModeTypeToString(hostdev->mode));
         return -1;
     }
@@ -2705,7 +2705,8 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
 
     default:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("hostdev subsys type '%s' not supported"),
+                       _("hot-plug is not supported for hostdev subsys type "
+                         "'%s'"),
                        virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
         goto error;
     }
@@ -4820,7 +4821,8 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
         break;
     default:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("hostdev subsys type '%s' not supported"),
+                       _("hot-unplug is not supported for hostdev subsys type "
+                         "'%s'"),
                        virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
         return -1;
     }
@@ -4852,7 +4854,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
 
     if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("hostdev mode '%s' not supported"),
+                       _("hot-unplug is not supported for hostdev mode '%s'"),
                        virDomainHostdevModeTypeToString(hostdev->mode));
         return -1;
     }
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Provide a much clearer message on device hot-plug
Posted by Peter Krempa 6 years, 11 months ago
On Thu, May 11, 2017 at 15:40:29 +0200, Erik Skultety wrote:
> Adjust the current message to make it clear, that it is the hot-plug
> operation that is unsupported with the given host device type.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1450072
> 
> Signed-off-by: Erik Skultety <eskultet@redhat.com>
> ---


>  src/qemu/qemu_hotplug.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 4ca10863c..1b8504b13 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -2674,7 +2674,7 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
>  {
>      if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> -                       _("hostdev mode '%s' not supported"),
> +                       _("hot-plug is not supported for hostdev mode '%s'"),

Libvirt tends to use hotplug (one word) mainly ...

>                         virDomainHostdevModeTypeToString(hostdev->mode));
>          return -1;
>      }
> @@ -2705,7 +2705,8 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
>  
>      default:
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> -                       _("hostdev subsys type '%s' not supported"),
> +                       _("hot-plug is not supported for hostdev subsys type "

Same as above.

> +                         "'%s'"),

Please don't break this string.

>                         virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
>          goto error;
>      }
> @@ -4820,7 +4821,8 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
>          break;
>      default:
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> -                       _("hostdev subsys type '%s' not supported"),
> +                       _("hot-unplug is not supported for hostdev subsys type "

A quick grep hints that we use "hot unplug" without the hyphen.

> +                         "'%s'"),

Please don't break this string.

>                         virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
>          return -1;
>      }
> @@ -4852,7 +4854,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
>  
>      if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> -                       _("hostdev mode '%s' not supported"),
> +                       _("hot-unplug is not supported for hostdev mode '%s'"),
>                         virDomainHostdevModeTypeToString(hostdev->mode));
>          return -1;

ACK if you fix the points above
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list