From 4e0739635b32261aea9c05c17081a20be7c00cb6 Mon Sep 17 00:00:00 2001
From: mstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>
Date: Sun, 15 Mar 2015 10:07:13 +0000
Subject: ccw: allow WRITE_STATUS to fail

We want to be able to fail setting a status on the device (e.g.
FEATURES_OK if the device can't work with the features negotiated).
The easiest way to do that is to allow the device to fail the
WRITE_STATUS command by posting a command reject.

VIRTIO-116

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

Approved unanimously:
https://www.oasis-open.org/apps/org/workgroup/virtio/ballot.php?id=2762
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio/branches/v1.0@479 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
---
 content.tex | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'content.tex')

diff --git a/content.tex b/content.tex
index 6a8638b..1efe93a 100644
--- a/content.tex
+++ b/content.tex
@@ -2595,6 +2595,23 @@ The driver changes the status of a device via the
 CCW_CMD_WRITE_STATUS command, which transmits an 8 bit status
 value.
 
+As described in
+\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits},
+a device sometimes fails to set the \field{status} field: For example, it
+might fail to accept the FEATURES_OK status bit during device initialization.
+
+\drivernormative{\paragraph}{Communicating Status Information}{Virtio Transport Options / Virtio over channel I/O / Device Initialization / Communicating Status Information}
+
+If the device posts a unit check with command reject in response to the
+CCW_CMD_WRITE_STATUS command, the driver MUST assume that the device failed
+to set the status and the \field{status} field retained its previous value.
+
+\devicenormative{\paragraph}{Communicating Status Information}{Virtio Transport Options / Virtio over channel I/O / Device Initialization / Communicating Status Information}
+
+If the device fails to set the \field{status} field to the value written by
+the driver, the device MUST assure that the \field{status} field is left
+unchanged and MUST post a unit check with command reject.
+
 \subsubsection{Handling Device Features}\label{sec:Virtio Transport Options / Virtio over channel I/O / Device Initialization / Handling Device Features}
 
 Feature bits are arranged in an array of 32 bit values, making
-- 
cgit v1.2.3

