[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GES
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN |
Date: |
Fri, 08 Apr 2011 11:39:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Results of quick test run now, patch review to follow.
Test uses a simple program to try ioctl CDROM_DRIVE_STATUS (attached).
Test run in the host:
[start with tray closed & empty]
$ ./drive-status
CDS_NO_DISC
$ eject /dev/sr0
[tray opens]
$ ./drive-status
CDS_TRAY_OPEN
$ eject -t /dev/sr0
[tray closes]
$ ./drive-status
CDS_NO_DISC
[open tray, insert media, close tray]
$ ./drive-status
CDS_DISC_OK
$ eject /dev/sr0
[tray opens]
$ ./drive-status
CDS_TRAY_OPEN
$ eject -t /dev/sr0
[tray closes]
$ ./drive-status
CDS_DRIVE_NOT_READY
[ok, too impatient]
$ ./drive-status
CDS_DISC_OK
Test in guest without your patches:
[start with empty drive]
# ./drive-status
CDS_NO_DISC
# eject /dev/sr0
# ./drive-status
CDS_NO_DISC
[incorrect, should be CDS_TRAY_OPEN]
# eject -t /dev/sr0
# ./drive-status
CDS_NO_DISC
[insert media with monitor command change]
# ./drive-status
CDS_DISC_OK
# eject /dev/sr0
# ./drive-status
CDS_NO_DISC
[incorrect, should be CDS_TRAY_OPEN]
# eject -t /dev/sr0
# ./drive-status
CDS_DISC_OK
With the patches, it behaves as expected. Except something (guest
kernel?) closes the tray right after eject if there's a medium in the
open tray.
Anaconda is *much* happier with the patches. Before, it could get into
a confused state where it can't find install medium because the tray is
stuck open. Now, it recovers from "can't find" on first retry, by
closing the tray.
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <linux/cdrom.h>
#include <sys/ioctl.h>
char *
cdsstr(int cds)
{
static char *ststr[5] = {
"CDS_NO_INFO",
"CDS_NO_DISC",
"CDS_TRAY_OPEN",
"CDS_DRIVE_NOT_READY",
"CDS_DISC_OK",
};
if ((unsigned)cds >= 5)
return NULL;
return ststr[cds];
}
int
main(void)
{
int fd, cds;
char *s;
fd = open("/dev/sr0", O_RDONLY | O_NONBLOCK);
if (fd < 0)
error(1, errno, "open");
cds = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
if (cds < 0)
error(1, errno, "ioctl");
s = cdsstr(cds);
if (s)
printf("%s\n", s);
else
printf("%d\n", cds);
return 0;
}
- [Qemu-devel] Re: [PATCH 3/5] atapi: GESN: Spin off No Event Available handling into own function, (continued)
[Qemu-devel] [PATCH 4/5] atapi: GESN: Add enums for commonly-used field types, Amit Shah, 2011/04/08
[Qemu-devel] [PATCH 5/5] atapi: Implement 'media' subcommand of GET_EVENT_STATUS_NOTIFICATION command, Amit Shah, 2011/04/08
[Qemu-devel] Re: [PATCH 0/5] atapi: Implement 'media' subcommand for GESN, Paolo Bonzini, 2011/04/08
Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN,
Markus Armbruster <=