Skip to contentSkip to conversation

qemu-options.hx: Replace deprecated -M example

PATCH In review [email protected] 3 participants 4 messages Dec 2, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-options.hx: Replace deprecated -M example

From: "Dr. David Alan Gilbert" <[email protected]>

The -M option was deprecated by -machine in 2011 by 80f52a669 and isn't actually documented in the manpage, but is still used in one of the examples. Replace it by -machine.
-M still gets used all over the place in other docs, and I'm not sure I realised it was deprecated until Julian pointed out it wasn't actually documented.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index fca2b7bc74..9cd0b7173c 100644
@@ -481,7 +481,7 @@ SRST
 
     ::
 
-        -M pc \
+        -machine pc \
         -smp 1,sockets=2,maxcpus=2 \
         -numa node,nodeid=0 -numa node,nodeid=1 \
         -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
Signature · 1 line
2.52.0
#1 lore raw
Quoted 8 lines · On 02/12/2025 01.57, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

The -M option was deprecated by -machine in 2011 by 80f52a669 and isn't actually documented in the manpage, but is still used in one of the examples. Replace it by -machine.
-M still gets used all over the place in other docs, and I'm not sure I realised it was deprecated until Julian pointed out it wasn't actually documented.

-M is not mentioned in docs/about/deprecated.rst, so no, it's not officially deprecated. And I think it's a nice short hand feature for an option that is used very often, so I also don't think that we should ever remove it. Thus I think it would be better to simply add it back to qemu-options.hx instead.

Thomas

#2 lore raw
Quoted 10 lines · Thomas Huth
Quoted 8 lines · On 02/12/2025 01.57, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

The -M option was deprecated by -machine in 2011 by 80f52a669 and isn't actually documented in the manpage, but is still used in one of the examples.  Replace it by -machine.
-M still gets used all over the place in other docs, and I'm not sure I realised it was deprecated until Julian pointed out it wasn't actually documented.

Quoted 2 lines

-M is not mentioned in docs/about/deprecated.rst, so no, it's not
officially deprecated. And I think it's a nice short hand feature for an option that is used very often, so I also don't think that we should ever remove it. Thus I think it would be better to simply add it back to qemu-options.hx instead.

Yes, its status as a synonym of -machine started only in 2015, in a commit that didn't even mention that effect:

commit 364c3e6b8dd7912e01d19122d791b8c8f6df4f6c
Author: Marcel Apfelbaum <[email protected]>
Date: Wed Jan 7 14:11:38 2015 +0200

vl.c: fix regression when reading machine type from config file

After 'Machine as QOM' series the machine type input triggers the creation of the machine class.
If the machine type is set in the configuration file, the machine class is not updated accordingly and remains the default.

Fixed that by querying the machine options after the configuration file is loaded.

(I wonder who's the guy that committed it). But it was a good idea, and there's no need to change this.

Paolo

#3 lore raw
In reply to Thomas Huth
Quoted 10 lines · * Thomas Huth ([email protected]) wrote:
Quoted 8 lines · On 02/12/2025 01.57, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

The -M option was deprecated by -machine in 2011 by 80f52a669 and isn't actually documented in the manpage, but is still used in one of the examples. Replace it by -machine.
-M still gets used all over the place in other docs, and I'm not sure I realised it was deprecated until Julian pointed out it wasn't actually documented.

Quoted 4 lines

-M is not mentioned in docs/about/deprecated.rst, so no, it's not officially deprecated. And I think it's a nice short hand feature for an option that is used very often, so I also don't think that we should ever remove it. Thus I think it would be better to simply add it back to qemu-options.hx instead.

Fair enough; I wasn't too sure which way this would go - I'm pretty sure I'd always used -M, but there again I saw libvirt used -machine now, and I'd frequently confused -m and -M so it did make some sense to move away from it.

I'll cut another patch adding -M back.

Dave

Quoted 2 lines

Thomas

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/