Skip to contentSkip to conversation

Fix the documentation for vfio-user and multi-process QEMU

PATCH In review Jagannathan Raman 3 participants 7 messages May 17, 2023 – May 25, 2023

lore
Share & tools
lore
#4 lore raw

PATCH 2/2 docs: fix multi-process QEMU documentation

In reply to Jagannathan Raman

Fix a typo in the system documentation for multi-process QEMU.

---
 docs/system/multi-process.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/system/multi-process.rst +1 -1
index 16f0352416..2008a67809 100644
@@ -4,7 +4,7 @@ Multi-process QEMU
 ==================
 
 This document describes how to configure and use multi-process qemu.
-For the design document refer to docs/devel/qemu-multiprocess.
+For the design document refer to docs/devel/multi-process.rst.
 
 1) Configuration
 ----------------
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 vfio-user: update comments

In reply to Jagannathan Raman

Clarify the behavior of TYPE_VFU_OBJECT when TYPE_REMOTE_MACHINE enables the auto-shutdown property. Also, add notes to VFU_OBJECT_ERROR.

---
 hw/remote/vfio-user-obj.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
hw/remote/vfio-user-obj.c +11 -3
index 88ffafc73e..8b10c32a3c 100644
@@ -30,6 +30,11 @@
  *
  * notes - x-vfio-user-server could block IO and monitor during the
  *         initialization phase.
+ *
+ *         When x-remote machine has the auto-shutdown property
+ *         enabled (default), x-vfio-user-server terminates after the last
+ *         client disconnects. Otherwise, it will continue running until
+ *         explicitly killed.
  */
 
 #include "qemu/osdep.h"
@@ -61,9 +66,12 @@
 OBJECT_DECLARE_TYPE(VfuObject, VfuObjectClass, VFU_OBJECT)
 
 /**
- * VFU_OBJECT_ERROR - reports an error message. If auto_shutdown
- * is set, it aborts the machine on error. Otherwise, it logs an
- * error message without aborting.
+ * VFU_OBJECT_ERROR - reports an error message.
+ *
+ * If auto_shutdown is set, it aborts the machine on error. Otherwise,
+ * it logs an error message without aborting. auto_shutdown is disabled
+ * when the server serves clients from multiple VMs; as such, an error
+ * from one VM shouldn't be able to disrupt other VM's services.
  */
 #define VFU_OBJECT_ERROR(o, fmt, ...)                                     \
     {                                                                     \
Signature · 1 line
2.20.1
#0 lore raw

cover Fix the documentation for vfio-user and multi-process QEMU

This series addresses recent comments from Markus Armbruster in the "Machine x-remote property auto-shutdown" email thread.

Jagannathan Raman (2):
vfio-user: update comments
docs: fix multi-process QEMU documentation

 docs/system/multi-process.rst |  2 +-
 hw/remote/vfio-user-obj.c     | 14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH v1 1/2] vfio-user: update comments

In reply to Jagannathan Raman
Quoted 30 lines · Jagannathan Raman

Clarify the behavior of TYPE_VFU_OBJECT when TYPE_REMOTE_MACHINE enables the auto-shutdown property. Also, add notes to VFU_OBJECT_ERROR.

---
 hw/remote/vfio-user-obj.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
hw/remote/vfio-user-obj.c +5 -2
index 88ffafc73e..8b10c32a3c 100644
@@ -30,6 +30,11 @@
  *
  * notes - x-vfio-user-server could block IO and monitor during the
  *         initialization phase.
+ *
+ *         When x-remote machine has the auto-shutdown property
+ *         enabled (default), x-vfio-user-server terminates after the last
+ *         client disconnects. Otherwise, it will continue running until
+ *         explicitly killed.
  */
 
 #include "qemu/osdep.h"
