From patchwork Mon Jul 16 14:24:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 171208 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 3B57D2C00D9 for ; Tue, 17 Jul 2012 00:25:09 +1000 (EST) Received: from localhost ([::1]:60246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqmEV-0003mc-6w for incoming@patchwork.ozlabs.org; Mon, 16 Jul 2012 10:25:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqmEF-0003bF-26 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 10:24:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqmE9-00039D-Qb for qemu-devel@nongnu.org; Mon, 16 Jul 2012 10:24:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqmE9-00038x-I7 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 10:24:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6GEOiEm022395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Jul 2012 10:24:44 -0400 Received: from yakj.usersys.redhat.com (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6GEOeDc019435; Mon, 16 Jul 2012 10:24:42 -0400 From: Paolo Bonzini To: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au Date: Mon, 16 Jul 2012 16:24:36 +0200 Message-Id: <1342448677-7453-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1342448677-7453-1-git-send-email-pbonzini@redhat.com> References: <1342448677-7453-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 1/2] virtio-scsi spec: unify event structs 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 All currently defined event structs have the same fields. Simplify the driver by enforcing this also for future structs. Signed-off-by: Paolo Bonzini --- virtio-spec.lyx | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index 905e619..f8b214b 100644 --- a/virtio-spec.lyx +++ b/virtio-spec.lyx @@ -8207,7 +8207,20 @@ struct virtio_scsi_event { \begin_layout Plain Layout +\change_deleted 1531152142 1342440791 + ... +\change_inserted 1531152142 1342440791 +u8 lun[8]; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1342440791 + + u32 reason; +\change_unchanged + \end_layout \begin_layout Plain Layout @@ -8221,16 +8234,32 @@ struct virtio_scsi_event { \end_layout \begin_layout Standard -If bit 31 is set in the event field, the device failed to report an event - due to missing buffers. +If bit 31 is set in the +\series bold +event +\series default + field, the device failed to report an event due to missing buffers. In this case, the driver should poll the logical units for unit attention conditions, and/or do whatever form of bus scan is appropriate for the guest operating system. \end_layout \begin_layout Standard -Other data that the device writes to the buffer depends on the contents - of the event field. + +\change_deleted 1531152142 1342440830 +Other data that the device writes to the buffer +\change_inserted 1531152142 1342440839 +The meaning of the +\series bold +reason +\series default + field +\change_unchanged + depends on the contents of the +\series bold +event +\series default + field. The following events are defined: \end_layout @@ -8312,36 +8341,50 @@ status open \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + struct virtio_scsi_event_reset { \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + // Write-only part \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + u32 event; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + u8 lun[8]; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + u32 reason; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + } \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440799 + \end_layout \begin_layout Plain Layout @@ -8542,40 +8585,58 @@ status open \begin_layout Plain Layout #define VIRTIO_SCSI_T_ASYNC_NOTIFY 2 +\change_deleted 1531152142 1342440854 + \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + struct virtio_scsi_event_an { \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + // Write-only part \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + u32 event; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + u8 lun[8]; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + u32 reason; \end_layout \begin_layout Plain Layout +\change_deleted 1531152142 1342440854 + } +\change_unchanged + \end_layout \end_inset