This commit is contained in:
committed by
Git OBS Bridge
parent
f5d6338f4d
commit
8cefe055e5
@@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py 2008-08-12 07:36:39.000000000 -0600
|
||||
@@ -0,0 +1,238 @@
|
||||
+#!/usr/bin/env python
|
||||
+# -*- mode: python; -*-
|
||||
@@ -243,8 +243,8 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
|
||||
+
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py 2008-08-12 07:36:39.000000000 -0600
|
||||
@@ -0,0 +1,125 @@
|
||||
+#============================================================================
|
||||
+# This library is free software; you can redistribute it and/or
|
||||
@@ -373,9 +373,9 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
|
||||
+ watcher.shutdown()
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvServer.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
|
||||
@@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvServer.py 2008-08-11 12:44:35.000000000 -0600
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py 2008-08-12 07:36:39.000000000 -0600
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
from SrvRoot import SrvRoot
|
||||
from XMLRPCServer import XMLRPCServer
|
||||
@@ -383,7 +383,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
|
||||
|
||||
xoptions = XendOptions.instance()
|
||||
|
||||
@@ -245,6 +246,8 @@ def _loadConfig(servers, root, reload):
|
||||
@@ -245,6 +246,8 @@
|
||||
if xoptions.get_xend_unix_xmlrpc_server():
|
||||
servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))
|
||||
|
||||
@@ -392,28 +392,28 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
|
||||
|
||||
def create():
|
||||
root = SrvDir()
|
||||
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
|
||||
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
|
||||
@@ -230,6 +230,16 @@ void xenstore_parse_domain_config(int hv
|
||||
*/
|
||||
waitForDevice(params);
|
||||
}
|
||||
+ /* if pyhsical CDROM put a watch on media-present after creating it */
|
||||
+ if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) {
|
||||
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
|
||||
+ if (bdrv_is_inserted(bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)]))
|
||||
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
|
||||
+ else
|
||||
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
|
||||
+ xs_watch(xsh, buf, "media-present");
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c 2008-08-11 12:36:15.000000000 -0600
|
||||
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c 2008-08-12 07:48:22.000000000 -0600
|
||||
@@ -297,6 +297,16 @@
|
||||
bdrv_set_type_hint(bs, BDRV_TYPE_CDROM);
|
||||
if (pasprintf(&buf, "%s/params", bpath) != -1)
|
||||
xs_watch(xsh, buf, dev);
|
||||
+ /* if pyhsical put a watch on media-present */
|
||||
+ if (drv && !strcmp(drv, "phy")) {
|
||||
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
|
||||
+ if (bdrv_is_inserted(bs))
|
||||
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
|
||||
+ else
|
||||
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
|
||||
+ xs_watch(xsh, buf, "media-present");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
bs = bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)] = bdrv_new(dev);
|
||||
@@ -566,6 +576,50 @@ void xenstore_record_dm_state(char *stat
|
||||
/* open device now if media present */
|
||||
@@ -631,6 +641,50 @@
|
||||
xenstore_record_dm("state", state);
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
|
||||
void xenstore_process_event(void *opaque)
|
||||
{
|
||||
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
|
||||
@@ -585,6 +639,11 @@ void xenstore_process_event(void *opaque
|
||||
@@ -650,6 +704,11 @@
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -476,31 +476,3 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
|
||||
if (strncmp(vec[XS_WATCH_TOKEN], "hd", 2) ||
|
||||
strlen(vec[XS_WATCH_TOKEN]) != 3)
|
||||
goto out;
|
||||
Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu/hw/ide.c
|
||||
+++ xen-3.3.0-testing/tools/ioemu/hw/ide.c
|
||||
@@ -361,6 +361,7 @@ typedef struct IDEState {
|
||||
uint8_t *io_buffer;
|
||||
QEMUTimer *sector_write_timer; /* only used for win2k instal hack */
|
||||
uint32_t irq_count; /* counts IRQs when using win2k install hack */
|
||||
+ uint8_t send_ua; /* send SENSE_UNIT_ATTENTION on next ready */
|
||||
} IDEState;
|
||||
|
||||
#define BM_STATUS_DMAING 0x01
|
||||
@@ -1462,8 +1463,15 @@ static void ide_atapi_cmd(IDEState *s)
|
||||
ASC_MEDIUM_MAY_HAVE_CHANGED);
|
||||
break;
|
||||
}
|
||||
+ if (s->send_ua) {
|
||||
+ ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION,
|
||||
+ ASC_MEDIUM_NOT_PRESENT);
|
||||
+ s->send_ua = 0;
|
||||
+ break;
|
||||
+ }
|
||||
ide_atapi_cmd_ok(s);
|
||||
} else {
|
||||
+ s->send_ua = 1;
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY,
|
||||
ASC_MEDIUM_NOT_PRESENT);
|
||||
xenstore_check_new_media_present(1000);
|
||||
|
Reference in New Issue
Block a user