WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] RFC: Xen cdrom haldaemon

To: Pat Campbell <plc@xxxxxxxxxx>
Subject: Re: [Xen-devel] RFC: Xen cdrom haldaemon
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Wed, 5 Sep 2007 18:56:33 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 05 Sep 2007 10:56:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46DE8884.3E48.0018.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C301DA12.15211%Keir.Fraser@xxxxxxxxxxxx> <20070903191808.GC22983@xxxxxxxxxx> <46DE8884.3E48.0018.0@xxxxxxxxxx>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Wed, Sep 05, 2007 at 10:43:30AM -0600, Pat Campbell wrote:
> 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.

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.
-- 
|=- 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  -=| 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel