All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/domctl: Improve XEN_DOMCTL_hypercall_init error handling
@ 2015-03-11 12:56 Andrew Cooper
  2015-03-11 13:42 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cooper @ 2015-03-11 12:56 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell, Jan Beulich, Wei Liu

EACCES cannot be distinguished against an incorrect DOMCTL_INTERFACE_VERSION,
and will cause an incorrect "need to rebuild the user-space tool set?" message
from libxc.  EINVAL is a perfectly reasonable alternative.

On the libxc side, put the useful piece of information in the error message,
rathe than the -1 from do_domctl().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_boot.c |    6 +++---
 xen/arch/x86/domctl.c     |    4 +---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index a141eb5..f82db2d 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -57,9 +57,9 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
     domctl.u.hypercall_init.gmfn = xc_dom_p2m_guest(dom, pfn);
     rc = do_domctl(dom->xch, &domctl);
     if ( rc != 0 )
-        xc_dom_panic(dom->xch,
-                     XC_INTERNAL_ERROR, "%s: HYPERCALL_INIT failed (rc=%d)",
-                     __FUNCTION__, rc);
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: HYPERCALL_INIT failed: %d - %s)",
+                     __FUNCTION__, errno, strerror(errno));
     return rc;
 }
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 3e5bef1..3ffb083 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -386,16 +386,14 @@ long arch_do_domctl(
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
-        ret = -EACCES;
         if ( !page || !get_page_type(page, PGT_writable_page) )
         {
+            ret = -EINVAL;
             if ( page )
                 put_page(page);
             break;
         }
 
-        ret = 0;
-
         hypercall_page = __map_domain_page(page);
         hypercall_page_initialise(d, hypercall_page);
         unmap_domain_page(hypercall_page);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH v2 0/6] tools/libxl: Improvements to libxl__datacopier
@ 2015-03-06 19:05 Andrew Cooper
  2015-03-06 19:05 ` [PATCH v2 1/6] tools/libxl: Introduce min and max macros Andrew Cooper
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cooper @ 2015-03-06 19:05 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Ian Campbell, Wen Congyang, Andrew Cooper, Ian Jackson,
	Ross Lagerwall

To support migration v2, we need far more flexibility out of the datacopier.

This series adds the ability to read from an fd into a local buffer and to
copy a specific number of bytes rather than to EOF.  It also contains bugfixes
related to writing from a local buffer, and POLLHUP handling.

Changes in v2:
 * Rewrite most commit message (but no code change)
 * Rework the POLLHUP fix from scratch

Andrew Cooper (2):
  tools/libxl: Introduce min and max macros
  tools/libxl: Fix datacopier POLLHUP handling to not always be fatal

Ross Lagerwall (3):
  tools/libxl: Allow adding larger amounts of prefixdata to datacopier
  tools/libxl: Allow limiting amount copied by datacopier
  tools/libxl: Extend datacopier to support reading into a buffer

Wen Congyang (1):
  tools/libxl: Update datacopier to support sending data only

 tools/libxl/libxl_aoutils.c    |  121 +++++++++++++++++++++++++---------------
 tools/libxl/libxl_bootloader.c |   24 +++++++-
 tools/libxl/libxl_dom.c        |    1 +
 tools/libxl/libxl_internal.h   |   35 ++++++++++--
 4 files changed, 129 insertions(+), 52 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-13 14:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 12:56 [PATCH] x86/domctl: Improve XEN_DOMCTL_hypercall_init error handling Andrew Cooper
2015-03-11 13:42 ` Jan Beulich
2015-03-12 11:01   ` [PATCH v2 1/6] tools/libxl: Introduce min and max macros Andrew Cooper
2015-03-12 11:02     ` Andrew Cooper
2015-03-12 11:03   ` [PATCH v2] x86/domctl: Improve XEN_DOMCTL_hypercall_init error handling Andrew Cooper
2015-03-12 11:31     ` Jan Beulich
2015-03-13 14:09     ` Wei Liu
  -- strict thread matches above, loose matches on Subject: below --
2015-03-06 19:05 [PATCH v2 0/6] tools/libxl: Improvements to libxl__datacopier Andrew Cooper
2015-03-06 19:05 ` [PATCH v2 1/6] tools/libxl: Introduce min and max macros Andrew Cooper
2015-03-11 12:07   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.