qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Does "-object" support structured options now?
@ 2024-03-04  6:43 Chun Feng Wu
  2024-03-04  8:06 ` Daniel P. Berrangé
  0 siblings, 1 reply; 7+ messages in thread
From: Chun Feng Wu @ 2024-03-04  6:43 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

Hi,

I noticed that throttle-group can be created with “-object”, however, per qemu doc(https://github.com/qemu/qemu/blob/master/docs/throttle.txt), “-object” doesn’t support structured options at that moment:

“
A throttle-group can also be created with the -object command line
option but at the moment there is no way to pass a 'limits' parameter
that contains a ThrottleLimits structure. The solution is to set the
individual values directly, like in this example:

   -object throttle-group,id=group0,x-iops-total=1000,x-bps-write=2097152

Note however that this is not a stable API (hence the 'x-' prefixes) and
will disappear when -object gains support for structured options and
enables use of 'limits'.
“

Does anybody know if the latest qemu code still lacks of such support(structured options for -object)? If so, is there any plan to support it(instead of non-stable API)?


--
Thanks and Regards,

Wu



[-- Attachment #2: Type: text/html, Size: 4965 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Does "-object" support structured options now?
  2024-03-04  6:43 Does "-object" support structured options now? Chun Feng Wu
@ 2024-03-04  8:06 ` Daniel P. Berrangé
  2024-03-06 14:33   ` Chun Feng Wu
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2024-03-04  8:06 UTC (permalink / raw)
  To: Chun Feng Wu; +Cc: qemu-devel@nongnu.org

On Mon, Mar 04, 2024 at 06:43:19AM +0000, Chun Feng Wu wrote:
> Hi,
> 
> I noticed that throttle-group can be created with “-object”, however, per qemu doc(https://github.com/qemu/qemu/blob/master/docs/throttle.txt), “-object” doesn’t support structured options at that moment:
> 
> “
> A throttle-group can also be created with the -object command line
> option but at the moment there is no way to pass a 'limits' parameter
> that contains a ThrottleLimits structure. The solution is to set the
> individual values directly, like in this example:
> 
>    -object throttle-group,id=group0,x-iops-total=1000,x-bps-write=2097152
> 
> Note however that this is not a stable API (hence the 'x-' prefixes) and
> will disappear when -object gains support for structured options and
> enables use of 'limits'.
> “
> 
> Does anybody know if the latest qemu code still lacks of such
> support(structured options for -object)? If so, is there any
> plan to support it(instead of non-stable API)?

-object supports JSON syntax these days so any QAPI structure can be
expressed no matter how complex.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Does "-object" support structured options now?
  2024-03-04  8:06 ` Daniel P. Berrangé
@ 2024-03-06 14:33   ` Chun Feng Wu
  2024-03-06 14:36     ` Daniel P. Berrangé
  2024-03-06 14:40     ` Markus Armbruster
  0 siblings, 2 replies; 7+ messages in thread
From: Chun Feng Wu @ 2024-03-06 14:33 UTC (permalink / raw)
  To: Daniel Berrange; +Cc: qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]

Thanks Daniel for your response!

I tried it with the following cmd

qemu-system-x86_64 [other options...] \
  -object '{"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}'

And I got error:
qemu-system-x86_64: -object {"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}: Parameter 'id' is missing

Do you know why such error happens?


--
Thanks and Regards,

Wu


From: Daniel P. Berrangé <berrange@redhat.com>
Date: Monday, March 4, 2024 at 16:06
To: Chun Feng Wu <wucf@cn.ibm.com>
Cc: qemu-devel@nongnu.org <qemu-devel@nongnu.org>
Subject: [EXTERNAL] Re: Does "-object" support structured options now?
On Mon, Mar 04, 2024 at 06:43:19AM +0000, Chun Feng Wu wrote:
> Hi,
>
> I noticed that throttle-group can be created with “-object”, however, per qemu doc(https://github.com/qemu/qemu/blob/master/docs/throttle.txt ), “-object” doesn’t support structured options at that moment:
>
> “
> A throttle-group can also be created with the -object command line
> option but at the moment there is no way to pass a 'limits' parameter
> that contains a ThrottleLimits structure. The solution is to set the
> individual values directly, like in this example:
>
>    -object throttle-group,id=group0,x-iops-total=1000,x-bps-write=2097152
>
> Note however that this is not a stable API (hence the 'x-' prefixes) and
> will disappear when -object gains support for structured options and
> enables use of 'limits'.
> “
>
> Does anybody know if the latest qemu code still lacks of such
> support(structured options for -object)? If so, is there any
> plan to support it(instead of non-stable API)?

-object supports JSON syntax these days so any QAPI structure can be
expressed no matter how complex.


With regards,
Daniel
--
|: https://berrange.com       -o-    https://www.flickr.com/photos/dberrange  :|
|: https://libvirt.org          -o-            https://fstop138.berrange.com  :|
|: https://entangle-photo.org     -o-    https://www.instagram.com/dberrange  :|

[-- Attachment #2: Type: text/html, Size: 6182 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Does "-object" support structured options now?
  2024-03-06 14:33   ` Chun Feng Wu
