From patchwork Thu Apr 19 14:29:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 153835 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 C82A7B6FF8 for ; Fri, 20 Apr 2012 02:21:03 +1000 (EST) Received: from localhost ([::1]:57833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKu6M-0004vC-PW for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2012 12:20:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKsNd-0000U5-H0 for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKsNX-000583-91 for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:41 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:63839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKsNX-0004Mc-0N for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:30:35 -0400 Received: by mail-pb0-f45.google.com with SMTP id uo5so12014088pbc.4 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=LjJdmMNfKvHjadEE3pB5phEfNYQjT1UxQLGUtxAPy/4=; b=G6NSFqcewr6QsXSiDG9xMRj2qZWhFzf1p9cJ1jiHTYxHJUovBNHQfmwJDgzXuOzIh/ V4+Ko4LIJarandAoth80qO3KjlYUf7WZZU37CC/pOnvMvYsb0EUBwsVbPKDYPSZy5O1u /TIdY/D57XNpcyukl64ydkNPtVtf5wDNsQKXOgj5FOGN4Pv5l1RKCYDVazP5y6mvJIlw W532qQNuDGe+lfF0n5ywetvUpCgF9z++CHB+B/MTcBm79I2KQHe0eegBieVxfMmm0bdI Sj8v+bStXODwsgITK1y19gHf7CucTdT5hjCyQDgK7jUBL2fA7TcjY0gTxL/zdwydB0Wq kf4g== Received: by 10.68.231.195 with SMTP id ti3mr4906157pbc.132.1334845833900; Thu, 19 Apr 2012 07:30:33 -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.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 07:30:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 19 Apr 2012 16:29:35 +0200 Message-Id: <1334845776-11664-16-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.160.45 Cc: Ronnie Sahlberg Subject: [Qemu-devel] [PATCH 15/16] SCSI emulation: should tell the guest that we actually support thin provisioning 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 Signed-off-by: Ronnie Sahlberg [Actually, we should report it only if discard_granularity is nonzero. Older SBC drafts assigned 0 to thin provisioning and 1 to thick (resource-provisioned, they call it). Newer drafts assign respectively 1 and 2 - Paolo] Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 85a75c4..a029ab6 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -628,7 +628,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) outbuf[3] = buflen = 8; outbuf[4] = 0; outbuf[5] = 0x60; /* write_same 10/16 supported */ - outbuf[6] = 0; + outbuf[6] = s->qdev.conf.discard_granularity ? 2 : 1; outbuf[7] = 0; break; }