SHA256
1
0
forked from pool/xen
OBS User unknown
2009-05-04 16:38:09 +00:00
committed by Git OBS Bridge
parent 4790095364
commit 0bb51565d6
187 changed files with 2454 additions and 20791 deletions

View File

@@ -1,28 +1,17 @@
Index: xen-3.3.1-testing/tools/ioemu-remote/xen-vl-extra.c
Index: xen-3.4.0-testing/tools/ioemu-remote/savevm.c
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/xen-vl-extra.c
+++ xen-3.3.1-testing/tools/ioemu-remote/xen-vl-extra.c
@@ -8,12 +8,18 @@
* there is only one place where this file is included. */
#include "qemu-xen.h"
--- xen-3.4.0-testing.orig/tools/ioemu-remote/savevm.c
+++ xen-3.4.0-testing/tools/ioemu-remote/savevm.c
@@ -28,6 +28,7 @@
#include "sysemu.h"
#include "qemu-timer.h"
#include "qemu-char.h"
+#include "block_int.h"
/* forward declarations of things in vl.c */
static int qemu_savevm_state(QEMUFile *f);
static int qemu_loadvm_state(QEMUFile *f);
+static int bdrv_can_snapshot(BlockDriverState *bs);
+static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
+ const char *name);
+
+
/* We use simpler state save/load functions for Xen */
void do_savevm(const char *name)
@@ -85,6 +91,81 @@ void do_loadvm(const char *name)
vm_start();
#include "block.h"
#include "audio/audio.h"
#include "migration.h"
@@ -1015,6 +1016,86 @@ static int bdrv_snapshot_find(BlockDrive
return ret;
}
+int save_disk_snapshots(const char* name)
@@ -35,11 +24,16 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/xen-vl-extra.c
+ int i;
+ int ret = 0;
+
+ /* Deal with all aio submit */
+ qemu_aio_flush();
+ /* Do fsync at backend fs */
+ ret = bdrv_flush_all();
+ if (ret)
+ fprintf(stderr, "Fsync error[%d] when do snapshot[%s]\n", ret, name);
+
+ saved_vm_running = vm_running;
+ vm_stop(0);
+
+ qemu_aio_flush();
+
+ /* Ensure that all images support snapshots or are read-only */
+ for(i = 0; i < MAX_DRIVES; i++) {
+ bs = drives_table[i].bdrv;
@@ -100,14 +94,14 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/xen-vl-extra.c
+ return ret;
+}
+
struct qemu_alarm_timer;
static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; }
static void unix_stop_timer(struct qemu_alarm_timer *t) { }
Index: xen-3.3.1-testing/tools/ioemu-remote/i386-dm/helper2.c
#ifndef CONFIG_DM
void do_savevm(const char *name)
Index: xen-3.4.0-testing/tools/ioemu-remote/i386-dm/helper2.c
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/i386-dm/helper2.c
+++ xen-3.3.1-testing/tools/ioemu-remote/i386-dm/helper2.c
@@ -101,6 +101,9 @@ int send_vcpu = 0;
--- xen-3.4.0-testing.orig/tools/ioemu-remote/i386-dm/helper2.c
+++ xen-3.4.0-testing/tools/ioemu-remote/i386-dm/helper2.c
@@ -109,6 +109,9 @@ int send_vcpu = 0;
#define NR_CPUS 32
evtchn_port_t ioreq_local_port[NR_CPUS];
@@ -117,7 +111,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/i386-dm/helper2.c
CPUX86State *cpu_x86_init(const char *cpu_model)
{
CPUX86State *env;
@@ -547,6 +550,7 @@ int main_loop(void)
@@ -551,6 +554,7 @@ int main_loop(void)
int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
char *qemu_file;
fd_set fds;
@@ -125,7 +119,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/i386-dm/helper2.c
main_loop_prepare();
@@ -574,11 +578,43 @@ int main_loop(void)
@@ -578,11 +582,43 @@ int main_loop(void)
main_loop_wait(1); /* For the select() on events */
/* Save the device state */
@@ -173,11 +167,11 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/i386-dm/helper2.c
/* Wait to be allowed to continue */
while (xen_pause_requested) {
Index: xen-3.3.1-testing/tools/ioemu-remote/qemu-xen.h
Index: xen-3.4.0-testing/tools/ioemu-remote/qemu-xen.h
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-3.3.1-testing/tools/ioemu-remote/qemu-xen.h
@@ -14,6 +14,15 @@ void qemu_invalidate_map_cache(void)
--- xen-3.4.0-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-3.4.0-testing/tools/ioemu-remote/qemu-xen.h
@@ -34,6 +34,15 @@ void qemu_invalidate_map_cache(void)
#define mapcache_lock() ((void)0)
#define mapcache_unlock() ((void)0)
@@ -193,18 +187,18 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/qemu-xen.h
/* helper2.c */
extern long time_offset;
void timeoffset_get(void);
@@ -43,6 +52,7 @@ int xenstore_fd(void);
@@ -68,6 +77,7 @@ int xenstore_fd(void);
void xenstore_process_event(void *opaque);
void xenstore_record_dm(char *subpath, char *state);
void xenstore_record_dm_state(char *state);
void xenstore_record_dm(const char *subpath, const char *state);
void xenstore_record_dm_state(const char *state);
+void xenstore_record_dm_error(char *errmsg);
void xenstore_check_new_media_present(int timeout);
void xenstore_write_vncport(int vnc_display);
void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen);
Index: xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-3.4.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
--- xen-3.4.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.0-testing/tools/ioemu-remote/xenstore.c
@@ -24,6 +24,7 @@
#include "exec-all.h"
@@ -213,7 +207,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
#include "hw.h"
#include "pci.h"
@@ -601,6 +602,7 @@ static void xenstore_process_dm_command_
@@ -849,6 +850,7 @@ static void xenstore_process_dm_command_
{
char *path = NULL, *command = NULL, *par = NULL;
unsigned int len;
@@ -221,7 +215,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
if (pasprintf(&path,
"/local/domain/0/device-model/%u/command", domid) == -1) {
@@ -613,7 +615,18 @@ static void xenstore_process_dm_command_
@@ -861,7 +863,18 @@ static void xenstore_process_dm_command_
if (!strncmp(command, "save", len)) {
fprintf(logfile, "dm-command: pause and save state\n");
@@ -241,7 +235,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
xen_pause_requested = 0;
@@ -677,6 +690,13 @@ void xenstore_record_dm_state(char *stat
@@ -966,6 +979,13 @@ void xenstore_record_dm_state(const char
xenstore_record_dm("state", state);
}