All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] tools changes
@ 2014-03-06 16:13 Olaf Hering
  2014-03-06 16:13 ` [PATCH 01/11] docs: remove ia64 from kexec_and_kdump.txt Olaf Hering
                   ` (13 more replies)
  0 siblings, 14 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Resend of changes from the 4.4 freeze time.

Olaf Hering (11):
  docs: remove ia64 from kexec_and_kdump.txt
  unmodified_drivers: remove ia64 parts of the code
  docs: remove ia64 from tmem-internals.html
  stubdom: remove ia64 from stubdom
  libxc: remove ia64 from xg_private.h
  pygrub: remote ia64 from pygrub
  xend: remove ia64 from xend sources
  libxl: add option for discard support to xl disk configuration
  tools/xc: pass errno to callers of xc_domain_save
  xend/pvscsi: recognize also SCSI CDROM devices
  tools/xend: move assert to exception block

 docs/misc/kexec_and_kdump.txt                      |  9 +--
 docs/misc/tmem-internals.html                      |  7 --
 docs/misc/xl-disk-configuration.txt                | 15 ++++
 stubdom/Makefile                                   |  3 -
 stubdom/newlib.patch                               | 22 ------
 tools/libxc/xc_domain_save.c                       | 88 ++++++++++++++++++++--
 tools/libxc/xg_private.h                           |  4 -
 tools/libxl/check-xl-disk-parse                    | 21 ++++--
 tools/libxl/libxl.c                                |  3 +
 tools/libxl/libxl.h                                |  5 ++
 tools/libxl/libxl_types.idl                        |  1 +
 tools/libxl/libxlu_disk_l.l                        |  4 +
 tools/pygrub/src/pygrub                            | 35 +++------
 tools/python/xen/util/vscsi_util.py                |  3 +
 tools/python/xen/xend/XendCheckpoint.py            |  6 +-
 tools/python/xen/xend/XendNode.py                  | 10 ---
 tools/python/xen/xend/arch.py                      |  1 -
 tools/python/xen/xend/image.py                     | 56 --------------
 tools/python/xen/xend/server/pciif.py              |  2 +-
 tools/xm-test/lib/XmTestLib/arch.py                | 14 +---
 tools/xm-test/lib/XmTestReport/arch.py             |  4 -
 .../linux-2.6/compat-include/xen/platform-compat.h |  4 -
 unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---
 unmodified_drivers/linux-2.6/overrides.mk          |  3 -
 unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 -
 .../linux-2.6/platform-pci/panic-handler.c         | 14 ----
 .../linux-2.6/platform-pci/platform-pci.c          | 23 ------
 .../linux-2.6/platform-pci/xen_support.c           | 36 ---------
 xen/include/public/io/blkif.h                      |  8 ++
 29 files changed, 157 insertions(+), 264 deletions(-)

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

* [PATCH 01/11] docs: remove ia64 from kexec_and_kdump.txt
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 16:13 ` [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code Olaf Hering
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 docs/misc/kexec_and_kdump.txt | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/docs/misc/kexec_and_kdump.txt b/docs/misc/kexec_and_kdump.txt
index 9ec3fcc..2f93771 100644
--- a/docs/misc/kexec_and_kdump.txt
+++ b/docs/misc/kexec_and_kdump.txt
@@ -137,10 +137,9 @@ command line parameter to the Xen hypervisor. It has two forms:
       e.g. crashkernel=128M@256M
 
    Regardless of which of the two forms of the crashkernel command line you
-   use, the crash kernel region should appear in /proc/iomem on x86 or
-   /proc/iomem_machine on ia64. If it doesn't then either the crashkernel
-   parameter is missing, or for some reason the region couldn't be placed -
-   for instance because it is too large.
+   use, the crash kernel region should appear in /proc/iomem on x86. If it
+   doesn't then either the crashkernel parameter is missing, or for some
+   reason the region couldn't be placed - for instance because it is too large.
 
    # cat /proc/iomem
    ...
@@ -179,8 +178,6 @@ On x86 systems the crash kernel may be either
 - Relocatability is controlled by the CONFIG_RELOCATABLE kernel
   compile configuration parameter. This option may not be available
   depending on the kernel version
-On ia64
-  Either a vmlinuz or vmlinux.gz image may be used
 
 
 2. Execute

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

* [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
  2014-03-06 16:13 ` [PATCH 01/11] docs: remove ia64 from kexec_and_kdump.txt Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-12 13:37   ` Ian Campbell
  2014-03-12 14:14   ` Jan Beulich
  2014-03-06 16:13 ` [PATCH 03/11] docs: remove ia64 from tmem-internals.html Olaf Hering
                   ` (11 subsequent siblings)
  13 siblings, 2 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 .../linux-2.6/compat-include/xen/platform-compat.h |  4 ---
 unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---------
 unmodified_drivers/linux-2.6/overrides.mk          |  3 --
 unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 ---
 .../linux-2.6/platform-pci/panic-handler.c         | 14 ---------
 .../linux-2.6/platform-pci/platform-pci.c          | 23 --------------
 .../linux-2.6/platform-pci/xen_support.c           | 36 ----------------------
 7 files changed, 1 insertion(+), 99 deletions(-)

diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
index 57afc72..240ca12 100644
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
@@ -42,10 +42,6 @@
 #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
 #endif
 
-#if defined(_ASM_IA64_PGTABLE_H) && !defined(_PGTABLE_NOPUD_H)
-#include <asm-generic/pgtable-nopud.h>
-#endif
-
 /* Some kernels have this typedef backported so we cannot reliably
  * detect based on version number, hence we forcibly #define it.
  */
diff --git a/unmodified_drivers/linux-2.6/mkbuildtree b/unmodified_drivers/linux-2.6/mkbuildtree
index 3aca16d..379b39b 100755
--- a/unmodified_drivers/linux-2.6/mkbuildtree
+++ b/unmodified_drivers/linux-2.6/mkbuildtree
@@ -5,7 +5,7 @@ if [ $1 ]; then
 else
     uname=`uname -m`
     echo "Defaulting to this machine's architecture, $uname, for linking."
-    echo "This may be overridden on the command line (i386,x86_64,ia64)."
+    echo "This may be overridden on the command line (i386,x86_64)."
 fi
 
 C=$(cd $(dirname $0) && pwd)
@@ -79,20 +79,6 @@ i[34567]86|x86_64)
         ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
     fi
   ;;
-"ia64")
-    ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
-    ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
-    ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
-    ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
-    ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
-    mkdir -p include/asm/xen
-    ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
-    ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
-    ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
-    ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
-    ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
-    ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
-  ;;
 *)
     echo unknown architecture $uname
     exit 1
diff --git a/unmodified_drivers/linux-2.6/overrides.mk b/unmodified_drivers/linux-2.6/overrides.mk
index 803eccd..6c278ad 100644
--- a/unmodified_drivers/linux-2.6/overrides.mk
+++ b/unmodified_drivers/linux-2.6/overrides.mk
@@ -7,9 +7,6 @@
 _XEN_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030205
 _XEN_CPPFLAGS += -DCONFIG_XEN_COMPAT=0xffffff
 _XEN_CPPFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_XEN_PLATFORM_COMPAT_H
-ifeq ($(ARCH),ia64)
-  _XEN_CPPFLAGS += -DCONFIG_VMX_GUEST
-endif
 
 _XEN_CPPFLAGS += -include $(wildcard $(objtree)/include/*/autoconf.h)
 
diff --git a/unmodified_drivers/linux-2.6/platform-pci/Kbuild b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
index 7b332ee..4701aa6 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild
+++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
@@ -16,7 +16,3 @@ xen-platform-pci-objs += ../xenbus/xenbus_dev.o
 xen-platform-pci-objs += ../xenbus/xenbus_client.o 
 xen-platform-pci-objs += ../xenbus/xen_proc.o
 
-# Can we do better ?
-ifeq ($(ARCH),ia64)
-  xen-platform-pci-objs += xencomm.o xencomm_arch.o xcom_hcall.o xcom_asm.o
-endif
diff --git a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
index 7564d0c..2b1895f 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
@@ -9,24 +9,10 @@
 
 MODULE_LICENSE("GPL");
 
-#ifdef __ia64__
-static void
-xen_panic_hypercall(struct unw_frame_info *info, void *arg)
-{
-	current->thread.ksp = (__u64)info->sw - 16;
-	HYPERVISOR_shutdown(SHUTDOWN_crash);
-	/* we're never actually going to get here... */
-}
-#endif
-
 static int
 xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
-#ifdef __ia64__
-	unw_init_running(xen_panic_hypercall, NULL);
-#else /* !__ia64__ */
 	HYPERVISOR_shutdown(SHUTDOWN_crash);
-#endif
 	/* we're never actually going to get here... */
 	return NOTIFY_DONE;
 }
diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
index 163b168..895e19d 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -39,9 +39,6 @@
 #include <xen/interface/hvm/params.h>
 #include <xen/features.h>
 #include <xen/evtchn.h>
-#ifdef __ia64__
-#include <asm/xen/xencomm.h>
-#endif
 
 #include "platform-pci.h"
 
@@ -78,10 +75,6 @@ static int __devinit init_xen_info(void)
 	struct xen_add_to_physmap xatp;
 	extern void *shared_info_area;
 
-#ifdef __ia64__
-	xencomm_initialize();
-#endif
-
 	setup_xen_features();
 
 	shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT;
@@ -115,8 +108,6 @@ unsigned long alloc_xen_mmio(unsigned long len)
 	return addr;
 }
 
-#ifndef __ia64__
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 static uint32_t xen_cpuid_base(void)
 {
@@ -212,28 +203,14 @@ static void resume_hypercall_stubs(void)
 	nr_hypercall_stub_pages = pages;
 }
 
