From patchwork Thu Apr 19 14:29:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 153801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A50ADB7000 for ; Fri, 20 Apr 2012 01:00:17 +1000 (EST) Received: from localhost ([::1]:37475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKsNy-0000sa-C8 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2012 10:31:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKsNe-0000XY-I4 for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKsNX-00058K-SE for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:42 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:49132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKsNX-0004YT-Jd for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:35 -0400 Received: by mail-pz0-f46.google.com with SMTP id z9so13323081dad.33 for ; Thu, 19 Apr 2012 07:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=X7W0Prbwi1skoikukfrfH+GOP1GLMrZrEnTnuqsmbhE=; b=ThXizyfyr8Gqn3WaX9GPlJ9dFLMhM1fhUVZZYvTj2WYXU/M8tb+2UIpd4zGYYPXED+ 9LiHix85eOwpseVu/clQmnE/hGD88hfai78SgVuo5gA3EL9lOrFAnnFEIuZF61VlaBLx lqEnHh7PXaIT/0PRzaTvpbUG/Nd5l9Oqxt94kDYrUucZZFRZTBGBWEPAz9C7g54Lowqa 5cQrThf4xAyuIqRViozdvC8tU8/2DPz42gE5a/vQ7yokOMPXz91THnWd96yZGNcR/spx 8LTlhWppbynP5+pa6mBfCRgmf6DsJodqtdILHuJHTtcW7qD0OtzKv9yBxP+3x5hsejX7 lK4Q== Received: by 10.68.223.33 with SMTP id qr1mr5104075pbc.47.1334845830921; Thu, 19 Apr 2012 07:30:30 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-182-16.ip50.fastwebnet.it. [93.34.182.16]) by mx.google.com with ESMTPS id r6sm2401487pbl.24.2012.04.19.07.30.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 07:30:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 19 Apr 2012 16:29:34 +0200 Message-Id: <1334845776-11664-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.9.3 In-Reply-To: <1334845776-11664-1-git-send-email-pbonzini@redhat.com> References: <1334845776-11664-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.46 Cc: Ronnie Sahlberg Subject: [Qemu-devel] [PATCH 14/16] SCSI emulation: Support unmap via WRITE_SAME_10. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Ronnie Sahlberg This was added in SBC r26 in place of the reserved bits that were present up to that version. It is the same as WRITE_SAME_16 as far as QEMU is concerned. Signed-off-by: Ronnie Sahlberg Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index fca31fa..85a75c4 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -627,7 +627,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) { outbuf[3] = buflen = 8; outbuf[4] = 0; - outbuf[5] = 0x40; /* write same with unmap supported */ + outbuf[5] = 0x60; /* write_same 10/16 supported */ outbuf[6] = 0; outbuf[7] = 0; break; @@ -1558,10 +1558,11 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf) goto illegal_lba; } break; + case WRITE_SAME_10: case WRITE_SAME_16: len = r->req.cmd.xfer / s->qdev.blocksize; - DPRINTF("WRITE SAME(16) (sector %" PRId64 ", count %d)\n", + DPRINTF("WRITE SAME() (sector %" PRId64 ", count %d)\n", r->req.cmd.lba, len); if (r->req.cmd.lba > s->qdev.max_lba) {