From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvbPO-0006kM-Ai for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvbPK-0003fa-09 for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:18 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvbPJ-0003fQ-Nt for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:13 -0400 Received: by pbbro12 with SMTP id ro12so8308161pbb.4 for ; Sun, 29 Jul 2012 14:52:11 -0700 (PDT) From: Ronnie Sahlberg Date: Mon, 30 Jul 2012 07:52:02 +1000 Message-Id: <1343598723-12299-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] [PATCH] SCSI update to the correct sense code for media removal prevention List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, pbonzini@redhat.com List, Paolo Please find a trivial patch that changes the sense code for errors when trying, and failing, to eject media using the START_STOP_UNIT command when the medium is locked down by a previous PREVENT_ALLOW_MEDIUM_REMOVAL command. MMC Annex F lists MEDIUM_REMOVAL_PREVENTED as the recommended sense code for this error. This now passes the test that a SCSI target retports the corre3ct sense code(s) for medium removal protection : iscsi-test --dataloss --test="*prevent*eject*" iscsi://127.0.0.1:32601/iqn.qemu.scsi-test/3 0381_preventallow_eject: ======================== Try to set PREVENTALLOW ... [OK] Try to eject the media ... Eject failed. [OK] Load the media again in case it was ejected ... [OK] Clear the PREVENTALLOW again ... [OK] TEST T0381_preventallow_eject [OK] regards ronnie sahlberg