Skip to contentSkip to conversation

virtio-blk: document that the capacity field can change

PATCH In review Stefan Hajnoczi 2 participants 5 messages Mar 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-blk: document that the capacity field can change

Block devices can change size during operation. A configuration change notification is sent by the device and the driver detects that the field has changed. Document this behavior that has already been implemented in Linux and QEMU since 2011.

---
 content.tex | 7 +++++++
 1 file changed, 7 insertions(+)
content.tex +7 -0
index c6f116c..96d2aa9 100644
@@ -4863,6 +4863,9 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 
 \drivernormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
+The driver SHOULD check if the content of the \field{capacity} field has
+changed upon receiving a configuration change notification.
+
 A driver MUST NOT submit a request which would cause a read or write
 beyond \field{capacity}.
 
@@ -4909,6 +4912,10 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 
 \devicenormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
+The device MAY change the content of the \field{capacity} field during
+operation of the device. When this happens, the device SHOULD trigger a
+configuration change notification.
+
 A device MUST set the \field{status} byte to VIRTIO_BLK_S_IOERR
 for a write request if the VIRTIO_BLK_F_RO feature if offered, and MUST NOT
 write any data.
Signature · 6 lines
2.35.1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Stefan Hajnoczi

Block devices can change size during operation. A configuration change notification is sent by the device and the driver detects that the field has changed. Document this behavior that has already been implemented in Linux and QEMU since 2011.

github issue so we can track this?

Quoted 31 lines
---
 content.tex | 7 +++++++
 1 file changed, 7 insertions(+)
content.tex +7 -0
index c6f116c..96d2aa9 100644
@@ -4863,6 +4863,9 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 
 \drivernormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
+The driver SHOULD check if the content of the \field{capacity} field has
+changed upon receiving a configuration change notification.
+
 A driver MUST NOT submit a request which would cause a read or write
 beyond \field{capacity}.
 
@@ -4909,6 +4912,10 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 
 \devicenormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
+The device MAY change the content of the \field{capacity} field during
+operation of the device. When this happens, the device SHOULD trigger a
+configuration change notification.
+
 A device MUST set the \field{status} byte to VIRTIO_BLK_S_IOERR
 for a write request if the VIRTIO_BLK_F_RO feature if offered, and MUST NOT
 write any data.
Signature · 1 line
2.35.1

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

#2 lore raw
In reply to Stefan Hajnoczi
Quoted 9 lines · Stefan Hajnoczi

Block devices can change size during operation. A configuration change notification is sent by the device and the driver detects that the field has changed. Document this behavior that has already been implemented in Linux and QEMU since 2011.

---
 content.tex | 7 +++++++
 1 file changed, 7 insertions(+)

Requesting a vote.

#3 lore raw
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Stefan Hajnoczi

Block devices can change size during operation. A configuration change notification is sent by the device and the driver detects that the field has changed. Document this behavior that has already been implemented in Linux and QEMU since 2011.

Quoted 8 lines
Quoted 4 lines
---
 content.tex | 7 +++++++
 1 file changed, 7 insertions(+)

Requesting a vote.

We can vote but not for 1.2 unless it's urgent (i.e. a regression), and I think we can wait with this one.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

#4 lore raw
Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Stefan Hajnoczi
Quoted 9 lines · Stefan Hajnoczi

Block devices can change size during operation. A configuration change notification is sent by the device and the driver detects that the field has changed. Document this behavior that has already been implemented in Linux and QEMU since 2011.

---
 content.tex | 7 +++++++
 1 file changed, 7 insertions(+)
Quoted 6 lines
Quoted 3 lines

Requesting a vote.

We can vote but not for 1.2 unless it's urgent (i.e. a regression), and I think we can wait with this one.

I agree, it's not urgent. It can wait for 1.3.

Stefan