- remove more obsolete changes:
CFLAGS passing to qemu-traditional, PYTHON_PREFIX_ARG handling and pygrub installation - update blktap-pv-cdrom.patch handle allocation errors in asprintf to fix compile errors handle value returned from xs_read properly remove casts from void pointers - update xenalyze to revision 138 Fix dump time calculation overflow move struct record_info into a header correctly display of count of HW events update trace.h to match xen-unstable Remove vestigal HW_IRQ trace records Remove decode of PV_UPDATE_VA_MAPPING automatically generate dependencies Get rid of redundant hvm dump_header Introduce more efficient read mechanism Eliminate unnecessary cycles_to_time calculation Rework math to remove two 64-bit divisions Enable -O2 optimization level Remove --dump-cooked Remove spurious dump_header construction Improve record-sorting algorithm Use long to cast into and out of pointers Make max_active_pcpu calculation smarter Optimize pcpu_string Enable more cr3 output Sort cr3 enumerated values by start time Add option to skip vga range in MMIO enumeration Handle MMIO records from different vmexits Relocate pio and mmio enumaration structs to their own sub-struct Handle new hvm_event traces Introduce generic summary functionality Function-ize setting of h->post_process Reorganize cr trace handling Allow several summary handlers to register on a single vmexit Get rid of all tabs in xenalyze.c Handle new IRQ tracing Decrease verbosity Print exit reason number if no string is available Fix minor summary issue Add string for TPR_BELOW_THRESHOLD Raise MAX_CPUS to 256 cpus. Add --report-pcpu option to report physical cpu utilization. increase MAX_CPUS Handle RUNSTATE_INIT in domain_runstate calculation - update RPM_OPT_FLAGS handling in spec file pass EXTRA_CFLAGS via environment - remove obsolete xencommons-proc-xen.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=206
This commit is contained in:
@@ -1,8 +1,43 @@
|
||||
---
|
||||
tools/blktap/drivers/Makefile | 6
|
||||
tools/blktap/drivers/block-cdrom.c | 565 +++++++++++++++++++++++
|
||||
tools/blktap/drivers/tapdisk.c | 16
|
||||
tools/blktap/drivers/tapdisk.h | 16
|
||||
tools/blktap/lib/blktaplib.h | 1
|
||||
tools/python/xen/xend/server/BlktapController.py | 1
|
||||
xen/include/public/io/blkif.h | 2
|
||||
xen/include/public/io/cdromif.h | 122 ++++
|
||||
8 files changed, 726 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/Makefile
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/Makefile
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/Makefile
|
||||
@@ -38,8 +38,9 @@ endif
|
||||
CFLAGS += $(PTHREAD_CFLAGS)
|
||||
LDFLAGS += $(PTHREAD_LDFLAGS)
|
||||
|
||||
-LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -L../lib -lblktap -lrt -lm $(PTHREAD_LIBS)
|
||||
-LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) $(PTHREAD_LIBS) -lz
|
||||
+LDLIBS_xen := $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
|
||||
+LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_xen) -L../lib -lblktap -lrt -lm $(PTHREAD_LIBS)
|
||||
+LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) $(PTHREAD_LIBS) -lz $(LDLIBS_xen)
|
||||
|
||||
BLK-OBJS-y := block-aio.o
|
||||
BLK-OBJS-y += block-sync.o
|
||||
@@ -47,6 +48,7 @@ BLK-OBJS-y += block-vmdk.o
|
||||
BLK-OBJS-y += block-ram.o
|
||||
BLK-OBJS-y += block-qcow.o
|
||||
BLK-OBJS-y += block-qcow2.o
|
||||
+BLK-OBJS-y += block-cdrom.o
|
||||
BLK-OBJS-y += aes.o
|
||||
BLK-OBJS-y += tapaio.o
|
||||
BLK-OBJS-$(CONFIG_Linux) += blk_linux.o
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
@@ -0,0 +1,535 @@
|
||||
@@ -0,0 +1,565 @@
|
||||
+/* block-cdrom.c
|
||||
+ *
|
||||
+ * simple slow synchronous cdrom disk implementation. Based off
|
||||
@@ -45,7 +80,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+#include <sys/statvfs.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <linux/fs.h>
|
||||
+#include <sys/mount.h>
|
||||
+
|
||||
+#include "tapdisk.h"
|
||||
+#include <xen/io/cdromif.h>
|
||||
@@ -75,7 +110,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ struct statvfs statBuf;
|
||||
+ struct stat stat;
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+
|
||||
+ s->size = 0;
|
||||
+ s->sector_size = CDROM_DEFAULT_SECTOR_SIZE;
|
||||
@@ -138,7 +173,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+static inline void init_fds(struct disk_driver *dd)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+
|
||||
+ for(i = 0; i < MAX_IOFD; i++)
|
||||
+ dd->io_fd[i] = 0;
|
||||
@@ -150,7 +185,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+
|
||||
+void open_device (struct disk_driver *dd)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ int o_flags;
|
||||
+
|
||||
+ o_flags = O_NONBLOCK | O_LARGEFILE |
|
||||
@@ -189,10 +224,14 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ */
|
||||
+int tdcdrom_open (struct disk_driver *dd, const char *name, td_flag_t flags)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ int ret;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+
|
||||
+ asprintf(&prv->dev_name, "%s", name);
|
||||
+ ret = asprintf(&prv->dev_name, "%s", name);
|
||||
+ if (ret < 0) {
|
||||
+ prv->dev_name = NULL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ prv->fd = -1;
|
||||
+ prv->media_changed = 0;
|
||||
+ prv->media_present = 0;
|
||||
@@ -201,6 +240,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+
|
||||
+ open_device(dd);
|
||||
+
|
||||
+out:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
@@ -209,7 +249,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret;
|
||||
@@ -238,7 +278,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret = 0;
|
||||
@@ -265,7 +305,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret = 0;
|
||||
@@ -368,12 +408,10 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ break;
|
||||
+ case XEN_TYPE_CDROM_OPEN:
|
||||
+ {
|
||||
+ char *buf = NULL;
|
||||
+ unsigned int len;
|
||||
+ struct stat statbuf;
|
||||
+ int major = 0;
|
||||
+ int minor = 0;
|
||||
+ char *num;
|
||||
+
|
||||
+ if (stat (prv->dev_name, &statbuf) == 0) {
|
||||
+ major = major (statbuf.st_rdev);
|
||||
@@ -383,21 +421,43 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ xco->err = 0;
|
||||
+ xco->ret = 0;
|
||||
+ if (xco->payload_offset) {
|
||||
+ char * nodename;
|
||||
+ char *present;
|
||||
+ char *buf;
|
||||
+ char *num;
|
||||
+ char *nodename;
|
||||
+ char media_present[2];
|
||||
+ nodename = (char *)sp + xco->payload_offset;
|
||||
+ asprintf(&buf, "%s/media-present", nodename);
|
||||
+ if (!xs_read(prv->xs_handle, XBT_NULL, buf, &len)) {
|
||||
+ sprintf(media_present, "%d", prv->media_present);
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, media_present, strlen(media_present));
|
||||
+ xs_watch(prv->xs_handle, buf, "media-present");
|
||||
+ asprintf(&buf, "%s/params", nodename);
|
||||
+ xs_watch(prv->xs_handle, buf, "params");
|
||||
+ asprintf(&num, "%x:%x", major, minor);
|
||||
+ asprintf(&buf, "%s/physical-device", nodename);
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, num, strlen(num));
|
||||
+ if (asprintf(&buf, "%s/media-present", nodename) < 0)
|
||||
+ goto out_payload_offset;
|
||||
+ present = xs_read(prv->xs_handle, XBT_NULL, buf, &len);
|
||||
+ if (present) {
|
||||
+ free(buf);
|
||||
+ goto out_payload_offset_free;
|
||||
+ }
|
||||
+
|
||||
+ sprintf(media_present, "%d", prv->media_present);
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, media_present, strlen(media_present));
|
||||
+ xs_watch(prv->xs_handle, buf, "media-present");
|
||||
+ free(buf);
|
||||
+
|
||||
+ if (asprintf(&buf, "%s/params", nodename) < 0)
|
||||
+ goto out_payload_offset_free;
|
||||
+ xs_watch(prv->xs_handle, buf, "params");
|
||||
+ free(buf);
|
||||
+
|
||||
+ if (asprintf(&num, "%x:%x", major, minor) < 0)
|
||||
+ goto out_payload_offset_free;
|
||||
+ if (asprintf(&buf, "%s/physical-device", nodename) < 0) {
|
||||
+ free(num);
|
||||
+ goto out_payload_offset_free;
|
||||
+ }
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, num, strlen(num));
|
||||
+ free(buf);
|
||||
+ free(num);
|
||||
+out_payload_offset_free:
|
||||
+ free(present);
|
||||
+out_payload_offset:
|
||||
+ ;
|
||||
+ }
|
||||
+
|
||||
+ xco->media_present = prv->media_present;
|
||||
@@ -434,7 +494,7 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+
|
||||
+int tdcdrom_close(struct disk_driver *dd)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+
|
||||
+ if (prv->fd != -1) {
|
||||
+ close(prv->fd);
|
||||
@@ -449,8 +509,8 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+
|
||||
+void tdcdrom_process_media_change_event(struct disk_driver *dd, char **vec)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ char *media_present = NULL;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ char *media_present;
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ media_present = xs_read(prv->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], &len);
|
||||
@@ -463,22 +523,26 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ open_device(dd);
|
||||
+ prv->media_changed = 1;
|
||||
+ }
|
||||
+ free(media_present);
|
||||
+}
|
||||
+
|
||||
+void tdcrom_process_params_event(struct disk_driver *dd, char **vec)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ char * params = NULL;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ char *params;
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ params = xs_read(prv->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], &len);
|
||||
+ if (params != NULL) {
|
||||
+ if (params) {
|
||||
+ char *cp = strchr(params, ':');
|
||||
+ if (cp) {
|
||||
+ cp++;
|
||||
+ if (prv->dev_name)
|
||||
+ free(prv->dev_name);
|
||||
+ asprintf(&prv->dev_name, "%s", cp);
|
||||
+ if (asprintf(&prv->dev_name, "%s", cp) < 0) {
|
||||
+ prv->dev_name = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
+ if (prv->fd != -1) {
|
||||
+ close(prv->fd);
|
||||
+ prv->fd = -1;
|
||||
@@ -486,12 +550,13 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ open_device(dd);
|
||||
+ prv->media_changed = 1;
|
||||
+ }
|
||||
+ free(params);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_do_callbacks(struct disk_driver *dd, int sid)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ struct tdcdrom_state *prv = dd->private;
|
||||
+ char **vec;
|
||||
+ unsigned int num;
|
||||
+
|
||||
@@ -538,6 +603,118 @@ Index: xen-4.2.0-testing/tools/blktap/drivers/block-cdrom.c
|
||||
+ .td_get_parent_id = tdcdrom_get_parent_id,
|
||||
+ .td_validate_parent = tdcdrom_validate_parent
|
||||
+};
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/tapdisk.c
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/tapdisk.c
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/tapdisk.c
|
||||
@@ -735,6 +735,22 @@ static void get_io_request(struct td_sta
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
+ case BLKIF_OP_PACKET:
|
||||
+ ret = 0;
|
||||
+ if (drv->td_queue_packet)
|
||||
+ ret = drv->td_queue_packet(dd, sector_nr,
|
||||
+ nsects, page,
|
||||
+ send_responses,
|
||||
+ idx, (void *)(long)i);
|
||||
+ if (ret > 0) dd->early += ret;
|
||||
+ else if (ret == -EBUSY) {
|
||||
+ /* put req back on queue */
|
||||
+ --info->fe_ring.req_cons;
|
||||
+ info->busy.req = req;
|
||||
+ info->busy.seg_idx = i;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ break;
|
||||
default:
|
||||
DPRINTF("Unknown block operation\n");
|
||||
break;
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/tapdisk.h
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
@@ -137,6 +137,9 @@ struct tap_disk {
|
||||
int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id);
|
||||
int (*td_validate_parent)(struct disk_driver *dd,
|
||||
struct disk_driver *p, td_flag_t flags);
|
||||
+ int (*td_queue_packet) (struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *prv);
|
||||
};
|
||||
|
||||
typedef struct disk_info {
|
||||
@@ -160,6 +163,7 @@ extern struct tap_disk tapdisk_vmdk;
|
||||
extern struct tap_disk tapdisk_ram;
|
||||
extern struct tap_disk tapdisk_qcow;
|
||||
extern struct tap_disk tapdisk_qcow2;
|
||||
+extern struct tap_disk tapdisk_cdrom;
|
||||
|
||||
|
||||
/*Define Individual Disk Parameters here */
|
||||
@@ -229,6 +233,17 @@ static disk_info_t qcow2_disk = {
|
||||
#endif
|
||||
};
|
||||
|
||||
+static disk_info_t cdrom_disk = {
|
||||
+ DISK_TYPE_CDROM,
|
||||
+ "raw image (cdrom)",
|
||||
+ "cdrom",
|
||||
+ 0,
|
||||
+ 0,
|
||||
+#ifdef TAPDISK
|
||||
+ &tapdisk_cdrom,
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
/*Main disk info array */
|
||||
static disk_info_t *dtypes[] = {
|
||||
&aio_disk,
|
||||
@@ -237,6 +252,7 @@ static disk_info_t *dtypes[] = {
|
||||
&ram_disk,
|
||||
&qcow_disk,
|
||||
&qcow2_disk,
|
||||
+ &cdrom_disk,
|
||||
};
|
||||
|
||||
typedef struct driver_list_entry {
|
||||
Index: xen-4.2.0-testing/tools/blktap/lib/blktaplib.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/lib/blktaplib.h
|
||||
+++ xen-4.2.0-testing/tools/blktap/lib/blktaplib.h
|
||||
@@ -219,6 +219,7 @@ typedef struct msg_pid {
|
||||
#define DISK_TYPE_RAM 3
|
||||
#define DISK_TYPE_QCOW 4
|
||||
#define DISK_TYPE_QCOW2 5
|
||||
+#define DISK_TYPE_CDROM 6
|
||||
|
||||
/* xenstore/xenbus: */
|
||||
#define DOMNAME "Domain-0"
|
||||
Index: xen-4.2.0-testing/tools/python/xen/xend/server/BlktapController.py
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/python/xen/xend/server/BlktapController.py
|
||||
+++ xen-4.2.0-testing/tools/python/xen/xend/server/BlktapController.py
|
||||
@@ -15,6 +15,7 @@ blktap1_disk_types = [
|
||||
'ram',
|
||||
'qcow',
|
||||
'qcow2',
|
||||
+ 'cdrom',
|
||||
'ioemu',
|
||||
]
|
||||
|
||||
Index: xen-4.2.0-testing/xen/include/public/io/blkif.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/xen/include/public/io/blkif.h
|
||||
+++ xen-4.2.0-testing/xen/include/public/io/blkif.h
|
||||
@@ -379,7 +379,7 @@
|
||||
* Used in SLES sources for device specific command packet
|
||||
* contained within the request. Reserved for that purpose.
|
||||
*/
|
||||
-#define BLKIF_OP_RESERVED_1 4
|
||||
+#define BLKIF_OP_PACKET 4
|
||||
/*
|
||||
* Indicate to the backend device that a region of storage is no longer in
|
||||
* use, and may be discarded at any time without impact to the client. If
|
||||
Index: xen-4.2.0-testing/xen/include/public/io/cdromif.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
@@ -665,139 +842,3 @@ Index: xen-4.2.0-testing/xen/include/public/io/cdromif.h
|
||||
+ sizeof(struct vcd_generic_command) - sizeof(struct request_sense))
|
||||
+
|
||||
+#endif
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/Makefile
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/Makefile
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/Makefile
|
||||
@@ -37,8 +37,9 @@ endif
|
||||
CFLAGS += $(PTHREAD_CFLAGS)
|
||||
LDFLAGS += $(PTHREAD_LDFLAGS)
|
||||
|
||||
-LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -L../lib -lblktap -lrt -lm $(PTHREAD_LIBS)
|
||||
-LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) $(PTHREAD_LIBS) -lz
|
||||
+LDLIBS_xen := $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
|
||||
+LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_xen) -L../lib -lblktap -lrt -lm $(PTHREAD_LIBS)
|
||||
+LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) $(PTHREAD_LIBS) -lz $(LDLIBS_xen)
|
||||
|
||||
BLK-OBJS-y := block-aio.o
|
||||
BLK-OBJS-y += block-sync.o
|
||||
@@ -46,6 +47,7 @@ BLK-OBJS-y += block-vmdk.o
|
||||
BLK-OBJS-y += block-ram.o
|
||||
BLK-OBJS-y += block-qcow.o
|
||||
BLK-OBJS-y += block-qcow2.o
|
||||
+BLK-OBJS-y += block-cdrom.o
|
||||
BLK-OBJS-y += aes.o
|
||||
BLK-OBJS-y += tapaio.o
|
||||
BLK-OBJS-$(CONFIG_Linux) += blk_linux.o
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/tapdisk.h
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
@@ -137,6 +137,9 @@ struct tap_disk {
|
||||
int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id);
|
||||
int (*td_validate_parent)(struct disk_driver *dd,
|
||||
struct disk_driver *p, td_flag_t flags);
|
||||
+ int (*td_queue_packet) (struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *prv);
|
||||
};
|
||||
|
||||
typedef struct disk_info {
|
||||
@@ -160,6 +163,7 @@ extern struct tap_disk tapdisk_vmdk;
|
||||
extern struct tap_disk tapdisk_ram;
|
||||
extern struct tap_disk tapdisk_qcow;
|
||||
extern struct tap_disk tapdisk_qcow2;
|
||||
+extern struct tap_disk tapdisk_cdrom;
|
||||
|
||||
|
||||
/*Define Individual Disk Parameters here */
|
||||
@@ -229,6 +233,17 @@ static disk_info_t qcow2_disk = {
|
||||
#endif
|
||||
};
|
||||
|
||||
+static disk_info_t cdrom_disk = {
|
||||
+ DISK_TYPE_CDROM,
|
||||
+ "raw image (cdrom)",
|
||||
+ "cdrom",
|
||||
+ 0,
|
||||
+ 0,
|
||||
+#ifdef TAPDISK
|
||||
+ &tapdisk_cdrom,
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
/*Main disk info array */
|
||||
static disk_info_t *dtypes[] = {
|
||||
&aio_disk,
|
||||
@@ -237,6 +252,7 @@ static disk_info_t *dtypes[] = {
|
||||
&ram_disk,
|
||||
&qcow_disk,
|
||||
&qcow2_disk,
|
||||
+ &cdrom_disk,
|
||||
};
|
||||
|
||||
typedef struct driver_list_entry {
|
||||
Index: xen-4.2.0-testing/tools/blktap/lib/blktaplib.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/lib/blktaplib.h
|
||||
+++ xen-4.2.0-testing/tools/blktap/lib/blktaplib.h
|
||||
@@ -219,6 +219,7 @@ typedef struct msg_pid {
|
||||
#define DISK_TYPE_RAM 3
|
||||
#define DISK_TYPE_QCOW 4
|
||||
#define DISK_TYPE_QCOW2 5
|
||||
+#define DISK_TYPE_CDROM 6
|
||||
|
||||
/* xenstore/xenbus: */
|
||||
#define DOMNAME "Domain-0"
|
||||
Index: xen-4.2.0-testing/xen/include/public/io/blkif.h
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/xen/include/public/io/blkif.h
|
||||
+++ xen-4.2.0-testing/xen/include/public/io/blkif.h
|
||||
@@ -379,7 +379,7 @@
|
||||
* Used in SLES sources for device specific command packet
|
||||
* contained within the request. Reserved for that purpose.
|
||||
*/
|
||||
-#define BLKIF_OP_RESERVED_1 4
|
||||
+#define BLKIF_OP_PACKET 4
|
||||
/*
|
||||
* Indicate to the backend device that a region of storage is no longer in
|
||||
* use, and may be discarded at any time without impact to the client. If
|
||||
Index: xen-4.2.0-testing/tools/blktap/drivers/tapdisk.c
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/blktap/drivers/tapdisk.c
|
||||
+++ xen-4.2.0-testing/tools/blktap/drivers/tapdisk.c
|
||||
@@ -735,6 +735,22 @@ static void get_io_request(struct td_sta
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
+ case BLKIF_OP_PACKET:
|
||||
+ ret = 0;
|
||||
+ if (drv->td_queue_packet)
|
||||
+ ret = drv->td_queue_packet(dd, sector_nr,
|
||||
+ nsects, page,
|
||||
+ send_responses,
|
||||
+ idx, (void *)(long)i);
|
||||
+ if (ret > 0) dd->early += ret;
|
||||
+ else if (ret == -EBUSY) {
|
||||
+ /* put req back on queue */
|
||||
+ --info->fe_ring.req_cons;
|
||||
+ info->busy.req = req;
|
||||
+ info->busy.seg_idx = i;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ break;
|
||||
default:
|
||||
DPRINTF("Unknown block operation\n");
|
||||
break;
|
||||
Index: xen-4.2.0-testing/tools/python/xen/xend/server/BlktapController.py
|
||||
===================================================================
|
||||
--- xen-4.2.0-testing.orig/tools/python/xen/xend/server/BlktapController.py
|
||||
+++ xen-4.2.0-testing/tools/python/xen/xend/server/BlktapController.py
|
||||
@@ -15,6 +15,7 @@ blktap1_disk_types = [
|
||||
'ram',
|
||||
'qcow',
|
||||
'qcow2',
|
||||
+ 'cdrom',
|
||||
'ioemu',
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user