Skip to contentSkip to conversation

RFC: Xen 3.1.1

DISCUSSION Keir Fraser 5 participants 11 messages Sep 3, 2007 – Sep 6, 2007

lore
Share & tools
lore
#0 lore raw

Folks,

We're planning to roll an update to the 3.1 branch, hopefully towards the end of next week. I have a fair number of patches already queued up to consider for backport, but if anyone has any in particular they would like to be considered, please let us know! This is *particularly* aimed at ia64 and powerpc maintainers, since I currently have no ia64 or ppc patches queued up for backport.

Regards,
Keir

#1 lore raw
Quoted 8 lines · Keir Fraser

Folks,

We're planning to roll an update to the 3.1 branch, hopefully towards the end of next week. I have a fair number of patches already queued up to consider for backport, but if anyone has any in particular they would like to be considered, please let us know! This is *particularly* aimed at ia64 and powerpc maintainers, since I currently have no ia64 or ppc patches queued up for backport.

I'd like to get the PVFB changes to replace libvncserver with QEMU into the release. I'll post updated patches ASAP.

I recently managed to get support for TLS + x509 certificate authentication merged into upstream QEMU for the VNC server so we have some serious quality security there. The back-port to QEMU 0.9.0 in Xen should be fairly easy for me to do, so I'll hopefully be able submit that in the next week too.

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#2 lore raw
Quoted 7 lines · Daniel P. Berrange

I'd like to get the PVFB changes to replace libvncserver with QEMU into the release. I'll post updated patches ASAP.

I recently managed to get support for TLS + x509 certificate authentication merged into upstream QEMU for the VNC server so we have some serious quality security there. The back-port to QEMU 0.9.0 in Xen should be fairly easy for me to do, so I'll hopefully be able submit that in the next week too.

Does backporting these to 3.1 make sense given that it uses qemu 0.8.2?

-- Keir

#3 lore raw
Quoted 11 lines · Keir Fraser
Quoted 7 lines · Daniel P. Berrange

I'd like to get the PVFB changes to replace libvncserver with QEMU into the release. I'll post updated patches ASAP.

I recently managed to get support for TLS + x509 certificate authentication merged into upstream QEMU for the VNC server so we have some serious quality security there. The back-port to QEMU 0.9.0 in Xen should be fairly easy for me to do, so I'll hopefully be able submit that in the next week too.

Does backporting these to 3.1 make sense given that it uses qemu 0.8.2?

I've backported them to 3.1 / QEMU 0.8.2 for the Fedora 8, test2 release but it was not exactly pretty. There've been a fair few changes to QEMU & its VNC server between 0.8.2 and 0.9.0, plus the various Xen specific patches, so I had to pull in a fair number of other changes first. If there's interest I can send out the patches against 3.1, but otherwise I'll just focus on the xen-unstable tree.

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#4 lore raw

RFC: Xen cdrom haldaemon

In reply to Daniel P. Berrange

Hi,

I have found that the DOM0 CDROM device returns a stale disk size if a CD is changed while any application has the device open.

