|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 11/35] scsi-disk: support READ DVD STRUCTURE |
Date: | Fri, 21 Oct 2011 15:11:40 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
On 10/21/2011 01:42 PM, Kevin Wolf wrote:
> + if (s->qdev.type != TYPE_ROM || !bdrv_is_inserted(s->bs)) { > + return -1; > + } > + if (s->tray_open || !bdrv_is_inserted(s->bs)) { > + scsi_check_condition(r, SENSE_CODE(NO_MEDIUM)); > + return -1; > + }You are checking twice for bdrv_is_inserted, which one do you really mean?
The first is bogus.
Also, format = 0xff should work even without a medium.
Will move the tray_open/bdrv_is_inserted/media_is_cd tests within the "if (format != 0xff)".
> + if (media_is_cd(s)) { > + scsi_check_condition(r, SENSE_CODE(INCOMPATIBLE_FORMAT)); > + return -1; > + } > + if (media != 0) { > + scsi_check_condition(r, SENSE_CODE(INCOMPATIBLE_FORMAT)); > + return -1; > + }
media != 0 should return INVALID_FIELD too. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |