* [PATCH] Missing CDROM media
@ 2006-04-10 15:57 Ross Maxfield
2006-04-10 18:27 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Ross Maxfield @ 2006-04-10 15:57 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
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.
I would like to see this patch applied to 3.0.2-testing as well.
Thanks,
Ross
[-- Attachment #2: missing_media.patch --]
[-- Type: application/octet-stream, Size: 884 bytes --]
diff -r 4ed269ac7d84 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Mon Apr 10 13:24:58 2006 +0100
+++ b/tools/ioemu/vl.c Mon Apr 10 09:49:36 2006 -0600
@@ -3245,8 +3245,17 @@ int main(int argc, char **argv)
/* we always create the cdrom drive, even if no disk is there */
bdrv_init();
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 */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Missing CDROM media
2006-04-10 15:57 [PATCH] Missing CDROM media Ross Maxfield
@ 2006-04-10 18:27 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2006-04-10 18:27 UTC (permalink / raw)
To: Ross Maxfield; +Cc: xen-devel
Ross Maxfield wrote:
> 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.
>
This is desired behavior.
The cdrom is always attached to the guest. The cdrom option doesn't
necessary attach a cdrom but rather attaches the media to the already
existing cdrom. If you wish to later change the media, use the "change"
option in the monitor.
Moving away from QEmu semantics is only going to make merging later more
difficult. You could perhaps add a check to Xend that remove the cdrom
option if media wasn't present. Then can expose the user interface we
want without moving further away from QEmu.
Regards,
Anthony Liguori
> I would like to see this patch applied to 3.0.2-testing as well.
>
> Thanks,
> Ross
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-10 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10 15:57 [PATCH] Missing CDROM media Ross Maxfield
2006-04-10 18:27 ` Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.