Accepting request 222812 from Virtualization

Update to Xen 4.4.0 RC4

OBS-URL: https://build.opensuse.org/request/show/222812
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=183
This commit is contained in:
Stephan Kulow 2014-02-19 10:29:49 +00:00 committed by Git OBS Bridge
commit 413f29a237
29 changed files with 2133 additions and 933 deletions

View File

@ -0,0 +1,37 @@
From 98abe3b337e69371678859c4cfd19df61aebb0d9 Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Sun, 2 Feb 2014 20:42:42 +0100
Subject: aarch64: rename PSR_MODE_ELxx to match linux headers
https://bugs.launchpad.net/linaro-aarch64/+bug/1169164
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
xen/include/public/arch-arm.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 7496556..95f2a7c 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -342,13 +342,13 @@ typedef uint64_t xen_callback_t;
/* 64 bit modes */
#define PSR_MODE_BIT 0x10 /* Set iff AArch32 */
-#define PSR_MODE_EL3h 0x0d
-#define PSR_MODE_EL3t 0x0c
-#define PSR_MODE_EL2h 0x09
-#define PSR_MODE_EL2t 0x08
-#define PSR_MODE_EL1h 0x05
-#define PSR_MODE_EL1t 0x04
-#define PSR_MODE_EL0t 0x00
+#define PSR_MODE_EL3h 0x0000000d
+#define PSR_MODE_EL3t 0x0000000c
+#define PSR_MODE_EL2h 0x00000009
+#define PSR_MODE_EL2t 0x00000008
+#define PSR_MODE_EL1h 0x00000005
+#define PSR_MODE_EL1t 0x00000004
+#define PSR_MODE_EL0t 0x00000000
#define PSR_GUEST32_INIT (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
#define PSR_GUEST64_INIT (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)

View File

@ -696,7 +696,7 @@ Index: xen-4.4.0-testing/xen/include/public/io/blkif.h
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/xen/include/public/io/blkif.h --- xen-4.4.0-testing.orig/xen/include/public/io/blkif.h
+++ xen-4.4.0-testing/xen/include/public/io/blkif.h +++ xen-4.4.0-testing/xen/include/public/io/blkif.h
@@ -444,7 +444,7 @@ @@ -453,7 +453,7 @@
* Used in SLES sources for device specific command packet * Used in SLES sources for device specific command packet
* contained within the request. Reserved for that purpose. * contained within the request. Reserved for that purpose.
*/ */

View File

