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/
Home Products Support Community News


[Xen-changelog] If the 'cdrom=' option is specified in the definition fi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] If the 'cdrom=' option is specified in the definition file but media is
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Apr 2006 10:14:14 +0000
Delivery-date: Tue, 11 Apr 2006 03:16:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4088dd0856a9cbc7ef050d7272e81666b7dfbcc7
# Parent  b454a09cddb1a4ba44e8a810f8f6779c5e5bb3ef
If the 'cdrom=' option is specified in the definition file but media is 
not found in the CD drive then main() in vl.c exits and the guest appears 
to hang.  This patch modifies vl.c slightly to check for the presents of 
media.  If the cdrom cannot be opened then the cd entry is removed from 
hd_filename[] and bs_table[] allowing the guest to continue initializing. 
If the guest requires the CD media then the guest should report, gracefully
or otherwise, that it's missing.

From: Ross Maxfield <rmaxfiel@xxxxxxxxxx>

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r b454a09cddb1 -r 4088dd0856a9 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Mon Apr 10 16:02:49 2006
+++ b/tools/ioemu/vl.c  Mon Apr 10 16:16:25 2006
@@ -3245,8 +3245,17 @@
     /* we always create the cdrom drive, even if no disk is there */
     if (has_cdrom) {
-        bs_table[2] = bdrv_new("cdrom");
-        bdrv_set_type_hint(bs_table[2], BDRV_TYPE_CDROM);
+        int fd;
+        if ( (fd = open(hd_filename[2], O_RDONLY | O_BINARY)) < 0) {
+                hd_filename[2]=NULL;
+                bs_table[2]=NULL;
+                fprintf(logfile, "Could not open CD %s.\n", hd_filename[i]);
+        }
+        else {
+                close(fd);
+                bs_table[2] = bdrv_new("cdrom");
+                bdrv_set_type_hint(bs_table[2], BDRV_TYPE_CDROM);
+        }
     /* open the virtual block devices */

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>