From patchwork Wed Jun 27 17:24:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 935627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rJi1W0AY"; dkim-atps=neutral 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 41G8tq0K9hz9s29 for ; Thu, 28 Jun 2018 03:25:21 +1000 (AEST) Received: from localhost ([::1]:60619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYEBx-0007qx-JR for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2018 13:25:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYEBT-0007pG-Cx for qemu-devel@nongnu.org; Wed, 27 Jun 2018 13:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYEBS-0005zV-Ds for qemu-devel@nongnu.org; Wed, 27 Jun 2018 13:24:47 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:36927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYEBS-0005yJ-94 for qemu-devel@nongnu.org; Wed, 27 Jun 2018 13:24:46 -0400 Received: by mail-qt0-x242.google.com with SMTP id a18-v6so2344964qtj.4 for ; Wed, 27 Jun 2018 10:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/Bz+PEv8GgLv7xCCHZW6Qvrf5yis/TjFEmubM6wkJ5I=; b=rJi1W0AYHnzsRGzbWsxjE3colOg7IE35WR/8yam3ABEq9k0IOfvtVapmC/ObNPM8+V DA44+RwM96pLwDiUw3FiptsqxoLyhBIV60onurppxEnmwLtPywLSXukpC0ahlpJiQNpt khVaYHq2qrz1oMz2n40JJQwVmv4/9Iyr35Zm7vRyYno7kqSdkWy/1bz/d5WbsRp9Liqq WuP+/BwYUF+/M1P8rH+1oqKCEFkWP5oXpZW3JFyDRr4Crk+N1/DroJ4y2s9g1eiU6CrK +AV22qcv89z+QWn/SeGJlsfkrIJaMYB6ARFrOT/IMxlf/0Gr3JQJuC7YYn1hIzOivKnP 9+Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/Bz+PEv8GgLv7xCCHZW6Qvrf5yis/TjFEmubM6wkJ5I=; b=JwL5RcJe/HpaCU7172J0s9PfhM3eoCOIG3tm5uZYh/LNNRRxIgH6wztdoflrdUcD2k DN78Ti34HviD5134zKvsDmJrBzm/AmhPAqGyS7HqekBqCrbQaY9Yhcp0qMPEVZa7VE8/ 8yJ1faPoqyMBtp3x1Ug9rVGapVX+xAOEAliPE+DQP2Z+YVyxBPR8FXDAP17fINv2qoJS 6wAZj5hPu3GCCf/5iP3zQrvt98m1x3Z6zFrN4681wcFk6P1Y0LMdRyxIG4ip6YY41q2c gI+cMBA/aKrtmQ70zhuqpJWBA/ovWVxIx42DwkoTfY9QCax72T2StRyt95ZJxHYJDLP8 kWwA== X-Gm-Message-State: APt69E11hMjuqG5cJzl9AIK2KL7nXLFR8iWmGbJnOmU/f+N8gsa0CBxU TsHVeSOflYkSsvy3JRArzXiwtVR6qKU= X-Google-Smtp-Source: AAOMgpdAJvDoWgbYB/aKcjhNkjB+a+us87Zx4tawc5raZPeyWm8vLguDHUWSz9w8waBU3kGXpHCBuQ== X-Received: by 2002:aed:2418:: with SMTP id r24-v6mr359769qtc.407.1530120285347; Wed, 27 Jun 2018 10:24:45 -0700 (PDT) Received: from localhost.localdomain ([2804:431:f700:f270:582a:8b7e:e8e1:da38]) by smtp.gmail.com with ESMTPSA id n69-v6sm3136182qke.52.2018.06.27.10.24.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jun 2018 10:24:44 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 14:24:29 -0300 Message-Id: <20180627172432.11120-1-danielhb413@gmail.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v2 0/3] VPD Block Limits emulation implementation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, Daniel Henrique Barboza , famz@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" v2: - series overhauled - first 2 patches are cleanups (split in 2 for easier review), patch 3 contains the whole logic - previous version link: https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg02289.html When using SCSI passthrough and running in Linux, QEMU edits the reply of the SCSI Inquiry VPD Block Limits message with the value of the /sys/bus//queue/max_sectors_kb parameter the device has in the host. Doing so allows the Linux guest to proper setup the device. But the Block Limits message is optional, and its absence can cause the device to be unusable by the guest. An example can be seen at https://bugzilla.redhat.com/show_bug.cgi?id=1566195. This series implements an approach to solve it. Daniel Henrique Barboza (3): hw/scsi: cleanups before VPD BL emulation hw/scsi: centralize SG_IO calls into single function hw/scsi: add VPD Block Limits emulation hw/scsi/scsi-disk.c | 427 +++++++++++++++++++++-------------------- hw/scsi/scsi-generic.c | 246 ++++++++++++++++++------ include/hw/scsi/scsi.h | 6 +- 3 files changed, 401 insertions(+), 278 deletions(-)