Hello community, here is the log from the commit of package xen for openSUSE:Factory checked in at 2014-02-19 11:29:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xen (Old) and /work/SRC/openSUSE:Factory/.xen.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "xen" Changes: -------- --- /work/SRC/openSUSE:Factory/xen/xen.changes 2014-02-02 18:47:01.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.xen.new/xen.changes 2014-02-19 11:29:52.000000000 +0100 @@ -1,0 +2,105 @@ +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+) + +------------------------------------------------------------------- @@ -17,0 +123,2 @@ + xen_pvonhvm.xen_emul_unplug.patch + Dropped xen_pvdrivers.conf @@ -31,0 +139 @@ + qemu-xen-upstream-blkif-discard.patch @@ -41,0 +150,4 @@ +- Restore a few missing xend patches + xend-config-enable-dump-comment.patch + xend-tools-watchdog-support.patch + xend-vif-route-ifup.patch Old: ---- xen.migrate.tools_add_xm_migrate_--log_progress_option.patch xen.migrate.tools_set_migration_constraints_from_cmdline.patch xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch New: ---- aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch libxc-pass-errno-to-callers-of-xc_domain_save.patch libxl.add-option-for-discard-support-to-xl-disk-conf.patch libxl.set-migration-constraints-from-cmdline.patch xend-pvscsi-recognize-also-SCSI-CDROM-devices.patch xend-remove-xm-deprecation-warning.patch xend-set-migration-constraints-from-cmdline.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xen.spec ++++++ ++++ 708 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/xen/xen.spec ++++ and /work/SRC/openSUSE:Factory/.xen.new/xen.spec ++++++ aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch ++++++
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) ++++++ blktap-pv-cdrom.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:29:55.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:29:55.000000000 +0100 @@ -696,7 +696,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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 * contained within the request. Reserved for that purpose. */ ++++++ change-vnc-passwd.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:29:55.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:29:55.000000000 +0100 @@ -2,71 +2,23 @@ Signed-off-by: Chunyan Liu <cyliu@novell.com> -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, +--- + tools/python/xen/xend/XendDomainInfo.py | 14 ++++++++++++++ + tools/python/xen/xend/server/XMLRPCServer.py | 2 +- + tools/python/xen/xm/main.py | 12 ++++++++++++ + tools/qemu-xen-traditional-dir-remote/vl.c | 2 +- + tools/qemu-xen-traditional-dir-remote/vnc.c | 1 + + tools/qemu-xen-traditional-dir-remote/xenstore.c | 14 ++++++++++++++ + 6 files changed, 43 insertions(+), 2 deletions(-) + 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 -@@ -1461,6 +1461,20 @@ class XendDomainInfo: - pci_conf = self.info['devices'][dev_uuid][1] - return map(pci_dict_to_bdf_str, pci_conf['devs']) - +@@ -1665,6 +1665,20 @@ class XendDomainInfo: + vfb_ctrl.reconfigureDevice(0, dev_info) + break + + def chgvncpasswd(self, passwd): + if self._stateGet() != DOM_STATE_HALTED: + path = '/local/domain/0/backend/vfb/%u/0/' % self.getDomid() @@ -81,9 +33,9 @@ + break + xen.xend.XendDomain.instance().managed_config_save(self) + - def setMemoryTarget(self, target): - """Set the memory target of this domain. - @param target: In MiB. + # + # Function to update xenstore /vm/* + # 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 @@ -155,3 +107,60 @@ } ## 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, ++++++ libxc-pass-errno-to-callers-of-xc_domain_save.patch ++++++ ++++ 647 lines (skipped) ++++++ libxl.add-option-for-discard-support-to-xl-disk-conf.patch ++++++ 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 */ ++++++ libxl.set-migration-constraints-from-cmdline.patch ++++++
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© (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, ++++++ magic_ioport_compat.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:29:55.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:29:55.000000000 +0100 @@ -6,7 +6,7 @@ =================================================================== --- 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 -@@ -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) { err = "unrecognised magic value"; ++++++ qemu-xen-dir-remote.tar.bz2 ++++++ /work/SRC/openSUSE:Factory/xen/qemu-xen-dir-remote.tar.bz2 /work/SRC/openSUSE:Factory/.xen.new/qemu-xen-dir-remote.tar.bz2 differ: char 11, line 1 ++++++ qemu-xen-traditional-dir-remote.tar.bz2 ++++++ ++++++ qemu-xen-upstream-blkif-discard.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:29:57.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:29:57.000000000 +0100 @@ -1,21 +1,23 @@ 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 discard code in qemu. -The discard support is enabled unconditionally. But it would be worth to -have a knob to disable it in case the backing file was intentionally -created non-sparse to avoid fragmentation. -How could this be knob be passed from domU.cfg:disk=[] to the actual -qemu process? Perhaps introduce an option discard=on|off|ignore|unmap. +The discard support is enabled unconditionally. The tool stack may provide a +property "discard-enable" in the backend node to optionally disable discard +support. This is helpful in case the backing file was intentionally created +non-sparse to avoid fragmentation. -Signed-off-by: Olaf Hering <olaf@aepfle.de> +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> --- - tools/qemu-xen-dir-remote/hw/block/xen_blkif.h | 12 ++++++++ - tools/qemu-xen-dir-remote/hw/block/xen_disk.c | 36 +++++++++++++++++++++++++ - 2 files changed, 48 insertions(+) + tools/qemu-xen-dir-remote/hw/block/xen_blkif.h | 12 ++++++++++ + tools/qemu-xen-dir-remote/hw/block/xen_disk.c | 30 +++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) Index: xen-4.4.0-testing/tools/qemu-xen-dir-remote/hw/block/xen_blkif.h =================================================================== @@ -51,16 +53,7 @@ =================================================================== --- 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 -@@ -68,6 +68,8 @@ struct ioreq { - 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 { +@@ -114,6 +114,7 @@ struct XenBlkDev { int requests_finished; /* Persistent grants extension */ @@ -68,64 +61,53 @@ gboolean feature_persistent; GTree *persistent_gnts; unsigned int persistent_gnt_count; -@@ -232,6 +235,7 @@ static void ioreq_release(struct ioreq * - static int ioreq_parse(struct ioreq *ioreq) - { - 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 */ +@@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ior + case BLKIF_OP_WRITE: + ioreq->prot = PROT_READ; /* from memory */ break; + case BLKIF_OP_DISCARD: -+ ioreq->sector_num = discard_req->sector_number; -+ ioreq->nb_sectors = discard_req->nr_sectors; + return 0; - case BLKIF_OP_FLUSH_DISKCACHE: - ioreq->presync = 1; - if (!ioreq->req.nr_segments) { -@@ -521,6 +529,13 @@ static int ioreq_runio_qemu_aio(struct i + default: + xen_be_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n", + ioreq->req.operation); +@@ -521,6 +524,16 @@ static int ioreq_runio_qemu_aio(struct i &ioreq->v, ioreq->v.size / BLOCK_SIZE, qemu_aio_complete, ioreq); break; + 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++; + bdrv_aio_discard(blkdev->bs, -+ ioreq->sector_num, ioreq->nb_sectors, ++ discard_req->sector_number, discard_req->nr_sectors, + qemu_aio_complete, ioreq); + break; ++ } default: /* unknown operation (shouldn't happen -- parse catches this) */ 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) +{ -+ int flags = BDRV_O_UNMAP; -+#if 0 -+ char *s = xenstore_read_be_str(&blkdev->xendev, "toolstack-options-discard"); ++ int enable; + -+ if (s && bdrv_parse_discard_flags(s, &flags) < 0) { -+ xen_be_printf(xendev, 0, "property toolstack-discard-options failed to parse: %s\n", s); -+ return; -+ } -+#endif -+ blkdev->feature_discard = !!(flags & BDRV_O_UNMAP); -+ if (!blkdev->feature_discard) -+ return; -+ xenstore_write_be_int(&blkdev->xendev, "feature-discard", 1); ++ blkdev->feature_discard = true; ++ ++ if (xenstore_read_be_int(&blkdev->xendev, "discard-enable", &enable) == 0) ++ blkdev->feature_discard = !!enable; ++ ++ if (blkdev->feature_discard) ++ xenstore_write_be_int(&blkdev->xendev, "feature-discard", 1); +} + static int blk_init(struct XenDevice *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, "info", info); @@ -134,7 +116,7 @@ g_free(directiosafe); 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; readonly = false; } ++++++ seabios-dir-remote.tar.bz2 ++++++ ++++++ xen-4.4.0-testing-src.tar.bz2 ++++++ ++++ 4859 lines of diff (skipped) ++++++ xen.migrate.tools-xend_move_assert_to_exception_block.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -17,11 +17,11 @@ tools/python/xen/xend/XendCheckpoint.py | 6 +++--- 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.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -262,9 +262,6 @@ def restore(xd, fd, dominfo = None, paus +--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -267,9 +267,6 @@ def restore(xd, fd, dominfo = None, paus store_port = dominfo.getStorePort() console_port = dominfo.getConsolePort() @@ -31,7 +31,7 @@ # if hvm, pass mem size to calculate the store_mfn if is_hvm: 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 try: ++++++ xend-checkpoint-rename.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -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.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -188,7 +188,7 @@ def save(fd, dominfo, network, live, dst +--- xen-4.4.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.4.0-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -190,7 +190,7 @@ def save(fd, dominfo, network, live, dst dominfo.destroy() dominfo.testDeviceComplete() try: ++++++ xend-console-port-restore.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -7,7 +7,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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() # xc_restore will wait for source to close connection ++++++ xend-domain-lock-sfex.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -2,7 +2,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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> # Return 0 on success, non-zero on error. # @@ -11,7 +11,7 @@ # -s Lock status. If lock is acquired, print any contents # on stdout and return 0. Return non-zero if lock is # available. -@@ -380,6 +380,11 @@ +@@ -383,6 +383,11 @@ # #(xend-domain-lock-utility domain-lock) ++++++ xend-domain-lock.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -3,16 +3,16 @@ tools/hotplug/Linux/Makefile | 1 tools/hotplug/Linux/domain-lock | 83 ++++++++++++++++++++++++++++++++ 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/XendOptions.py | 29 +++++++++++ - 7 files changed, 290 insertions(+) + 7 files changed, 296 insertions(+) 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/tools/examples/xend-config.sxp -@@ -321,6 +321,65 @@ +@@ -324,6 +324,65 @@ # device assignment could really work properly even after we do this. #(pci-passthrough-strict-check yes) @@ -228,8 +228,8 @@ =================================================================== --- xen-4.4.0-testing.orig/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 - str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ] +@@ -141,6 +141,11 @@ def save(fd, dominfo, network, live, dst + ] log.debug("[xc_save]: %s", string.join(cmd)) + # It is safe to release the domain lock at this point if not @@ -240,7 +240,7 @@ def saveInputHandler(line, tochild): log.debug("In saveInputHandler %s", line) 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, dominfo.getDomid()) dominfo.resumeDomain() @@ -250,7 +250,7 @@ try: 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: dominfo.unpause() ++++++ xend-max-free-mem.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -92,7 +92,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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['log_save_progress'] = str(log_save_progress) ++++++ xend-migration-domname-fix.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -21,7 +21,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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.testDeviceComplete() try: ++++++ xend-pvscsi-recognize-also-SCSI-CDROM-devices.patch ++++++ 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) ++++++ xend-remove-xm-deprecation-warning.patch ++++++ 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) ++++++ xend-set-migration-constraints-from-cmdline.patch ++++++
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) ++++++ xend-tools-watchdog-support.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -129,7 +129,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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_get_defbool(config, "xen_platform_pci", &b_info->u.hvm.xen_platform_pci, 0); ++++++ xend-xenpaging.autostart.patch ++++++ --- /var/tmp/diff_new_pack.EEg1jZ/_old 2014-02-19 11:30:00.000000000 +0100 +++ /var/tmp/diff_new_pack.EEg1jZ/_new 2014-02-19 11:30:00.000000000 +0100 @@ -150,7 +150,7 @@ =================================================================== --- xen-4.4.0-testing.orig/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 self.setMemoryTarget(target) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org