Test scenerio: ( Don't need XEN for this )
Two shell processes
Shell A runs simple test program with an arg to
open the cd for reading
report media size using lseek(0, SEEK_END) then enter a sleep loop leaving FD open
In Shell B
eject
insert a different CD
eject -t,
run simple test progran, no arg
( size is still what was reported in shell A)
Kill Shell A test CD process
Run test CD process again, now you should have the
correct size

Simple test program, cdrom-test.c, has been attached.

I did enter a defect against the Linux kernel about this but was unable to convince them it was their defect.

If we put Xen in the mix, say installing a FV Redhat system from physical CD media you will have two CDROM device file descriptors open. One in blkback and the other in QEMU. When you get to CD #2 you won't be able to complete the install as the total disk size has not been updated for the larger CD #2, stays at the smaller CD #1 size.

You can get the QEMU descriptor closed by using xen-store writes but none effect the blkback FD and there is no way, that I have found, to effect ALL open Xen related FDs on that device.

I have created a proof of concept patch for 3.1 that addresses the above issue by causing all VMs, FV and PV, to close thier open pyhsical CDROM file descriptors when the device door is opened. File descriptors are re-opened when the door is closed AND a CD was inserted.

The basic flow of the patch is:

Kernel:
blkback driver:
if block device is a physical cdrom then
Add media_present=1 into xenstore backend/vbd
for this device
Place a xenstore watch on media_present

watch_handler
if watch token is media_present
read value
if 0 then close block device fd
if 1 then re-open block device fd

Any access with fd closed results in EACCESS error

qemu
if block device is a cdrom
Place a xenstore watch on media_present
watch_handler
if watch token is media_present
read value
if 0 then close block device
if 1 then re-open block device and set media_changed

Any access with fd closed results in EACCESS error

xend
Starts XEN HalDaemon process

XEN HalDaemon
Registers event callback for HALD events
callback handler
gets device major/minor numbers
for each vbd in xenstore
if matching major and minor
if add_event ( cdrom door closed with media )
xenstore write 1 to vbd/media_present
else ( cddrom door open )
xenstore write 0 to vbd/media_present

I am just learning python, could use a python guy to enhance and generalize.

With my patch applied I was able to install RHEL5 from the 5 CD set as well as a WIN2003 server from multi CD media.

The patch is attached. Patch still needs some work but I would like some feedback before going further down this path. Is this something that fits into the current and near future architecture and might be considered for addition?

Thanks in advance

Pat

# HG changeset patch
# User [email protected]
# Date 1182539263 21600
# Node ID fa6ec13addb49f7054c364a90bbcbfae1d79fea8 # Parent 362adec0c4592f130ba17304126656b40f1b0324 CDROM removable media-present attribute plus handling code

linux-2.6-xen-sparse/drivers/xen/blkback/Makefile +1 -1
diff -r 362adec0c459 -r fa6ec13addb4 linux-2.6-xen-sparse/drivers/xen/blkback/Makefile
@@ -1,3 +1,3 @@ obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkb
 obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkbk.o
 
-blkbk-y	:= blkback.o xenbus.o interface.o vbd.o
+blkbk-y	:= blkback.o xenbus.o interface.o vbd.o cdrom.o
linux-2.6-xen-sparse/drivers/xen/blkback/cdrom.c new file +169 -0

169 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/blkback/common.h +15 -0
diff -r 362adec0c459 -r fa6ec13addb4 linux-2.6-xen-sparse/drivers/xen/blkback/common.h
@@ -96,6 +96,17 @@ typedef struct blkif_st {
 	grant_ref_t    shmem_ref;
 } blkif_t;
 
+struct backend_info
+{
+	struct xenbus_device *dev;
+	blkif_t *blkif;
+	struct xenbus_watch backend_watch;
+	struct xenbus_watch backend_cdrom_watch;
+	unsigned major;
+	unsigned minor;
+	char *mode;
+};
+
 blkif_t *blkif_alloc(domid_t domid);
 void blkif_disconnect(blkif_t *blkif);
 void blkif_free(blkif_t *blkif);
@@ -136,4 +147,8 @@ int blkback_barrier(struct xenbus_transa
 int blkback_barrier(struct xenbus_transaction xbt,
 		    struct backend_info *be, int state);
 
+/* cdrom media change */
+int cdrom_is_type(struct backend_info *be);
+void cdrom_add_media_watch(struct backend_info *be);
+
 #endif /* __BLKIF__BACKEND__COMMON_H__ */
linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c +3 -0
diff -r 362adec0c459 -r fa6ec13addb4 linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
@@ -106,6 +106,9 @@ int vbd_translate(struct phys_req *req, 
 	if ((operation != READ) && vbd->readonly)
 		goto out;
 
+	if (vbd->bdev == NULL)
+		goto out;
+
 	if (unlikely((req->sector_number + req->nr_sects) > vbd_sz(vbd)))
 		goto out;
 
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +9 -10
diff -r 362adec0c459 -r fa6ec13addb4 linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
@@ -26,16 +26,6 @@
 #define DPRINTK(fmt, args...)				\
 	pr_debug("blkback/xenbus (%s:%d) " fmt ".\n",	\
 		 __FUNCTION__, __LINE__, ##args)
-
-struct backend_info
-{
-	struct xenbus_device *dev;
-	blkif_t *blkif;
-	struct xenbus_watch backend_watch;
-	unsigned major;
-	unsigned minor;
-	char *mode;
-};
 
 static void connect(struct backend_info *);
 static int connect_ring(struct backend_info *);
@@ -179,6 +169,12 @@ static int blkback_remove(struct xenbus_
 		be->backend_watch.node = NULL;
 	}
 
+	if (be->backend_cdrom_watch.node) {
+		unregister_xenbus_watch(&be->backend_cdrom_watch);
+		kfree(be->backend_cdrom_watch.node);
+		be->backend_cdrom_watch.node = NULL;
+	}
+
 	if (be->blkif) {
 		blkif_disconnect(be->blkif);
 		vbd_free(&be->blkif->vbd);
@@ -330,6 +326,9 @@ static void backend_changed(struct xenbu
 
 		/* We're potentially connected now */
 		update_blkif_status(be->blkif);
+
+		/* Add watch for cdrom media status if necessay */
+		cdrom_add_media_watch(be);
 	}
 }
 
tools/ioemu/block.c +197 -13

246 lines not on this page · raw message

tools/ioemu/block_int.h +8 -0
diff -r 362adec0c459 -r fa6ec13addb4 tools/ioemu/block_int.h
@@ -41,6 +41,13 @@ struct BlockDriver {
                              int nb_sectors, int *pnum);
     int (*bdrv_set_key)(BlockDriverState *bs, const char *key);
     int (*bdrv_make_empty)(BlockDriverState *bs);
+
+    /* removable device specific */
+    int (*bdrv_is_inserted)(BlockDriverState *bs);
+    int (*bdrv_media_changed)(BlockDriverState *bs);
+    int (*bdrv_eject)(BlockDriverState *bs, int eject_flag);
+    int (*bdrv_set_locked)(BlockDriverState *bs, int locked);
+
     struct BlockDriver *next;
 };
 
@@ -65,6 +72,7 @@ struct BlockDriverState {
     char backing_file[1024]; /* if non zero, the image is a diff of
                                 this file image */
     int is_temporary;
+    int media_changed;
     
     BlockDriverState *backing_hd;
     
tools/ioemu/hw/ide.c +6 -2
diff -r 362adec0c459 -r fa6ec13addb4 tools/ioemu/hw/ide.c
@@ -278,6 +278,7 @@
 #define ASC_ILLEGAL_OPCODE                   0x20
 #define ASC_LOGICAL_BLOCK_OOR                0x21
 #define ASC_INV_FIELD_IN_CMD_PACKET          0x24
+#define ASC_MEDIA_CHANGED                    0x28
 #define ASC_MEDIUM_NOT_PRESENT               0x3a
 #define ASC_SAVING_PARAMETERS_NOT_SUPPORTED  0x39
 
@@ -393,6 +394,7 @@ typedef struct PCIIDEState {
 } PCIIDEState;
 
 #define DMA_MULTI_THREAD
+#undef DMA_MULTI_THREAD
 
 #ifdef DMA_MULTI_THREAD
 
@@ -1341,7 +1343,6 @@ static void ide_atapi_cmd(IDEState *s)
         } else {
             ide_atapi_cmd_error(s, SENSE_NOT_READY, 
                                 ASC_MEDIUM_NOT_PRESENT);
-            xenstore_check_new_media_present(1000);
         }
         break;
     case GPCMD_MODE_SENSE_10:
@@ -1530,7 +1531,10 @@ static void ide_atapi_cmd(IDEState *s)
             
             if (eject && !start) {
                 /* eject the disk */
-                bdrv_close(s->bs);
+                bdrv_eject(s->bs, 1);
+            } else if (eject && start) {
+                /* close the tray */
+                bdrv_eject(s->bs, 0);
             }
             ide_atapi_cmd_ok(s);
         }
tools/ioemu/xenstore.c +42 -4

70 lines not on this page · raw message

tools/python/xen/xend/server/HalDaemon.py new file +228 -0

228 lines not on this page · raw message

tools/python/xen/xend/server/Hald.py new file +113 -0

113 lines not on this page · raw message

tools/python/xen/xend/server/SrvServer.py +3 -0
diff -r 362adec0c459 -r fa6ec13addb4 tools/python/xen/xend/server/SrvServer.py
@@ -57,6 +57,7 @@ from xen.web.SrvDir import SrvDir
 
 from SrvRoot import SrvRoot
 from XMLRPCServer import XMLRPCServer
+from xen.xend.server.Hald import Hald
 
 xoptions = XendOptions.instance()
 
@@ -248,6 +249,8 @@ def _loadConfig(servers, root, reload):
     if xoptions.get_xend_unix_xmlrpc_server():
         servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))
 
