This commit is contained in:
committed by
Git OBS Bridge
parent
4790095364
commit
0bb51565d6
@@ -1,51 +1,25 @@
|
||||
Index: xen-3.3.1-testing/tools/blktap/drivers/tapdisk.h
|
||||
From 5ac882a6d7499e4a36103db071203bf4d1ddfe1f Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Wolf <kwolf@suse.de>
|
||||
Date: Tue, 10 Mar 2009 16:26:45 +0100
|
||||
Subject: [PATCH 2/6] ioemu: Use the image format sent by blktapctrl
|
||||
|
||||
Currently the blktap backend in ioemu lets qemu guess which format an
|
||||
image is in. This was a security problem and the blktap backend
|
||||
doesn't work any more since this was fixed in qemu.
|
||||
|
||||
This patch changes ioemu to respect the format it gets from blktapctrl.
|
||||
|
||||
Signed-off-by: Kevin Wolf <kwolf@suse.de>
|
||||
---
|
||||
hw/xen_blktap.c | 22 +++++++++++++++++++---
|
||||
hw/xen_blktap.h | 14 ++++++++++++++
|
||||
2 files changed, 33 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: xen-3.4.0-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/blktap/drivers/tapdisk.h
|
||||
+++ xen-3.3.1-testing/tools/blktap/drivers/tapdisk.h
|
||||
@@ -159,16 +159,6 @@ extern struct tap_disk tapdisk_ram;
|
||||
extern struct tap_disk tapdisk_qcow;
|
||||
extern struct tap_disk tapdisk_qcow2;
|
||||
|
||||
-#define MAX_DISK_TYPES 20
|
||||
-
|
||||
-#define DISK_TYPE_AIO 0
|
||||
-#define DISK_TYPE_SYNC 1
|
||||
-#define DISK_TYPE_VMDK 2
|
||||
-#define DISK_TYPE_RAM 3
|
||||
-#define DISK_TYPE_QCOW 4
|
||||
-#define DISK_TYPE_QCOW2 5
|
||||
-#define DISK_TYPE_IOEMU 6
|
||||
-
|
||||
|
||||
/*Define Individual Disk Parameters here */
|
||||
static disk_info_t aio_disk = {
|
||||
Index: xen-3.3.1-testing/tools/blktap/lib/blktaplib.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/blktap/lib/blktaplib.h
|
||||
+++ xen-3.3.1-testing/tools/blktap/lib/blktaplib.h
|
||||
@@ -211,6 +211,17 @@ typedef struct msg_pid {
|
||||
#define CTLMSG_PID 9
|
||||
#define CTLMSG_PID_RSP 10
|
||||
|
||||
+/* disk driver types */
|
||||
+#define MAX_DISK_TYPES 20
|
||||
+
|
||||
+#define DISK_TYPE_AIO 0
|
||||
+#define DISK_TYPE_SYNC 1
|
||||
+#define DISK_TYPE_VMDK 2
|
||||
+#define DISK_TYPE_RAM 3
|
||||
+#define DISK_TYPE_QCOW 4
|
||||
+#define DISK_TYPE_QCOW2 5
|
||||
+#define DISK_TYPE_IOEMU 6
|
||||
+
|
||||
/* xenstore/xenbus: */
|
||||
#define DOMNAME "Domain-0"
|
||||
int setup_probe_watch(struct xs_handle *h);
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
@@ -222,9 +222,10 @@ static int map_new_dev(struct td_state *
|
||||
--- xen-3.4.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
|
||||
+++ xen-3.4.0-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
@@ -220,9 +220,10 @@ static int map_new_dev(struct td_state *
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -57,7 +31,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
char* devname;
|
||||
static int devnumber = 0;
|
||||
int i;
|
||||
@@ -234,7 +235,22 @@ static int open_disk(struct td_state *s,
|
||||
@@ -232,7 +233,22 @@ static int open_disk(struct td_state *s,
|
||||
bs = bdrv_new(devname);
|
||||
free(devname);
|
||||
|
||||
@@ -81,7 +55,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
fprintf(stderr, "Could not open image file %s\n", path);
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -529,7 +545,7 @@ static void handle_blktap_ctrlmsg(void*
|
||||
@@ -527,7 +543,7 @@ static void handle_blktap_ctrlmsg(void*
|
||||
s = state_init();
|
||||
|
||||
/*Open file*/
|
||||
@@ -90,13 +64,13 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
|
||||
msglen = sizeof(msg_hdr_t);
|
||||
msg->type = CTLMSG_IMG_FAIL;
|
||||
msg->len = msglen;
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.h
|
||||
Index: xen-3.4.0-testing/tools/ioemu-remote/hw/xen_blktap.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.h
|
||||
@@ -50,4 +50,19 @@ typedef struct fd_list_entry {
|
||||
struct fd_list_entry **pprev, *next;
|
||||
} fd_list_entry_t;
|
||||
--- xen-3.4.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
|
||||
+++ xen-3.4.0-testing/tools/ioemu-remote/hw/xen_blktap.h
|
||||
@@ -52,4 +52,18 @@ typedef struct fd_list_entry {
|
||||
|
||||
int init_blktap(void);
|
||||
|
||||
+typedef struct disk_info {
|
||||
+ int idnum;
|
||||
@@ -109,7 +83,6 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.h
|
||||
+ { DISK_TYPE_VMDK, &bdrv_vmdk },
|
||||
+ { DISK_TYPE_QCOW, &bdrv_qcow },
|
||||
+ { DISK_TYPE_QCOW2, &bdrv_qcow2 },
|
||||
+ { DISK_TYPE_IOEMU, NULL },
|
||||
+ { -1, NULL }
|
||||
+};
|
||||
+
|
||||
|
Reference in New Issue
Block a user