diff mbox

[v2,for-4.7,6/6] libxl: fix usage of XEN_EOPNOTSUPP

Message ID 1462272910-41200-7-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné May 3, 2016, 10:55 a.m. UTC
The errno values returned by libxc are already translated into the
underlying OS error space, so it's wrong to compare them against Xen error
codes.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_dom_save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Liu May 3, 2016, 11:31 a.m. UTC | #1
On Tue, May 03, 2016 at 12:55:10PM +0200, Roger Pau Monne wrote:
> The errno values returned by libxc are already translated into the
> underlying OS error space, so it's wrong to compare them against Xen error
> codes.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

Ian, this should be backported to 4.6.

Wei.

> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
>  tools/libxl/libxl_dom_save.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c
> index 076be04..579039f 100644
> --- a/tools/libxl/libxl_dom_save.c
> +++ b/tools/libxl/libxl_dom_save.c
> @@ -386,7 +386,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
>       */
>      ret = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes, &nr_vmemranges,
>                               &nr_vcpus, NULL, NULL, NULL);
> -    if (ret != -1 || errno != XEN_EOPNOTSUPP) {
> +    if (ret != -1 || errno != EOPNOTSUPP) {
>          LOG(ERROR, "Cannot save a guest with vNUMA configured");
>          rc = ERROR_FAIL;
>          goto out;
> -- 
> 2.6.4 (Apple Git-63)
>
diff mbox

Patch

diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c
index 076be04..579039f 100644
--- a/tools/libxl/libxl_dom_save.c
+++ b/tools/libxl/libxl_dom_save.c
@@ -386,7 +386,7 @@  void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
      */
     ret = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes, &nr_vmemranges,
                              &nr_vcpus, NULL, NULL, NULL);
-    if (ret != -1 || errno != XEN_EOPNOTSUPP) {
+    if (ret != -1 || errno != EOPNOTSUPP) {
         LOG(ERROR, "Cannot save a guest with vNUMA configured");
         rc = ERROR_FAIL;
         goto out;