From patchwork Fri May 22 19:59:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 475763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1591D140E33 for ; Sat, 23 May 2015 06:00:43 +1000 (AEST) Received: from localhost ([::1]:35673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yvt7Z-0006YU-Aa for incoming@patchwork.ozlabs.org; Fri, 22 May 2015 16:00:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yvt6w-0005HC-C1 for qemu-devel@nongnu.org; Fri, 22 May 2015 16:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yvt6v-0004gy-4r for qemu-devel@nongnu.org; Fri, 22 May 2015 16:00:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yvt6u-0004gM-Uc for qemu-devel@nongnu.org; Fri, 22 May 2015 16:00:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4MJxwEa026952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 22 May 2015 15:59:58 -0400 Received: from scv.usersys.redhat.com (dhcp-17-29.bos.redhat.com [10.18.17.29]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4MJxtpp017384; Fri, 22 May 2015 15:59:57 -0400 From: John Snow To: qemu-devel@nongnu.org Date: Fri, 22 May 2015 15:59:37 -0400 Message-Id: <1432324792-9373-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1432324792-9373-1-git-send-email-jsnow@redhat.com> References: <1432324792-9373-1-git-send-email-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, jsnow@redhat.com Subject: [Qemu-devel] [PULL 04/19] libqos/ahci: Fix sector set method 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 || probably does not mean the same thing as |. Additionally, allow users to submit a prd_size of 0 to indicate that they'd like to continue using the default. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 1430417242-11859-3-git-send-email-jsnow@redhat.com --- tests/libqos/ahci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 229409b..8c8fd89 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -769,7 +769,7 @@ void ahci_command_set_offset(AHCICommand *cmd, uint64_t lba_sect) fis->lba_lo[1] = (lba_sect >> 8) & 0xFF; fis->lba_lo[2] = (lba_sect >> 16) & 0xFF; if (cmd->props->lba28) { - fis->device = (fis->device & 0xF0) || (lba_sect >> 24) & 0x0F; + fis->device = (fis->device & 0xF0) | ((lba_sect >> 24) & 0x0F); } fis->lba_hi[0] = (lba_sect >> 24) & 0xFF; fis->lba_hi[1] = (lba_sect >> 32) & 0xFF; @@ -787,7 +787,9 @@ void ahci_command_set_sizes(AHCICommand *cmd, uint64_t xbytes, /* Each PRD can describe up to 4MiB, and must not be odd. */ g_assert_cmphex(prd_size, <=, 4096 * 1024); g_assert_cmphex(prd_size & 0x01, ==, 0x00); - cmd->prd_size = prd_size; + if (prd_size) { + cmd->prd_size = prd_size; + } cmd->xbytes = xbytes; cmd->fis.count = (cmd->xbytes / AHCI_SECTOR_SIZE); cmd->header.prdtl = size_to_prdtl(cmd->xbytes, cmd->prd_size);