+    servers.add(Hald())
+
 
 def create():
     root = SrvDir()

# HG changeset patch
# User [email protected]
# Date 1182542474 21600
# Node ID 46685041fb424de81500375183149ecb126e1a88 # Parent fa6ec13addb49f7054c364a90bbcbfae1d79fea8 Added return true to raw_is_inserted() if ioctl fails

tools/ioemu/block.c +3 -0
diff -r fa6ec13addb4 -r 46685041fb42 tools/ioemu/block.c
@@ -777,6 +777,9 @@ static int raw_is_inserted(BlockDriverSt
     case BDRV_TYPE_CDROM:
         ret = ioctl(s->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
         if (ret == CDS_DISC_OK) {
+            return 1;
+		}
+        if (ret == -1) {  // iso case
             return 1;
 		}
         else {

# HG changeset patch
# User [email protected]
# Date 1182542925 21600
# Node ID 69fc41d0f24bbc6a428d0e5dd23225ef7aa9d6f5 # Parent 46685041fb424de81500375183149ecb126e1a88 Added if test for params

tools/ioemu/xenstore.c +2 -1
diff -r 46685041fb42 -r 69fc41d0f24b tools/ioemu/xenstore.c
@@ -168,7 +168,8 @@ void xenstore_parse_domain_config(int do
         /* check if it is a cdrom */
         if (type && !strcmp(type, "cdrom")) {
             bdrv_set_type_hint(bs_table[hd_index], BDRV_TYPE_CDROM);
-            xs_watch(xsh, buf, dev);
+            if (pasprintf(&buf, "%s/params", bpath) != -1)
+                xs_watch(xsh, buf, dev);
 	    if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
                 free(media_present);
                 media_present = xs_read(xsh, XBT_NULL, buf, &len);
tools/python/xen/xend/server/Hald.py +13 -1
diff -ur a/tools/python/xen/xend/server/Hald.py b/tools/python/xen/xend/server/Hald.py
@@ -74,6 +74,8 @@
                 pid2 = None
             if pid2 == 0:
                 os.chdir("/")
+                env = os.environ.copy()
+                env['PYTHONPATH'] = self.getpythonpath()
                 for fd in range(0, 256):
                     try:
                         os.close(fd)
@@ -82,7 +84,7 @@
                 os.open("/dev/null", os.O_RDWR)
                 os.dup2(0, 1)
                 os.dup2(0, 2)
-                os.execvp(prog, args)
+                os.execvpe(prog, args, env)
                 os._exit(1)
             else:
                 w.write(str(pid2 or 0))
@@ -96,6 +98,16 @@
         #log.debug( "daemon_pid: %d", daemon_pid )
         return daemon_pid
 
+    def getpythonpath(self):
+        str = " "
+        for p in sys.path:
+            if str != " ":
+                str = str + ":" + p
+            else:
+                if str != "":
+                   str = p
+        return str
+
     def find(self,path, matchFunc=os.path.isfile):
         """Find a module in the sys.path
         From web page: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

Re: RFC: Xen cdrom haldaemon

Could the haldaemon's work be pushed into blkback in the kernel?

-- Keir

Quoted 106 lines · Pat Campbell

Hi,

I have found that the DOM0 CDROM device returns a stale disk size if a CD is changed while any application has the device open.

Test scenerio: ( Don't need XEN for this )
Two shell processes
Shell A runs simple test program with an arg to
open the cd for reading
report media size using lseek(0, SEEK_END) then enter a sleep loop leaving FD open
In Shell B
eject
insert a different CD
eject -t,
run simple test progran, no arg
( size is still what was reported in shell A)
Kill Shell A test CD process
Run test CD process again, now you should have the
correct size

Simple test program, cdrom-test.c, has been attached.

I did enter a defect against the Linux kernel about this but was unable to convince them it was their defect.

If we put Xen in the mix, say installing a FV Redhat system from physical CD media you will have two CDROM device file descriptors open. One in blkback and the other in QEMU. When you get to CD #2 you won't be able to complete the install as the total disk size has not been updated for the larger CD #2, stays at the smaller CD #1 size.

You can get the QEMU descriptor closed by using xen-store writes but none effect the blkback FD and there is no way, that I have found, to effect ALL open Xen related FDs on that device.

I have created a proof of concept patch for 3.1 that addresses the above issue by causing all VMs, FV and PV, to close thier open pyhsical CDROM file descriptors when the device door is opened. File descriptors are re-opened when the door is closed AND a CD was inserted.

The basic flow of the patch is:

Kernel:
blkback driver:
if block device is a physical cdrom then
Add media_present=1 into xenstore backend/vbd
for this device
Place a xenstore watch on media_present

watch_handler
if watch token is media_present
read value
if 0 then close block device fd
if 1 then re-open block device fd

Any access with fd closed results in EACCESS error

qemu
if block device is a cdrom
Place a xenstore watch on media_present
watch_handler
if watch token is media_present
read value
if 0 then close block device
if 1 then re-open block device and set media_changed

Any access with fd closed results in EACCESS error

xend
Starts XEN HalDaemon process

XEN HalDaemon
Registers event callback for HALD events
callback handler
gets device major/minor numbers
for each vbd in xenstore
if matching major and minor
if add_event ( cdrom door closed with media )
xenstore write 1 to vbd/media_present
else ( cddrom door open )
xenstore write 0 to vbd/media_present

I am just learning python, could use a python guy to enhance and generalize.

With my patch applied I was able to install RHEL5 from the 5 CD set as well as a WIN2003 server from multi CD media.

The patch is attached. Patch still needs some work but I would like some feedback before going further down this path. Is this something that fits into the current and near future architecture and might be considered for addition?

Thanks in advance

Pat

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw

Re: RFC: Xen cdrom haldaemon

Quoted 4 lines · Keir Fraser

Could the haldaemon's work be pushed into blkback in the kernel?

Could be but if we pull it into the kernel we would have to write our own device poll routine and no longer leverage HALD and DBUS.

As I have thought about this some more I think the code I added to blkback to create the media present attribute should be moved up into xend as well.

Pat

Quoted 111 lines

-- Keir

Quoted 106 lines · Pat Campbell

Hi,

I have found that the DOM0 CDROM device returns a stale disk size if a CD is changed while any application has the device open.

Test scenerio: ( Don't need XEN for this )
Two shell processes
Shell A runs simple test program with an arg to
open the cd for reading
report media size using lseek(0, SEEK_END) then enter a sleep loop leaving FD open
In Shell B
eject
insert a different CD
eject - t,
run simple test progran, no arg
( size is still what was reported in shell A)
Kill Shell A test CD process
Run test CD process again, now you should have the
correct size

Simple test program, cdrom- test.c, has been attached.

I did enter a defect against the Linux kernel about this but was unable to convince them it was their defect.

If we put Xen in the mix, say installing a FV Redhat system from physical CD media you will have two CDROM device file descriptors open. One in blkback and the other in QEMU. When you get to CD #2 you won't be able to complete the install as the total disk size has not been updated for the larger CD #2, stays at the smaller CD #1 size.

You can get the QEMU descriptor closed by using xen- store writes but none effect the blkback FD and there is no way, that I have found, to effect ALL open Xen related FDs on that device.

I have created a proof of concept patch for 3.1 that addresses the above issue by causing all VMs, FV and PV, to close thier open pyhsical CDROM file descriptors when the device door is opened. File descriptors are re- opened when the door is closed AND a CD was inserted.

The basic flow of the patch is:

Kernel:
blkback driver:
if block device is a physical cdrom then
Add media_present=1 into xenstore backend/vbd
for this device
Place a xenstore watch on media_present

watch_handler
if watch token is media_present
read value
if 0 then close block device fd
if 1 then re- open block device fd

Any access with fd closed results in EACCESS error

qemu
if block device is a cdrom
Place a xenstore watch on media_present
watch_handler
if watch token is media_present
read value
if 0 then close block device
if 1 then re- open block device and set media_changed

Any access with fd closed results in EACCESS error

xend
Starts XEN HalDaemon process

XEN HalDaemon
Registers event callback for HALD events
callback handler
gets device major/minor numbers
for each vbd in xenstore
if matching major and minor
if add_event ( cdrom door closed with media )
xenstore write 1 to vbd/media_present
else ( cddrom door open )
xenstore write 0 to vbd/media_present

I am just learning python, could use a python guy to enhance and generalize.

With my patch applied I was able to install RHEL5 from the 5 CD set as well as a WIN2003 server from multi CD media.

The patch is attached. Patch still needs some work but I would like some feedback before going further down this path. Is this something that fits into the current and near future architecture and might be considered for addition?

Thanks in advance

Pat

_______________________________________________
Xen- devel mailing list
Xen- [email protected]
http://lists.xensource.com/xen- devel

#7 lore raw

Re: RFC: Xen cdrom haldaemon

In reply to Pat Campbell
Quoted 42 lines · Pat Campbell

The basic flow of the patch is:

Kernel:
blkback driver:
if block device is a physical cdrom then
Add media_present=1 into xenstore backend/vbd
for this device
Place a xenstore watch on media_present

watch_handler
if watch token is media_present
read value
if 0 then close block device fd
if 1 then re-open block device fd

Any access with fd closed results in EACCESS error

qemu
if block device is a cdrom
Place a xenstore watch on media_present
watch_handler
if watch token is media_present
read value
if 0 then close block device
if 1 then re-open block device and set media_changed

Any access with fd closed results in EACCESS error

xend
Starts XEN HalDaemon process

XEN HalDaemon
Registers event callback for HALD events
callback handler
gets device major/minor numbers
for each vbd in xenstore
if matching major and minor
if add_event ( cdrom door closed with media )
xenstore write 1 to vbd/media_present
else ( cddrom door open )
xenstore write 0 to vbd/media_present

Quoted 2 lines

I am just learning python, could use a python guy to enhance and generalize.

To be honest this sounds like rather overkill. Why on earth is blkback opening the device in the first place? blkback/blkfront don't have any kind of support for CDROM capabilities, so paravirt drivers for a disk device Xend marked as a cdrom don't make sense. If we stop blkback from processing any devices with the ':cdrom' annotation, then only QEMU will have the device open & the problem should go away if I'm understanding your description properly.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#8 lore raw

Re: RFC: Xen cdrom haldaemon

Quoted 1 line
Quoted 1 line
Quoted 1 line

On Wed, Sep 5, 2007 at 11:56 AM, in message <[email protected]>,

Quoted 54 lines · Daniel P. Berrange
Quoted 42 lines · Pat Campbell

The basic flow of the patch is:

Kernel:
blkback driver:
if block device is a physical cdrom then
Add media_present=1 into xenstore backend/vbd
for this device
Place a xenstore watch on media_present

watch_handler
if watch token is media_present
read value
if 0 then close block device fd
if 1 then re- open block device fd

Any access with fd closed results in EACCESS error

qemu
if block device is a cdrom
Place a xenstore watch on media_present
watch_handler
if watch token is media_present
read value
if 0 then close block device
if 1 then re- open block device and set media_changed

Any access with fd closed results in EACCESS error

xend
Starts XEN HalDaemon process

XEN HalDaemon
Registers event callback for HALD events
callback handler
gets device major/minor numbers
for each vbd in xenstore
if matching major and minor
if add_event ( cdrom door closed with media )
xenstore write 1 to vbd/media_present
else ( cddrom door open )
xenstore write 0 to vbd/media_present

Quoted 2 lines

I am just learning python, could use a python guy to enhance and generalize.

To be honest this sounds like rather overkill. Why on earth is blkback opening the device in the first place? blkback/blkfront don't have any kind of support for CDROM capabilities, so paravirt drivers for a disk device Xend marked as a cdrom don't make sense. If we stop blkback from processing any devices with the ':cdrom' annotation, then only QEMU will have the device open & the problem should go away if I'm understanding your description properly.

Quoted 1 line

Dan.

Getting rid of the blkback open FD for QEMU guests would help but the root problem still exists. We still need to get all open file descriptors to the CDROM device closed and reopened when the media is swapped out.

This is a contrived scenario but possible.
4 active FV guests, all configured to the same physical CDROM
( These guests for whatever reason share the CDROM data )
Currently there will be 8 open descriptors, 4 if blkback is changed Admin wants to swap out the CD with a new one that has additional info
All open descriptors have to be closed before any guest will be able to access the additional info because of the CD size not being changed while any app has the CD device open.

Pat

#9 lore raw
In reply to Keir Fraser

Two things I would like to see fixed (which may already be...) are:

1. the bug in qemu that was giving me random crashes (see patch supplied by 'Daniel P. Berrange [[email protected]]' in the xen-users list with the subject 'qemu-dm crashing under 3.1' on or around 20070615). HVM is pretty much not usable without it - uptimes of a few days maximum.

2. A fix for the bug where HVM domains ignore the flag to say use local time. My windows domains all start 10 hours off.

Thanks

James

Quoted 10 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Keir Fraser
Sent: Tuesday, 4 September 2007 00:35
To: xen-devel
Subject: [Xen-devel] RFC: Xen 3.1.1

Folks,

We're planning to roll an update to the 3.1 branch, hopefully towards

the

Quoted 2 lines

end of next week. I have a fair number of patches already queued up to consider for backport, but if anyone has any in particular they would

like

Quoted 1 line

to be considered, please let us know! This is *particularly* aimed at

ia64

Quoted 12 lines

and powerpc maintainers, since I currently have no ia64 or ppc patches queued up for backport.

Regards,
Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#10 lore raw
In reply to Keir Fraser
Quoted 2 lines · Keir Fraser

We're planning to roll an update to the 3.1 branch, hopefully towards the end of next week.

That seems awfully quick, given that we can't yet see what will be in the release?

Top of my list are all the patches that implement missing Xen API stuff such as 15275:b643179d7452

Also the managed domain foibles like 15149:8fcefab1d63b and 15394:168b143a1a88, etc.

Both of these groups of patches are essentially finishing stuff that should have been in the release already so seem important.

15161:e046da853ffc - whilst an RFE, this would be very nice to have.

15164:d93e560c1d50
15165:4730ec3d5ab3
15179:152dc0d812b2 - these are essentially about not losing data

15621:f85acff5bef5, 15251:6f06bd06ef47 and related - low risk but without these ballooning patches, dom0 behaviour can become pathological

15253:ebe4140fe4f8 - this was a nasty little bug

15283:e08cbd487414 - reflect current reality

15671:0c79a9414f8d, 15673:f343d3c16dcc, 15674:07364f8574b8 - nasty random corruption?

regards
john