@@ -61,9 +66,12 @@
 OBJECT_DECLARE_TYPE(VfuObject, VfuObjectClass, VFU_OBJECT)
 
 /**
- * VFU_OBJECT_ERROR - reports an error message. If auto_shutdown
- * is set, it aborts the machine on error. Otherwise, it logs an

hw/remote/vfio-user-obj.c line 77

Quoted 10 lines
hw/remote/vfio-user-obj.c +6 -1
- * error message without aborting.
+ * VFU_OBJECT_ERROR - reports an error message.
+ *
+ * If auto_shutdown is set, it aborts the machine on error. Otherwise,
+ * it logs an error message without aborting. auto_shutdown is disabled
+ * when the server serves clients from multiple VMs; as such, an error
+ * from one VM shouldn't be able to disrupt other VM's services.
  */
 #define VFU_OBJECT_ERROR(o, fmt, ...)                                     \
     {                                                                     \

I still very much doubt an error can be severe enough to justify abort() in one configuration, yet harmless enough to permit carrying on in another configuration. But this patch merely documents what the code does, so

Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH v1 2/2] docs: fix multi-process QEMU documentation

In reply to Jagannathan Raman
Quoted 12 lines · Jagannathan Raman

Fix a typo in the system documentation for multi-process QEMU.

---
 docs/system/multi-process.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/system/multi-process.rst +0 -0
index 16f0352416..2008a67809 100644

docs/system/multi-process.rst Multi-process QEMU · line 10

Quoted 8 lines
docs/system/multi-process.rst +1 -1
@@ -4,7 +4,7 @@ Multi-process QEMU
 ==================
 
 This document describes how to configure and use multi-process qemu.
-For the design document refer to docs/devel/qemu-multiprocess.
+For the design document refer to docs/devel/multi-process.rst.
 
 1) Configuration
 ----------------
#3 lore raw

Re: [PATCH v1 1/2] vfio-user: update comments

In reply to Markus Armbruster
Quoted 39 lines · Markus Armbruster
Quoted 37 lines · Jagannathan Raman

Clarify the behavior of TYPE_VFU_OBJECT when TYPE_REMOTE_MACHINE enables the auto-shutdown property. Also, add notes to VFU_OBJECT_ERROR.

---
 hw/remote/vfio-user-obj.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
hw/remote/vfio-user-obj.c +11 -3
index 88ffafc73e..8b10c32a3c 100644
@@ -30,6 +30,11 @@
  *
  * notes - x-vfio-user-server could block IO and monitor during the
  *         initialization phase.
+ *
+ *         When x-remote machine has the auto-shutdown property
+ *         enabled (default), x-vfio-user-server terminates after the last
+ *         client disconnects. Otherwise, it will continue running until
+ *         explicitly killed.
  */
 
 #include "qemu/osdep.h"
@@ -61,9 +66,12 @@
 OBJECT_DECLARE_TYPE(VfuObject, VfuObjectClass, VFU_OBJECT)
 
 /**
- * VFU_OBJECT_ERROR - reports an error message. If auto_shutdown
- * is set, it aborts the machine on error. Otherwise, it logs an
- * error message without aborting.
+ * VFU_OBJECT_ERROR - reports an error message.
+ *
+ * If auto_shutdown is set, it aborts the machine on error. Otherwise,
+ * it logs an error message without aborting. auto_shutdown is disabled
+ * when the server serves clients from multiple VMs; as such, an error
+ * from one VM shouldn't be able to disrupt other VM's services.
Quoted 8 lines

hw/remote/vfio-user-obj.c line 77

Quoted 3 lines
hw/remote/vfio-user-obj.c +0 -0
  */
 #define VFU_OBJECT_ERROR(o, fmt, ...)                                     \
     {                                                                     \

I still very much doubt an error can be severe enough to justify abort() in one configuration, yet harmless enough to permit carrying on in another configuration. But this patch merely documents what the code does, so

In both cases this vfio-user device is broken after the error occurs. The difference in behavior is that in a multi-device server the other devices should not be disrupted when one of them breaks.

Stefan

Reviewed-by on the v1 series
#6 lore raw
In reply to Jagannathan Raman
Quoted 14 lines · Jagannathan Raman

This series addresses recent comments from Markus Armbruster in the "Machine x-remote property auto-shutdown" email thread.

Jagannathan Raman (2):
vfio-user: update comments
docs: fix multi-process QEMU documentation

 docs/system/multi-process.rst |  2 +-
 hw/remote/vfio-user-obj.c     | 14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1