From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvhpE-00053v-B5 for qemu-devel@nongnu.org; Mon, 30 Jul 2012 00:43:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvhpD-00021i-AO for qemu-devel@nongnu.org; Mon, 30 Jul 2012 00:43:24 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:46188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvhpD-00021e-4D for qemu-devel@nongnu.org; Mon, 30 Jul 2012 00:43:23 -0400 Received: by pbbro12 with SMTP id ro12so8769336pbb.4 for ; Sun, 29 Jul 2012 21:43:22 -0700 (PDT) From: Ronnie Sahlberg Date: Mon, 30 Jul 2012 14:43:12 +1000 Message-Id: <1343623393-3582-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] [PATCH] SCSI allow removable SBC disks 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 small patch that adds a new "drive" keyword "removable". When used together with SCSI DISK devices, this makes the emulation support removable scsi disk. Example: -drive file=./scsi-disk.img,if=scsi,removable Emulation of SCSI DISK with removable media currently pass all my tests for SCSI removable media and behaviour of STARTSTOPUNIT/ALLOWPREVENTMEDIUMREMOVAL commands : 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] iscsi-test --dataloss --test="*nomedia*" iscsi://127.0.0.1:32601/iqn.qemu.scsi-test/3 0370_nomedia: ============ Try to eject the media ... [OK] Test TESTUNITREADY ... [OK] Test SYNCHRONIZECACHE10 ... [OK] Test SYNCHRONIZECACHE16 ... [OK] Test READ10 ... [OK] Test READ12 ... [OK] Test READ16 ... [OK] Test READCAPACITY10 ... [OK] Test READCAPACITY16 ... [OK] Test GETLBASTATUS ... [OK] Test PREFETCH10 ... [OK] Test PREFETCH16 ... [OK] Test VERIFY10 ... [OK] Test VERIFY12 ... [OK] Test VERIFY16 ... [OK] Test WRITE10 ... [OK] Test WRITE12 ... [OK] Test WRITE16 ... [OK] Test WRITEVERIFY10 ... [OK] Test WRITEVERIFY12 ... [OK] Test WRITEVERIFY16 ... [OK] Test ORWRITE ... [OK] Test COMPAREWRITE ... [OK] Test WRITESAME10 ... [OK] Test WRITESAME16 ... [OK] Test UNMAP ... [OK] Try to mount the media again ... [OK] TEST T0370_nomedia [OK]