-#else /* __ia64__ */
-
-#define init_hypercall_stubs()		(0)
-#define resume_hypercall_stubs()	((void)0)
-
-#endif
-
 static uint64_t get_callback_via(struct pci_dev *pdev)
 {
 	u8 pin;
 	int irq;
 
-#ifdef __ia64__
-	for (irq = 0; irq < 16; irq++) {
-		if (isa_irq_to_vector(irq) == pdev->irq)
-			return irq; /* ISA IRQ */
-	}
-#else /* !__ia64__ */
 	irq = pdev->irq;
 	if (irq < 16)
 		return irq; /* ISA IRQ */
-#endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 	pin = pdev->pin;
diff --git a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
index 510a2b7..c8aadc0 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
@@ -30,42 +30,6 @@
 #include <xen/platform-compat.h>
 #endif
 
-#if defined (__ia64__)
-unsigned long __hypercall(unsigned long a1, unsigned long a2,
-			  unsigned long a3, unsigned long a4,
-			  unsigned long a5, unsigned long cmd)
-{
-	unsigned long __res;
-	__asm__ __volatile__ (";;\n"
-		"mov r2=%1\n"
-		"break 0x1000 ;;\n"
-		"mov %0=r8 ;;\n"
-		: "=r"(__res) : "r"(cmd) : "r2", "r8", "memory");
-
-	return __res;
-}
-EXPORT_SYMBOL(__hypercall);
-
-int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
-{
-	return xencomm_hypercall_grant_table_op(cmd, uop, count);
-}
-EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
-
-/* without using balloon driver on PV-on-HVM for ia64 */
-void balloon_update_driver_allowance(long delta)
-{
-	/* nothing */
-}
-EXPORT_SYMBOL_GPL(balloon_update_driver_allowance);
-
-void balloon_release_driver_page(struct page *page)
-{
-	/* nothing */
-}
-EXPORT_SYMBOL_GPL(balloon_release_driver_page);
-#endif /* __ia64__ */
-
 void xen_machphys_update(unsigned long mfn, unsigned long pfn)
 {
 	BUG();

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

* [PATCH 03/11] docs: remove ia64 from tmem-internals.html
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
  2014-03-06 16:13 ` [PATCH 01/11] docs: remove ia64 from kexec_and_kdump.txt Olaf Hering
  2014-03-06 16:13 ` [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 16:13 ` [PATCH 04/11] stubdom: remove ia64 from stubdom Olaf Hering
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 docs/misc/tmem-internals.html | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/docs/misc/tmem-internals.html b/docs/misc/tmem-internals.html
index ccc34c3..2d8635d 100644
--- a/docs/misc/tmem-internals.html
+++ b/docs/misc/tmem-internals.html
@@ -728,13 +728,6 @@ However, the Xen heap is limited in size on
 32-bit Xen so tmem did not work very well.
 There are still 32-bit ifdefs in some places in the code, but things may
 have bit-rotted so using tmem on a 32-bit Xen is not recommended.
-<P>
-<b><i>IA-64 implementation. </i></b>
-The vast majority of the tmem
-implementation is architecture-independent.
-For tmem to run on Xen/ia64, it is believed that only one or two
-routines needs to be written.(See the
-#ifdef __ia64__ at <i>cli_mfn_to_va()</i>.)
 
 <h2>Known Issues</h2>

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

* [PATCH 04/11] stubdom: remove ia64 from stubdom
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (2 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 03/11] docs: remove ia64 from tmem-internals.html Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 16:13 ` [PATCH 05/11] libxc: remove ia64 from xg_private.h Olaf Hering
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 stubdom/Makefile     |  3 ---
 stubdom/newlib.patch | 22 ----------------------
 2 files changed, 25 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 19f2228..b1822b7 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -23,9 +23,6 @@ TARGET_CFLAGS=-mno-red-zone
 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
 STUBDOM_SUPPORTED=1
 endif
-ifeq ($(GNU_TARGET_ARCH), ia64)
-TARGET_CFLAGS=-mconstant-gp
-endif
 
 CROSS_ROOT=cross-root-$(GNU_TARGET_ARCH)
 CROSS_PREFIX=$(CURDIR)/$(CROSS_ROOT)
diff --git a/stubdom/newlib.patch b/stubdom/newlib.patch
index 733dc13..ee9b6f2 100644
--- a/stubdom/newlib.patch
+++ b/stubdom/newlib.patch
@@ -81,28 +81,6 @@ diff -u -p -r1.10 stdint.h
 
 Define the basic ia64 jump buffer
 
-Index: newlib/libc/include/machine/setjmp.h
-===================================================================
-RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
-retrieving revision 1.34
-diff -u -p -r1.34 setjmp.h
---- newlib/libc/include/machine/setjmp.h	7 Nov 2007 21:42:24 -0000	1.34
-+++ newlib/libc/include/machine/setjmp.h	11 Jan 2008 18:10:43 -0000
-@@ -72,6 +72,11 @@ _BEGIN_STD_C
- #define _JBLEN  8
- #endif
- 
-+#ifdef __ia64__
-+#define _JBTYPE long
-+#define _JBLEN 70
-+#endif
-+
- #ifdef __i960__
- #define _JBLEN 35
- #endif
-
-In mini-os we use a dynamic reentrency buffer.
-
 Index: newlib/libc/include/sys/config.h
 ===================================================================
 RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v

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

* [PATCH 05/11] libxc: remove ia64 from xg_private.h
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (3 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 04/11] stubdom: remove ia64 from stubdom Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 16:13 ` [PATCH 06/11] pygrub: remote ia64 from pygrub Olaf Hering
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libxc/xg_private.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 5ff2124..f5755fd 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -120,10 +120,6 @@ typedef uint64_t l4_pgentry_64_t;
 #define PAGE_SIZE_X86           (1UL << PAGE_SHIFT_X86)
 #define PAGE_MASK_X86           (~(PAGE_SIZE_X86-1))
 
-#define PAGE_SHIFT_IA64         14
-#define PAGE_SIZE_IA64          (1UL << PAGE_SHIFT_IA64)
-#define PAGE_MASK_IA64          (~(PAGE_SIZE_IA64-1))
-
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT)

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

* [PATCH 06/11] pygrub: remote ia64 from pygrub
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (4 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 05/11] libxc: remove ia64 from xg_private.h Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 18:04   ` Ian Jackson
  2014-03-06 16:13 ` [PATCH 07/11] xend: remove ia64 from xend sources Olaf Hering
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/pygrub/src/pygrub | 35 +++++++++++------------------------
 1 file changed, 11 insertions(+), 24 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index ee4e741..54fecee 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -360,11 +360,7 @@ class Grub:
                 curline = len(img.lines) - 1
 
         if self.isdone:
-           # Fix to allow pygrub command-line editing in Lilo bootloader (used by IA64)
-           if platform.machine() == 'ia64':
-              origimg.reset(img.lines, img.path)
-           else:
-              origimg.reset(img.lines)
+           origimg.reset(img.lines)
 
     def edit_line(self, line):
         self.screen.erase()
@@ -416,25 +412,16 @@ class Grub:
         if not os.access(fn, os.R_OK):
             raise RuntimeError, "Unable to access %s" %(fn,)
 
-        if platform.machine() == 'ia64':
-            cfg_list = map(lambda x: (x,grub.LiloConf.LiloConfigFile), 
-                           # common distributions
-                           ["/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
-                            "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
-                            "/efi/SuSE/elilo.conf",] + 
-                           # fallbacks
-                           ["/efi/boot/elilo.conf", "/elilo.conf",])
-        else:
-            cfg_list = map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
-                           ["/boot/grub/grub.cfg", "/grub/grub.cfg",
-                            "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
-                       map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
-                           ["/boot/isolinux/isolinux.cfg",
-                            "/boot/extlinux/extlinux.conf",
-                            "/boot/extlinux.conf"]) + \
-                       map(lambda x: (x,grub.GrubConf.GrubConfigFile),
-                           ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
-                            "/grub/menu.lst", "/grub/grub.conf"])
+        cfg_list = map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
+                       ["/boot/grub/grub.cfg", "/grub/grub.cfg",
+                        "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
+                   map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
+                       ["/boot/isolinux/isolinux.cfg",
+                        "/boot/extlinux/extlinux.conf",
+                        "/boot/extlinux.conf"]) + \
+                   map(lambda x: (x,grub.GrubConf.GrubConfigFile),
+                       ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
+                        "/grub/menu.lst", "/grub/grub.conf"])
 
         if not fs:
             # set the config file and parse it

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

* [PATCH 07/11] xend: remove ia64 from xend sources
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (5 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 06/11] pygrub: remote ia64 from pygrub Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 16:13 ` [PATCH 08/11] libxl: add option for discard support to xl disk configuration Olaf Hering
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/python/xen/xend/XendNode.py      | 10 ------
 tools/python/xen/xend/arch.py          |  1 -
 tools/python/xen/xend/image.py         | 56 ----------------------------------
 tools/python/xen/xend/server/pciif.py  |  2 +-
 tools/xm-test/lib/XmTestLib/arch.py    | 14 ++-------
 tools/xm-test/lib/XmTestReport/arch.py |  4 ---
 6 files changed, 4 insertions(+), 83 deletions(-)

diff --git a/tools/python/xen/xend/XendNode.py b/tools/python/xen/xend/XendNode.py
index f16932c..a26383b 100644
--- a/tools/python/xen/xend/XendNode.py
+++ b/tools/python/xen/xend/XendNode.py
@@ -132,16 +132,6 @@ class XendNode:
                       'stepping' : cpuinfo[number]['stepping'],
                       'flags'    : cpuinfo[number]['flags'],
                     })
-            elif arch.type == "ia64":
-                self.cpus[u].update(
-                    { 'host'     : self.uuid,
-                      'features' : cpu_features,
-                      'speed'    : int(float(cpuinfo[number]['cpu MHz'])),
-                      'vendor'   : cpuinfo[number]['vendor'],
-                      'modelname': cpuinfo[number]['family'],
-                      'stepping' : cpuinfo[number]['model'],
-                      'flags'    : cpuinfo[number]['features'],
-                    })
             else:
                 self.cpus[u].update(
                     { 'host'     : self.uuid,
diff --git a/tools/python/xen/xend/arch.py b/tools/python/xen/xend/arch.py
index 6d789d9..2af55e8 100644
--- a/tools/python/xen/xend/arch.py
+++ b/tools/python/xen/xend/arch.py
@@ -27,6 +27,5 @@ _types = {
     "x86_64": "x86",
     "amd64": "x86",
     "i86pc": "x86",
-    "ia64": "ia64",
 }
 type = _types.get(os.uname()[4], "unknown")
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index 832c168..54334ae 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -729,8 +729,6 @@ class LinuxImageHandler(ImageHandler):
         log.debug("features       = %s", self.vm.getFeatures())
         log.debug("flags          = %d", self.flags)
         log.debug("superpages     = %d", self.superpages)
-        if arch.type == "ia64":
-            log.debug("vhpt          = %d", self.vhpt)
 
         return xc.linux_build(domid          = self.vm.getDomid(),
                               memsize        = mem_mb,
@@ -982,56 +980,6 @@ class HVMImageHandler(ImageHandler):
         return rc
 
 
-class IA64_HVM_ImageHandler(HVMImageHandler):
-
-    def configure(self, vmConfig):
-        HVMImageHandler.configure(self, vmConfig)
-        self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
-        self.vramsize = int(vmConfig['platform'].get('videoram',4)) * 1024
-
-    def buildDomain(self):
-        xc.nvram_init(self.vm.getName(), self.vm.getDomid())
-        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_VHPT_SIZE, self.vhpt)
-        if self.guest_os_type is not None:
-            xc.set_os_type(self.guest_os_type.lower(), self.vm.getDomid())
-        return HVMImageHandler.buildDomain(self)
-
-    def getRequiredAvailableMemory(self, mem_kb):
-        page_kb = 16
-        # ROM size for guest firmware, io page, xenstore page
-        # buffer io page, buffer pio page and memmap info page
-        extra_pages = 1024 + 5
-        mem_kb += extra_pages * page_kb
-        mem_kb += self.vramsize
-        return mem_kb
-
-    def getRequiredInitialReservation(self):
-        return self.vm.getMemoryTarget()
-
-    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
-        # Explicit shadow memory is not a concept 
-        return 0
-
-    def getDeviceModelArgs(self, restore = False):
-        args = HVMImageHandler.getDeviceModelArgs(self, restore)
-        args = args + ([ "-m", "%s" %
-                         (self.getRequiredInitialReservation() / 1024) ])
-        return args
-
-    def setCpuid(self):
-        # Guest CPUID configuration is not implemented yet.
-        return
-
-class IA64_Linux_ImageHandler(LinuxImageHandler):
-
-    def configure(self, vmConfig):
-        LinuxImageHandler.configure(self, vmConfig)
-        self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
-
-    def setCpuid(self):
-        # Guest CPUID configuration is not implemented yet.
-        return
-
 class X86_HVM_ImageHandler(HVMImageHandler):
 
     def configure(self, vmConfig):
@@ -1079,10 +1027,6 @@ class X86_Linux_ImageHandler(LinuxImageHandler):
         return rc
 
 _handlers = {
-    "ia64": {
-        "linux": IA64_Linux_ImageHandler,
-        "hvm": IA64_HVM_ImageHandler,
-    },
     "x86": {
         "linux": X86_Linux_ImageHandler,
         "hvm": X86_HVM_ImageHandler,
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 27c1b75..165953f 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -412,7 +412,7 @@ class PciController(DevController):
                                     ' the same guest with %s'
                                 raise VmError(err_msg % (f, dev.name))
             elif dev.dev_type == DEV_TYPE_PCI:
-                if dev.bus == 0 or arch.type == "ia64":
+                if dev.bus == 0:
                     if not dev.pci_af_flr:
                         # We cope with this case by using the Dstate transition
                         # method or some vendor specific methods for now.
diff --git a/tools/xm-test/lib/XmTestLib/arch.py b/tools/xm-test/lib/XmTestLib/arch.py
index d505cc0..f3d8455 100644
--- a/tools/xm-test/lib/XmTestLib/arch.py
+++ b/tools/xm-test/lib/XmTestLib/arch.py
@@ -39,16 +39,13 @@ def getRdPath():
 
     return rdpath
 
-# Begin: Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+# Begin: Intel as well as AMD 32-bit and 64-bit processors
 def ia_checkBuffer(buffer):
     return
 
 def ia_minSafeMem():
     return 32
 
-def ia64_minSafeMem():
-    return 128
-
 def ia_getDeviceModel():
     """Get the path to the device model based on
     the architecture reported in uname"""
@@ -85,7 +82,7 @@ ia_HVMDefaults =      {"memory"       : 64,
                        "serial"       : "pty",
                        "device_model" : ia_getDeviceModel(),
 }
-# End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+# End  : Intel as well as AMD 32-bit and 64-bit processors
 
 """Convert from uname specification to a more general platform."""
 _uname_to_arch_map = {
@@ -94,12 +91,11 @@ _uname_to_arch_map = {
     "i586"  : "x86",
     "i686"  : "x86",
     "x86_64": "x86_64",
-    "ia64"  : "ia64",
 }
 
 # Lookup current platform.
 _arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
-if _arch == "x86" or _arch == "x86_64" or _arch == "ia64":
+if _arch == "x86" or _arch == "x86_64":
     minSafeMem = ia_minSafeMem
     getDefaultKernel = ia_getDefaultKernel
     checkBuffer = ia_checkBuffer
@@ -118,9 +114,5 @@ if _arch == "x86" or _arch == "x86_64" or _arch == "ia64":
         else:
             configDefaults['extra'] = clause
 
-    if _arch == "ia64":
-        minSafeMem = ia64_minSafeMem
-        configDefaults['memory'] = ia64_minSafeMem()
-
 else:
     raise ValueError, "Unknown architecture!"
diff --git a/tools/xm-test/lib/XmTestReport/arch.py b/tools/xm-test/lib/XmTestReport/arch.py
index 920526d..b1f4bc8 100644
--- a/tools/xm-test/lib/XmTestReport/arch.py
+++ b/tools/xm-test/lib/XmTestReport/arch.py
@@ -29,7 +29,6 @@ _uname_to_arch_map = {
     "i586"  : "x86",
     "i686"  : "x86",
     "x86_64": "x86_64",
-    "ia64"  : "ia64",
 }
 
 _arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
@@ -39,8 +38,5 @@ if _arch == "x86":
 elif _arch == "x86_64":
     cpuValues = {"model_name" : "Unknown",
                  "flags"      : "Unknown"}
-elif _arch == "ia64":
-    cpuValues = {"arch"     : "Unknown",
-                 "features" : "Unknown"}
 else:
     raise ValueError, "Unknown architecture!"

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

* [PATCH 08/11] libxl: add option for discard support to xl disk configuration
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (6 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 07/11] xend: remove ia64 from xend sources Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 18:15   ` Ian Jackson
  2014-03-06 16:13 ` [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save Olaf Hering
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Handle new option discard=on|off for disk configuration. It is supposed
to disable discard support if file based backing storage was
intentionally created non-sparse to avoid fragmentation of the file.

The option is a boolean and intended for the backend driver. A new
boolean property "discard-enable" is written to the backend node. An
upcoming patch for qemu will make use of this property. The kernel
blkback driver may be updated as well to disable discard for phy based
backing storage.

v2:
rename xenstore property from discard_enable to discard-enable
update description in xl-disk-configuration.txt
use libxl_defbool as type for discard_enable
update check-xl-disk-parse to use "<default>"
add LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE to libxl.h

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 docs/misc/xl-disk-configuration.txt | 15 +++++++++++++++
 tools/libxl/check-xl-disk-parse     | 21 ++++++++++++++-------
 tools/libxl/libxl.c                 |  3 +++
 tools/libxl/libxl.h                 |  5 +++++
 tools/libxl/libxl_types.idl         |  1 +
 tools/libxl/libxlu_disk_l.l         |  4 ++++
 xen/include/public/io/blkif.h       |  8 ++++++++
 7 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/docs/misc/xl-disk-configuration.txt b/docs/misc/xl-disk-configuration.txt
index cf22397..b8077da 100644
--- a/docs/misc/xl-disk-configuration.txt
+++ b/docs/misc/xl-disk-configuration.txt
@@ -178,6 +178,21 @@ information to be interpreted by the executable program <script>,
 These scripts are normally called "block-<script>".
 
 
+discard=<boolean>
+---------------
+
+Description:           Instruct backend to advertise discard support to frontend
+Supported values:      on, off, 0, 1
+Mandatory:             No
+Default value:         on if, available for that backend typ
+
+This option is an advisory setting for the backend driver, depending of the
+value, to advertise discard support (TRIM, UNMAP) to the frontend. The real
+benefit of this option is to be able to force it off rather than on. It allows
+to disable "hole punching" for file based backends which were intentionally
+created non-sparse to avoid fragmentation of the file.
+
+
 
 ============================================
 DEPRECATED PARAMETERS, PREFIXES AND SYNTAXES
diff --git a/tools/libxl/check-xl-disk-parse b/tools/libxl/check-xl-disk-parse
index 797277c..4d26ca3 100755
--- a/tools/libxl/check-xl-disk-parse
+++ b/tools/libxl/check-xl-disk-parse
@@ -61,7 +61,8 @@ disk: {
     "script": null,
     "removable": 0,
     "readwrite": 1,
-    "is_cdrom": 0
+    "is_cdrom": 0,
+    "discard_enable": "<default>"
 }
 
 END
@@ -82,7 +83,8 @@ disk: {
     "script": null,
     "removable": 1,
     "readwrite": 0,
-    "is_cdrom": 1
+    "is_cdrom": 1,
+    "discard_enable": "<default>"
 }
 
 END
@@ -104,7 +106,8 @@ disk: {
     "script": null,
     "removable": 0,
     "readwrite": 1,
-    "is_cdrom": 0
+    "is_cdrom": 0,
+    "discard_enable": "<default>"
 }
 
 EOF
@@ -121,7 +124,8 @@ disk: {
     "script": null,
     "removable": 1,
     "readwrite": 0,
-    "is_cdrom": 1
+    "is_cdrom": 1,
+    "discard_enable": "<default>"
 }
 
 EOF
@@ -142,7 +146,8 @@ disk: {
     "script": null,
     "removable": 1,
     "readwrite": 0,
-    "is_cdrom": 1
+    "is_cdrom": 1,
+    "discard_enable": "<default>"
 }
 
 EOF
@@ -160,7 +165,8 @@ disk: {
     "script": "block-iscsi",
     "removable": 0,
     "readwrite": 1,
-    "is_cdrom": 0
+    "is_cdrom": 0,
+    "discard_enable": "<default>"
 }
 
 EOF
@@ -180,7 +186,8 @@ disk: {
     "script": "block-drbd",
     "removable": 0,
     "readwrite": 1,
-    "is_cdrom": 0
+    "is_cdrom": 0,
+    "discard_enable": "<default>"
 }
 
 EOF
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 730f6e1..a18929b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2192,6 +2192,9 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         flexarray_append(back, disk->readwrite ? "w" : "r");
         flexarray_append(back, "device-type");
         flexarray_append(back, disk->is_cdrom ? "cdrom" : "disk");
+        if (!libxl_defbool_is_default(disk->discard_enable))
+            flexarray_append_pair(back, "discard-enable",
+                                  libxl_defbool_val(disk->discard_enable) ? "1" : "0");
 
         flexarray_append(front, "backend-id");
         flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid));
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 06bbca6..f3a8ea0 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -95,6 +95,11 @@
 #define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
 
 /*
+ * The libxl_device_disk has the discard_enable field.
+ */
+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 649ce50..6575515 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -415,6 +415,7 @@ libxl_device_disk = Struct("device_disk", [
     ("removable", integer),
     ("readwrite", integer),
     ("is_cdrom", integer),
+    ("discard_enable", libxl_defbool),
     ])
 
 libxl_device_nic = Struct("device_nic", [
diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
index 7c4e7f1..2585bee 100644
--- a/tools/libxl/libxlu_disk_l.l
+++ b/tools/libxl/libxlu_disk_l.l
@@ -173,6 +173,10 @@ backendtype=[^,]*,? { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 
 vdev=[^,]*,?	{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
 script=[^,]*,?	{ STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
+discard=on,?	{ libxl_defbool_set(&DPC->disk->discard_enable, true); }
+discard=1,?	{ libxl_defbool_set(&DPC->disk->discard_enable, true); }
+discard=off,?	{ libxl_defbool_set(&DPC->disk->discard_enable, false); }
+discard=0,?	{ libxl_defbool_set(&DPC->disk->discard_enable, false); }
 
  /* the target magic parameter, eats the rest of the string */
 
diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index c3e169c..dad32d2 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -175,6 +175,14 @@
  *
  *------------------------- Backend Device Properties -------------------------
  *
+ * discard-enable
+ *      Values:         0/1 (boolean)
+ *      Default Value:  1
+ *
+ *      This optional property, set by the toolstack, instructs the backend to
+ *      offer discard to the frontend. If the property is missing the backend
+ *      should offer discard if the backing storage actually supports it.
+ *
  * discard-alignment
  *      Values:         <uint32_t>
  *      Default Value:  0

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

* [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (7 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 08/11] libxl: add option for discard support to xl disk configuration Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 18:17   ` Ian Jackson
  2014-03-06 16:13 ` [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices Olaf Hering
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Callers of xc_domain_save use errno to print diagnostics if the call
fails. But xc_domain_save does not preserve the actual errno in case of
a failure.

This change preserves errno in all cases where code jumps to the label
"out". In addition a new label "exit" is added to catch also code which
used to do just "return 1".

Now libxl_save_helper:complete can print the actual error string.

Note: some of the functions used in xc_domain_save do not use errno to
indicate a reason. In these cases the errno remains undefined as it used
to be without this change.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libxc/xc_domain_save.c | 88 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 82 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 42c4752..f32ac81 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -806,6 +806,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     xc_dominfo_t info;
     DECLARE_DOMCTL;
 
+    int errnoval = 0;
     int rc = 1, frc, i, j, last_iter = 0, iter = 0;
     int live  = (flags & XCFLAGS_LIVE);
     int debug = (flags & XCFLAGS_DEBUG);
@@ -898,8 +899,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     if ( hvm && !callbacks->switch_qemu_logdirty )
     {
         ERROR("No switch_qemu_logdirty callback provided.");
-        errno = EINVAL;
-        return 1;
+        errnoval = EINVAL;
+        goto exit;
     }
 
     outbuf_init(xch, &ob_pagebuf, OUTBUF_SIZE);
@@ -913,14 +914,16 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     if ( !get_platform_info(xch, dom,
                             &ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) )
     {
+        errnoval = errno;
         ERROR("Unable to get platform info.");
-        return 1;
+        goto exit;
     }
 
     if ( xc_domain_getinfo(xch, dom, 1, &info) != 1 )
     {
+        errnoval = errno;
         PERROR("Could not get domain info");
-        return 1;
+        goto exit;
     }
 
     shared_info_frame = info.shared_info_frame;
@@ -932,6 +935,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                            PROT_READ, shared_info_frame);
         if ( !live_shinfo )
         {
+            errnoval = errno;
             PERROR("Couldn't map live_shinfo");
             goto out;
         }
@@ -942,6 +946,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
     if ( dinfo->p2m_size > ~XEN_DOMCTL_PFINFO_LTAB_MASK )
     {
+        errnoval = E2BIG;
         ERROR("Cannot save this big a guest");
         goto out;
     }
@@ -967,6 +972,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             
             if ( frc < 0 )
             {
+                errnoval = errno;
                 PERROR("Couldn't enable shadow mode (rc %d) (errno %d)", frc, errno );
                 goto out;
             }
@@ -975,6 +981,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         /* Enable qemu-dm logging dirty pages to xen */
         if ( hvm && callbacks->switch_qemu_logdirty(dom, 1, callbacks->data) )
         {
+            errnoval = errno;
             PERROR("Couldn't enable qemu log-dirty mode (errno %d)", errno);
             goto out;
         }
@@ -985,6 +992,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( suspend_and_state(callbacks->suspend, callbacks->data, xch,
                                io_fd, dom, &info) )
         {
+            errnoval = errno;
             ERROR("Domain appears not to have suspended");
             goto out;
         }
@@ -994,6 +1002,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     {
         if (!(compress_ctx = xc_compression_create_context(xch, dinfo->p2m_size)))
         {
+            errnoval = errno;
             ERROR("Failed to create compression context");
             goto out;
         }
@@ -1012,6 +1021,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
     if ( !to_send || !to_fix || !to_skip )
     {
+        errnoval = ENOMEM;
         ERROR("Couldn't allocate to_send array");
         goto out;
     }
@@ -1024,12 +1034,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         hvm_buf_size = xc_domain_hvm_getcontext(xch, dom, 0, 0);
         if ( hvm_buf_size == -1 )
         {
+            errnoval = errno;
             PERROR("Couldn't get HVM context size from Xen");
             goto out;
         }
         hvm_buf = malloc(hvm_buf_size);
         if ( !hvm_buf )
         {
+            errnoval = ENOMEM;
             ERROR("Couldn't allocate memory");
             goto out;
         }
@@ -1043,7 +1055,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     if ( (pfn_type == NULL) || (pfn_batch == NULL) || (pfn_err == NULL) )
     {
         ERROR("failed to alloc memory for pfn_type and/or pfn_batch arrays");
-        errno = ENOMEM;
+        errnoval = ENOMEM;
         goto out;
     }
     memset(pfn_type, 0,
@@ -1052,6 +1064,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     /* Setup the mfn_to_pfn table mapping */
     if ( !(ctx->live_m2p = xc_map_m2p(xch, ctx->max_mfn, PROT_READ, &ctx->m2p_mfn0)) )
     {
+        errnoval = errno;
         PERROR("Failed to map live M2P table");
         goto out;
     }
@@ -1059,6 +1072,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     /* Start writing out the saved-domain record. */
     if ( write_exact(io_fd, &dinfo->p2m_size, sizeof(unsigned long)) )
     {
+        errnoval = errno;
         PERROR("write: p2m_size");
         goto out;
     }
@@ -1071,6 +1085,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         ctx->live_p2m = map_and_save_p2m_table(xch, io_fd, dom, ctx, live_shinfo);
         if ( ctx->live_p2m == NULL )
         {
+            errnoval = errno;
             PERROR("Failed to map/save the p2m frame list");
             goto out;
         }
@@ -1097,12 +1112,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     tmem_saved = xc_tmem_save(xch, dom, io_fd, live, XC_SAVE_ID_TMEM);
     if ( tmem_saved == -1 )
     {
+        errnoval = errno;
         PERROR("Error when writing to state file (tmem)");
         goto out;
     }
 
     if ( !live && save_tsc_info(xch, dom, io_fd) < 0 )
     {
+        errnoval = errno;
         PERROR("Error when writing to state file (tsc)");
         goto out;
     }
@@ -1143,6 +1160,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                     dinfo->p2m_size, NULL, 0, NULL);
                 if ( frc != dinfo->p2m_size )
                 {
+                    errnoval = errno;
                     ERROR("Error peeking shadow bitmap");
                     goto out;
                 }
@@ -1257,6 +1275,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                 xch, dom, PROT_READ, pfn_type, pfn_err, batch);
             if ( region_base == NULL )
             {
+                errnoval = errno;
                 PERROR("map batch failed");
                 goto out;
             }
@@ -1264,6 +1283,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             /* Get page types */
             if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
             {
+                errnoval = errno;
                 PERROR("get_pfn_type_batch failed");
                 goto out;
             }
@@ -1332,6 +1352,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
             if ( wrexact(io_fd, &batch, sizeof(unsigned int)) )
             {
+                errnoval = errno;
                 PERROR("Error when writing to state file (2)");
                 goto out;
             }
@@ -1341,6 +1362,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                     ((unsigned long *)pfn_type)[j] = pfn_type[j];
             if ( wrexact(io_fd, pfn_type, sizeof(unsigned long)*batch) )
             {
+                errnoval = errno;
                 PERROR("Error when writing to state file (3)");
                 goto out;
             }
@@ -1368,6 +1390,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                        (char*)region_base+(PAGE_SIZE*(j-run)), 
                                        PAGE_SIZE*run) != PAGE_SIZE*run )
                         {
+                            errnoval = errno;
                             PERROR("Error when writing to state file (4a)"
                                   " (errno %d)", errno);
                             goto out;
@@ -1396,6 +1419,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
                     if ( race && !live )
                     {
+                        errnoval = errno;
                         ERROR("Fatal PT race (pfn %lx, type %08lx)", pfn,
                               pagetype);
                         goto out;
@@ -1409,6 +1433,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                                         pfn, 1 /* raw page */);
                         if (c_err == -2) /* OOB PFN */
                         {
+                            errnoval = errno;
                             ERROR("Could not add pagetable page "
                                   "(pfn:%" PRIpfn "to page buffer\n", pfn);
                             goto out;
@@ -1428,6 +1453,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                              */
                             if (wrcompressed(io_fd) < 0)
                             {
+                                errnoval = errno;
                                 ERROR("Error when writing compressed"
                                       " data (4b)\n");
                                 goto out;
@@ -1437,6 +1463,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                     else if ( wruncached(io_fd, live, page,
                                          PAGE_SIZE) != PAGE_SIZE )
                     {
+                        errnoval = errno;
                         PERROR("Error when writing to state file (4b)"
                               " (errno %d)", errno);
                         goto out;
@@ -1456,6 +1483,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
                         if (c_err == -2) /* OOB PFN */
                         {
+                            errnoval = errno;
                             ERROR("Could not add page "
                                   "(pfn:%" PRIpfn "to page buffer\n", pfn);
                             goto out;
@@ -1465,6 +1493,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                         {
                             if (wrcompressed(io_fd) < 0)
                             {
+                                errnoval = errno;
                                 ERROR("Error when writing compressed"
                                       " data (4c)\n");
                                 goto out;
@@ -1483,6 +1512,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                (char*)region_base+(PAGE_SIZE*(j-run)), 
                                PAGE_SIZE*run) != PAGE_SIZE*run )
                 {
+                    errnoval = errno;
                     PERROR("Error when writing to state file (4c)"
                           " (errno %d)", errno);
                     goto out;
@@ -1520,6 +1550,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             /* send "-1" to put receiver into debug mode */
             if ( wrexact(io_fd, &id, sizeof(int)) )
             {
+                errnoval = errno;
                 PERROR("Error when writing to state file (6)");
                 goto out;
             }
@@ -1542,6 +1573,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                 if ( suspend_and_state(callbacks->suspend, callbacks->data,
                                        xch, io_fd, dom, &info) )
                 {
+                    errnoval = errno;
                     ERROR("Domain appears not to have suspended");
                     goto out;
                 }
@@ -1550,12 +1582,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                 if ( (tmem_saved > 0) &&
                      (xc_tmem_save_extra(xch,dom,io_fd,XC_SAVE_ID_TMEM_EXTRA) == -1) )
                 {
+                        errnoval = errno;
                         PERROR("Error when writing to state file (tmem)");
                         goto out;
                 }
 
                 if ( save_tsc_info(xch, dom, io_fd) < 0 )
                 {
+                    errnoval = errno;
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
@@ -1567,6 +1601,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                    XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
                                    dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
             {
+                errnoval = errno;
                 PERROR("Error flushing shadow PT");
                 goto out;
             }
@@ -1598,6 +1633,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
         if ( info.max_vcpu_id >= XC_SR_MAX_VCPUS )
         {
+            errnoval = E2BIG;
             ERROR("Too many VCPUS in guest!");
             goto out;
         }
@@ -1614,6 +1650,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( wrexact(io_fd, &chunk, offsetof(struct chunk, vcpumap)
                      + vcpumap_sz(info.max_vcpu_id)) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file");
             goto out;
         }
@@ -1633,6 +1670,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the generation id buffer location for guest");
             goto out;
         }
@@ -1645,6 +1683,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the ident_pt for EPT guest");
             goto out;
         }
@@ -1657,6 +1696,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the paging ring pfn for guest");
             goto out;
         }
@@ -1669,6 +1709,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the access ring pfn for guest");
             goto out;
         }
@@ -1681,6 +1722,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the sharing ring pfn for guest");
             goto out;
         }
@@ -1693,6 +1735,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the vm86 TSS for guest");
             goto out;
         }
@@ -1705,6 +1748,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the console pfn for guest");
             goto out;
         }
@@ -1716,6 +1760,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
         if ((chunk.data != 0) && wrexact(io_fd, &chunk, sizeof(chunk)))
         {
+            errnoval = errno;
             PERROR("Error when writing the firmware ioport version");
             goto out;
         }
@@ -1728,6 +1773,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (chunk.data != 0) &&
              wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
+            errnoval = errno;
             PERROR("Error when writing the viridian flag");
             goto out;
         }
@@ -1741,6 +1787,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
         if ( callbacks->toolstack_save(dom, &buf, &len, callbacks->data) < 0 )
         {
+            errnoval = errno;
             PERROR("Error calling toolstack_save");
             goto out;
         }
@@ -1759,6 +1806,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         i = XC_SAVE_ID_LAST_CHECKPOINT;
         if ( wrexact(io_fd, &i, sizeof(int)) )
         {
+            errnoval = errno;
             PERROR("Error when writing last checkpoint chunk");
             goto out;
         }
@@ -1778,6 +1826,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         i = XC_SAVE_ID_ENABLE_COMPRESSION;
         if ( wrexact(io_fd, &i, sizeof(int)) )
         {
+            errnoval = errno;
             PERROR("Error when writing enable_compression marker");
             goto out;
         }
@@ -1787,6 +1836,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     i = 0;
     if ( wrexact(io_fd, &i, sizeof(int)) )
     {
+        errnoval = errno;
         PERROR("Error when writing to state file (6')");
         goto out;
     }
@@ -1805,6 +1855,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                          (unsigned long *)&magic_pfns[2]);
         if ( wrexact(io_fd, magic_pfns, sizeof(magic_pfns)) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file (7)");
             goto out;
         }
@@ -1813,18 +1864,21 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( (rec_size = xc_domain_hvm_getcontext(xch, dom, hvm_buf, 
                                                   hvm_buf_size)) == -1 )
         {
+            errnoval = errno;
             PERROR("HVM:Could not get hvm buffer");
             goto out;
         }
         
         if ( wrexact(io_fd, &rec_size, sizeof(uint32_t)) )
         {
+            errnoval = errno;
             PERROR("error write hvm buffer size");
             goto out;
         }
         
         if ( wrexact(io_fd, hvm_buf, rec_size) )
         {
+            errnoval = errno;
             PERROR("write HVM info failed!");
             goto out;
         }
@@ -1849,6 +1903,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
         if ( wrexact(io_fd, &j, sizeof(unsigned int)) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file (6a)");
             goto out;
         }
@@ -1863,6 +1918,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             {
                 if ( wrexact(io_fd, &pfntab, sizeof(unsigned long)*j) )
                 {
+                    errnoval = errno;
                     PERROR("Error when writing to state file (6b)");
                     goto out;
                 }
@@ -1873,6 +1929,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
     if ( xc_vcpu_getcontext(xch, dom, 0, &ctxt) )
     {
+        errnoval = errno;
         PERROR("Could not get vcpu context");
         goto out;
     }
@@ -1888,6 +1945,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     mfn = GET_FIELD(&ctxt, user_regs.edx);
     if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
     {
+        errnoval = ERANGE;
         ERROR("Suspend record is not in range of pseudophys map");
         goto out;
     }
@@ -1900,6 +1958,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
         if ( (i != 0) && xc_vcpu_getcontext(xch, dom, i, &ctxt) )
         {
+            errnoval = errno;
             PERROR("No context for VCPU%d", i);
             goto out;
         }
@@ -1910,6 +1969,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             mfn = GET_FIELD(&ctxt, gdt_frames[j]);
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
             {
+                errnoval = ERANGE;
                 ERROR("GDT frame is not in range of pseudophys map");
                 goto out;
             }
@@ -1920,6 +1980,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( !MFN_IS_IN_PSEUDOPHYS_MAP(UNFOLD_CR3(
                                            GET_FIELD(&ctxt, ctrlreg[3]))) )
         {
+            errnoval = ERANGE;
             ERROR("PT base is not in range of pseudophys map");
             goto out;
         }
@@ -1931,6 +1992,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         {
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(UNFOLD_CR3(ctxt.x64.ctrlreg[1])) )
             {
+                errnoval = ERANGE;
                 ERROR("PT base is not in range of pseudophys map");
                 goto out;
             }
@@ -1943,6 +2005,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                                         ? sizeof(ctxt.x64) 
                                         : sizeof(ctxt.x32))) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file (1)");
             goto out;
         }
@@ -1953,11 +2016,13 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         domctl.u.ext_vcpucontext.vcpu = i;
         if ( xc_domctl(xch, &domctl) < 0 )
         {
+            errnoval = errno;
             PERROR("No extended context for VCPU%d", i);
             goto out;
         }
         if ( wrexact(io_fd, &domctl.u.ext_vcpucontext, 128) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file (2)");
             goto out;
         }
@@ -1971,6 +2036,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         domctl.u.vcpuextstate.size = 0;
         if ( xc_domctl(xch, &domctl) < 0 )
         {
+            errnoval = errno;
             PERROR("No eXtended states (XSAVE) for VCPU%d", i);
             goto out;
         }
@@ -1982,6 +2048,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         buffer = xc_hypercall_buffer_alloc(xch, buffer, domctl.u.vcpuextstate.size);
         if ( !buffer )
         {
+            errnoval = errno;
             PERROR("Insufficient memory for getting eXtended states for"
                    "VCPU%d", i);
             goto out;
@@ -1989,6 +2056,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         set_xen_guest_handle(domctl.u.vcpuextstate.buffer, buffer);
         if ( xc_domctl(xch, &domctl) < 0 )
         {
+            errnoval = errno;
             PERROR("No eXtended states (XSAVE) for VCPU%d", i);
             xc_hypercall_buffer_free(xch, buffer);
             goto out;
@@ -2000,6 +2068,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                      sizeof(domctl.u.vcpuextstate.size)) ||
              wrexact(io_fd, buffer, domctl.u.vcpuextstate.size) )
         {
+            errnoval = errno;
             PERROR("Error when writing to state file VCPU extended state");
             xc_hypercall_buffer_free(xch, buffer);
             goto out;
@@ -2015,6 +2084,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
               arch.pfn_to_mfn_frame_list_list, 0);
     if ( wrexact(io_fd, page, PAGE_SIZE) )
     {
+        errnoval = errno;
         PERROR("Error when writing to state file (1)");
         goto out;
     }
@@ -2022,6 +2092,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     /* Flush last write and check for errors. */
     if ( fsync(io_fd) && errno != EINVAL )
     {
+        errnoval = errno;
         PERROR("Error when flushing state file");
         goto out;
     }
@@ -2043,6 +2114,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         ob = &ob_pagebuf;
         if (wrcompressed(io_fd) < 0)
         {
+            errnoval = errno;
             ERROR("Error when writing compressed data, after postcopy\n");
             rc = 1;
             goto out;
@@ -2051,6 +2123,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( wrexact(io_fd, ob_tailbuf.buf, ob_tailbuf.pos) )
         {
             rc = 1;
+            errnoval = errno;
             PERROR("Error when copying tailbuf into outbuf");
             goto out;
         }
@@ -2079,6 +2152,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         if ( suspend_and_state(callbacks->suspend, callbacks->data, xch,
                                io_fd, dom, &info) )
         {
+            errnoval = errno;
             ERROR("Domain appears not to have suspended");
             goto out;
         }
@@ -2130,7 +2204,9 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     free(hvm_buf);
     outbuf_free(&ob_pagebuf);
 
-    DPRINTF("Save exit of domid %u with rc=%d\n", dom, rc);
+exit:
+    DPRINTF("Save exit of domid %u with rc=%d, errno=%d\n", dom, rc, errnoval);
+    errno = errnoval;
 
     return !!rc;
 }

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

* [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (8 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 18:19   ` Ian Jackson
  2014-03-06 16:13 ` [PATCH 11/11] tools/xend: move assert to exception block Olaf Hering
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0'
fails because for some reason the sr driver was not handled at all in
the match list. With the change the above command succeeds and the
device is attached.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/python/xen/util/vscsi_util.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/python/xen/util/vscsi_util.py b/tools/python/xen/util/vscsi_util.py
index 5872e65..a4f5ad3 100644
--- a/tools/python/xen/util/vscsi_util.py
+++ b/tools/python/xen/util/vscsi_util.py
@@ -66,6 +66,9 @@ def _vscsi_get_hctl_by(phyname, scsi_devices):
     if re.match('/dev/sd[a-z]+([1-9]|1[0-5])?$', phyname):
         # sd driver
         name = re.sub('(^/dev/)|([1-9]|1[0-5])?$', '', phyname)
+    elif re.match('/dev/sr[0-9]+$', phyname):
+        # sr driver
+        name = re.sub('^/dev/', '', phyname)
     elif re.match('/dev/sg[0-9]+$', phyname):
         # sg driver
         name = re.sub('^/dev/', '', phyname)

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

* [PATCH 11/11] tools/xend: move assert to exception block
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (9 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices Olaf Hering
@ 2014-03-06 16:13 ` Olaf Hering
  2014-03-06 18:07 ` [PATCH 00/11] tools changes Ian Jackson
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 16:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Ian.Jackson, Ian.Campbell

The two assert in restore trigger sometimes after hundreds of
migrations. If they trigger the destination host will not destroy the
newly created, yet empty guest. After a second migration attempt to this
host there will be two guets with the same name and uuid. This situation
is poorly handled by the xm tools.
With this change the empty guest will be destroyed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/python/xen/xend/XendCheckpoint.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index a433ffa..b8caf02 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -249,9 +249,6 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False):
     store_port   = dominfo.getStorePort()
     console_port = dominfo.getConsolePort()
 
-    assert store_port
-    assert console_port
-
     # if hvm, pass mem size to calculate the store_mfn
     if is_hvm:
         apic = int(dominfo.info['platform'].get('apic', 0))
@@ -263,6 +260,9 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False):
         pae  = 0
 
     try:
+        assert store_port
+        assert console_port
+
         restore_image = image.create(dominfo, dominfo.info)
         memory = restore_image.getRequiredAvailableMemory(
             dominfo.info['memory_dynamic_max'] / 1024)

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

* Re: [PATCH 06/11] pygrub: remote ia64 from pygrub
  2014-03-06 16:13 ` [PATCH 06/11] pygrub: remote ia64 from pygrub Olaf Hering
@ 2014-03-06 18:04   ` Ian Jackson
  2014-03-06 18:59     ` Olaf Hering
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2014-03-06 18:04 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("[PATCH 06/11] pygrub: remote ia64 from pygrub"):
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
...
> -        if platform.machine() == 'ia64':
> -            cfg_list = map(lambda x: (x,grub.LiloConf.LiloConfigFile), 
> -                           # common distributions
> -                           ["/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
> -                            "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 

This seems related to ia64 using EFI.  Do we want to preserve this
code for EFI support on other platforms ?

Ian.
;4~

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

* Re: [PATCH 00/11] tools changes
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (10 preceding siblings ...)
  2014-03-06 16:13 ` [PATCH 11/11] tools/xend: move assert to exception block Olaf Hering
@ 2014-03-06 18:07 ` Ian Jackson
  2014-03-12 14:41 ` Ian Campbell
  2014-03-12 14:41 ` Boris Ostrovsky
  13 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2014-03-06 18:07 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("[PATCH 00/11] tools changes"):
> Resend of changes from the 4.4 freeze time.

Thanks.  I think this would benefit from being split up into an
ia64-removal series, and a miscellaneous fixes series.

When you resend, please add my ack to these patches:

>   docs: remove ia64 from kexec_and_kdump.txt
>   unmodified_drivers: remove ia64 parts of the code
>   docs: remove ia64 from tmem-internals.html
>   stubdom: remove ia64 from stubdom
>   libxc: remove ia64 from xg_private.h
>   xend: remove ia64 from xend sources

I haven't just applied them to give others a chance to comment.

I have commented on this one already:

>   pygrub: remote ia64 from pygrub

The others I'm going to deal with individually, although having them
in a series of misc patches is helpful.  If you get acks on some but
not all of them, moving the acked patches to the start of the series
would allow them to be applied while the others are still being
discussed.

Thanks,
Ian.

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

* Re: [PATCH 08/11] libxl: add option for discard support to xl disk configuration
  2014-03-06 16:13 ` [PATCH 08/11] libxl: add option for discard support to xl disk configuration Olaf Hering
@ 2014-03-06 18:15   ` Ian Jackson
  2014-03-06 19:11     ` Olaf Hering
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2014-03-06 18:15 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("[PATCH 08/11] libxl: add option for discard support to xl disk configuration"):
> Handle new option discard=on|off for disk configuration. It is supposed
> to disable discard support if file based backing storage was
> intentionally created non-sparse to avoid fragmentation of the file.
> 
> The option is a boolean and intended for the backend driver. A new
> boolean property "discard-enable" is written to the backend node. An
> upcoming patch for qemu will make use of this property. The kernel
> blkback driver may be updated as well to disable discard for phy based
> backing storage.

Thanks.

> +discard=<boolean>
> +---------------
...
> +This option is an advisory setting for the backend driver, depending of the
> +value, to advertise discard support (TRIM, UNMAP) to the frontend.

I think the semantics of this are unclear.  Calling it an "advisory"
setting doesn't help.  The documentation should explicitly explain
under what circumstances it might be honoured.

> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 730f6e1..a18929b 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2192,6 +2192,9 @@ static void device_disk_add(libxl__egc *egc, uint32_t d...
> +        if (!libxl_defbool_is_default(disk->discard_enable))
> +            flexarray_append_pair(back, "discard-enable",
> +                                  libxl_defbool_val(disk->discard_enable) ? "1" : "0");

This approach is quite unusual, and arguably wrong.  I think it would
be better if the default were (essentially) fixed.  This would result
in discard-enable always being written here.

> + * discard-enable
> + *      Values:         0/1 (boolean)
> + *      Default Value:  1
> + *
> + *      This optional property, set by the toolstack, instructs the
> + *      backend to offer discard to the frontend. If the property
> + *      is missing the backend should offer discard if the backing
> + *      storage actually supports it.

What should the backend do if the property is set but the backend
doesn't support the requested value ?

Ian.

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

* Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-06 16:13 ` [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save Olaf Hering
@ 2014-03-06 18:17   ` Ian Jackson
  2014-03-06 19:19     ` Olaf Hering
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2014-03-06 18:17 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("[PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save"):
> Callers of xc_domain_save use errno to print diagnostics if the call
> fails. But xc_domain_save does not preserve the actual errno in case of
> a failure.
> 
> This change preserves errno in all cases where code jumps to the label
> "out". In addition a new label "exit" is added to catch also code which
> used to do just "return 1".

I can't help wondering if this patch would be a lot smaller if it were
done by having ERROR and PERROR, and the cleanup part of
xc_domain_save, preserve errno.

> Note: some of the functions used in xc_domain_save do not use errno to
> indicate a reason. In these cases the errno remains undefined as it used
> to be without this change.

Do you intend to fix this too ?

Thanks,
Ian.

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

* Re: [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices
  2014-03-06 16:13 ` [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices Olaf Hering
@ 2014-03-06 18:19   ` Ian Jackson
  2014-03-06 19:20     ` Olaf Hering
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2014-03-06 18:19 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("[PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices"):
> Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0'
> fails because for some reason the sr driver was not handled at all in
> the match list. With the change the above command succeeds and the
> device is attached.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

I'm going to wait with applying this to give anyone who is still
interested in xend a chance to comment.

(Also, we are perhaps going to be removing xend in the 4.5 cycle...)

Ian.

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

* Re: [PATCH 06/11] pygrub: remote ia64 from pygrub
  2014-03-06 18:04   ` Ian Jackson
@ 2014-03-06 18:59     ` Olaf Hering
  2014-03-07 11:06       ` Ian Jackson
  0 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 18:59 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian.Campbell, xen-devel

On Thu, Mar 06, Ian Jackson wrote:

> Olaf Hering writes ("[PATCH 06/11] pygrub: remote ia64 from pygrub"):
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ...
> > -        if platform.machine() == 'ia64':
> > -            cfg_list = map(lambda x: (x,grub.LiloConf.LiloConfigFile), 
> > -                           # common distributions
> > -                           ["/efi/debian/elilo.conf", "/efi/gentoo/elilo.conf", 
> > -                            "/efi/redflag/elilo.conf", "/efi/redhat/elilo.conf", 
> 
> This seems related to ia64 using EFI.  Do we want to preserve this
> code for EFI support on other platforms ?

Do we have any guests supporting EFI as firmware? 
If so, the guest most likely uses grub2 instead of elilo.

Olaf

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

* Re: [PATCH 08/11] libxl: add option for discard support to xl disk configuration
  2014-03-06 18:15   ` Ian Jackson
@ 2014-03-06 19:11     ` Olaf Hering
  0 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 19:11 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian.Campbell, xen-devel

On Thu, Mar 06, Ian Jackson wrote:

> Olaf Hering writes ("[PATCH 08/11] libxl: add option for discard support to xl disk configuration"):
> > +This option is an advisory setting for the backend driver, depending of the
> > +value, to advertise discard support (TRIM, UNMAP) to the frontend.
> I think the semantics of this are unclear.  Calling it an "advisory"
> setting doesn't help.  The documentation should explicitly explain
> under what circumstances it might be honoured.
> > +        if (!libxl_defbool_is_default(disk->discard_enable))
> This approach is quite unusual, and arguably wrong.  I think it would
> be better if the default were (essentially) fixed.  This would result
> in discard-enable always being written here.

I'm fine with writing discard-enable="1" always.

> What should the backend do if the property is set but the backend
> doesn't support the requested value ?

The backend could advertise feature-discard anyway, so that error paths
will be executed when the frontend actually sends a discard request.
Right now the backend will catch this and both frontend/backend will
internally disable discard.

Olaf

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

* Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-06 18:17   ` Ian Jackson
@ 2014-03-06 19:19     ` Olaf Hering
  2014-03-10 16:49       ` Ian Jackson
  0 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 19:19 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian.Campbell, xen-devel

On Thu, Mar 06, Ian Jackson wrote:

> Olaf Hering writes ("[PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save"):
> > Callers of xc_domain_save use errno to print diagnostics if the call
> > fails. But xc_domain_save does not preserve the actual errno in case of
> > a failure.
> > 
> > This change preserves errno in all cases where code jumps to the label
> > "out". In addition a new label "exit" is added to catch also code which
> > used to do just "return 1".
> 
> I can't help wondering if this patch would be a lot smaller if it were
> done by having ERROR and PERROR, and the cleanup part of
> xc_domain_save, preserve errno.

Something like this for the macros?

diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index a610f0c..8b791b6 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,9 +123,15 @@ void xc_report_progress_step(xc_interface *xch,
 #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DETAIL,0, _f , ## _a)
 #define DBGPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DEBUG,0, _f , ## _a)
 
-#define ERROR(_m, _a...)  xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a )
-#define PERROR(_m, _a...) xc_report_error(xch,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
+#define ERROR(_m, _a...)  do { int __errno = errno; \
+        xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a ); \
+        errno = __errno; \
+        } while (0)
+#define PERROR(_m, _a...) do { int __errno = errno; \
+        xc_report_error(xch,XC_INTERNAL_ERROR,_m " (%d = %s)", \
+        ## _a , errno, xc_strerror(xch, errno)); \
+        errno = __errno; \
+        } while (0)
 
 /*
  * HYPERCALL ARGUMENT BUFFERS


> > Note: some of the functions used in xc_domain_save do not use errno to
> > indicate a reason. In these cases the errno remains undefined as it used
> > to be without this change.
> 
> Do you intend to fix this too ?

I will have a look.

Olaf

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

* Re: [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices
  2014-03-06 18:19   ` Ian Jackson
@ 2014-03-06 19:20     ` Olaf Hering
  0 siblings, 0 replies; 33+ messages in thread
From: Olaf Hering @ 2014-03-06 19:20 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian.Campbell, xen-devel

On Thu, Mar 06, Ian Jackson wrote:

> I'm going to wait with applying this to give anyone who is still
> interested in xend a chance to comment.
> 
> (Also, we are perhaps going to be removing xend in the 4.5 cycle...)

It would be nice to have this backported to 4.2+ at some point.

Olaf

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

* Re: [PATCH 06/11] pygrub: remote ia64 from pygrub
  2014-03-06 18:59     ` Olaf Hering
@ 2014-03-07 11:06       ` Ian Jackson
  0 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2014-03-07 11:06 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("Re: [PATCH 06/11] pygrub: remote ia64 from pygrub"):
> On Thu, Mar 06, Ian Jackson wrote:
> > This seems related to ia64 using EFI.  Do we want to preserve this
> > code for EFI support on other platforms ?
> 
> Do we have any guests supporting EFI as firmware? 
> If so, the guest most likely uses grub2 instead of elilo.

This is a good point.  So, for the patch, I think:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

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

* Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-06 19:19     ` Olaf Hering
@ 2014-03-10 16:49       ` Ian Jackson
  2014-03-11  8:21         ` Olaf Hering
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2014-03-10 16:49 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Ian.Campbell, xen-devel

Olaf Hering writes ("Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save"):
> On Thu, Mar 06, Ian Jackson wrote:
> > I can't help wondering if this patch would be a lot smaller if it were
> > done by having ERROR and PERROR, and the cleanup part of
> > xc_domain_save, preserve errno.
> 
> Something like this for the macros?
> 
> diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
> index a610f0c..8b791b6 100644
> --- a/tools/libxc/xc_private.h
> +++ b/tools/libxc/xc_private.h
> @@ -123,9 +123,15 @@ void xc_report_progress_step(xc_interface *xch,
>  #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DETAIL,0, _f , ## _a)
>  #define DBGPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DEBUG,0, _f , ## _a)
>  
> -#define ERROR(_m, _a...)  xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a )
> -#define PERROR(_m, _a...) xc_report_error(xch,XC_INTERNAL_ERROR,_m \
> -                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
> +#define ERROR(_m, _a...)  do { int __errno = errno; \
> +        xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a ); \
> +        errno = __errno; \
> +        } while (0)
> +#define PERROR(_m, _a...) do { int __errno = errno; \
> +        xc_report_error(xch,XC_INTERNAL_ERROR,_m " (%d = %s)", \
> +        ## _a , errno, xc_strerror(xch, errno)); \
> +        errno = __errno; \
> +        } while (0)

Yes, except the temporary should be called "error_macro_errno" or
something.

The "__thing" convention is one found in various places (including
parts of the hypervisor) but it is wrong because:

  * Identifiers starting with "__" (and in some contexts "_") are
    reserved for the C implementation (ie the compiler and libc)
    and must not be used.

  * The names of these internal variables should contain the macro
    name, so that if several different macros are combined in one bit
    of code, they don't end up with name clashes.  (That leaves only
    sort-of-recursive invocations which is not usually a problem.)

Thanks,
Ian.

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

* Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-10 16:49       ` Ian Jackson
@ 2014-03-11  8:21         ` Olaf Hering
  2014-03-11 11:18           ` Ian Jackson
  0 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-11  8:21 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian.Campbell, xen-devel

On Mon, Mar 10, Ian Jackson wrote:

> Yes, except the temporary should be called "error_macro_errno" or
> something.

I have changed it, now it looks like this:

+#define PERROR(_m, _a...) do { int PERROR_errno = errno; \
+        xc_report_error(xch,XC_INTERNAL_ERROR,_m " (%d = %s)", \
+        ## _a , errno, xc_strerror(xch, errno)); \
+        errno = PERROR_errno; \
+        } while (0)

Olaf

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

* Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save
  2014-03-11  8:21         ` Olaf Hering
@ 2014-03-11 11:18           ` Ian Jackson
  0 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2014-03-11 11:18 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Campbell, xen-devel

Olaf Hering writes ("Re: [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save"):
> On Mon, Mar 10, Ian Jackson wrote:
> 
> > Yes, except the temporary should be called "error_macro_errno" or
> > something.
> 
> I have changed it, now it looks like this:
> 
> +#define PERROR(_m, _a...) do { int PERROR_errno = errno; \
> +        xc_report_error(xch,XC_INTERNAL_ERROR,_m " (%d = %s)", \
> +        ## _a , errno, xc_strerror(xch, errno)); \
> +        errno = PERROR_errno; \
> +        } while (0)

That looks fine to me.

Thanks,
Ian.

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

* Re: [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code
  2014-03-06 16:13 ` [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code Olaf Hering
@ 2014-03-12 13:37   ` Ian Campbell
  2014-03-12 14:14   ` Jan Beulich
  1 sibling, 0 replies; 33+ messages in thread
From: Ian Campbell @ 2014-03-12 13:37 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Keir Fraser, Ian.Jackson, Jan Beulich, xen-devel

On Thu, 2014-03-06 at 17:13 +0100, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

./scripts/get_maintainer.pl says:
Keir Fraser <keir@xen.org>
Jan Beulich <jbeulich@suse.com>

CC added for you.

> ---
>  .../linux-2.6/compat-include/xen/platform-compat.h |  4 ---
>  unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---------
>  unmodified_drivers/linux-2.6/overrides.mk          |  3 --
>  unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 ---
>  .../linux-2.6/platform-pci/panic-handler.c         | 14 ---------
>  .../linux-2.6/platform-pci/platform-pci.c          | 23 --------------
>  .../linux-2.6/platform-pci/xen_support.c           | 36 ----------------------
>  7 files changed, 1 insertion(+), 99 deletions(-)
> 
> diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
> index 57afc72..240ca12 100644
> --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
> +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
> @@ -42,10 +42,6 @@
>  #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
>  #endif
>  
> -#if defined(_ASM_IA64_PGTABLE_H) && !defined(_PGTABLE_NOPUD_H)
> -#include <asm-generic/pgtable-nopud.h>
> -#endif
> -
>  /* Some kernels have this typedef backported so we cannot reliably
>   * detect based on version number, hence we forcibly #define it.
>   */
> diff --git a/unmodified_drivers/linux-2.6/mkbuildtree b/unmodified_drivers/linux-2.6/mkbuildtree
> index 3aca16d..379b39b 100755
> --- a/unmodified_drivers/linux-2.6/mkbuildtree
> +++ b/unmodified_drivers/linux-2.6/mkbuildtree
> @@ -5,7 +5,7 @@ if [ $1 ]; then
>  else
>      uname=`uname -m`
>      echo "Defaulting to this machine's architecture, $uname, for linking."
> -    echo "This may be overridden on the command line (i386,x86_64,ia64)."
> +    echo "This may be overridden on the command line (i386,x86_64)."
>  fi
>  
>  C=$(cd $(dirname $0) && pwd)
> @@ -79,20 +79,6 @@ i[34567]86|x86_64)
>          ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
>      fi
>    ;;
> -"ia64")
> -    ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
> -    mkdir -p include/asm/xen
> -    ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
> -    ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
> -    ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
> -    ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
> -    ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
> -    ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
> -  ;;
>  *)
>      echo unknown architecture $uname
>      exit 1
> diff --git a/unmodified_drivers/linux-2.6/overrides.mk b/unmodified_drivers/linux-2.6/overrides.mk
> index 803eccd..6c278ad 100644
> --- a/unmodified_drivers/linux-2.6/overrides.mk
> +++ b/unmodified_drivers/linux-2.6/overrides.mk
> @@ -7,9 +7,6 @@
>  _XEN_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030205
>  _XEN_CPPFLAGS += -DCONFIG_XEN_COMPAT=0xffffff
>  _XEN_CPPFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_XEN_PLATFORM_COMPAT_H
> -ifeq ($(ARCH),ia64)
> -  _XEN_CPPFLAGS += -DCONFIG_VMX_GUEST
> -endif
>  
>  _XEN_CPPFLAGS += -include $(wildcard $(objtree)/include/*/autoconf.h)
>  
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/Kbuild b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> index 7b332ee..4701aa6 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> +++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> @@ -16,7 +16,3 @@ xen-platform-pci-objs += ../xenbus/xenbus_dev.o
>  xen-platform-pci-objs += ../xenbus/xenbus_client.o 
>  xen-platform-pci-objs += ../xenbus/xen_proc.o
>  
> -# Can we do better ?
> -ifeq ($(ARCH),ia64)
> -  xen-platform-pci-objs += xencomm.o xencomm_arch.o xcom_hcall.o xcom_asm.o
> -endif
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> index 7564d0c..2b1895f 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> @@ -9,24 +9,10 @@
>  
>  MODULE_LICENSE("GPL");
>  
> -#ifdef __ia64__
> -static void
> -xen_panic_hypercall(struct unw_frame_info *info, void *arg)
> -{
> -	current->thread.ksp = (__u64)info->sw - 16;
> -	HYPERVISOR_shutdown(SHUTDOWN_crash);
> -	/* we're never actually going to get here... */
> -}
> -#endif
> -
>  static int
>  xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
>  {
> -#ifdef __ia64__
> -	unw_init_running(xen_panic_hypercall, NULL);
> -#else /* !__ia64__ */
>  	HYPERVISOR_shutdown(SHUTDOWN_crash);
> -#endif
>  	/* we're never actually going to get here... */
>  	return NOTIFY_DONE;
>  }
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> index 163b168..895e19d 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> @@ -39,9 +39,6 @@
>  #include <xen/interface/hvm/params.h>
>  #include <xen/features.h>
>  #include <xen/evtchn.h>
> -#ifdef __ia64__
> -#include <asm/xen/xencomm.h>
> -#endif
>  
>  #include "platform-pci.h"
>  
> @@ -78,10 +75,6 @@ static int __devinit init_xen_info(void)
>  	struct xen_add_to_physmap xatp;
>  	extern void *shared_info_area;
>  
> -#ifdef __ia64__
> -	xencomm_initialize();
> -#endif
> -
>  	setup_xen_features();
>  
>  	shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT;
> @@ -115,8 +108,6 @@ unsigned long alloc_xen_mmio(unsigned long len)
>  	return addr;
>  }
>  
> -#ifndef __ia64__
> -
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
>  static uint32_t xen_cpuid_base(void)
>  {
> @@ -212,28 +203,14 @@ static void resume_hypercall_stubs(void)
>  	nr_hypercall_stub_pages = pages;
>  }
>  
> -#else /* __ia64__ */
> -
> -#define init_hypercall_stubs()		(0)
> -#define resume_hypercall_stubs()	((void)0)
> -
> -#endif
> -
>  static uint64_t get_callback_via(struct pci_dev *pdev)
>  {
>  	u8 pin;
>  	int irq;
>  
> -#ifdef __ia64__
> -	for (irq = 0; irq < 16; irq++) {
> -		if (isa_irq_to_vector(irq) == pdev->irq)
> -			return irq; /* ISA IRQ */
> -	}
> -#else /* !__ia64__ */
>  	irq = pdev->irq;
>  	if (irq < 16)
>  		return irq; /* ISA IRQ */
> -#endif
>  
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
>  	pin = pdev->pin;
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> index 510a2b7..c8aadc0 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> @@ -30,42 +30,6 @@
>  #include <xen/platform-compat.h>
>  #endif
>  
> -#if defined (__ia64__)
> -unsigned long __hypercall(unsigned long a1, unsigned long a2,
> -			  unsigned long a3, unsigned long a4,
> -			  unsigned long a5, unsigned long cmd)
> -{
> -	unsigned long __res;
> -	__asm__ __volatile__ (";;\n"
> -		"mov r2=%1\n"
> -		"break 0x1000 ;;\n"
> -		"mov %0=r8 ;;\n"
> -		: "=r"(__res) : "r"(cmd) : "r2", "r8", "memory");
> -
> -	return __res;
> -}
> -EXPORT_SYMBOL(__hypercall);
> -
> -int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
> -{
> -	return xencomm_hypercall_grant_table_op(cmd, uop, count);
> -}
> -EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
> -
> -/* without using balloon driver on PV-on-HVM for ia64 */
> -void balloon_update_driver_allowance(long delta)
> -{
> -	/* nothing */
> -}
> -EXPORT_SYMBOL_GPL(balloon_update_driver_allowance);
> -
> -void balloon_release_driver_page(struct page *page)
> -{
> -	/* nothing */
> -}
> -EXPORT_SYMBOL_GPL(balloon_release_driver_page);
> -#endif /* __ia64__ */
> -
>  void xen_machphys_update(unsigned long mfn, unsigned long pfn)
>  {
>  	BUG();

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

* Re: [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code
  2014-03-06 16:13 ` [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code Olaf Hering
  2014-03-12 13:37   ` Ian Campbell
@ 2014-03-12 14:14   ` Jan Beulich
  2014-03-12 14:26     ` Olaf Hering
  1 sibling, 1 reply; 33+ messages in thread
From: Jan Beulich @ 2014-03-12 14:14 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Jackson, Ian.Campbell, xen-devel

>>> On 06.03.14 at 17:13, Olaf Hering <olaf@aepfle.de> wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  .../linux-2.6/compat-include/xen/platform-compat.h |  4 ---
>  unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---------
>  unmodified_drivers/linux-2.6/overrides.mk          |  3 --
>  unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 ---
>  .../linux-2.6/platform-pci/panic-handler.c         | 14 ---------
>  .../linux-2.6/platform-pci/platform-pci.c          | 23 --------------
>  .../linux-2.6/platform-pci/xen_support.c           | 36 ----------------------
>  7 files changed, 1 insertion(+), 99 deletions(-)

Why? In fact I think it was a mistake too to remove the ia64 bits
from the public headers - there's nothing wrong with someone
still wanting to build ia64 PV drivers against an old Linux tree (e.g.
linux-2.6.18-xen.hg itself, where I intentionally avoided mirroring
that public header cleanup), and the implementation going away
is unrelated to the interface definitions remaining the same.

Jan

> --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
> +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
> @@ -42,10 +42,6 @@
>  #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
>  #endif
>  
> -#if defined(_ASM_IA64_PGTABLE_H) && !defined(_PGTABLE_NOPUD_H)
> -#include <asm-generic/pgtable-nopud.h>
> -#endif
> -
>  /* Some kernels have this typedef backported so we cannot reliably
>   * detect based on version number, hence we forcibly #define it.
>   */
> diff --git a/unmodified_drivers/linux-2.6/mkbuildtree 
> b/unmodified_drivers/linux-2.6/mkbuildtree
> index 3aca16d..379b39b 100755
> --- a/unmodified_drivers/linux-2.6/mkbuildtree
> +++ b/unmodified_drivers/linux-2.6/mkbuildtree
> @@ -5,7 +5,7 @@ if [ $1 ]; then
>  else
>      uname=`uname -m`
>      echo "Defaulting to this machine's architecture, $uname, for linking."
> -    echo "This may be overridden on the command line (i386,x86_64,ia64)."
> +    echo "This may be overridden on the command line (i386,x86_64)."
>  fi
>  
>  C=$(cd $(dirname $0) && pwd)
> @@ -79,20 +79,6 @@ i[34567]86|x86_64)
>          ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
>      fi
>    ;;
> -"ia64")
> -    ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
> -    ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
> -    mkdir -p include/asm/xen
> -    ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
> -    ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
> -    ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
> -    ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
> -    ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
> -    ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
> -  ;;
>  *)
>      echo unknown architecture $uname
>      exit 1
> diff --git a/unmodified_drivers/linux-2.6/overrides.mk 
> b/unmodified_drivers/linux-2.6/overrides.mk
> index 803eccd..6c278ad 100644
> --- a/unmodified_drivers/linux-2.6/overrides.mk
> +++ b/unmodified_drivers/linux-2.6/overrides.mk
> @@ -7,9 +7,6 @@
>  _XEN_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030205
>  _XEN_CPPFLAGS += -DCONFIG_XEN_COMPAT=0xffffff
>  _XEN_CPPFLAGS += -I$(M)/include -I$(M)/compat-include 
> -DHAVE_XEN_PLATFORM_COMPAT_H
> -ifeq ($(ARCH),ia64)
> -  _XEN_CPPFLAGS += -DCONFIG_VMX_GUEST
> -endif
>  
>  _XEN_CPPFLAGS += -include $(wildcard $(objtree)/include/*/autoconf.h)
>  
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/Kbuild 
> b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> index 7b332ee..4701aa6 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> +++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild
> @@ -16,7 +16,3 @@ xen-platform-pci-objs += ../xenbus/xenbus_dev.o
>  xen-platform-pci-objs += ../xenbus/xenbus_client.o 
>  xen-platform-pci-objs += ../xenbus/xen_proc.o
>  
> -# Can we do better ?
> -ifeq ($(ARCH),ia64)
> -  xen-platform-pci-objs += xencomm.o xencomm_arch.o xcom_hcall.o xcom_asm.o
> -endif
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c 
> b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> index 7564d0c..2b1895f 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c
> @@ -9,24 +9,10 @@
>  
>  MODULE_LICENSE("GPL");
>  
> -#ifdef __ia64__
> -static void
> -xen_panic_hypercall(struct unw_frame_info *info, void *arg)
> -{
> -	current->thread.ksp = (__u64)info->sw - 16;
> -	HYPERVISOR_shutdown(SHUTDOWN_crash);
> -	/* we're never actually going to get here... */
> -}
> -#endif
> -
>  static int
>  xen_panic_event(struct notifier_block *this, unsigned long event, void 
> *ptr)
>  {
> -#ifdef __ia64__
> -	unw_init_running(xen_panic_hypercall, NULL);
> -#else /* !__ia64__ */
>  	HYPERVISOR_shutdown(SHUTDOWN_crash);
> -#endif
>  	/* we're never actually going to get here... */
>  	return NOTIFY_DONE;
>  }
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c 
> b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> index 163b168..895e19d 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
> @@ -39,9 +39,6 @@
>  #include <xen/interface/hvm/params.h>
>  #include <xen/features.h>
>  #include <xen/evtchn.h>
> -#ifdef __ia64__
> -#include <asm/xen/xencomm.h>
> -#endif
>  
>  #include "platform-pci.h"
>  
> @@ -78,10 +75,6 @@ static int __devinit init_xen_info(void)
>  	struct xen_add_to_physmap xatp;
>  	extern void *shared_info_area;
>  
> -#ifdef __ia64__
> -	xencomm_initialize();
> -#endif
> -
>  	setup_xen_features();
>  
>  	shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT;
> @@ -115,8 +108,6 @@ unsigned long alloc_xen_mmio(unsigned long len)
>  	return addr;
>  }
>  
> -#ifndef __ia64__
> -
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
>  static uint32_t xen_cpuid_base(void)
>  {
> @@ -212,28 +203,14 @@ static void resume_hypercall_stubs(void)
>  	nr_hypercall_stub_pages = pages;
>  }
>  
> -#else /* __ia64__ */
> -
> -#define init_hypercall_stubs()		(0)
> -#define resume_hypercall_stubs()	((void)0)
> -
> -#endif
> -
>  static uint64_t get_callback_via(struct pci_dev *pdev)
>  {
>  	u8 pin;
>  	int irq;
>  
> -#ifdef __ia64__
> -	for (irq = 0; irq < 16; irq++) {
> -		if (isa_irq_to_vector(irq) == pdev->irq)
> -			return irq; /* ISA IRQ */
> -	}
> -#else /* !__ia64__ */
>  	irq = pdev->irq;
>  	if (irq < 16)
>  		return irq; /* ISA IRQ */
> -#endif
>  
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
>  	pin = pdev->pin;
> diff --git a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c 
> b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> index 510a2b7..c8aadc0 100644
> --- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> +++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c
> @@ -30,42 +30,6 @@
>  #include <xen/platform-compat.h>
>  #endif
>  
> -#if defined (__ia64__)
> -unsigned long __hypercall(unsigned long a1, unsigned long a2,
> -			  unsigned long a3, unsigned long a4,
> -			  unsigned long a5, unsigned long cmd)
> -{
> -	unsigned long __res;
> -	__asm__ __volatile__ (";;\n"
> -		"mov r2=%1\n"
> -		"break 0x1000 ;;\n"
> -		"mov %0=r8 ;;\n"
> -		: "=r"(__res) : "r"(cmd) : "r2", "r8", "memory");
> -
> -	return __res;
> -}
> -EXPORT_SYMBOL(__hypercall);
> -
> -int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int 
> count)
> -{
> -	return xencomm_hypercall_grant_table_op(cmd, uop, count);
> -}
> -EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
> -
> -/* without using balloon driver on PV-on-HVM for ia64 */
> -void balloon_update_driver_allowance(long delta)
> -{
> -	/* nothing */
> -}
> -EXPORT_SYMBOL_GPL(balloon_update_driver_allowance);
> -
> -void balloon_release_driver_page(struct page *page)
> -{
> -	/* nothing */
> -}
> -EXPORT_SYMBOL_GPL(balloon_release_driver_page);
> -#endif /* __ia64__ */
> -
>  void xen_machphys_update(unsigned long mfn, unsigned long pfn)
>  {
>  	BUG();
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 

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

* Re: [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code
  2014-03-12 14:14   ` Jan Beulich
@ 2014-03-12 14:26     ` Olaf Hering
  2014-03-12 15:04       ` Jan Beulich
  0 siblings, 1 reply; 33+ messages in thread
From: Olaf Hering @ 2014-03-12 14:26 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Ian.Jackson, Ian.Campbell, xen-devel

On Wed, Mar 12, Jan Beulich wrote:

> >>> On 06.03.14 at 17:13, Olaf Hering <olaf@aepfle.de> wrote:
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > ---
> >  .../linux-2.6/compat-include/xen/platform-compat.h |  4 ---
> >  unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---------
> >  unmodified_drivers/linux-2.6/overrides.mk          |  3 --
> >  unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 ---
> >  .../linux-2.6/platform-pci/panic-handler.c         | 14 ---------
> >  .../linux-2.6/platform-pci/platform-pci.c          | 23 --------------
> >  .../linux-2.6/platform-pci/xen_support.c           | 36 ----------------------
> >  7 files changed, 1 insertion(+), 99 deletions(-)
> 
> Why? In fact I think it was a mistake too to remove the ia64 bits
> from the public headers - there's nothing wrong with someone
> still wanting to build ia64 PV drivers against an old Linux tree (e.g.
> linux-2.6.18-xen.hg itself, where I intentionally avoided mirroring
> that public header cleanup), and the implementation going away
> is unrelated to the interface definitions remaining the same.

Wouldnt they pick 4.3 or older for that task, given that there are no
relevant changes? But I'm fine with dropping that patch.

Olaf

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

* Re: [PATCH 00/11] tools changes
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (11 preceding siblings ...)
  2014-03-06 18:07 ` [PATCH 00/11] tools changes Ian Jackson
@ 2014-03-12 14:41 ` Ian Campbell
  2014-03-12 14:41 ` Boris Ostrovsky
  13 siblings, 0 replies; 33+ messages in thread
From: Ian Campbell @ 2014-03-12 14:41 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Jackson, xen-devel

On Thu, 2014-03-06 at 17:13 +0100, Olaf Hering wrote:
> Resend of changes from the 4.4 freeze time.
> 
> Olaf Hering (11):
>   docs: remove ia64 from kexec_and_kdump.txt
>   docs: remove ia64 from tmem-internals.html
>   stubdom: remove ia64 from stubdom
>   libxc: remove ia64 from xg_private.h
>   pygrub: remote ia64 from pygrub
>   xend: remove ia64 from xend sources

I have applied these with Ian J and my acks.

But not:
> unmodified_drivers: remove ia64 parts of the code

which needs other acks.

Nor
>   libxl: add option for discard support to xl disk configuration
>   tools/xc: pass errno to callers of xc_domain_save
>   xend/pvscsi: recognize also SCSI CDROM devices
>   tools/xend: move assert to exception block

which were non trivial looking and/or Ian J has commented.

Ian.

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

* Re: [PATCH 00/11] tools changes
  2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
                   ` (12 preceding siblings ...)
  2014-03-12 14:41 ` Ian Campbell
@ 2014-03-12 14:41 ` Boris Ostrovsky
  2014-03-12 15:01   ` Ian Campbell
  13 siblings, 1 reply; 33+ messages in thread
From: Boris Ostrovsky @ 2014-03-12 14:41 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Jackson, Ian.Campbell, xen-devel

On 03/06/2014 11:13 AM, Olaf Hering wrote:
> Resend of changes from the 4.4 freeze time.
>
> Olaf Hering (11):
>    docs: remove ia64 from kexec_and_kdump.txt
>    unmodified_drivers: remove ia64 parts of the code
>    docs: remove ia64 from tmem-internals.html
>    stubdom: remove ia64 from stubdom
>    libxc: remove ia64 from xg_private.h
>    pygrub: remote ia64 from pygrub
>    xend: remove ia64 from xend sources
>    libxl: add option for discard support to xl disk configuration
>    tools/xc: pass errno to callers of xc_domain_save
>    xend/pvscsi: recognize also SCSI CDROM devices
>    tools/xend: move assert to exception block


This reminds me: do we still need xencomm? My understanding is that it 
was only used by ia64 (and ppc?) and Linux recently removed support for 
it. I don't know whether other OSs use it.

-boris


>
>   docs/misc/kexec_and_kdump.txt                      |  9 +--
>   docs/misc/tmem-internals.html                      |  7 --
>   docs/misc/xl-disk-configuration.txt                | 15 ++++
>   stubdom/Makefile                                   |  3 -
>   stubdom/newlib.patch                               | 22 ------
>   tools/libxc/xc_domain_save.c                       | 88 ++++++++++++++++++++--
>   tools/libxc/xg_private.h                           |  4 -
>   tools/libxl/check-xl-disk-parse                    | 21 ++++--
>   tools/libxl/libxl.c                                |  3 +
>   tools/libxl/libxl.h                                |  5 ++
>   tools/libxl/libxl_types.idl                        |  1 +
>   tools/libxl/libxlu_disk_l.l                        |  4 +
>   tools/pygrub/src/pygrub                            | 35 +++------
>   tools/python/xen/util/vscsi_util.py                |  3 +
>   tools/python/xen/xend/XendCheckpoint.py            |  6 +-
>   tools/python/xen/xend/XendNode.py                  | 10 ---
>   tools/python/xen/xend/arch.py                      |  1 -
>   tools/python/xen/xend/image.py                     | 56 --------------
>   tools/python/xen/xend/server/pciif.py              |  2 +-
>   tools/xm-test/lib/XmTestLib/arch.py                | 14 +---
>   tools/xm-test/lib/XmTestReport/arch.py             |  4 -
>   .../linux-2.6/compat-include/xen/platform-compat.h |  4 -
>   unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---
>   unmodified_drivers/linux-2.6/overrides.mk          |  3 -
>   unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 -
>   .../linux-2.6/platform-pci/panic-handler.c         | 14 ----
>   .../linux-2.6/platform-pci/platform-pci.c          | 23 ------
>   .../linux-2.6/platform-pci/xen_support.c           | 36 ---------
>   xen/include/public/io/blkif.h                      |  8 ++
>   29 files changed, 157 insertions(+), 264 deletions(-)
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 00/11] tools changes
  2014-03-12 14:41 ` Boris Ostrovsky
@ 2014-03-12 15:01   ` Ian Campbell
  2014-03-12 15:17     ` Boris Ostrovsky
  0 siblings, 1 reply; 33+ messages in thread
From: Ian Campbell @ 2014-03-12 15:01 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: Olaf Hering, Ian.Jackson, xen-devel

On Wed, 2014-03-12 at 10:41 -0400, Boris Ostrovsky wrote:
> On 03/06/2014 11:13 AM, Olaf Hering wrote:
> > Resend of changes from the 4.4 freeze time.
> >
> > Olaf Hering (11):
> >    docs: remove ia64 from kexec_and_kdump.txt
> >    unmodified_drivers: remove ia64 parts of the code
> >    docs: remove ia64 from tmem-internals.html
> >    stubdom: remove ia64 from stubdom
> >    libxc: remove ia64 from xg_private.h
> >    pygrub: remote ia64 from pygrub
> >    xend: remove ia64 from xend sources
> >    libxl: add option for discard support to xl disk configuration
> >    tools/xc: pass errno to callers of xc_domain_save
> >    xend/pvscsi: recognize also SCSI CDROM devices
> >    tools/xend: move assert to exception block
> 
> 
> This reminds me: do we still need xencomm? My understanding is that it 
> was only used by ia64 (and ppc?) and Linux recently removed support for 
> it. I don't know whether other OSs use it.

My understanding was that it was a ppc thing, not sure about ia64.

Neither x86 nor arm uses it AFAIK. I'm not entirely sure what its
purpose actually was.

Ian.

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

* Re: [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code
  2014-03-12 14:26     ` Olaf Hering
@ 2014-03-12 15:04       ` Jan Beulich
  0 siblings, 0 replies; 33+ messages in thread
From: Jan Beulich @ 2014-03-12 15:04 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian.Jackson, Ian.Campbell, xen-devel

>>> On 12.03.14 at 15:26, Olaf Hering <olaf@aepfle.de> wrote:
> On Wed, Mar 12, Jan Beulich wrote:
> 
>> >>> On 06.03.14 at 17:13, Olaf Hering <olaf@aepfle.de> wrote:
>> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
>> > ---
>> >  .../linux-2.6/compat-include/xen/platform-compat.h |  4 ---
>> >  unmodified_drivers/linux-2.6/mkbuildtree           | 16 +---------
>> >  unmodified_drivers/linux-2.6/overrides.mk          |  3 --
>> >  unmodified_drivers/linux-2.6/platform-pci/Kbuild   |  4 ---
>> >  .../linux-2.6/platform-pci/panic-handler.c         | 14 ---------
>> >  .../linux-2.6/platform-pci/platform-pci.c          | 23 --------------
>> >  .../linux-2.6/platform-pci/xen_support.c           | 36 
> ----------------------
>> >  7 files changed, 1 insertion(+), 99 deletions(-)
>> 
>> Why? In fact I think it was a mistake too to remove the ia64 bits
>> from the public headers - there's nothing wrong with someone
>> still wanting to build ia64 PV drivers against an old Linux tree (e.g.
>> linux-2.6.18-xen.hg itself, where I intentionally avoided mirroring
>> that public header cleanup), and the implementation going away
>> is unrelated to the interface definitions remaining the same.
> 
> Wouldnt they pick 4.3 or older for that task, given that there are no
> relevant changes?

As long as there are no relevant changes, sure. The moment some
bug fix shows up, this could change.

> But I'm fine with dropping that patch.

Please do, at least until we decided whether the related public
header pruning was premature.

Jan

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

* Re: [PATCH 00/11] tools changes
  2014-03-12 15:01   ` Ian Campbell
@ 2014-03-12 15:17     ` Boris Ostrovsky
  0 siblings, 0 replies; 33+ messages in thread
From: Boris Ostrovsky @ 2014-03-12 15:17 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Olaf Hering, Ian.Jackson, xen-devel

On 03/12/2014 11:01 AM, Ian Campbell wrote:
> On Wed, 2014-03-12 at 10:41 -0400, Boris Ostrovsky wrote:
>> On 03/06/2014 11:13 AM, Olaf Hering wrote:
>>> Resend of changes from the 4.4 freeze time.
>>>
>>> Olaf Hering (11):
>>>     docs: remove ia64 from kexec_and_kdump.txt
>>>     unmodified_drivers: remove ia64 parts of the code
>>>     docs: remove ia64 from tmem-internals.html
>>>     stubdom: remove ia64 from stubdom
>>>     libxc: remove ia64 from xg_private.h
>>>     pygrub: remote ia64 from pygrub
>>>     xend: remove ia64 from xend sources
>>>     libxl: add option for discard support to xl disk configuration
>>>     tools/xc: pass errno to callers of xc_domain_save
>>>     xend/pvscsi: recognize also SCSI CDROM devices
>>>     tools/xend: move assert to exception block
>>
>> This reminds me: do we still need xencomm? My understanding is that it
>> was only used by ia64 (and ppc?) and Linux recently removed support for
>> it. I don't know whether other OSs use it.
> My understanding was that it was a ppc thing, not sure about ia64.
>
> Neither x86 nor arm uses it AFAIK. I'm not entirely sure what its
> purpose actually was.

Then it sounds like we should be able to remove it.

I can send a patch unless one of the maintainers wants to do it (i.e. 
remove relevant files and update Makefiles).

-boris

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

end of thread, other threads:[~2014-03-12 15:17 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 16:13 [PATCH 00/11] tools changes Olaf Hering
2014-03-06 16:13 ` [PATCH 01/11] docs: remove ia64 from kexec_and_kdump.txt Olaf Hering
2014-03-06 16:13 ` [PATCH 02/11] unmodified_drivers: remove ia64 parts of the code Olaf Hering
2014-03-12 13:37   ` Ian Campbell
2014-03-12 14:14   ` Jan Beulich
2014-03-12 14:26     ` Olaf Hering
2014-03-12 15:04       ` Jan Beulich
2014-03-06 16:13 ` [PATCH 03/11] docs: remove ia64 from tmem-internals.html Olaf Hering
2014-03-06 16:13 ` [PATCH 04/11] stubdom: remove ia64 from stubdom Olaf Hering
2014-03-06 16:13 ` [PATCH 05/11] libxc: remove ia64 from xg_private.h Olaf Hering
2014-03-06 16:13 ` [PATCH 06/11] pygrub: remote ia64 from pygrub Olaf Hering
2014-03-06 18:04   ` Ian Jackson
2014-03-06 18:59     ` Olaf Hering
2014-03-07 11:06       ` Ian Jackson
2014-03-06 16:13 ` [PATCH 07/11] xend: remove ia64 from xend sources Olaf Hering
2014-03-06 16:13 ` [PATCH 08/11] libxl: add option for discard support to xl disk configuration Olaf Hering
2014-03-06 18:15   ` Ian Jackson
2014-03-06 19:11     ` Olaf Hering
2014-03-06 16:13 ` [PATCH 09/11] tools/xc: pass errno to callers of xc_domain_save Olaf Hering
2014-03-06 18:17   ` Ian Jackson
2014-03-06 19:19     ` Olaf Hering
2014-03-10 16:49       ` Ian Jackson
2014-03-11  8:21         ` Olaf Hering
2014-03-11 11:18           ` Ian Jackson
2014-03-06 16:13 ` [PATCH 10/11] xend/pvscsi: recognize also SCSI CDROM devices Olaf Hering
2014-03-06 18:19   ` Ian Jackson
2014-03-06 19:20     ` Olaf Hering
2014-03-06 16:13 ` [PATCH 11/11] tools/xend: move assert to exception block Olaf Hering
2014-03-06 18:07 ` [PATCH 00/11] tools changes Ian Jackson
2014-03-12 14:41 ` Ian Campbell
2014-03-12 14:41 ` Boris Ostrovsky
2014-03-12 15:01   ` Ian Campbell
2014-03-12 15:17     ` Boris Ostrovsky

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.