Skip to contentSkip to conversation

qga/qapi-schema: Deemphasize numeric @whence in guest-file-seek

PATCH In review Markus Armbruster 2 participants 2 messages Sep 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qga/qapi-schema: Deemphasize numeric @whence in guest-file-seek

guest-file-seek accepts both symbolic and numeric @whence values, but the former is documented as "preferred interface". Remove or replace mentions of numeric values by symbolic ones.

---
 qga/qapi-schema.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
qga/qapi-schema.json +4 -4
index 040c932310..576ce7fea8 100644
@@ -342,11 +342,11 @@
 #
 # Symbolic names for use in `guest-file-seek`
 #
-# @set: Set to the specified offset (same effect as 'whence':0)
+# @set: Set to the specified offset
 #
-# @cur: Add offset to the current location (same effect as 'whence':1)
+# @cur: Add offset to the current location
 #
-# @end: Add offset to the end of the file (same effect as 'whence':2)
+# @end: Add offset to the end of the file
 #
 # Since: 2.6
 ##
@@ -373,7 +373,7 @@
 #
 # Seek to a position in the file, as with fseek(), and return the
 # current file position afterward.  Also encapsulates ftell()'s
-# functionality, with offset=0 and whence=1.
+# functionality, with offset=0 and whence="cur".
 #
 # @handle: filehandle returned by `guest-file-open`
 #
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Markus Armbruster

guest-file-seek accepts both symbolic and numeric @whence values, but the former is documented as "preferred interface". Remove or replace mentions of numeric values by symbolic ones.

Sure. The equivalences are still documented in GuestFileWhence, so this seems fine. If the symbolic names are preferred, it seems fine that looking up the symbol doesn't give you a crappier, non-preferred way to specify it. By contrast, if you look up the numbers, it should tell you what the equivalent preferred enum is.

(make "upgrading" easy, make "downgrading" hard.)

yadda yadda

Quoted 35 lines
---
 qga/qapi-schema.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
qga/qapi-schema.json +4 -5
index 040c932310..576ce7fea8 100644
@@ -342,11 +342,11 @@
 #
 # Symbolic names for use in `guest-file-seek`
 #
-# @set: Set to the specified offset (same effect as 'whence':0)
+# @set: Set to the specified offset
 #
-# @cur: Add offset to the current location (same effect as 'whence':1)
+# @cur: Add offset to the current location
 #
-# @end: Add offset to the end of the file (same effect as 'whence':2)
+# @end: Add offset to the end of the file
 #
 # Since: 2.6
 ##
@@ -373,7 +373,7 @@
 #
 # Seek to a position in the file, as with fseek(), and return the
 # current file position afterward.  Also encapsulates ftell()'s
-# functionality, with offset=0 and whence=1.
+# functionality, with offset=0 and whence="cur".
 #
 # @handle: filehandle returned by `guest-file-open`
 #
--

2.55.0