@ 2024-03-06 14:36     ` Daniel P. Berrangé
  2024-03-06 14:42       ` Daniel P. Berrangé
  2024-03-06 14:40     ` Markus Armbruster
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2024-03-06 14:36 UTC (permalink / raw)
  To: Chun Feng Wu; +Cc: qemu-devel@nongnu.org

On Wed, Mar 06, 2024 at 02:33:05PM +0000, Chun Feng Wu wrote:
> Thanks Daniel for your response!
> 
> I tried it with the following cmd
> 
> qemu-system-x86_64 [other options...] \
>   -object '{"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}'
> 
> And I got error:
> qemu-system-x86_64: -object {"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}: Parameter 'id' is missing
> 
> Do you know why such error happens?

You have made a mistake somewhere in invoking it ?

The first command line you show above works fine when i test it myself.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Does "-object" support structured options now?
  2024-03-06 14:33   ` Chun Feng Wu
  2024-03-06 14:36     ` Daniel P. Berrangé
@ 2024-03-06 14:40     ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2024-03-06 14:40 UTC (permalink / raw)
  To: Chun Feng Wu; +Cc: Daniel Berrange, qemu-devel@nongnu.org

Chun Feng Wu <wucf@cn.ibm.com> writes:

> Thanks Daniel for your response!
>
> I tried it with the following cmd
>
> qemu-system-x86_64 [other options...] \
>   -object '{"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}'
>
> And I got error:
> qemu-system-x86_64: -object {"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}: Parameter 'id' is missing
>
> Do you know why such error happens?

Can't reproduce the error.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Does "-object" support structured options now?
  2024-03-06 14:36     ` Daniel P. Berrangé
@ 2024-03-06 14:42       ` Daniel P. Berrangé
  2024-03-06 23:45         ` Chun Feng Wu
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2024-03-06 14:42 UTC (permalink / raw)
  To: Chun Feng Wu, qemu-devel@nongnu.org

On Wed, Mar 06, 2024 at 02:36:08PM +0000, Daniel P. Berrangé wrote:
> On Wed, Mar 06, 2024 at 02:33:05PM +0000, Chun Feng Wu wrote:
> > Thanks Daniel for your response!
> > 
> > I tried it with the following cmd
> > 
> > qemu-system-x86_64 [other options...] \
> >   -object '{"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}'
> > 
> > And I got error:
> > qemu-system-x86_64: -object {"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}: Parameter 'id' is missing
> > 
> > Do you know why such error happens?
> 
> You have made a mistake somewhere in invoking it ?

Or perhaps you are using a much older QEMU release which lacks JSON
support ?  You need QEMU >= 6.0.0

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Does "-object" support structured options now?
  2024-03-06 14:42       ` Daniel P. Berrangé
@ 2024-03-06 23:45         ` Chun Feng Wu
  0 siblings, 0 replies; 7+ messages in thread
From: Chun Feng Wu @ 2024-03-06 23:45 UTC (permalink / raw)
  To: Daniel Berrange, qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]

Yes, you’re right, QEMU >=6.0.0 works well, I failed test because I did it on QEMU 4.2.1

From: Daniel P. Berrangé <berrange@redhat.com>
Date: Wednesday, March 6, 2024 at 22:43
To: Chun Feng Wu <wucf@cn.ibm.com>, qemu-devel@nongnu.org <qemu-devel@nongnu.org>
Subject: [EXTERNAL] Re: Does "-object" support structured options now?
On Wed, Mar 06, 2024 at 02:36:08PM +0000, Daniel P. Berrangé wrote:
> On Wed, Mar 06, 2024 at 02:33:05PM +0000, Chun Feng Wu wrote:
> > Thanks Daniel for your response!
> >
> > I tried it with the following cmd
> >
> > qemu-system-x86_64 [other options...] \
> >   -object '{"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}'
> >
> > And I got error:
> > qemu-system-x86_64: -object {"qom-type":"throttle-group","id":"limits0","limits":{"iops-total":200}}: Parameter 'id' is missing
> >
> > Do you know why such error happens?
>
> You have made a mistake somewhere in invoking it ?

Or perhaps you are using a much older QEMU release which lacks JSON
support ?  You need QEMU >= 6.0.0

With regards,
Daniel
--
|: https://berrange.com       -o-    https://www.flickr.com/photos/dberrange  :|
|: https://libvirt.org          -o-            https://fstop138.berrange.com  :|
|: https://entangle-photo.org     -o-    https://www.instagram.com/dberrange  :|

[-- Attachment #2: Type: text/html, Size: 4183 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-06 23:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04  6:43 Does "-object" support structured options now? Chun Feng Wu
2024-03-04  8:06 ` Daniel P. Berrangé
2024-03-06 14:33   ` Chun Feng Wu
2024-03-06 14:36     ` Daniel P. Berrangé
2024-03-06 14:42       ` Daniel P. Berrangé
2024-03-06 23:45         ` Chun Feng Wu
2024-03-06 14:40     ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).