@ -2,71 +2,23 @@ Add support of change-vnc-password while vm is running.
Signed-off-by: Chunyan Liu <cyliu@novell.com> Signed-off-by: Chunyan Liu <cyliu@novell.com>
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c ---
=================================================================== tools/python/xen/xend/XendDomainInfo.py | 14 ++++++++++++++
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vl.c tools/python/xen/xend/server/XMLRPCServer.py | 2 +-
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c tools/python/xen/xm/main.py | 12 ++++++++++++
@@ -200,7 +200,7 @@ DriveInfo drives_table[MAX_DRIVES+1]; tools/qemu-xen-traditional-dir-remote/vl.c | 2 +-
int nb_drives; tools/qemu-xen-traditional-dir-remote/vnc.c | 1 +
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; tools/qemu-xen-traditional-dir-remote/xenstore.c | 14 ++++++++++++++
int vga_ram_size; 6 files changed, 43 insertions(+), 2 deletions(-)
-static DisplayState *display_state;
+DisplayState *display_state;
int nographic;
static int curses;
static int sdl;
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vnc.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c
@@ -2600,6 +2600,7 @@ int vnc_display_password(DisplayState *d
if (password && password[0]) {
if (!(vs->password = qemu_strdup(password)))
return -1;
+ vs->auth = VNC_AUTH_VNC;
}
return 0;
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c
@@ -25,6 +25,7 @@
#include "qemu-xen.h"
#include "xen_backend.h"
+extern DisplayState *display_state;
struct xs_handle *xsh = NULL;
static char *media_filename[MAX_DRIVES+1];
static QEMUTimer *insert_timer = NULL;
@@ -897,6 +898,19 @@ static void xenstore_process_dm_command_
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
xen_pause_requested = 0;
+ } else if (!strncmp(command, "chgvncpasswd", len)) {
+ fprintf(logfile, "dm-command: change vnc passwd\n");
+ if (pasprintf(&path,
+ "/local/domain/0/backend/vfb/%u/0/vncpasswd", domid) == -1) {
+ fprintf(logfile, "out of memory reading dm command parameter\n");
+ goto out;
+ }
+ par = xs_read(xsh, XBT_NULL, path, &len);
+ if (!par)
+ goto out;
+ if (vnc_display_password(display_state, par) == 0)
+ xenstore_record_dm_state("vncpasswdchged");
+ free(par);
} else if (!strncmp(command, "usb-add", len)) {
fprintf(logfile, "dm-command: usb-add a usb device\n");
if (pasprintf(&path,
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1461,6 +1461,20 @@ class XendDomainInfo: @@ -1665,6 +1665,20 @@ class XendDomainInfo:
pci_conf = self.info['devices'][dev_uuid][1] vfb_ctrl.reconfigureDevice(0, dev_info)
return map(pci_dict_to_bdf_str, pci_conf['devs']) break
+ def chgvncpasswd(self, passwd): + def chgvncpasswd(self, passwd):
+ if self._stateGet() != DOM_STATE_HALTED: + if self._stateGet() != DOM_STATE_HALTED:
+ path = '/local/domain/0/backend/vfb/%u/0/' % self.getDomid() + path = '/local/domain/0/backend/vfb/%u/0/' % self.getDomid()
@ -81,9 +33,9 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
+ break + break
+ xen.xend.XendDomain.instance().managed_config_save(self) + xen.xend.XendDomain.instance().managed_config_save(self)
+ +
def setMemoryTarget(self, target): #
"""Set the memory target of this domain. # Function to update xenstore /vm/*
@param target: In MiB. #
Index: xen-4.4.0-testing/tools/python/xen/xend/server/XMLRPCServer.py Index: xen-4.4.0-testing/tools/python/xen/xend/server/XMLRPCServer.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/server/XMLRPCServer.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/server/XMLRPCServer.py
@ -155,3 +107,60 @@ Index: xen-4.4.0-testing/tools/python/xen/xm/main.py
} }
## The commands supported by a separate argument parser in xend.xm. ## The commands supported by a separate argument parser in xend.xm.
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vl.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c
@@ -200,7 +200,7 @@ DriveInfo drives_table[MAX_DRIVES+1];
int nb_drives;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
int vga_ram_size;
-static DisplayState *display_state;
+DisplayState *display_state;
int nographic;
static int curses;
static int sdl;
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vnc.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c
@@ -2600,6 +2600,7 @@ int vnc_display_password(DisplayState *d
if (password && password[0]) {
if (!(vs->password = qemu_strdup(password)))
return -1;
+ vs->auth = VNC_AUTH_VNC;
}
return 0;
Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c
===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c
+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c
@@ -25,6 +25,7 @@
#include "qemu-xen.h"
#include "xen_backend.h"
+extern DisplayState *display_state;
struct xs_handle *xsh = NULL;
static char *media_filename[MAX_DRIVES+1];
static QEMUTimer *insert_timer = NULL;
@@ -897,6 +898,19 @@ static void xenstore_process_dm_command_
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
xen_pause_requested = 0;
+ } else if (!strncmp(command, "chgvncpasswd", len)) {
+ fprintf(logfile, "dm-command: change vnc passwd\n");
+ if (pasprintf(&path,
+ "/local/domain/0/backend/vfb/%u/0/vncpasswd", domid) == -1) {
+ fprintf(logfile, "out of memory reading dm command parameter\n");
+ goto out;
+ }
+ par = xs_read(xsh, XBT_NULL, path, &len);
+ if (!par)
+ goto out;
+ if (vnc_display_password(display_state, par) == 0)
+ xenstore_record_dm_state("vncpasswdchged");
+ free(par);
} else if (!strncmp(command, "usb-add", len)) {
fprintf(logfile, "dm-command: usb-add a usb device\n");
if (pasprintf(&path,

View File

@ -0,0 +1,647 @@
From b7fc90f3d4f0d61281312c5d05859ee2de8fc8be Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Mon, 10 Feb 2014 12:47:26 +0100
Subject: libxc: 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".
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;
}

View File

@ -0,0 +1,129 @@
References: FATE#316071
Subject: 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.
This change does not break ABI. Instead of adding a new member ->discard_enable
to struct libxl_device_disk the existing ->readwrite member is reused.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
docs/misc/xl-disk-configuration.txt | 15 +++++++++++++++
tools/libxl/libxl.c | 2 ++
tools/libxl/libxl.h | 11 +++++++++++
tools/libxl/libxlu_disk.c | 3 +++
tools/libxl/libxlu_disk_i.h | 2 +-
tools/libxl/libxlu_disk_l.l | 4 ++++
6 files changed, 36 insertions(+), 1 deletion(-)
Index: xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt
===================================================================
--- xen-4.4.0-testing.orig/docs/misc/xl-disk-configuration.txt
+++ xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt
@@ -178,6 +178,21 @@ information to be interpreted by the exe
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
Index: xen-4.4.0-testing/tools/libxl/libxl.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl.c
+++ xen-4.4.0-testing/tools/libxl/libxl.c
@@ -2213,6 +2213,8 @@ static void device_disk_add(libxl__egc *
flexarray_append(back, disk->readwrite ? "w" : "r");
flexarray_append(back, "device-type");
flexarray_append(back, disk->is_cdrom ? "cdrom" : "disk");
+ if (disk->readwrite == LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC)
+ flexarray_append_pair(back, "discard-enable", "0");
flexarray_append(front, "backend-id");
flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid));
Index: xen-4.4.0-testing/tools/libxl/libxl.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl.h
+++ xen-4.4.0-testing/tools/libxl/libxl.h
@@ -95,6 +95,17 @@
#define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
/*
+ * The libxl_device_disk lacks discard_enable field, disabling discard
+ * is supported without breaking the ABI. This is done by overloading
+ * struct libxl_device_disk->readwrite:
+ * readwrite == 0: disk is readonly, no discard
+ * readwrite == 1: disk is readwrite, backend driver may enable discard
+ * readwrite == MAGIC: disk is readwrite, backend driver should not offer
+ * discard to the frontend driver.
+ */
+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC 0xdcadU
+
+/*
* libxl ABI compatibility
*
* The only guarantee which libxl makes regarding ABI compatibility
Index: xen-4.4.0-testing/tools/libxl/libxlu_disk.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk.c
+++ xen-4.4.0-testing/tools/libxl/libxlu_disk.c
@@ -80,6 +80,9 @@ int xlu_disk_parse(XLU_Config *cfg,
disk->format = LIBXL_DISK_FORMAT_EMPTY;
}
+ if (disk->readwrite && dpc.disable_discard)
+ disk->readwrite = LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC;
+
if (!disk->vdev) {
xlu__disk_err(&dpc,0, "no vdev specified");
goto x_err;
Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_i.h
+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h
@@ -10,7 +10,7 @@ typedef struct {
void *scanner;
YY_BUFFER_STATE buf;
libxl_device_disk *disk;
- int access_set, had_depr_prefix;
+ int access_set, disable_discard, had_depr_prefix;
const char *spec;
} DiskParseContext;
Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_l.l
+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l
@@ -173,6 +173,10 @@ backendtype=[^,]*,? { STRIP(','); setbac
vdev=[^,]*,? { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
script=[^,]*,? { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
+discard=on,? { DPC->disable_discard = 0; }
+discard=1,? { DPC->disable_discard = 0; }
+discard=off,? { DPC->disable_discard = 1; }
+discard=0,? { DPC->disable_discard = 1; }
/* the target magic parameter, eats the rest of the string */

View File

@ -0,0 +1,515 @@
From 77deb80879859ed279e24a790ec08e9c5d37dd0e Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Wed, 5 Feb 2014 14:37:53 +0100
Subject: libxl: set migration constraints from cmdline
Add new options to xl migrate to control the process of migration.
The intention is to optionally abort the migration if it takes too long
to migrate a busy guest due to the high number of new dirty pages.
Currently the guest is suspended to transfer the remaining dirty pages.
The suspend/resume cycle will cause a time jump. This transfer can take
a long time, which can confuse the guest if the time jump is too far.
The new options allow to override the built-in default values, which are
not changed by this patch.
--max_iters <number> Number of iterations before final suspend (default: 30)
--max_factor <factor> Max amount of memory to transfer before final suspend (default: 3*RAM)
--min_remaing <pages> Number of dirty pages before stop&copy (default: 50)
--abort_if_busy Abort migration instead of doing final suspend.
The changes to libxl change the API, handle LIBXL_API_VERSION == 0x040200.
v8:
- merge --min_remaing changes
- tools/libxc: print stats if migration is aborted
- use special _suse version of lib calls to preserve ABI
v7:
- remove short options
- update description of --abort_if_busy in xl.1
- extend description of --abort_if_busy in xl help
- add comment to libxl_domain_suspend declaration, props is optional
v6:
- update the LIBXL_API_VERSION handling for libxl_domain_suspend
change it to an inline function if LIBXL_API_VERSION is defined to 4.2.0
- rename libxl_save_properties to libxl_domain_suspend_properties
- rename ->xlflags to ->flags within that struct
v5:
- adjust libxl_domain_suspend prototype, move flags, max_iters,
max_factor into a new, optional struct libxl_save_properties
- rename XCFLAGS_DOMSAVE_NOSUSPEND to XCFLAGS_DOMSAVE_ABORT_IF_BUSY
- rename LIBXL_SUSPEND_NO_FINAL_SUSPEND to LIBXL_SUSPEND_ABORT_IF_BUSY
- rename variables no_suspend to abort_if_busy
- rename option -N/--no_suspend to -A/--abort_if_busy
- update xl.1, extend description of -A option
v4:
- update default for no_suspend from None to 0 in XendCheckpoint.py:save
- update logoutput in setMigrateConstraints
- change xm migrate defaults from None to 0
- add new options to xl.1
- fix syntax error in XendDomain.py:domain_migrate_constraints_set
- fix xm migrate -N option name to match xl migrate
v3:
- move logic errors in libxl__domain_suspend and fixed help text in
cmd_table to separate patches
- fix syntax error in XendCheckpoint.py
- really pass max_iters and max_factor in libxl__xc_domain_save
- make libxl_domain_suspend_0x040200 declaration globally visible
- bump libxenlight.so SONAME from 2.0 to 2.1 due to changed
libxl_domain_suspend
v2:
- use LIBXL_API_VERSION and define libxl_domain_suspend_0x040200
- fix logic error in min_reached check in xc_domain_save
- add longopts
- update --help text
- correct description of migrate --help text
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
docs/man/xl.pod.1 | 20 ++++++++++++++++++++
tools/libxc/xc_domain_save.c | 27 ++++++++++++++++++++++++--
tools/libxc/xc_nomigrate.c | 10 +++++++++
tools/libxc/xenguest.h | 7 +++++++
tools/libxl/libxl.c | 27 +++++++++++++++++++++++---
tools/libxl/libxl.h | 14 ++++++++++++++
tools/libxl/libxl_dom.c | 1 +
tools/libxl/libxl_internal.h | 4 ++++
tools/libxl/libxl_save_callout.c | 4 +++-
tools/libxl/libxl_save_helper.c | 4 +++-
tools/libxl/xl_cmdimpl.c | 41 ++++++++++++++++++++++++++++++++++------
tools/libxl/xl_cmdtable.c | 23 ++++++++++++++--------
12 files changed, 161 insertions(+), 21 deletions(-)
Index: xen-4.4.0-testing/docs/man/xl.pod.1
===================================================================
--- xen-4.4.0-testing.orig/docs/man/xl.pod.1
+++ xen-4.4.0-testing/docs/man/xl.pod.1
@@ -392,6 +392,26 @@ Send <config> instead of config file fro
Print huge (!) amount of debug during the migration process.
+=item B<--max_iters> I<number>
+
+Number of iterations before final suspend (default: 30)
+
+=item B<--max_factor> I<factor>
+
+Max amount of memory to transfer before final suspend (default: 3*RAM)
+
+=item B<--min_remaining>
+
+Number of remaining dirty pages. If the number of dirty pages drops that
+low the guest is suspended and the remaing pages are transfered to <host>.
+
+=item B<--abort_if_busy>
+
+Abort migration instead of doing final suspend/transfer/resume if the
+guest has still dirty pages after the number of iterations and/or the
+amount of RAM transferred. This avoids long periods of time where the
+guest is suspended.
+
=back
=item B<remus> [I<OPTIONS>] I<domain-id> I<host>
Index: xen-4.4.0-testing/tools/libxc/xc_domain_save.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xc_domain_save.c
+++ xen-4.4.0-testing/tools/libxc/xc_domain_save.c
@@ -43,6 +43,7 @@
*/
#define DEF_MAX_ITERS 29 /* limit us to 30 times round loop */
#define DEF_MAX_FACTOR 3 /* never send more than 3x p2m_size */
+#define DEF_MIN_REMAINING 50 /* low water mark of dirty pages */
struct save_ctx {
unsigned long hvirt_start; /* virtual starting address of the hypervisor */
@@ -798,8 +799,9 @@ static int save_tsc_info(xc_interface *x
return 0;
}
-int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
+int xc_domain_save_suse(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
uint32_t max_factor, uint32_t flags,
+ uint32_t min_remaining,
struct save_callbacks* callbacks, int hvm,
unsigned long vm_generationid_addr)
{
@@ -810,6 +812,7 @@ int xc_domain_save(xc_interface *xch, in
int rc = 1, frc, i, j, last_iter = 0, iter = 0;
int live = (flags & XCFLAGS_LIVE);
int debug = (flags & XCFLAGS_DEBUG);
+ int abort_if_busy = (flags & XCFLAGS_DOMSAVE_ABORT_IF_BUSY);
int superpages = !!hvm;
int race = 0, sent_last_iter, skip_this_iter = 0;
unsigned int sent_this_iter = 0;
@@ -910,6 +913,7 @@ int xc_domain_save(xc_interface *xch, in
/* If no explicit control parameters given, use defaults */
max_iters = max_iters ? : DEF_MAX_ITERS;
max_factor = max_factor ? : DEF_MAX_FACTOR;
+ min_remaining = min_remaining ? : DEF_MIN_REMAINING;
if ( !get_platform_info(xch, dom,
&ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) )
@@ -1563,10 +1567,22 @@ int xc_domain_save(xc_interface *xch, in
if ( live )
{
+ int min_reached = sent_this_iter + skip_this_iter < min_remaining;
if ( (iter >= max_iters) ||
- (sent_this_iter+skip_this_iter < 50) ||
+ min_reached ||
(total_sent > dinfo->p2m_size*max_factor) )
{
+ if ( !min_reached && abort_if_busy )
+ {
+ errnoval = EBUSY;
+ DPRINTF("Live migration aborted, as requested. (guest too busy?)");
+ DPRINTF(" total_sent %lu iter %d, max_iters %u max_factor %u",
+ total_sent, iter, max_iters, max_factor);
+ print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
+ rc = 1;
+ goto out;
+ }
+
DPRINTF("Start last iteration\n");
last_iter = 1;
@@ -2210,6 +2226,13 @@ exit:
return !!rc;
}
+int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
+ uint32_t max_factor, uint32_t flags,
+ struct save_callbacks* callbacks, int hvm,
+ unsigned long vm_generationid_addr)
+{
+ return xc_domain_save_suse(xch, io_fd, dom, max_iters, max_factor, flags, 0, callbacks, hvm, vm_generationid_addr);
+}
/*
* Local variables:
Index: xen-4.4.0-testing/tools/libxc/xc_nomigrate.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xc_nomigrate.c
+++ xen-4.4.0-testing/tools/libxc/xc_nomigrate.c
@@ -21,6 +21,16 @@
#include <xenctrl.h>
#include <xenguest.h>
+int xc_domain_save_suse(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
+ uint32_t max_factor, uint32_t flags,
+ uint32_t min_remaining,
+ struct save_callbacks* callbacks, int hvm,
+ unsigned long vm_generationid_addr)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
uint32_t max_factor, uint32_t flags,
struct save_callbacks* callbacks, int hvm,
Index: xen-4.4.0-testing/tools/libxc/xenguest.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xenguest.h
+++ xen-4.4.0-testing/tools/libxc/xenguest.h
@@ -28,6 +28,7 @@
#define XCFLAGS_HVM (1 << 2)
#define XCFLAGS_STDVGA (1 << 3)
#define XCFLAGS_CHECKPOINT_COMPRESS (1 << 4)
+#define XCFLAGS_DOMSAVE_ABORT_IF_BUSY (1 << 5)
#define X86_64_B_SIZE 64
#define X86_32_B_SIZE 32
@@ -89,6 +90,12 @@ int xc_domain_save(xc_interface *xch, in
struct save_callbacks* callbacks, int hvm,
unsigned long vm_generationid_addr);
+int xc_domain_save_suse(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
+ uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
+ uint32_t min_remaining,
+ struct save_callbacks* callbacks, int hvm,
+ unsigned long vm_generationid_addr);
+
/* callbacks provided by xc_domain_restore */
struct restore_callbacks {
Index: xen-4.4.0-testing/tools/libxl/libxl.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl.c
+++ xen-4.4.0-testing/tools/libxl/libxl.c
@@ -763,7 +763,8 @@ static void domain_suspend_cb(libxl__egc
}
-int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
+static int do_libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd,
+ const libxl_domain_suspend_suse_properties *props,
const libxl_asyncop_how *ao_how)
{
AO_CREATE(ctx, domid, ao_how);
@@ -784,8 +785,14 @@ int libxl_domain_suspend(libxl_ctx *ctx,
dss->domid = domid;
dss->fd = fd;
dss->type = type;
- dss->live = flags & LIBXL_SUSPEND_LIVE;
- dss->debug = flags & LIBXL_SUSPEND_DEBUG;
+ if (props) {
+ dss->live = props->flags & LIBXL_SUSPEND_LIVE;
+ dss->debug = props->flags & LIBXL_SUSPEND_DEBUG;
+ dss->max_iters = props->max_iters;
+ dss->max_factor = props->max_factor;
+ dss->min_remaining = props->min_remaining;
+ dss->xlflags = props->flags;
+ }
libxl__domain_suspend(egc, dss);
return AO_INPROGRESS;
@@ -794,6 +801,20 @@ int libxl_domain_suspend(libxl_ctx *ctx,
return AO_ABORT(rc);
}
+int libxl_domain_suspend_suse(libxl_ctx *ctx, uint32_t domid, int fd,
+ const libxl_domain_suspend_suse_properties *props,
+ const libxl_asyncop_how *ao_how)
+{
+ return do_libxl_domain_suspend(ctx, domid, fd, props, ao_how);
+}
+
+int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
+ const libxl_asyncop_how *ao_how)
+{
+ libxl_domain_suspend_suse_properties props = { .flags = flags };
+ return do_libxl_domain_suspend(ctx, domid, fd, &props, ao_how);
+}
+
int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid)
{
int ret;
Index: xen-4.4.0-testing/tools/libxl/libxl.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl.h
+++ xen-4.4.0-testing/tools/libxl/libxl.h
@@ -687,8 +687,22 @@ int libxl_domain_suspend(libxl_ctx *ctx,
int flags, /* LIBXL_SUSPEND_* */
const libxl_asyncop_how *ao_how)
LIBXL_EXTERNAL_CALLERS_ONLY;
+
+typedef struct {
+ int flags; /* LIBXL_SUSPEND_* */
+ int max_iters;
+ int max_factor;
+ int min_remaining;
+} libxl_domain_suspend_suse_properties;
+
+int libxl_domain_suspend_suse(libxl_ctx *ctx, uint32_t domid, int fd,
+ const libxl_domain_suspend_suse_properties *props, /* optional */
+ const libxl_asyncop_how *ao_how)
+ LIBXL_EXTERNAL_CALLERS_ONLY;
+
#define LIBXL_SUSPEND_DEBUG 1
#define LIBXL_SUSPEND_LIVE 2
+#define LIBXL_SUSPEND_ABORT_IF_BUSY 4
/* @param suspend_cancel [from xenctrl.h:xc_domain_resume( @param fast )]
* If this parameter is true, use co-operative resume. The guest
Index: xen-4.4.0-testing/tools/libxl/libxl_dom.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl_dom.c
+++ xen-4.4.0-testing/tools/libxl/libxl_dom.c
@@ -1337,6 +1337,7 @@ void libxl__domain_suspend(libxl__egc *e
dss->xcflags = (live ? XCFLAGS_LIVE : 0)
| (debug ? XCFLAGS_DEBUG : 0)
+ | (dss->xlflags & LIBXL_SUSPEND_ABORT_IF_BUSY ? XCFLAGS_DOMSAVE_ABORT_IF_BUSY : 0)
| (dss->hvm ? XCFLAGS_HVM : 0);
dss->suspend_eventchn = -1;
Index: xen-4.4.0-testing/tools/libxl/libxl_internal.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl_internal.h
+++ xen-4.4.0-testing/tools/libxl/libxl_internal.h
@@ -2319,6 +2319,10 @@ struct libxl__domain_suspend_state {
xc_evtchn *xce; /* event channel handle */
int suspend_eventchn;
int hvm;
+ int max_iters;
+ int max_factor;
+ int min_remaining;
+ int xlflags;
int xcflags;
int guest_responded;
const char *dm_savefile;
Index: xen-4.4.0-testing/tools/libxl/libxl_save_callout.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl_save_callout.c
+++ xen-4.4.0-testing/tools/libxl/libxl_save_callout.c
@@ -108,7 +108,9 @@ void libxl__xc_domain_save(libxl__egc *e
}
const unsigned long argnums[] = {
- dss->domid, 0, 0, dss->xcflags, dss->hvm, vm_generationid_addr,
+ dss->domid,
+ dss->max_iters, dss->max_factor, dss->min_remaining,
+ dss->xcflags, dss->hvm, vm_generationid_addr,
toolstack_data_fd, toolstack_data_len,
cbflags,
};
Index: xen-4.4.0-testing/tools/libxl/libxl_save_helper.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl_save_helper.c
+++ xen-4.4.0-testing/tools/libxl/libxl_save_helper.c
@@ -221,6 +221,7 @@ int main(int argc, char **argv)
uint32_t dom = strtoul(NEXTARG,0,10);
uint32_t max_iters = strtoul(NEXTARG,0,10);
uint32_t max_factor = strtoul(NEXTARG,0,10);
+ uint32_t min_remaining = strtoul(NEXTARG,0,10);
uint32_t flags = strtoul(NEXTARG,0,10);
int hvm = atoi(NEXTARG);
unsigned long genidad = strtoul(NEXTARG,0,10);
@@ -235,7 +236,8 @@ int main(int argc, char **argv)
helper_setcallbacks_save(&helper_save_callbacks, cbflags);
startup("save");
- r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags,
+ r = xc_domain_save_suse(xch, io_fd, dom, max_iters, max_factor, flags,
+ min_remaining,
&helper_save_callbacks, hvm, genidad);
complete(r);
Index: xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/xl_cmdimpl.c
+++ xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c
@@ -3645,6 +3645,8 @@ static void migrate_do_preamble(int send
}
static void migrate_domain(uint32_t domid, const char *rune, int debug,
+ int max_iters, int max_factor,
+ int min_remaining, int abort_if_busy,
const char *override_config_file)
{
pid_t child = -1;
@@ -3653,7 +3655,13 @@ static void migrate_domain(uint32_t domi
char *away_domname;
char rc_buf;
uint8_t *config_data;
- int config_len, flags = LIBXL_SUSPEND_LIVE;
+ int config_len;
+ libxl_domain_suspend_suse_properties props = {
+ .flags = LIBXL_SUSPEND_LIVE,
+ .max_iters = max_iters,
+ .max_factor = max_factor,
+ .min_remaining = min_remaining,
+ };
save_domain_core_begin(domid, override_config_file,
&config_data, &config_len);
@@ -3672,10 +3680,13 @@ static void migrate_domain(uint32_t domi
xtl_stdiostream_adjust_flags(logger, XTL_STDIOSTREAM_HIDE_PROGRESS, 0);
if (debug)
- flags |= LIBXL_SUSPEND_DEBUG;
- rc = libxl_domain_suspend(ctx, domid, send_fd, flags, NULL);
+ props.flags |= LIBXL_SUSPEND_DEBUG;
+ if (abort_if_busy)
+ props.flags |= LIBXL_SUSPEND_ABORT_IF_BUSY;
+
+ rc = libxl_domain_suspend_suse(ctx, domid, send_fd, &props, NULL);
if (rc) {
- fprintf(stderr, "migration sender: libxl_domain_suspend failed"
+ fprintf(stderr, "migration sender: libxl_domain_suspend_suse failed"
" (rc=%d)\n", rc);
if (rc == ERROR_GUEST_TIMEDOUT)
goto failed_suspend;
@@ -4062,13 +4073,18 @@ int main_migrate(int argc, char **argv)
char *rune = NULL;
char *host;
int opt, daemonize = 1, monitor = 1, debug = 0;
+ int max_iters = 0, max_factor = 0, min_remaining = 0, abort_if_busy = 0;
static struct option opts[] = {
{"debug", 0, 0, 0x100},
+ {"max_iters", 1, 0, 0x101},
+ {"max_factor", 1, 0, 0x102},
+ {"min_remaining", 1, 0, 0x103},
+ {"abort_if_busy", 0, 0, 0x104},
COMMON_LONG_OPTS,
{0, 0, 0, 0}
};
- SWITCH_FOREACH_OPT(opt, "FC:s:e", opts, "migrate", 2) {
+ SWITCH_FOREACH_OPT(opt, "FC:s:eM:m:A", opts, "migrate", 2) {
case 'C':
config_filename = optarg;
break;
@@ -4085,6 +4101,18 @@ int main_migrate(int argc, char **argv)
case 0x100:
debug = 1;
break;
+ case 0x101:
+ max_iters = atoi(optarg);
+ break;
+ case 0x102:
+ max_factor = atoi(optarg);
+ break;
+ case 0x103:
+ min_remaining = atoi(optarg);
+ break;
+ case 0x104:
+ abort_if_busy = 1;
+ break;
}
domid = find_domain(argv[optind]);
@@ -4100,7 +4128,8 @@ int main_migrate(int argc, char **argv)
return 1;
}
- migrate_domain(domid, rune, debug, config_filename);
+ migrate_domain(domid, rune, debug, max_iters, max_factor, min_remaining,
+ abort_if_busy, config_filename);
return 0;
}
#endif
Index: xen-4.4.0-testing/tools/libxl/xl_cmdtable.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/xl_cmdtable.c
+++ xen-4.4.0-testing/tools/libxl/xl_cmdtable.c
@@ -150,14 +150,21 @@ struct cmd_spec cmd_table[] = {
&main_migrate, 0, 1,
"Migrate a domain to another host",
"[options] <Domain> <host>",
- "-h Print this help.\n"
- "-C <config> Send <config> instead of config file from creation.\n"
- "-s <sshcommand> Use <sshcommand> instead of ssh. String will be passed\n"
- " to sh. If empty, run <host> instead of ssh <host> xl\n"
- " migrate-receive [-d -e]\n"
- "-e Do not wait in the background (on <host>) for the death\n"
- " of the domain.\n"
- "--debug Print huge (!) amount of debug during the migration process."
+ "-h Print this help.\n"
+ "-C <config> Send <config> instead of config file from creation.\n"
+ "-s <sshcommand> Use <sshcommand> instead of ssh. String will be passed\n"
+ " to sh. If empty, run <host> instead of ssh <host> xl\n"
+ " migrate-receive [-d -e]\n"
+ "-e Do not wait in the background (on <host>) for the death\n"
+ " of the domain.\n"
+ "--debug Print huge (!) amount of debug during the migration process.\n"
+ "\n"
+ "SUSE Linux specific options:\n"
+ "--max_iters <number> Number of iterations before final suspend (default: 30)\n"
+ "--max_factor <factor> Max amount of memory to transfer before final suspend (default: 3*RAM).\n"
+ "--min_remaining <pages> Number of remaining dirty pages before final suspend (default: 50).\n"
+ "--abort_if_busy Abort migration instead of doing final suspend, if number\n"
+ " of iterations or amount of transfered memory is exceeded."
},
{ "restore",
&main_restore, 0, 1,

View File

@ -6,7 +6,7 @@ Index: xen-4.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c --- xen-4.4.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +++ xen-4.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -322,7 +322,10 @@ static int check_platform_magic(struct d @@ -337,7 +337,10 @@ static int check_platform_magic(struct d
if (magic != XEN_IOPORT_MAGIC_VAL) { if (magic != XEN_IOPORT_MAGIC_VAL) {
err = "unrecognised magic value"; err = "unrecognised magic value";

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3b56a36923b59d32ee786e4f43f4b6cf31f260d8244ca62fc9a2dcc6fc9e7dcc oid sha256:3e62addd6c9481d6b12e951dffb8474b7ccffa50a007caf7d9c9ad17fbdac4ee
size 7571075 size 7571602

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:09f3f0d1ddfa65ac71bd67da2ba45992f5945bacd551cce01e6ea50aec96bca0 oid sha256:ee8f1852348a9054add13614aa36cd5d0dc06522bad0e442bb7c6a8e1fcd871a
size 3213079 size 3213098

View File

@ -1,21 +1,23 @@
References: FATE#316071 References: FATE#316071
Subject: [RFC] qemu-upstream: add discard support for xen_disk Subject: qemu-upstream: add discard support for xen_disk
Implement discard support for xen_disk. It makes use of the existing Implement discard support for xen_disk. It makes use of the existing
discard code in qemu. discard code in qemu.
The discard support is enabled unconditionally. But it would be worth to The discard support is enabled unconditionally. The tool stack may provide a
have a knob to disable it in case the backing file was intentionally property "discard-enable" in the backend node to optionally disable discard
created non-sparse to avoid fragmentation. support. This is helpful in case the backing file was intentionally created
How could this be knob be passed from domU.cfg:disk=[] to the actual non-sparse to avoid fragmentation.
qemu process? Perhaps introduce an option discard=on|off|ignore|unmap.
v2:
rename xenstore property from discard_enable to discard-enable
move discard_req to case BLKIF_OP_DISCARD
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Olaf Hering <olaf@aepfle.de>
--- ---
tools/qemu-xen-dir-remote/hw/block/xen_blkif.h | 12 ++++++++ tools/qemu-xen-dir-remote/hw/block/xen_blkif.h | 12 ++++++++++
tools/qemu-xen-dir-remote/hw/block/xen_disk.c | 36 +++++++++++++++++++++++++ tools/qemu-xen-dir-remote/hw/block/xen_disk.c | 30 +++++++++++++++++++++++++
2 files changed, 48 insertions(+) 2 files changed, 42 insertions(+)
Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_blkif.h Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_blkif.h
=================================================================== ===================================================================
@ -51,16 +53,7 @@ Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_disk.c
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/qemu-xen-dir-remote/hw/block/xen_disk.c --- xen-4.4.0-testing.orig/tools/qemu-xen-dir-remote/hw/block/xen_disk.c
+++ xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_disk.c +++ xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_disk.c
@@ -68,6 +68,8 @@ struct ioreq { @@ -114,6 +114,7 @@ struct XenBlkDev {
int presync;
int postsync;
uint8_t mapped;
+ int64_t sector_num;
+ int nb_sectors;
/* grant mapping */
uint32_t domids[BLKIF_MAX_SEGMENTS_PER_REQUEST];
@@ -114,6 +116,7 @@ struct XenBlkDev {
int requests_finished; int requests_finished;
/* Persistent grants extension */ /* Persistent grants extension */
@ -68,64 +61,53 @@ Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_disk.c
gboolean feature_persistent; gboolean feature_persistent;
GTree *persistent_gnts; GTree *persistent_gnts;
unsigned int persistent_gnt_count; unsigned int persistent_gnt_count;
@@ -232,6 +235,7 @@ static void ioreq_release(struct ioreq * @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ior
static int ioreq_parse(struct ioreq *ioreq) case BLKIF_OP_WRITE:
{ ioreq->prot = PROT_READ; /* from memory */
struct XenBlkDev *blkdev = ioreq->blkdev;
+ struct blkif_request_discard *discard_req = (void *)&ioreq->req;
uintptr_t mem;
size_t len;
int i;
@@ -244,6 +248,10 @@ static int ioreq_parse(struct ioreq *ior
case BLKIF_OP_READ:
ioreq->prot = PROT_WRITE; /* to memory */
break; break;
+ case BLKIF_OP_DISCARD: + case BLKIF_OP_DISCARD:
+ ioreq->sector_num = discard_req->sector_number;
+ ioreq->nb_sectors = discard_req->nr_sectors;
+ return 0; + return 0;
case BLKIF_OP_FLUSH_DISKCACHE: default:
ioreq->presync = 1; xen_be_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n",
if (!ioreq->req.nr_segments) { ioreq->req.operation);
@@ -521,6 +529,13 @@ static int ioreq_runio_qemu_aio(struct i @@ -521,6 +524,16 @@ static int ioreq_runio_qemu_aio(struct i
&ioreq->v, ioreq->v.size / BLOCK_SIZE, &ioreq->v, ioreq->v.size / BLOCK_SIZE,
qemu_aio_complete, ioreq); qemu_aio_complete, ioreq);
break; break;
+ case BLKIF_OP_DISCARD: + case BLKIF_OP_DISCARD:
+ bdrv_acct_start(blkdev->bs, &ioreq->acct, ioreq->nb_sectors * BLOCK_SIZE, BDRV_ACCT_WRITE); + {
+ struct blkif_request_discard *discard_req = (void *)&ioreq->req;
+ bdrv_acct_start(blkdev->bs, &ioreq->acct, discard_req->nr_sectors * BLOCK_SIZE, BDRV_ACCT_WRITE);
+ ioreq->aio_inflight++; + ioreq->aio_inflight++;
+ bdrv_aio_discard(blkdev->bs, + bdrv_aio_discard(blkdev->bs,
+ ioreq->sector_num, ioreq->nb_sectors, + discard_req->sector_number, discard_req->nr_sectors,
+ qemu_aio_complete, ioreq); + qemu_aio_complete, ioreq);
+ break; + break;
+ }
default: default:
/* unknown operation (shouldn't happen -- parse catches this) */ /* unknown operation (shouldn't happen -- parse catches this) */
goto err; goto err;
@@ -699,6 +714,23 @@ static void blk_alloc(struct XenDevice * @@ -699,6 +712,19 @@ static void blk_alloc(struct XenDevice *
} }
} }
+static void blk_parse_discard(struct XenBlkDev *blkdev) +static void blk_parse_discard(struct XenBlkDev *blkdev)
+{ +{
+ int flags = BDRV_O_UNMAP; + int enable;
+#if 0
+ char *s = xenstore_read_be_str(&blkdev->xendev, "toolstack-options-discard");
+ +
+ if (s && bdrv_parse_discard_flags(s, &flags) < 0) { + blkdev->feature_discard = true;
+ xen_be_printf(xendev, 0, "property toolstack-discard-options failed to parse: %s\n", s); +
+ return; + if (xenstore_read_be_int(&blkdev->xendev, "discard-enable", &enable) == 0)
+ } + blkdev->feature_discard = !!enable;
+#endif +
+ blkdev->feature_discard = !!(flags & BDRV_O_UNMAP); + if (blkdev->feature_discard)
+ if (!blkdev->feature_discard) + xenstore_write_be_int(&blkdev->xendev, "feature-discard", 1);
+ return;
+ xenstore_write_be_int(&blkdev->xendev, "feature-discard", 1);
+} +}
+ +
static int blk_init(struct XenDevice *xendev) static int blk_init(struct XenDevice *xendev)
{ {
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
@@ -766,6 +798,8 @@ static int blk_init(struct XenDevice *xe @@ -766,6 +792,8 @@ static int blk_init(struct XenDevice *xe
xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1); xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
xenstore_write_be_int(&blkdev->xendev, "info", info); xenstore_write_be_int(&blkdev->xendev, "info", info);
@ -134,7 +116,7 @@ Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_disk.c
g_free(directiosafe); g_free(directiosafe);
return 0; return 0;
@@ -801,6 +835,8 @@ static int blk_connect(struct XenDevice @@ -801,6 +829,8 @@ static int blk_connect(struct XenDevice
qflags |= BDRV_O_RDWR; qflags |= BDRV_O_RDWR;
readonly = false; readonly = false;
} }

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:25e28a2c8b953e6764b76a47c5543ef986ed14864e4b6575ad82b2002c355aa6 oid sha256:76b7b90cca79d7804cb4234ca1d403b8e4e03f103e3dcd03489541e66e611bf0
size 366253 size 366520

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:c60b78517141f58aeb10a7cce305bb6576d2cc45dd6bd112fbe700ae958a5221 oid sha256:4ad02731bbe8fffa1c57d5b10ddf435c01c6ecadf2a8d342660abfda1d6419d2
size 4350072 size 4356222

View File

@ -1,3 +1,108 @@
-------------------------------------------------------------------
Tue Feb 17 12:33:42 MST 2014 - carnold@suse.com
- Update to Xen 4.4.0 RC4 c/s 28391
xen-4.4.0-testing-src.tar.bz2
-------------------------------------------------------------------
Tue Feb 11 13:27:42 MST 2014 - carnold@suse.com
- Update to c/s 28381 to include libxl fork and event fixes for
libvirt
xen-4.4.0-testing-src.tar.bz2
-------------------------------------------------------------------
Tue Feb 11 16:14:08 CET 2014 - ohering@suse.de
- bnc#863297: xend/pvscsi: recognize also SCSI CDROM devices
xend-pvscsi-recognize-also-SCSI-CDROM-devices.patch
-------------------------------------------------------------------
Tue Feb 11 09:24:23 CET 2014 - ohering@suse.de
- fate#316614: set migration constraints from cmdline
fix xl migrate to print the actual error string
libxc-pass-errno-to-callers-of-xc_domain_save.patch
-------------------------------------------------------------------
Mon Feb 10 10:01:54 MST 2014 - carnold@suse.com
- Include additional help docs for xl in xen-tools
- Apply all patches including those for unpackaged xend
xen.spec
-------------------------------------------------------------------
Mon Feb 10 10:28:18 CET 2014 - ohering@suse.de
- fate#316614: set migration constraints from cmdline
split existing changes into libxl and xend part
added libxl.set-migration-constraints-from-cmdline.patch
added xend-set-migration-constraints-from-cmdline.patch
removed xen.migrate.tools_add_xm_migrate_--log_progress_option.patch
removed xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch
removed xen.migrate.tools_set_migration_constraints_from_cmdline.patch
-------------------------------------------------------------------
Tue Feb 4 11:20:12 MST 2014 - carnold@suse.com
- Enable ix86 32bit build for xen-libs to be built to support
xen-tools-domU on 32bit VMs and also vhostmd running in 32bit VMs
-------------------------------------------------------------------
Sun Feb 3 16:38:34 MST 2014 - carnold@suse.de
- Enable blktapctrl when qemu-traditional is required to satisfy
build dependencies. Remove binaries after build if xend is
disabled
-------------------------------------------------------------------
Sun Feb 2 22:47:34 CET 2014 - ohering@suse.de
- update ifarch usage in xen.spec to cover also arm
- blktapctrl is used only by xend
- fix xend-tools-xend sub pkg handling
- default to gcc47 for sles11sp3 builds
- remove all latex packages from BuildRequires
- aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch
-------------------------------------------------------------------
Sun Feb 2 19:43:05 CET 2014 - ohering@suse.de
- add arch dependent install suffix for /boot/xen files
-------------------------------------------------------------------
Sat Feb 1 13:39:03 CET 2014 - ohering@suse.de
- Set max_cpus==4 for non-x86_64 builds
-------------------------------------------------------------------
Fri Jan 31 08:41:15 MST 2014 - carnold@suse.com
- Update to Xen 4.4.0 RC3 c/s 28321
-------------------------------------------------------------------
Thu Jan 30 23:10:22 CET 2014 - ohering@suse.de
- Add flex and bison to BuildRequires, needed by previous patch
-------------------------------------------------------------------
Thu Jan 30 17:19:10 CET 2014 - ohering@suse.de
- fate#316071: add discard support for file backed storage (qdisk)
libxl.add-option-for-discard-support-to-xl-disk-conf.patch
-------------------------------------------------------------------
Thu Jan 27 19:53:39 MST 2014 - carnold@suse.com
- On platforms where xend is still supported don't output a
deprecation warning when using xm.
xend-remove-xm-deprecation-warning.patch
-------------------------------------------------------------------
Thu Jan 23 16:11:39 MST 2014 - carnold@suse.com
- Changed License to GPL-2.0 (from GPL-2.0+)
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jan 23 16:11:39 MST 2014 - carnold@suse.com Thu Jan 23 16:11:39 MST 2014 - carnold@suse.com
@ -15,6 +120,8 @@ Sat Jan 18 00:35:46 CET 2014 - ohering@suse.de
pv-on-hvm files. pv-on-hvm files.
Rely on core kernel to skip initialization of emulated hardware Rely on core kernel to skip initialization of emulated hardware
Handle xen_emul_unplug= from xenlinux based core kernel-default Handle xen_emul_unplug= from xenlinux based core kernel-default
xen_pvonhvm.xen_emul_unplug.patch
Dropped xen_pvdrivers.conf
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jan 16 13:11:32 MST 2014 - carnold@suse.com Wed Jan 16 13:11:32 MST 2014 - carnold@suse.com
@ -29,6 +136,7 @@ Wed Jan 15 19:55:32 CET 2014 - ohering@suse.de
- fate#316071: add discard support for file backed storage (qdisk) - fate#316071: add discard support for file backed storage (qdisk)
to qemu-upstream, enabled unconditionally to qemu-upstream, enabled unconditionally
qemu-xen-upstream-blkif-discard.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 14 12:13:45 MST 2014 - carnold@suse.com Tue Jan 14 12:13:45 MST 2014 - carnold@suse.com
@ -39,6 +147,10 @@ Tue Jan 14 12:13:45 MST 2014 - carnold@suse.com
Tue Jan 9 11:44:11 MST 2014 - carnold@suse.com Tue Jan 9 11:44:11 MST 2014 - carnold@suse.com
- Restore 32bit ix86 support in spec file for kmps and domU tools - Restore 32bit ix86 support in spec file for kmps and domU tools
- Restore a few missing xend patches
xend-config-enable-dump-comment.patch
xend-tools-watchdog-support.patch
xend-vif-route-ifup.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 2 11:52:11 MST 2014 - carnold@suse.com Tue Jan 2 11:52:11 MST 2014 - carnold@suse.com

View File

@ -17,11 +17,11 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/python/xen/xend/XendCheckpoint.py | 6 +++--- tools/python/xen/xend/XendCheckpoint.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-) 1 file changed, 3 insertions(+), 3 deletions(-)
Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
=================================================================== ===================================================================
--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -262,9 +262,6 @@ def restore(xd, fd, dominfo = None, paus @@ -267,9 +267,6 @@ def restore(xd, fd, dominfo = None, paus
store_port = dominfo.getStorePort() store_port = dominfo.getStorePort()
console_port = dominfo.getConsolePort() console_port = dominfo.getConsolePort()
@ -31,7 +31,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py
# if hvm, pass mem size to calculate the store_mfn # if hvm, pass mem size to calculate the store_mfn
if is_hvm: if is_hvm:
apic = int(dominfo.info['platform'].get('apic', 0)) apic = int(dominfo.info['platform'].get('apic', 0))
@@ -276,6 +273,9 @@ def restore(xd, fd, dominfo = None, paus @@ -281,6 +278,9 @@ def restore(xd, fd, dominfo = None, paus
pae = 0 pae = 0
try: try:

View File

@ -1,144 +0,0 @@
user: Olaf Hering <olaf@aepfle.de>
date: Wed Mar 06 17:05:15 2013 +0100
files: tools/libxc/xenguest.h tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/migrate.py tools/xcutils/xc_save.c
description:
tools: add xm migrate --log_progress option
xc_domain_save does print progress messages. These verbose messages are
disabled per default to avoid flood in xend.log. Sometimes it is helpful
to see progress when migrating large and busy guests. So add a new
option to xm migrate to actually enable the printing of progress
messsages.
xl migrate is not modified with this change because it does not use the
stdio logger.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Index: xen-4.4.0-testing/tools/libxc/xenguest.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xenguest.h
+++ xen-4.4.0-testing/tools/libxc/xenguest.h
@@ -29,6 +29,7 @@
#define XCFLAGS_STDVGA (1 << 3)
#define XCFLAGS_CHECKPOINT_COMPRESS (1 << 4)
#define XCFLAGS_DOMSAVE_ABORT_IF_BUSY (1 << 5)
+#define XCFLAGS_PROGRESS (1 << 6)
#define X86_64_B_SIZE 64
#define X86_32_B_SIZE 32
Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -121,16 +121,19 @@ def save(fd, dominfo, network, live, dst
max_iters = dominfo.info.get('max_iters', "0")
max_factor = dominfo.info.get('max_factor', "0")
abort_if_busy = dominfo.info.get('abort_if_busy', "0")
+ log_save_progress = dominfo.info.get('log_save_progress', "0")
if max_iters == "None":
max_iters = "0"
if max_factor == "None":
max_factor = "0"
if abort_if_busy == "None":
abort_if_busy = "0"
+ if log_save_progress == "None":
+ log_save_progress = "0"
cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
str(dominfo.getDomid()),
max_iters, max_factor,
- str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) ) ]
+ str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ]
log.debug("[xc_save]: %s", string.join(cmd))
def saveInputHandler(line, tochild):
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
@@ -1832,17 +1832,18 @@ class XendDomain:
log.exception(ex)
raise XendError(str(ex))
- def domain_migrate_constraints_set(self, domid, max_iters, max_factor, abort_if_busy):
+ def domain_migrate_constraints_set(self, domid, max_iters, max_factor, abort_if_busy, log_save_progress):
"""Set the Migrate Constraints of this domain.
@param domid: Domain ID or Name
@param max_iters: Number of iterations before final suspend
@param max_factor: Max amount of memory to transfer before final suspend
@param abort_if_busy: Abort migration instead of doing final suspend
+ @param log_save_progress: Log progress of migrate to xend.log
"""
dominfo = self.domain_lookup_nr(domid)
if not dominfo:
raise XendInvalidDomain(str(domid))
- dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy)
+ dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy, log_save_progress)
def domain_maxmem_set(self, domid, mem):
"""Set the memory limit for a domain.
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1475,17 +1475,19 @@ class XendDomainInfo:
break
xen.xend.XendDomain.instance().managed_config_save(self)
- def setMigrateConstraints(self, max_iters, max_factor, abort_if_busy):
+ def setMigrateConstraints(self, max_iters, max_factor, abort_if_busy, log_save_progress):
"""Set the Migrate Constraints of this domain.
@param max_iters: Number of iterations before final suspend
@param max_factor: Max amount of memory to transfer before final suspend
@param abort_if_busy: Abort migration instead of doing final suspend
+ @param log_save_progress: Log progress of migrate to xend.log
"""
log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s'.",
self.info['name_label'], str(self.domid), max_iters, max_factor, abort_if_busy)
self.info['max_iters'] = str(max_iters)
self.info['max_factor'] = str(max_factor)
self.info['abort_if_busy'] = str(abort_if_busy)
+ self.info['log_save_progress'] = str(log_save_progress)
def setMemoryTarget(self, target):
"""Set the memory target of this domain.
Index: xen-4.4.0-testing/tools/python/xen/xm/migrate.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xm/migrate.py
+++ xen-4.4.0-testing/tools/python/xen/xm/migrate.py
@@ -67,6 +67,10 @@ gopts.opt('abort_if_busy',
fn=set_true, default=0,
use="Abort migration instead of doing final suspend.")
+gopts.opt('log_progress',
+ fn=set_true, default=0,
+ use="Log progress of migration to xend.log")
+
def help():
return str(gopts)
@@ -95,7 +99,8 @@ def main(argv):
server.xend.domain.migrate_constraints_set(dom,
opts.vals.max_iters,
opts.vals.max_factor,
- opts.vals.abort_if_busy)
+ opts.vals.abort_if_busy,
+ opts.vals.log_progress)
server.xend.domain.migrate(dom, dst, opts.vals.live,
opts.vals.port,
opts.vals.node,
Index: xen-4.4.0-testing/tools/xcutils/xc_save.c
===================================================================
--- xen-4.4.0-testing.orig/tools/xcutils/xc_save.c
+++ xen-4.4.0-testing/tools/xcutils/xc_save.c
@@ -184,7 +184,8 @@ main(int argc, char **argv)
si.suspend_evtchn = -1;
lvl = si.flags & XCFLAGS_DEBUG ? XTL_DEBUG: XTL_DETAIL;
- lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS;
+ lflags = XTL_STDIOSTREAM_SHOW_PID;
+ lflags |= si.flags & XCFLAGS_PROGRESS ? 0 : XTL_STDIOSTREAM_HIDE_PROGRESS;
l = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, lvl, lflags);
si.xch = xc_interface_open(l, 0, 0);
if (!si.xch)

View File

@ -1,232 +0,0 @@
user: Olaf Hering <olaf@aepfle.de>
date: Wed Mar 06 17:05:14 2013 +0100
files: docs/man/xl.pod.1 tools/libxc/xc_domain_save.c tools/libxc/xenguest.h tools/libxl/Makefile tools/libxl/libxl.c tools/libxl/libxl.h tools/libxl/libxl_dom.c tools/libxl/libxl_internal.h tools/libxl/libxl_save_callout.c tools/libxl/xl_cmdimpl.c tools/libxl/xl_cmdtable.c tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/migrate.py
description:
tools: set migration constraints from cmdline
Add new options to xm/xl migrate to control the process of migration.
The intention is to optionally abort the migration if it takes too long
to migrate a busy guest due to the high number of dirty pages. Currently
the guest is suspended to transfer the remaining dirty pages. This
transfer can take too long, which can confuse the guest if its suspended
for too long.
-M <number> Number of iterations before final suspend (default: 30)
--max_iters <number>
-m <factor> Max amount of memory to transfer before final suspend (default: 3*RAM)
--max_factor <factor>
-A Abort migration instead of doing final suspend.
--abort_if_busy
The changes to libxl change the API, handle LIBXL_API_VERSION == 0x040200.
TODO:
eventually add also --min_remaining (default value 50) in a seperate patch
v6:
- update the LIBXL_API_VERSION handling for libxl_domain_suspend
change it to an inline function if LIBXL_API_VERSION is defined to 4.2.0
- rename libxl_save_properties to libxl_domain_suspend_properties
- rename ->xlflags to ->flags within that struct
v5:
- adjust libxl_domain_suspend prototype, move flags, max_iters,
max_factor into a new, optional struct libxl_save_properties
- rename XCFLAGS_DOMSAVE_NOSUSPEND to XCFLAGS_DOMSAVE_ABORT_IF_BUSY
- rename LIBXL_SUSPEND_NO_FINAL_SUSPEND to LIBXL_SUSPEND_ABORT_IF_BUSY
- rename variables no_suspend to abort_if_busy
- rename option -N/--no_suspend to -A/--abort_if_busy
- update xl.1, extend description of -A option
v4:
- update default for no_suspend from None to 0 in XendCheckpoint.py:save
- update logoutput in setMigrateConstraints
- change xm migrate defaults from None to 0
- add new options to xl.1
- fix syntax error in XendDomain.py:domain_migrate_constraints_set
- fix xm migrate -N option name to match xl migrate
v3:
- move logic errors in libxl__domain_suspend and fixed help text in
cmd_table to separate patches
- fix syntax error in XendCheckpoint.py
- really pass max_iters and max_factor in libxl__xc_domain_save
- make libxl_domain_suspend_0x040200 declaration globally visible
- bump libxenlight.so SONAME from 2.0 to 2.1 due to changed
libxl_domain_suspend
v2:
- use LIBXL_API_VERSION and define libxl_domain_suspend_0x040200
- fix logic error in min_reached check in xc_domain_save
- add longopts
- update --help text
- correct description of migrate --help text
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/libxc/xc_domain_save.c | 13 ++++++++++++-
tools/libxc/xenguest.h | 1 +
tools/python/xen/xend/XendCheckpoint.py | 14 ++++++++++++--
tools/python/xen/xend/XendDomain.py | 12 ++++++++++++
tools/python/xen/xend/XendDomainInfo.py | 12 ++++++++++++
tools/python/xen/xm/migrate.py | 16 ++++++++++++++++
6 files changed, 65 insertions(+), 3 deletions(-)
Index: xen-4.4.0-testing/tools/libxc/xc_domain_save.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xc_domain_save.c
+++ xen-4.4.0-testing/tools/libxc/xc_domain_save.c
@@ -809,6 +809,7 @@ int xc_domain_save(xc_interface *xch, in
int rc = 1, frc, i, j, last_iter = 0, iter = 0;
int live = (flags & XCFLAGS_LIVE);
int debug = (flags & XCFLAGS_DEBUG);
+ int abort_if_busy = (flags & XCFLAGS_DOMSAVE_ABORT_IF_BUSY);
int superpages = !!hvm;
int race = 0, sent_last_iter, skip_this_iter = 0;
unsigned int sent_this_iter = 0;
@@ -1532,10 +1533,20 @@ int xc_domain_save(xc_interface *xch, in
if ( live )
{
+ int min_reached = sent_this_iter + skip_this_iter < 50;
if ( (iter >= max_iters) ||
- (sent_this_iter+skip_this_iter < 50) ||
+ min_reached ||
(total_sent > dinfo->p2m_size*max_factor) )
{
+ if ( !min_reached && abort_if_busy )
+ {
+ ERROR("Live migration aborted, as requested. (guest too busy?)"
+ " total_sent %lu iter %d, max_iters %u max_factor %u",
+ total_sent, iter, max_iters, max_factor);
+ rc = 1;
+ goto out;
+ }
+
DPRINTF("Start last iteration\n");
last_iter = 1;
Index: xen-4.4.0-testing/tools/libxc/xenguest.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xenguest.h
+++ xen-4.4.0-testing/tools/libxc/xenguest.h
@@ -28,6 +28,7 @@
#define XCFLAGS_HVM (1 << 2)
#define XCFLAGS_STDVGA (1 << 3)
#define XCFLAGS_CHECKPOINT_COMPRESS (1 << 4)
+#define XCFLAGS_DOMSAVE_ABORT_IF_BUSY (1 << 5)
#define X86_64_B_SIZE 64
#define X86_32_B_SIZE 32
Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -118,9 +118,19 @@ def save(fd, dominfo, network, live, dst
# enabled. Passing "0" simply uses the defaults compiled into
# libxenguest; see the comments and/or code in xc_linux_save() for
# more information.
+ max_iters = dominfo.info.get('max_iters', "0")
+ max_factor = dominfo.info.get('max_factor', "0")
+ abort_if_busy = dominfo.info.get('abort_if_busy', "0")
+ if max_iters == "None":
+ max_iters = "0"
+ if max_factor == "None":
+ max_factor = "0"
+ if abort_if_busy == "None":
+ abort_if_busy = "0"
cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
- str(dominfo.getDomid()), "0", "0",
- str(int(live) | (int(hvm) << 2)) ]
+ str(dominfo.getDomid()),
+ max_iters, max_factor,
+ str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) ) ]
log.debug("[xc_save]: %s", string.join(cmd))
def saveInputHandler(line, tochild):
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
@@ -1832,6 +1832,18 @@ class XendDomain:
log.exception(ex)
raise XendError(str(ex))
+ def domain_migrate_constraints_set(self, domid, max_iters, max_factor, abort_if_busy):
+ """Set the Migrate Constraints of this domain.
+ @param domid: Domain ID or Name
+ @param max_iters: Number of iterations before final suspend
+ @param max_factor: Max amount of memory to transfer before final suspend
+ @param abort_if_busy: Abort migration instead of doing final suspend
+ """
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ raise XendInvalidDomain(str(domid))
+ dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy)
+
def domain_maxmem_set(self, domid, mem):
"""Set the memory limit for a domain.
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1475,6 +1475,18 @@ class XendDomainInfo:
break
xen.xend.XendDomain.instance().managed_config_save(self)
+ def setMigrateConstraints(self, max_iters, max_factor, abort_if_busy):
+ """Set the Migrate Constraints of this domain.
+ @param max_iters: Number of iterations before final suspend
+ @param max_factor: Max amount of memory to transfer before final suspend
+ @param abort_if_busy: Abort migration instead of doing final suspend
+ """
+ log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s'.",
+ self.info['name_label'], str(self.domid), max_iters, max_factor, abort_if_busy)
+ self.info['max_iters'] = str(max_iters)
+ self.info['max_factor'] = str(max_factor)
+ self.info['abort_if_busy'] = str(abort_if_busy)
+
def setMemoryTarget(self, target):
"""Set the memory target of this domain.
@param target: In MiB.
Index: xen-4.4.0-testing/tools/python/xen/xm/migrate.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xm/migrate.py
+++ xen-4.4.0-testing/tools/python/xen/xm/migrate.py
@@ -55,6 +55,18 @@ gopts.opt('change_home_server', short='c
fn=set_true, default=0,
use="Change home server for managed domains.")
+gopts.opt('max_iters', val='max_iters',
+ fn=set_int, default=0,
+ use="Number of iterations before final suspend (default: 30).")
+
+gopts.opt('max_factor', val='max_factor',
+ fn=set_int, default=0,
+ use="Max amount of memory to transfer before final suspend (default: 3*RAM).")
+
+gopts.opt('abort_if_busy',
+ fn=set_true, default=0,
+ use="Abort migration instead of doing final suspend.")
+
def help():
return str(gopts)
@@ -80,6 +92,10 @@ def main(argv):
server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
other_config)
else:
+ server.xend.domain.migrate_constraints_set(dom,
+ opts.vals.max_iters,
+ opts.vals.max_factor,
+ opts.vals.abort_if_busy)
server.xend.domain.migrate(dom, dst, opts.vals.live,
opts.vals.port,
opts.vals.node,

View File

@ -1,269 +0,0 @@
user: Olaf Hering <olaf@aepfle.de>
date: Thu Mar 28 15:42:14 2013 +0100
files: docs/man/xl.pod.1 tools/libxc/Makefile tools/libxc/xc_domain_save.c tools/libxc/xc_nomigrate.c tools/libxc/xenguest.h tools/libxl/libxl.c tools/libxl/libxl.h tools/libxl/libxl_internal.h tools/libxl/libxl_save_callout.c tools/libxl/libxl_save_helper.c tools/libxl/xl_cmdimpl.c tools/libxl/xl_cmdtable.c tools/python/xen/lowlevel/checkpoint/libcheckpoint.c tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/migrate.py tools/xcutils/xc_save.c
description:
tools: set number of dirty pages during migration
If a guest is really busy it will not reach the low number of remaining
50 dirty pages for the final suspend. As a result the guest is either
suspendend for a long time during the final transfer, or if the number
of iterations is increased the migration will take a long time.
Add a new option xm/xl migrate --min_remaing <pages> to increase the
default from command line. The default of 50 is 200kb, which is
appearently an arbitrary number. With todays network speeds a larger
block of memory can be transfered quickly without causing too much
suspension time. This knob gives the admin the chance to adapt the
suspension time to the given workload.
The existing default of 50 pages is not altered by this change.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/libxc/xc_domain_save.c | 6 ++++--
tools/libxc/xc_nomigrate.c | 2 +-
tools/libxc/xenguest.h | 2 +-
tools/libxl/libxl_save_helper.c | 2 +-
tools/python/xen/lowlevel/checkpoint/libcheckpoint.c | 2 +-
tools/python/xen/xend/XendCheckpoint.py | 5 ++++-
tools/python/xen/xend/XendDomain.py | 5 +++--
tools/python/xen/xend/XendDomainInfo.py | 8 +++++---
tools/python/xen/xm/migrate.py | 5 +++++
tools/xcutils/xc_save.c | 11 ++++++-----
11 files changed, 32 insertions(+), 18 deletions(-)
Index: xen-4.4.0-testing/tools/libxc/xc_domain_save.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xc_domain_save.c
+++ xen-4.4.0-testing/tools/libxc/xc_domain_save.c
@@ -43,6 +43,7 @@
*/
#define DEF_MAX_ITERS 29 /* limit us to 30 times round loop */
#define DEF_MAX_FACTOR 3 /* never send more than 3x p2m_size */
+#define DEF_MIN_REMAINING 50 /* low water mark of dirty pages */
struct save_ctx {
unsigned long hvirt_start; /* virtual starting address of the hypervisor */
@@ -799,7 +800,7 @@ static int save_tsc_info(xc_interface *x
}
int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
- uint32_t max_factor, uint32_t flags,
+ uint32_t max_factor, uint32_t min_remaining, uint32_t flags,
struct save_callbacks* callbacks, int hvm,
unsigned long vm_generationid_addr)
{
@@ -910,6 +911,7 @@ int xc_domain_save(xc_interface *xch, in
/* If no explicit control parameters given, use defaults */
max_iters = max_iters ? : DEF_MAX_ITERS;
max_factor = max_factor ? : DEF_MAX_FACTOR;
+ min_remaining = min_remaining ? : DEF_MIN_REMAINING;
if ( !get_platform_info(xch, dom,
&ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) )
@@ -1533,7 +1535,7 @@ int xc_domain_save(xc_interface *xch, in
if ( live )
{
- int min_reached = sent_this_iter + skip_this_iter < 50;
+ int min_reached = sent_this_iter + skip_this_iter < min_remaining;
if ( (iter >= max_iters) ||
min_reached ||
(total_sent > dinfo->p2m_size*max_factor) )
Index: xen-4.4.0-testing/tools/libxc/xc_nomigrate.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xc_nomigrate.c
+++ xen-4.4.0-testing/tools/libxc/xc_nomigrate.c
@@ -22,7 +22,7 @@
#include <xenguest.h>
int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
- uint32_t max_factor, uint32_t flags,
+ uint32_t max_factor, uint32_t min_remaining, uint32_t flags,
struct save_callbacks* callbacks, int hvm,
unsigned long vm_generationid_addr)
{
Index: xen-4.4.0-testing/tools/libxc/xenguest.h
===================================================================
--- xen-4.4.0-testing.orig/tools/libxc/xenguest.h
+++ xen-4.4.0-testing/tools/libxc/xenguest.h
@@ -87,7 +87,7 @@ struct save_callbacks {
* @return 0 on success, -1 on failure
*/
int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
- uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
+ uint32_t max_factor, uint32_t min_remaining, uint32_t flags /* XCFLAGS_xxx */,
struct save_callbacks* callbacks, int hvm,
unsigned long vm_generationid_addr);
Index: xen-4.4.0-testing/tools/libxl/libxl_save_helper.c
===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/libxl_save_helper.c
+++ xen-4.4.0-testing/tools/libxl/libxl_save_helper.c
@@ -235,7 +235,7 @@ int main(int argc, char **argv)
helper_setcallbacks_save(&helper_save_callbacks, cbflags);
startup("save");
- r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags,
+ r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, 0, flags,
&helper_save_callbacks, hvm, genidad);
complete(r);
Index: xen-4.4.0-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+++ xen-4.4.0-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -206,7 +206,7 @@ int checkpoint_start(checkpoint_state* s
callbacks->switch_qemu_logdirty = noop_switch_logdirty;
- rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm,
+ rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, 0, flags, callbacks, hvm,
vm_generationid_addr);
if (hvm)
Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -120,19 +120,22 @@ def save(fd, dominfo, network, live, dst
# more information.
max_iters = dominfo.info.get('max_iters', "0")
max_factor = dominfo.info.get('max_factor', "0")
+ min_remaining = dominfo.info.get('min_remaining', "0")
abort_if_busy = dominfo.info.get('abort_if_busy', "0")
log_save_progress = dominfo.info.get('log_save_progress', "0")
if max_iters == "None":
max_iters = "0"
if max_factor == "None":
max_factor = "0"
+ if min_remaining == "None":
+ min_remaining = "0"
if abort_if_busy == "None":
abort_if_busy = "0"
if log_save_progress == "None":
log_save_progress = "0"
cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
str(dominfo.getDomid()),
- max_iters, max_factor,
+ max_iters, max_factor, min_remaining,
str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ]
log.debug("[xc_save]: %s", string.join(cmd))
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomain.py
@@ -1832,18 +1832,19 @@ class XendDomain:
log.exception(ex)
raise XendError(str(ex))
- def domain_migrate_constraints_set(self, domid, max_iters, max_factor, abort_if_busy, log_save_progress):
+ def domain_migrate_constraints_set(self, domid, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress):
"""Set the Migrate Constraints of this domain.
@param domid: Domain ID or Name
@param max_iters: Number of iterations before final suspend
@param max_factor: Max amount of memory to transfer before final suspend
+ @param min_remaining: Number of dirty pages before final suspend
@param abort_if_busy: Abort migration instead of doing final suspend
@param log_save_progress: Log progress of migrate to xend.log
"""
dominfo = self.domain_lookup_nr(domid)
if not dominfo:
raise XendInvalidDomain(str(domid))
- dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy, log_save_progress)
+ dominfo.setMigrateConstraints(max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress)
def domain_maxmem_set(self, domid, mem):
"""Set the memory limit for a domain.
Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1475,17 +1475,19 @@ class XendDomainInfo:
break
xen.xend.XendDomain.instance().managed_config_save(self)
- def setMigrateConstraints(self, max_iters, max_factor, abort_if_busy, log_save_progress):
+ def setMigrateConstraints(self, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress):
"""Set the Migrate Constraints of this domain.
@param max_iters: Number of iterations before final suspend
@param max_factor: Max amount of memory to transfer before final suspend
+ @param min_remaining: Number of dirty pages before final suspend
@param abort_if_busy: Abort migration instead of doing final suspend
@param log_save_progress: Log progress of migrate to xend.log
"""
- log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s'.",
- self.info['name_label'], str(self.domid), max_iters, max_factor, abort_if_busy)
+ log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s' '%s'.",
+ self.info['name_label'], str(self.domid), max_iters, max_factor, min_remaining, abort_if_busy)
self.info['max_iters'] = str(max_iters)
self.info['max_factor'] = str(max_factor)
+ self.info['min_remaining'] = str(min_remaining)
self.info['abort_if_busy'] = str(abort_if_busy)
self.info['log_save_progress'] = str(log_save_progress)
Index: xen-4.4.0-testing/tools/python/xen/xm/migrate.py
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xm/migrate.py
+++ xen-4.4.0-testing/tools/python/xen/xm/migrate.py
@@ -63,6 +63,10 @@ gopts.opt('max_factor', val='max_factor'
fn=set_int, default=0,
use="Max amount of memory to transfer before final suspend (default: 3*RAM).")
+gopts.opt('min_remaining', val='min_remaining',
+ fn=set_int, default=0,
+ use="Number of dirty pages before final suspend (default: 50).")
+
gopts.opt('abort_if_busy',
fn=set_true, default=0,
use="Abort migration instead of doing final suspend.")
@@ -99,6 +103,7 @@ def main(argv):
server.xend.domain.migrate_constraints_set(dom,
opts.vals.max_iters,
opts.vals.max_factor,
+ opts.vals.min_remaining,
opts.vals.abort_if_busy,
opts.vals.log_progress)
server.xend.domain.migrate(dom, dst, opts.vals.live,
Index: xen-4.4.0-testing/tools/xcutils/xc_save.c
===================================================================
--- xen-4.4.0-testing.orig/tools/xcutils/xc_save.c
+++ xen-4.4.0-testing/tools/xcutils/xc_save.c
@@ -166,20 +166,21 @@ static int switch_qemu_logdirty(int domi
int
main(int argc, char **argv)
{
- unsigned int maxit, max_f, lflags;
+ unsigned int maxit, max_f, min_r, lflags;
int io_fd, ret, port;
struct save_callbacks callbacks;
xentoollog_level lvl;
xentoollog_logger *l;
- if (argc != 6)
- errx(1, "usage: %s iofd domid maxit maxf flags", argv[0]);
+ if (argc != 7)
+ errx(1, "usage: %s iofd domid maxit maxf minr flags", argv[0]);
io_fd = atoi(argv[1]);
si.domid = atoi(argv[2]);
maxit = atoi(argv[3]);
max_f = atoi(argv[4]);
- si.flags = atoi(argv[5]);
+ min_r = atoi(argv[5]);
+ si.flags = atoi(argv[6]);
si.suspend_evtchn = -1;
@@ -213,7 +214,7 @@ main(int argc, char **argv)
memset(&callbacks, 0, sizeof(callbacks));
callbacks.suspend = suspend;
callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
- ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags,
+ ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, min_r, si.flags,
&callbacks, !!(si.flags & XCFLAGS_HVM), 0);
if (si.suspend_evtchn > 0)

261
xen.spec
View File

@ -15,43 +15,62 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
Name: xen Name: xen
ExclusiveArch: %ix86 x86_64 %arm aarch64 ExclusiveArch: %ix86 x86_64 %arm aarch64
%define xvers 4.4 %define xvers 4.4
%define xvermaj 4 %define xvermaj 4
%define changeset 28287 %define changeset 28391
%define xen_build_dir xen-4.4.0-testing %define xen_build_dir xen-4.4.0-testing
%ifarch %arm aarch64 #
%define with_kmp 0 %define with_kmp 0
%define with_xend 0 %define with_xend 0
%define with_xend_tools_pkg 0
%define with_debug 0 %define with_debug 0
%define with_stubdom 0 %define with_stubdom 0
%define with_dom0_support 1 %define with_gdbsx 0
%else %define with_dom0_support 0
%define with_qemu_traditional 0
#
%ifarch x86_64 %ifarch x86_64
%define with_kmp 1 %define with_kmp 1
%define with_debug 1 %define with_debug 1
%define with_stubdom 1 %define with_stubdom 1
%define with_gdbsx 1
%define with_dom0_support 1 %define with_dom0_support 1
%define with_qemu_traditional 1 %define with_qemu_traditional 1
%define with_xend_tools_pkg 0
%if %suse_version > 1230
%define with_xend_tools_pkg 1
%endif
%if %suse_version > 1230 %if %suse_version > 1230
%define with_xend 1 %define with_xend 1
%else %else
%define with_xend 1 %define with_xend 1
%endif %endif
%else
%define with_xend 0
%define with_stubdom 0
%define with_dom0_support 0
%define with_qemu_traditional 0
%endif %endif
#
%ifarch %arm aarch64
%define with_dom0_support 1
%endif %endif
# EFI requires gcc46 or newer #
# its available in 12.1 or >= sles11sp2 %define max_cpus 4
%if %suse_version == 1210 || %suse_version == 1110 %ifarch x86_64
%define with_gcc46 1 %define max_cpus 512
%endif
#
%define xen_install_suffix %{nil}
%ifarch x86_64
%define xen_install_suffix .gz
%endif
# EFI requires gcc 4.6 or newer
# gcc46 is available in 12.1 or sles11sp2
# gcc47 is available in sles11sp3
# 12.2+ have gcc 4.7 as default compiler
%if %suse_version == 1110
%define with_gcc47 1
%else %else
%define with_gcc46 0 %define with_gcc47 0
%endif %endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%if %suse_version >= 1230 %if %suse_version >= 1230
@ -65,6 +84,8 @@ BuildRequires: libfdt1-devel
%ifarch %ix86 x86_64 %ifarch %ix86 x86_64
BuildRequires: dev86 BuildRequires: dev86
%endif %endif
BuildRequires: flex
BuildRequires: bison
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: glib2-devel BuildRequires: glib2-devel
BuildRequires: libaio-devel BuildRequires: libaio-devel
@ -73,32 +94,21 @@ BuildRequires: libuuid-devel
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libyajl-devel BuildRequires: libyajl-devel
BuildRequires: libpixman-1-0-devel BuildRequires: libpixman-1-0-devel
%if %{?with_qemu_traditional}0
BuildRequires: pciutils-devel
BuildRequires: SDL-devel
%endif
%if %{?with_stubdom}0
%if 0%{?suse_version} < 1230
BuildRequires: texinfo
%else
BuildRequires: makeinfo
%endif
%endif
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: transfig %if %{?with_systemd}0
%if %suse_version >= 1030
BuildRequires: texinfo
BuildRequires: texlive
%if %suse_version > 1220
BuildRequires: texlive-latex
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
BuildRequires: texlive-helvetic
BuildRequires: texlive-psnfss
BuildRequires: texlive-times
BuildRequires: tex(a4.sty)
BuildRequires: tex(a4wide.sty)
BuildRequires: tex(fancyhdr.sty)
BuildRequires: tex(parskip.sty)
BuildRequires: tex(setspace.sty)
%endif
%else
BuildRequires: te_ams
BuildRequires: te_latex
BuildRequires: tetex
%endif
%if %suse_version >= 1230
BuildRequires: systemd BuildRequires: systemd
%endif %endif
%if %suse_version >= 1120 %if %suse_version >= 1120
@ -112,15 +122,11 @@ BuildRequires: acpica
%endif %endif
%endif %endif
%ifarch x86_64 %ifarch x86_64
%if %{?with_gcc46}0 %if %{?with_gcc47}0
BuildRequires: gcc46 BuildRequires: gcc47
BuildRequires: libgcc46
BuildRequires: libgcc46-32bit
%endif %endif
BuildRequires: glibc-32bit BuildRequires: glibc-32bit
BuildRequires: glibc-devel-32bit BuildRequires: glibc-devel-32bit
%define max_cpus 512
%define pae_enabled n
%endif %endif
%if %{?with_kmp}0 %if %{?with_kmp}0
BuildRequires: kernel-source BuildRequires: kernel-source
@ -133,11 +139,11 @@ BuildRequires: xorg-x11-util-devel
%endif %endif
%endif %endif
Version: 4.4.0_02 Version: 4.4.0_04
Release: 0 Release: 0
PreReq: %insserv_prereq %fillup_prereq PreReq: %insserv_prereq %fillup_prereq
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
License: GPL-2.0+ License: GPL-2.0
Group: System/Kernel Group: System/Kernel
Source0: xen-4.4.0-testing-src.tar.bz2 Source0: xen-4.4.0-testing-src.tar.bz2
Source1: stubdom.tar.bz2 Source1: stubdom.tar.bz2
@ -253,11 +259,12 @@ Patch382: ioemu-disable-emulated-ide-if-pv.patch
Patch383: xenpaging.qemu.flush-cache.patch Patch383: xenpaging.qemu.flush-cache.patch
Patch384: qemu-xen-upstream-blkif-discard.patch Patch384: qemu-xen-upstream-blkif-discard.patch
Patch385: xen_pvonhvm.xen_emul_unplug.patch Patch385: xen_pvonhvm.xen_emul_unplug.patch
Patch386: libxc-pass-errno-to-callers-of-xc_domain_save.patch
Patch387: libxl.set-migration-constraints-from-cmdline.patch
# Xend # Xend
Patch400: xen.migrate.tools_set_migration_constraints_from_cmdline.patch Patch400: xend-set-migration-constraints-from-cmdline.patch
Patch401: xen.migrate.tools_add_xm_migrate_--log_progress_option.patch
Patch402: xen.migrate.tools-xend_move_assert_to_exception_block.patch Patch402: xen.migrate.tools-xend_move_assert_to_exception_block.patch
Patch403: xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch Patch403: xend-pvscsi-recognize-also-SCSI-CDROM-devices.patch
Patch404: xend-config.patch Patch404: xend-config.patch
Patch405: xend-max-free-mem.patch Patch405: xend-max-free-mem.patch
Patch406: xend-hvm-default-pae.patch Patch406: xend-hvm-default-pae.patch
@ -292,6 +299,7 @@ Patch434: xend-domain-lock-sfex.patch
Patch435: xend-32on64-extra-mem.patch Patch435: xend-32on64-extra-mem.patch
Patch436: xend-hv_extid_compatibility.patch Patch436: xend-hv_extid_compatibility.patch
Patch437: xend-xenpaging.autostart.patch Patch437: xend-xenpaging.autostart.patch
Patch438: xend-remove-xm-deprecation-warning.patch
# Other bug fixes or features # Other bug fixes or features
Patch450: libxen_permissive.patch Patch450: libxen_permissive.patch
Patch451: xenconsole-no-multiple-connections.patch Patch451: xenconsole-no-multiple-connections.patch
@ -305,6 +313,8 @@ Patch461: blktapctrl-default-to-ioemu.patch
Patch462: blktapctrl-disable-debug-printf.patch Patch462: blktapctrl-disable-debug-printf.patch
Patch463: blktap-pv-cdrom.patch Patch463: blktap-pv-cdrom.patch
Patch464: set-mtu-from-bridge-for-tap-interface.patch Patch464: set-mtu-from-bridge-for-tap-interface.patch
Patch465: libxl.add-option-for-discard-support-to-xl-disk-conf.patch
Patch466: aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch
# Hypervisor and PV driver Patches # Hypervisor and PV driver Patches
Patch501: x86-ioapic-ack-default.patch Patch501: x86-ioapic-ack-default.patch
Patch502: x86-cpufreq-report.patch Patch502: x86-cpufreq-report.patch
@ -372,8 +382,6 @@ Authors:
Ewan Mellor <ewan@xensource.com> Ewan Mellor <ewan@xensource.com>
... ...
%if %{?with_dom0_support}0
%package libs %package libs
Summary: Xen Virtualization: Libraries Summary: Xen Virtualization: Libraries
Group: System/Kernel Group: System/Kernel
@ -395,6 +403,8 @@ Authors:
Ian Pratt <ian.pratt@cl.cam.ac.uk> Ian Pratt <ian.pratt@cl.cam.ac.uk>
%if %{?with_dom0_support}0
%package tools %package tools
Summary: Xen Virtualization: Control tools for domain 0 Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel Group: System/Kernel
@ -430,7 +440,7 @@ Authors:
%if %{?with_xend}0 %if %{?with_xend}0
%if %suse_version > 1230 %if %{?with_xend_tools_pkg}0
%package xend-tools %package xend-tools
Summary: Xen Virtualization: Control tools for domain 0 Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel Group: System/Kernel
@ -599,10 +609,10 @@ Authors:
%patch383 -p1 %patch383 -p1
%patch384 -p1 %patch384 -p1
%patch385 -p1 %patch385 -p1
%patch386 -p1
%patch387 -p1
# Xend # Xend
%if %{?with_xend}0
%patch400 -p1 %patch400 -p1
%patch401 -p1
%patch402 -p1 %patch402 -p1
%patch403 -p1 %patch403 -p1
%patch404 -p1 %patch404 -p1
@ -639,7 +649,7 @@ Authors:
%patch435 -p1 %patch435 -p1
%patch436 -p1 %patch436 -p1
%patch437 -p1 %patch437 -p1
%endif %patch438 -p1
# Other bug fixes or features # Other bug fixes or features
%patch450 -p1 %patch450 -p1
%patch451 -p1 %patch451 -p1
@ -653,6 +663,8 @@ Authors:
%patch462 -p1 %patch462 -p1
%patch463 -p1 %patch463 -p1
%patch464 -p1 %patch464 -p1
%patch465 -p1
%patch466 -p1
# Hypervisor and PV driver Patches # Hypervisor and PV driver Patches
%patch501 -p1 %patch501 -p1
%patch502 -p1 %patch502 -p1
@ -689,9 +701,13 @@ configure_flags="${configure_flags} --enable-qemu-traditional"
configure_flags="${configure_flags} --disable-qemu-traditional" configure_flags="${configure_flags} --disable-qemu-traditional"
%endif %endif
%if %{?with_xend}0 %if %{?with_xend}0
configure_flags="${configure_flags} --enable-xend" configure_flags="${configure_flags} --enable-xend --enable-blktap1"
%else %else
configure_flags="${configure_flags} --disable-xend" %if %{?with_qemu_traditional}0
configure_flags="${configure_flags} --disable-xend --enable-blktap1"
%else
configure_flags="${configure_flags} --disable-xend --disable-blktap1"
%endif
%endif %endif
./configure \ ./configure \
--enable-xenapi \ --enable-xenapi \
@ -701,7 +717,7 @@ configure_flags="${configure_flags} --disable-xend"
--sbindir=%{_sbindir} \ --sbindir=%{_sbindir} \
--libdir=%{_libdir} \ --libdir=%{_libdir} \
--datadir=%{_datadir} \ --datadir=%{_datadir} \
--enable-blktap1 ${configure_flags} ${configure_flags}
%if %{?with_dom0_support}0 %if %{?with_dom0_support}0
CFLAGS_SAVE=$CFLAGS CFLAGS_SAVE=$CFLAGS
%ifarch %ix86 x86_64 %ifarch %ix86 x86_64
@ -709,7 +725,6 @@ make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FL
%endif %endif
make -C tools/include/xen-foreign %{?_smp_mflags} make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags} make tools docs %{?_smp_mflags}
make -C tools/debugger/gdbsx
%if %{?with_xend}0 %if %{?with_xend}0
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes XEN_ROOT=$PWD make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
%endif %endif
@ -739,10 +754,10 @@ export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
# EFI # EFI
%ifarch x86_64 %arm aarch64 %if %{?with_dom0_support}0
make -C xen install \ make -C xen install \
%if %{?with_gcc46}0 %if %{?with_gcc47}0
CC=gcc-4.6 \ CC=gcc-4.7 \
%endif %endif
max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
make -C xen clean make -C xen clean
@ -751,28 +766,26 @@ install_xen()
local ext="" local ext=""
if [ -n "$1" ]; then if [ -n "$1" ]; then
ext="-$1" ext="-$1"
mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}.gz \ mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}%{xen_install_suffix} \
$RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}%{xen_install_suffix}
mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \ mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \
$RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release}
fi fi
rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz rm $RPM_BUILD_ROOT/boot/xen-%{xvers}%{xen_install_suffix}
rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}%{xen_install_suffix}
rm $RPM_BUILD_ROOT/boot/xen.gz rm $RPM_BUILD_ROOT/boot/xen%{xen_install_suffix}
# Do not link to links; grub cannot follow. # Do not link to links; grub cannot follow.
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}.gz ln -s xen${ext}-%{version}-%{release}%{xen_install_suffix} $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}%{xen_install_suffix}
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}.gz ln -s xen${ext}-%{version}-%{release}%{xen_install_suffix} $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}%{xen_install_suffix}
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz ln -s xen${ext}-%{version}-%{release}%{xen_install_suffix} $RPM_BUILD_ROOT/boot/xen${ext}%{xen_install_suffix}
ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext} ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext}
} }
%ifnarch %arm aarch64
%if %{?with_debug}0 %if %{?with_debug}0
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} make -C xen install max_phys_cpus=%{max_cpus} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen dbg install_xen dbg
make -C xen clean make -C xen clean
%endif %endif
%endif make -C xen install max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen install_xen
make -C xen clean make -C xen clean
make -C tools/include/xen-foreign %{?_smp_mflags} make -C tools/include/xen-foreign %{?_smp_mflags}
@ -782,12 +795,12 @@ make -C tools install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw} rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw}
echo > xen.files.txt echo > xen.files.txt
%ifarch x86_64 # EFI depends on gcc47
# EFI depends on gcc46
if test -d $RPM_BUILD_ROOT%{_libdir}/efi if test -d $RPM_BUILD_ROOT%{_libdir}/efi
then then
echo %{_libdir}/efi >> xen.files.txt echo %{_libdir}/efi >> xen.files.txt
fi fi
%ifarch x86_64
cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw
cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir} cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir}
%endif %endif
@ -832,7 +845,9 @@ for name in COPYING %SOURCE10 %SOURCE11 %SOURCE12; do
install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/
done done
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc
for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt \
xenpaging.txt xl-disk-configuration.txt xl-network-configuration.markdown \
xl-numa-placement.markdown; do
install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/ install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/
done done
@ -840,17 +855,14 @@ done
mkdir -p $RPM_BUILD_ROOT/etc/init.d mkdir -p $RPM_BUILD_ROOT/etc/init.d
install tools/hotplug/Linux/init.d/xendomains $RPM_BUILD_ROOT/etc/init.d/xendomains install tools/hotplug/Linux/init.d/xendomains $RPM_BUILD_ROOT/etc/init.d/xendomains
ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains
%ifnarch %arm aarch64
install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback
ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback
install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback
%endif
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf
# Xend init scripts and related programs # Xend init scripts and related programs
%if %{?with_xend}0 %if %{?with_xend}0
%ifnarch %arm aarch64
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet
@ -872,7 +884,6 @@ mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE56} %{buildroot}%{_unitdir}/xend.service install -m 644 %{SOURCE56} %{buildroot}%{_unitdir}/xend.service
%endif %endif
%endif %endif
%endif
# Example config # Example config
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts} mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts}
@ -966,9 +977,11 @@ rm -f $RPM_BUILD_ROOT/usr/sbin/xen-python-path
rm -f $RPM_BUILD_ROOT/usr/sbin/xen-list rm -f $RPM_BUILD_ROOT/usr/sbin/xen-list
rm -f $RPM_BUILD_ROOT/usr/sbin/xen-destroy rm -f $RPM_BUILD_ROOT/usr/sbin/xen-destroy
rm -f $RPM_BUILD_ROOT/usr/sbin/xen-vmresync rm -f $RPM_BUILD_ROOT/usr/sbin/xen-vmresync
rm -f $RPM_BUILD_ROOT/usr/sbin/blktapctrl
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/xend-relocation.sh rm -f $RPM_BUILD_ROOT/etc/xen/scripts/xend-relocation.sh
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/domain-lock* rm -f $RPM_BUILD_ROOT/etc/xen/scripts/domain-lock*
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/vm-monitor rm -f $RPM_BUILD_ROOT/etc/xen/scripts/vm-monitor
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/blktap
rm -f $RPM_BUILD_ROOT/etc/xen/xm-config.xml rm -f $RPM_BUILD_ROOT/etc/xen/xm-config.xml
rm -f $RPM_BUILD_ROOT/etc/xen/*.sxp rm -f $RPM_BUILD_ROOT/etc/xen/*.sxp
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/xm* rm -f $RPM_BUILD_ROOT/usr/share/man/man1/xm*
@ -986,7 +999,6 @@ rm -f $RPM_BUILD_ROOT/usr/share/man/man1/xen-list.1.gz
# 32 bit hypervisor no longer supported. Remove dom0 tools. # 32 bit hypervisor no longer supported. Remove dom0 tools.
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc
rm -rf $RPM_BUILD_ROOT/%{_datadir}/man rm -rf $RPM_BUILD_ROOT/%{_datadir}/man
rm -rf $RPM_BUILD_ROOT/%{_libdir}/fs
rm -rf $RPM_BUILD_ROOT/%{_libdir}/xen rm -rf $RPM_BUILD_ROOT/%{_libdir}/xen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python* rm -rf $RPM_BUILD_ROOT/%{_libdir}/python*
rm -rf $RPM_BUILD_ROOT/usr/sbin rm -rf $RPM_BUILD_ROOT/usr/sbin
@ -1003,42 +1015,41 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/pygrub
rm -f $RPM_BUILD_ROOT/%{_bindir}/remus rm -f $RPM_BUILD_ROOT/%{_bindir}/remus
rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%endif %endif
%if %{?with_dom0_support}0 %if %{?with_dom0_support}0
%files -f xen.files.txt %files -f xen.files.txt
%defattr(-,root,root) %defattr(-,root,root)
/boot/xen-%{version}-%{release}.gz /boot/xen-%{version}-%{release}%{xen_install_suffix}
/boot/xen-%{xvermaj}.gz /boot/xen-%{xvermaj}%{xen_install_suffix}
/boot/xen-%{xvers}.gz /boot/xen-%{xvers}%{xen_install_suffix}
%ifnarch %arm aarch64
%if %{?with_debug}0 %if %{?with_debug}0
/boot/xen-dbg-%{version}-%{release}.gz /boot/xen-dbg-%{version}-%{release}%{xen_install_suffix}
/boot/xen-dbg-%{xvermaj}.gz /boot/xen-dbg-%{xvermaj}%{xen_install_suffix}
/boot/xen-dbg-%{xvers}.gz /boot/xen-dbg-%{xvers}%{xen_install_suffix}
/boot/xen-dbg.gz /boot/xen-dbg%{xen_install_suffix}
%endif
%endif %endif
/boot/xen-syms /boot/xen-syms
/boot/xen-syms-%{version}-%{release} /boot/xen-syms-%{version}-%{release}
%ifnarch %arm aarch64
%if %{?with_debug}0 %if %{?with_debug}0
/boot/xen-syms-dbg /boot/xen-syms-dbg
/boot/xen-syms-dbg-%{version}-%{release} /boot/xen-syms-dbg-%{version}-%{release}
%endif %endif
/boot/xen%{xen_install_suffix}
%endif %endif
/boot/xen.gz
%files libs %files libs
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/fs/ %{_libdir}/fs/
%{_libdir}/*.so.* %{_libdir}/*.so.*
%if %{?with_dom0_support}0
%files tools %files tools
%defattr(-,root,root) %defattr(-,root,root)
%ifnarch %arm aarch64 %ifarch %ix86 x86_64
/usr/bin/xenalyze /usr/bin/xenalyze
/usr/bin/xenalyze.dump-raw /usr/bin/xenalyze.dump-raw
%endif %endif
@ -1046,65 +1057,51 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
/usr/bin/xenstore* /usr/bin/xenstore*
/usr/bin/xentrace* /usr/bin/xentrace*
/usr/bin/pygrub /usr/bin/pygrub
%ifnarch %arm aarch64
%if %{?with_qemu_traditional}0 %if %{?with_qemu_traditional}0
/usr/bin/tapdisk-ioemu /usr/bin/tapdisk-ioemu
%endif %endif
/usr/bin/remus /usr/bin/remus
/usr/bin/xencov_split /usr/bin/xencov_split
/usr/sbin/blktapctrl
%endif
#/usr/sbin/flask-* #/usr/sbin/flask-*
/usr/sbin/tap* /usr/sbin/tap*
/usr/sbin/rcxendomains /usr/sbin/rcxendomains
%ifnarch %arm aarch64
/usr/sbin/rcpciback /usr/sbin/rcpciback
/usr/sbin/xenbaked /usr/sbin/xenbaked
%endif
/usr/sbin/xenconsoled /usr/sbin/xenconsoled
/usr/sbin/xencov /usr/sbin/xencov
%ifnarch %arm aarch64
/usr/sbin/xen-hptool
/usr/sbin/xen-hvmcrash
/usr/sbin/xen-hvmctx
/usr/sbin/xenlockprof /usr/sbin/xenlockprof
/usr/sbin/xen-lowmemd
/usr/sbin/xenmon.py /usr/sbin/xenmon.py
/usr/sbin/xenperf /usr/sbin/xenperf
/usr/sbin/xenpm /usr/sbin/xenpm
/usr/sbin/xenpmd /usr/sbin/xenpmd
%endif
/usr/sbin/xen-ringwatch /usr/sbin/xen-ringwatch
/usr/sbin/xenstored /usr/sbin/xenstored
%ifnarch %arm aarch64
/usr/sbin/xen-tmem-list-parse /usr/sbin/xen-tmem-list-parse
%endif
/usr/sbin/xentop /usr/sbin/xentop
%ifnarch %arm aarch64
/usr/sbin/xentrace_setmask /usr/sbin/xentrace_setmask
%endif
/usr/sbin/xenwatchdogd /usr/sbin/xenwatchdogd
/usr/sbin/gtracestat /usr/sbin/gtracestat
/usr/sbin/gtraceview /usr/sbin/gtraceview
/usr/sbin/lock-util /usr/sbin/lock-util
/usr/sbin/td-util /usr/sbin/td-util
%ifnarch %arm aarch64
/usr/sbin/vhd-update /usr/sbin/vhd-update
/usr/sbin/vhd-util /usr/sbin/vhd-util
%if %{?with_gdbsx}0
/usr/sbin/gdbsx /usr/sbin/gdbsx
%endif %endif
/usr/sbin/xl /usr/sbin/xl
%ifnarch %arm aarch64 %ifarch %ix86 x86_64
/usr/sbin/xen-hptool
/usr/sbin/xen-hvmcrash
/usr/sbin/xen-hvmctx
/usr/sbin/xen-lowmemd
/usr/sbin/kdd /usr/sbin/kdd
%endif %endif
%dir %attr(700,root,root) /etc/xen %dir %attr(700,root,root) /etc/xen
%dir /etc/xen/scripts %dir /etc/xen/scripts
%ifnarch %arm aarch64
%if %{?with_qemu_traditional}0 %if %{?with_qemu_traditional}0
/etc/xen/scripts/qemu-ifup /etc/xen/scripts/qemu-ifup
%endif %endif
%endif
/etc/xen/scripts/blktap
/etc/xen/scripts/block* /etc/xen/scripts/block*
/etc/xen/scripts/external-device-migrate /etc/xen/scripts/external-device-migrate
/etc/xen/scripts/hotplugpath.sh /etc/xen/scripts/hotplugpath.sh
@ -1122,16 +1119,14 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
/usr/lib/xen /usr/lib/xen
%endif %endif
%ifnarch %arm aarch64
/var/adm/fillup-templates/sysconfig.pciback /var/adm/fillup-templates/sysconfig.pciback
%endif
/var/adm/fillup-templates/sysconfig.xencommons /var/adm/fillup-templates/sysconfig.xencommons
/var/adm/fillup-templates/sysconfig.xendomains /var/adm/fillup-templates/sysconfig.xendomains
%dir /var/lib/xen %dir /var/lib/xen
%dir %attr(700,root,root) /var/lib/xen/images %dir %attr(700,root,root) /var/lib/xen/images
%dir %attr(700,root,root) /var/lib/xen/save %dir %attr(700,root,root) /var/lib/xen/save
%dir %attr(700,root,root) /var/lib/xen/dump %dir %attr(700,root,root) /var/lib/xen/dump
%ifnarch %arm aarch64 %ifarch %ix86 x86_64
%dir %attr(700,root,root) /var/lib/xen/xenpaging %dir %attr(700,root,root) /var/lib/xen/xenpaging
%endif %endif
%dir /var/lib/xenstored %dir /var/lib/xenstored
@ -1151,9 +1146,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%config /etc/init.d/xencommons %config /etc/init.d/xencommons
%config /etc/init.d/xendomains %config /etc/init.d/xendomains
%config /etc/init.d/xen-watchdog %config /etc/init.d/xen-watchdog
%ifnarch %arm aarch64
%config /etc/init.d/pciback %config /etc/init.d/pciback
%endif
%if %{?with_systemd}0 %if %{?with_systemd}0
%{_unitdir}/xencommons.service %{_unitdir}/xencommons.service
%{_unitdir}/xendomains.service %{_unitdir}/xendomains.service
@ -1172,12 +1165,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%{_datadir}/qemu-xen/* %{_datadir}/qemu-xen/*
%endif %endif
%if %{?with_qemu_traditional}0 %if %{?with_qemu_traditional}0
%ifnarch %arm aarch64
%dir %{_datadir}/xen %dir %{_datadir}/xen
%dir %{_datadir}/xen/qemu %dir %{_datadir}/xen/qemu
%{_datadir}/xen/qemu/* %{_datadir}/xen/qemu/*
%endif %endif
%endif
%dir %{_libdir}/python%{pyver}/site-packages/grub %dir %{_libdir}/python%{pyver}/site-packages/grub
%dir %{_libdir}/python%{pyver}/site-packages/xen %dir %{_libdir}/python%{pyver}/site-packages/xen
%dir %{_libdir}/python%{pyver}/site-packages/xen/lowlevel %dir %{_libdir}/python%{pyver}/site-packages/xen/lowlevel
@ -1204,14 +1195,11 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%{_mandir}/man8/*.8.gz %{_mandir}/man8/*.8.gz
%if %{?with_xend}0 %if %{?with_xend}0
%if %suse_version > 1230 %if %{?with_xend_tools_pkg}0
%files xend-tools %files xend-tools
%endif %endif
%defattr(-,root,root) %defattr(-,root,root)
%ifnarch %arm aarch64
/etc/udev/rules.d/40-xend.rules /etc/udev/rules.d/40-xend.rules
%endif
%ifnarch %arm aarch64
/usr/sbin/rcxend /usr/sbin/rcxend
/usr/sbin/xm /usr/sbin/xm
/usr/sbin/xend /usr/sbin/xend
@ -1220,6 +1208,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
/usr/sbin/xen-list /usr/sbin/xen-list
/usr/sbin/xen-destroy /usr/sbin/xen-destroy
/usr/sbin/xen-vmresync /usr/sbin/xen-vmresync
/usr/sbin/blktapctrl
%dir /var/lib/xen/xend-db %dir /var/lib/xen/xend-db
%dir /var/lib/xen/xend-db/domain %dir /var/lib/xen/xend-db/domain
%dir /var/lib/xen/xend-db/migrate %dir /var/lib/xen/xend-db/migrate
@ -1235,11 +1224,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%if %{?with_systemd}0 %if %{?with_systemd}0
%{_unitdir}/xend.service %{_unitdir}/xend.service
%endif %endif
%endif
%dir %attr(700,root,root) /etc/xen %dir %attr(700,root,root) /etc/xen
%config(noreplace) /etc/xen/*.sxp %config(noreplace) /etc/xen/*.sxp
%config(noreplace) /etc/xen/*.xml %config(noreplace) /etc/xen/*.xml
%ifnarch %arm aarch64 /etc/xen/scripts/blktap
/etc/xen/scripts/xend-relocation.sh /etc/xen/scripts/xend-relocation.sh
/etc/xen/scripts/domain-lock* /etc/xen/scripts/domain-lock*
/etc/xen/scripts/vm-monitor /etc/xen/scripts/vm-monitor
@ -1255,13 +1243,12 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.so.*
%{_mandir}/man5/xend-config.sxp.5.gz %{_mandir}/man5/xend-config.sxp.5.gz
%{_mandir}/man1/xen-list.1.gz %{_mandir}/man1/xen-list.1.gz
%endif %endif
%endif
# with_dom0_support # with_dom0_support
%endif %endif
%files tools-domU %files tools-domU
%defattr(-,root,root) %defattr(-,root,root)
%ifnarch %arm aarch64 %ifarch %ix86 x86_64
/usr/bin/xen-detect /usr/bin/xen-detect
%endif %endif
/bin/domu-xenstore /bin/domu-xenstore
@ -1313,7 +1300,6 @@ fi
%endif %endif
%endif %endif
%ifnarch %arm aarch64
%if %{?with_systemd}0 %if %{?with_systemd}0
%{fillup_and_insserv -i -y -n xendomains xendomains} %{fillup_and_insserv -i -y -n xendomains xendomains}
/bin/systemctl enable xendomains.service /bin/systemctl enable xendomains.service
@ -1347,11 +1333,11 @@ if [ -f /usr/bin/qemu-io ]; then
rm -f /usr/lib/xen/bin/qemu-io-xen rm -f /usr/lib/xen/bin/qemu-io-xen
ln -s /usr/bin/qemu-io /usr/lib/xen/bin/qemu-io-xen ln -s /usr/bin/qemu-io /usr/lib/xen/bin/qemu-io-xen
fi fi
%endif
%if %suse_version > 1230
%if %{?with_xend}0 %if %{?with_xend}0
%if %{?with_xend_tools_pkg}0
%post xend-tools %post xend-tools
%endif
%if %{?with_systemd}0 %if %{?with_systemd}0
%{fillup_and_insserv -i -y -n xend xend} %{fillup_and_insserv -i -y -n xend xend}
/bin/systemctl enable xend.service /bin/systemctl enable xend.service
@ -1359,7 +1345,6 @@ fi
%{fillup_and_insserv -y -n xend xend} %{fillup_and_insserv -y -n xend xend}
%endif %endif
%endif %endif
%endif
%preun tools %preun tools
%if %{?with_systemd}0 %if %{?with_systemd}0
@ -1383,7 +1368,9 @@ fi
%if %suse_version > 1230 %if %suse_version > 1230
%if %{?with_xend}0 %if %{?with_xend}0
%if %{?with_xend_tools_pkg}0
%preun xend-tools %preun xend-tools
%endif
%if %{?with_systemd}0 %if %{?with_systemd}0
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/bin/systemctl disable xend.service /bin/systemctl disable xend.service
@ -1401,7 +1388,6 @@ fi
%endif %endif
%endif %endif
%{insserv_cleanup} %{insserv_cleanup}
%ifnarch %arm aarch64
%if %suse_version <= 1230 %if %suse_version <= 1230
%if %{?with_xend}0 %if %{?with_xend}0
if [ -f /usr/bin/qemu-img-xen ]; then if [ -f /usr/bin/qemu-img-xen ]; then
@ -1412,11 +1398,12 @@ if [ -f /usr/bin/qemu-nbd-xen ]; then
fi fi
%endif %endif
%endif %endif
%endif
%if %suse_version > 1230 %if %suse_version > 1230
%if %{?with_xend}0 %if %{?with_xend}0
%if %{?with_xend_tools_pkg}0
%postun xend-tools %postun xend-tools
%endif
%{restart_on_update xend} %{restart_on_update xend}
%{insserv_cleanup} %{insserv_cleanup}
if [ -f /usr/bin/qemu-img-xen ]; then if [ -f /usr/bin/qemu-img-xen ]; then
@ -1428,10 +1415,10 @@ fi
%endif %endif
%endif %endif
%endif
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%endif
%changelog %changelog

View File

@ -1,8 +1,8 @@
Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
=================================================================== ===================================================================
--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -188,7 +188,7 @@ def save(fd, dominfo, network, live, dst @@ -190,7 +190,7 @@ def save(fd, dominfo, network, live, dst
dominfo.destroy() dominfo.destroy()
dominfo.testDeviceComplete() dominfo.testDeviceComplete()
try: try:

View File

@ -7,7 +7,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -345,8 +345,7 @@ def restore(xd, fd, dominfo = None, paus @@ -347,8 +347,7 @@ def restore(xd, fd, dominfo = None, paus
restore_image.setCpuid() restore_image.setCpuid()
# xc_restore will wait for source to close connection # xc_restore will wait for source to close connection

View File

@ -2,7 +2,7 @@ Index: xen-4.4.0-testing/tools/examples/xend-config.sxp
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/examples/xend-config.sxp --- xen-4.4.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-4.4.0-testing/tools/examples/xend-config.sxp +++ xen-4.4.0-testing/tools/examples/xend-config.sxp
@@ -354,7 +354,7 @@ @@ -357,7 +357,7 @@
# path /<xend-domain-lock-path>/<vm-uuid> # path /<xend-domain-lock-path>/<vm-uuid>
# Return 0 on success, non-zero on error. # Return 0 on success, non-zero on error.
# #
@ -11,7 +11,7 @@ Index: xen-4.4.0-testing/tools/examples/xend-config.sxp
# -s Lock status. If lock is acquired, print any contents # -s Lock status. If lock is acquired, print any contents
# on stdout and return 0. Return non-zero if lock is # on stdout and return 0. Return non-zero if lock is
# available. # available.
@@ -380,6 +380,11 @@ @@ -383,6 +383,11 @@
# #
#(xend-domain-lock-utility domain-lock) #(xend-domain-lock-utility domain-lock)

View File

@ -3,16 +3,16 @@
tools/hotplug/Linux/Makefile | 1 tools/hotplug/Linux/Makefile | 1
tools/hotplug/Linux/domain-lock | 83 ++++++++++++++++++++++++++++++++ tools/hotplug/Linux/domain-lock | 83 ++++++++++++++++++++++++++++++++
tools/hotplug/Linux/vm-monitor | 41 +++++++++++++++ tools/hotplug/Linux/vm-monitor | 41 +++++++++++++++
tools/python/xen/xend/XendCheckpoint.py | 3 + tools/python/xen/xend/XendCheckpoint.py | 9 +++
tools/python/xen/xend/XendDomainInfo.py | 74 ++++++++++++++++++++++++++++ tools/python/xen/xend/XendDomainInfo.py | 74 ++++++++++++++++++++++++++++
tools/python/xen/xend/XendOptions.py | 29 +++++++++++ tools/python/xen/xend/XendOptions.py | 29 +++++++++++
7 files changed, 290 insertions(+) 7 files changed, 296 insertions(+)
Index: xen-4.4.0-testing/tools/examples/xend-config.sxp Index: xen-4.4.0-testing/tools/examples/xend-config.sxp
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/examples/xend-config.sxp --- xen-4.4.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-4.4.0-testing/tools/examples/xend-config.sxp +++ xen-4.4.0-testing/tools/examples/xend-config.sxp
@@ -321,6 +321,65 @@ @@ -324,6 +324,65 @@
# device assignment could really work properly even after we do this. # device assignment could really work properly even after we do this.
#(pci-passthrough-strict-check yes) #(pci-passthrough-strict-check yes)
@ -228,8 +228,8 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -139,6 +139,11 @@ def save(fd, dominfo, network, live, dst @@ -141,6 +141,11 @@ def save(fd, dominfo, network, live, dst
str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ] ]
log.debug("[xc_save]: %s", string.join(cmd)) log.debug("[xc_save]: %s", string.join(cmd))
+ # It is safe to release the domain lock at this point if not + # It is safe to release the domain lock at this point if not
@ -240,7 +240,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
def saveInputHandler(line, tochild): def saveInputHandler(line, tochild):
log.debug("In saveInputHandler %s", line) log.debug("In saveInputHandler %s", line)
if line == "suspend": if line == "suspend":
@@ -203,6 +208,9 @@ def save(fd, dominfo, network, live, dst @@ -205,6 +210,9 @@ def save(fd, dominfo, network, live, dst
log.exception("Save failed on domain %s (%s) - resuming.", domain_name, log.exception("Save failed on domain %s (%s) - resuming.", domain_name,
dominfo.getDomid()) dominfo.getDomid())
dominfo.resumeDomain() dominfo.resumeDomain()
@ -250,7 +250,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
try: try:
dominfo.setName(domain_name) dominfo.setName(domain_name)
@@ -369,6 +377,7 @@ def restore(xd, fd, dominfo = None, paus @@ -371,6 +379,7 @@ def restore(xd, fd, dominfo = None, paus
if not paused: if not paused:
dominfo.unpause() dominfo.unpause()

View File

@ -92,7 +92,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1491,6 +1491,27 @@ class XendDomainInfo: @@ -1477,6 +1477,27 @@ class XendDomainInfo:
self.info['abort_if_busy'] = str(abort_if_busy) self.info['abort_if_busy'] = str(abort_if_busy)
self.info['log_save_progress'] = str(log_save_progress) self.info['log_save_progress'] = str(log_save_progress)

View File

@ -21,7 +21,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -188,7 +188,10 @@ def save(fd, dominfo, network, live, dst @@ -190,7 +190,10 @@ def save(fd, dominfo, network, live, dst
dominfo.destroy() dominfo.destroy()
dominfo.testDeviceComplete() dominfo.testDeviceComplete()
try: try:

View File

@ -0,0 +1,27 @@
From: Olaf Hering <olaf@aepfle.de>
Date: Tue, 11 Feb 2014 15:21:01 +0100
Subject: 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>
---
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
--- 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)

View File

@ -0,0 +1,34 @@
Index: xen-4.4.0-testing/tools/python/xen/xm/xm
===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xm/xm
+++ xen-4.4.0-testing/tools/python/xen/xm/xm
@@ -4,17 +4,17 @@ import sys, os.path
from xen.xm import main
-print >>sys.stderr, ("WARNING: xend/xm is deprecated.")
-
-if not os.path.exists("/var/run/xm-deprecation-long-warning"):
- print >>sys.stderr, ("""
-xend is deprecated and scheduled for removal. Please migrate to another
-toolstack ASAP.
-
-See http://wiki.xen.org/wiki/Choice_of_Toolstacks for information on
-other alternatives, including xl which is designed to be a drop in
-replacement for xm (http://wiki.xen.org/wiki/XL).
-""")
- open("/var/run/xm-deprecation-long-warning", "w").close()
+#print >>sys.stderr, ("WARNING: xend/xm is deprecated.")
+#
+#if not os.path.exists("/var/run/xm-deprecation-long-warning"):
+# print >>sys.stderr, ("""
+#xend is deprecated and scheduled for removal. Please migrate to another
+#toolstack ASAP.
+#
+#See http://wiki.xen.org/wiki/Choice_of_Toolstacks for information on
+#other alternatives, including xl which is designed to be a drop in
+#replacement for xm (http://wiki.xen.org/wiki/XL).
+#""")
+# open("/var/run/xm-deprecation-long-warning", "w").close()
main.main(sys.argv)

View File

@ -0,0 +1,366 @@
From aa0cecb067ca6077c67cfc13f0ce31af7a3b72bb Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Mon, 10 Feb 2014 09:43:40 +0100
Subject: xend: set migration constraints from cmdline
xend part of required libxl change to tweak parameters of xc_domain_save
Add xm migrate --log_progress option. xc_domain_save does print progress
messages. These verbose messages are disabled per default to avoid flood
in xend.log. Sometimes it is helpful to see progress when migrating
large and busy guests. So add a new option to xm migrate to actually
enable the printing of progress messsages.
Print messages from xc_save with xc_report. Make use of xc_report in
xc_save to log also pid if some error occoured.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/libxc/xc_private.h | 1 +
tools/libxc/xenguest.h | 1 +
tools/python/xen/xend/XendCheckpoint.py | 22 +++++++++-
tools/python/xen/xend/XendDomain.py | 14 ++++++
tools/python/xen/xend/XendDomainInfo.py | 16 +++++++
tools/python/xen/xm/migrate.py | 26 +++++++++++
tools/xcutils/xc_save.c | 76 +++++++++++++++++++++------------
7 files changed, 127 insertions(+), 29 deletions(-)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 92271c9..947991a 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -119,6 +119,7 @@ void xc_report_progress_step(xc_interface *xch,
/* anamorphic macros: struct xc_interface *xch must be in scope */
+#define WPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_WARN,0, _f , ## _a)
#define IPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_INFO,0, _f , ## _a)
#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)
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index fc255c7..172d98a 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -29,6 +29,7 @@
#define XCFLAGS_STDVGA (1 << 3)
#define XCFLAGS_CHECKPOINT_COMPRESS (1 << 4)
#define XCFLAGS_DOMSAVE_ABORT_IF_BUSY (1 << 5)
+#define XCFLAGS_PROGRESS (1 << 6)
#define X86_64_B_SIZE 64
#define X86_32_B_SIZE 32
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index b8caf02..4233e49 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -118,9 +118,27 @@ def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1,sock=None):
# enabled. Passing "0" simply uses the defaults compiled into
# libxenguest; see the comments and/or code in xc_linux_save() for
# more information.
+ max_iters = dominfo.info.get('max_iters', "0")
+ max_factor = dominfo.info.get('max_factor', "0")
+ min_remaining = dominfo.info.get('min_remaining', "0")
+ abort_if_busy = dominfo.info.get('abort_if_busy', "0")
+ log_save_progress = dominfo.info.get('log_save_progress', "0")
+ if max_iters == "None":
+ max_iters = "0"
+ if max_factor == "None":
+ max_factor = "0"
+ if min_remaining == "None":
+ min_remaining = "0"
+ if abort_if_busy == "None":
+ abort_if_busy = "0"
+ if log_save_progress == "None":
+ log_save_progress = "0"
cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
- str(dominfo.getDomid()), "0", "0",
- str(int(live) | (int(hvm) << 2)) ]
+ str(dominfo.getDomid()),
+ max_iters, max_factor,
+ str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ),
+ min_remaining
+ ]
log.debug("[xc_save]: %s", string.join(cmd))
def saveInputHandler(line, tochild):
diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py
index 1d4da8f..6d873d6 100644
--- a/tools/python/xen/xend/XendDomain.py
+++ b/tools/python/xen/xend/XendDomain.py
@@ -1832,6 +1832,20 @@ class XendDomain:
log.exception(ex)
raise XendError(str(ex))
+ def domain_migrate_constraints_set(self, domid, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress):
+ """Set the Migrate Constraints of this domain.
+ @param domid: Domain ID or Name
+ @param max_iters: Number of iterations before final suspend
+ @param max_factor: Max amount of memory to transfer before final suspend
+ @param min_remaining: Number of dirty pages before final suspend
+ @param abort_if_busy: Abort migration instead of doing final suspend
+ @param log_save_progress: Log progress of migrate to xend.log
+ """
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ raise XendInvalidDomain(str(domid))
+ dominfo.setMigrateConstraints(max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress)
+
def domain_maxmem_set(self, domid, mem):
"""Set the memory limit for a domain.
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 8d4ff5c..f77b270 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -1461,6 +1461,22 @@ class XendDomainInfo:
pci_conf = self.info['devices'][dev_uuid][1]
return map(pci_dict_to_bdf_str, pci_conf['devs'])
+ def setMigrateConstraints(self, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress):
+ """Set the Migrate Constraints of this domain.
+ @param max_iters: Number of iterations before final suspend
+ @param max_factor: Max amount of memory to transfer before final suspend
+ @param min_remaining: Number of dirty pages before final suspend
+ @param abort_if_busy: Abort migration instead of doing final suspend
+ @param log_save_progress: Log progress of migrate to xend.log
+ """
+ log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s' '%s'.",
+ self.info['name_label'], str(self.domid), max_iters, max_factor, min_remaining, abort_if_busy)
+ self.info['max_iters'] = str(max_iters)
+ self.info['max_factor'] = str(max_factor)
+ self.info['min_remaining'] = str(min_remaining)
+ self.info['abort_if_busy'] = str(abort_if_busy)
+ self.info['log_save_progress'] = str(log_save_progress)
+
def setMemoryTarget(self, target):
"""Set the memory target of this domain.
@param target: In MiB.
diff --git a/tools/python/xen/xm/migrate.py b/tools/python/xen/xm/migrate.py
index c1ea19d..c5c9500 100644
--- a/tools/python/xen/xm/migrate.py
+++ b/tools/python/xen/xm/migrate.py
@@ -55,6 +55,26 @@ gopts.opt('change_home_server', short='c',
fn=set_true, default=0,
use="Change home server for managed domains.")
+gopts.opt('max_iters', val='max_iters',
+ fn=set_int, default=0,
+ use="Number of iterations before final suspend (default: 30).")
+
+gopts.opt('max_factor', val='max_factor',
+ fn=set_int, default=0,
+ use="Max amount of memory to transfer before final suspend (default: 3*RAM).")
+
+gopts.opt('min_remaining', val='min_remaining',
+ fn=set_int, default=0,
+ use="Number of dirty pages before final suspend (default: 50).")
+
+gopts.opt('abort_if_busy',
+ fn=set_true, default=0,
+ use="Abort migration instead of doing final suspend.")
+
+gopts.opt('log_progress',
+ fn=set_true, default=0,
+ use="Log progress of migration to xend.log")
+
def help():
return str(gopts)
@@ -80,6 +100,12 @@ def main(argv):
server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
other_config)
else:
+ server.xend.domain.migrate_constraints_set(dom,
+ opts.vals.max_iters,
+ opts.vals.max_factor,
+ opts.vals.min_remaining,
+ opts.vals.abort_if_busy,
+ opts.vals.log_progress)
server.xend.domain.migrate(dom, dst, opts.vals.live,
opts.vals.port,
opts.vals.node,
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
index e34bd2c..08ad224 100644
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -7,6 +7,7 @@
*
*/
+#include <unistd.h>
#include <err.h>
#include <stdlib.h>
#include <stdint.h>
@@ -19,6 +20,7 @@
#include <fcntl.h>
#include <err.h>
+#include <xc_private.h>
#include <xenstore.h>
#include <xenctrl.h>
#include <xenguest.h>
@@ -51,16 +53,17 @@ static int compat_suspend(void)
* receive the acknowledgement from the subscribe event channel. */
static int evtchn_suspend(void)
{
+ xc_interface *xch = si.xch;
int rc;
rc = xc_evtchn_notify(si.xce, si.suspend_evtchn);
if (rc < 0) {
- warnx("failed to notify suspend request channel: %d", rc);
+ WPRINTF("failed to notify suspend request channel: %d", rc);
return 0;
}
- if (xc_await_suspend(si.xch, si.xce, si.suspend_evtchn) < 0) {
- warnx("suspend failed");
+ if (xc_await_suspend(xch, si.xce, si.suspend_evtchn) < 0) {
+ WPRINTF("suspend failed");
return 0;
}
@@ -104,20 +107,27 @@ static int suspend(void* data)
static int switch_qemu_logdirty(int domid, unsigned int enable, void *data)
{
+ xc_interface *xch = si.xch;
struct xs_handle *xs;
char *path, *p, *ret_str, *cmd_str, **watch;
unsigned int len;
struct timeval tv;
fd_set fdset;
- if ((xs = xs_daemon_open()) == NULL)
- errx(1, "Couldn't contact xenstore");
- if (!(path = strdup("/local/domain/0/device-model/")))
- errx(1, "can't get domain path in store");
+ if ((xs = xs_daemon_open()) == NULL) {
+ PERROR("Couldn't contact xenstore");
+ exit(1);
+ }
+ if (!(path = strdup("/local/domain/0/device-model/"))) {
+ PERROR("can't get domain path in store");
+ exit(1);
+ }
if (!(path = realloc(path, strlen(path)
+ 10
- + strlen("/logdirty/cmd") + 1)))
- errx(1, "no memory for constructing xenstore path");
+ + strlen("/logdirty/cmd") + 1))) {
+ PERROR("no memory for constructing xenstore path");
+ exit(1);
+ }
snprintf(path + strlen(path), 11, "%i", domid);
strcat(path, "/logdirty/");
p = path + strlen(path);
@@ -126,16 +136,22 @@ static int switch_qemu_logdirty(int domid, unsigned int enable, void *data)
/* Watch for qemu's return value */
strcpy(p, "ret");
if (!xs_watch(xs, path, "qemu-logdirty-ret"))
- errx(1, "can't set watch in store (%s)\n", path);
+ {
+ ERROR("can't set watch in store (%s)\n", path);
+ exit(1);
+ }
- if (!(cmd_str = strdup( enable == 0 ? "disable" : "enable")))
- errx(1, "can't get logdirty cmd path in store");
+ if (!(cmd_str = strdup( enable == 0 ? "disable" : "enable"))) {
+ PERROR("can't get logdirty cmd path in store");
+ exit(1);
+ }
/* Tell qemu that we want it to start logging dirty page to Xen */
strcpy(p, "cmd");
- if (!xs_write(xs, XBT_NULL, path, cmd_str, strlen(cmd_str)))
- errx(1, "can't write to store path (%s)\n",
- path);
+ if (!xs_write(xs, XBT_NULL, path, cmd_str, strlen(cmd_str))) {
+ PERROR("can't write to store path (%s)\n", path);
+ exit(1);
+ }
/* Wait a while for qemu to signal that it has service logdirty command */
read_again:
@@ -144,8 +160,10 @@ static int switch_qemu_logdirty(int domid, unsigned int enable, void *data)
FD_ZERO(&fdset);
FD_SET(xs_fileno(xs), &fdset);
- if ((select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv)) != 1)
- errx(1, "timed out waiting for qemu logdirty response.\n");
+ if ((select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv)) != 1) {
+ PERROR("timed out waiting for qemu logdirty response.\n");
+ exit(1);
+ }
watch = xs_read_watch(xs, &len);
free(watch);
@@ -166,53 +184,57 @@ static int switch_qemu_logdirty(int domid, unsigned int enable, void *data)
int
main(int argc, char **argv)
{
- unsigned int maxit, max_f, lflags;
+ xc_interface *xch;
+ unsigned int maxit, max_f, lflags, min_r;
int io_fd, ret, port;
struct save_callbacks callbacks;
xentoollog_level lvl;
xentoollog_logger *l;
- if (argc != 6)
- errx(1, "usage: %s iofd domid maxit maxf flags", argv[0]);
+ if (argc != 7)
+ errx(1, "usage: %s iofd domid maxit maxf flags minr", argv[0]);
io_fd = atoi(argv[1]);
si.domid = atoi(argv[2]);
maxit = atoi(argv[3]);
max_f = atoi(argv[4]);
si.flags = atoi(argv[5]);
+ min_r = atoi(argv[6]);
si.suspend_evtchn = -1;
lvl = si.flags & XCFLAGS_DEBUG ? XTL_DEBUG: XTL_DETAIL;
- lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS;
+ lflags = XTL_STDIOSTREAM_SHOW_PID;
+ if (si.flags & XCFLAGS_PROGRESS)
+ lflags |= XTL_STDIOSTREAM_HIDE_PROGRESS;
l = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, lvl, lflags);
- si.xch = xc_interface_open(l, 0, 0);
+ xch = si.xch = xc_interface_open(l, 0, 0);
if (!si.xch)
- errx(1, "failed to open control interface");
+ errx(1, "[%lu] failed to open control interface", (unsigned long)getpid());
si.xce = xc_evtchn_open(NULL, 0);
if (si.xce == NULL)
- warnx("failed to open event channel handle");
+ WPRINTF("failed to open event channel handle");
else
{
port = xs_suspend_evtchn_port(si.domid);
if (port < 0)
- warnx("failed to get the suspend evtchn port\n");
+ WPRINTF("failed to get the suspend evtchn port\n");
else
{
si.suspend_evtchn =
xc_suspend_evtchn_init(si.xch, si.xce, si.domid, port);
if (si.suspend_evtchn < 0)
- warnx("suspend event channel initialization failed, "
+ WPRINTF("suspend event channel initialization failed, "
"using slow path");
}
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.suspend = suspend;
callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
- ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags,
+ ret = xc_domain_save_suse(si.xch, io_fd, si.domid, maxit, max_f, min_r, si.flags,
&callbacks, !!(si.flags & XCFLAGS_HVM), 0);
if (si.suspend_evtchn > 0)

View File

@ -129,7 +129,7 @@ Index: xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/libxl/xl_cmdimpl.c --- xen-4.4.0-testing.orig/tools/libxl/xl_cmdimpl.c
+++ xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c +++ xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c
@@ -1694,6 +1694,8 @@ skip_vfb: @@ -1726,6 +1726,8 @@ skip_vfb:
xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0); xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
xlu_cfg_get_defbool(config, "xen_platform_pci", xlu_cfg_get_defbool(config, "xen_platform_pci",
&b_info->u.hvm.xen_platform_pci, 0); &b_info->u.hvm.xen_platform_pci, 0);

View File

@ -150,7 +150,7 @@ Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1563,6 +1563,17 @@ class XendDomainInfo: @@ -1549,6 +1549,17 @@ class XendDomainInfo:
target = max_target target = max_target
self.setMemoryTarget(target) self.setMemoryTarget(target)