All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] detecting seccomp sandbox capability via QMP
@ 2012-12-03 15:55 Ján Tomko
  2012-12-04 11:46 ` Luiz Capitulino
  0 siblings, 1 reply; 11+ messages in thread
From: Ján Tomko @ 2012-12-03 15:55 UTC (permalink / raw)
  To: qemu-devel

Hello,

is there a way to check if QEMU was compiled with --enable-seccomp via QMP?

Jan

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-03 15:55 [Qemu-devel] detecting seccomp sandbox capability via QMP Ján Tomko
@ 2012-12-04 11:46 ` Luiz Capitulino
  2012-12-04 14:42   ` Ján Tomko
  0 siblings, 1 reply; 11+ messages in thread
From: Luiz Capitulino @ 2012-12-04 11:46 UTC (permalink / raw)
  To: Ján Tomko; +Cc: qemu-devel, otubo

On Mon, 03 Dec 2012 16:55:35 +0100
Ján Tomko <jtomko@redhat.com> wrote:

> Hello,
> 
> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?

Not that I'm aware of. Could you describe your use-case?

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 11:46 ` Luiz Capitulino
@ 2012-12-04 14:42   ` Ján Tomko
  2012-12-04 15:17     ` Luiz Capitulino
  2012-12-04 15:23     ` Daniel P. Berrange
  0 siblings, 2 replies; 11+ messages in thread
From: Ján Tomko @ 2012-12-04 14:42 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: qemu-devel, otubo

On 12/04/12 12:46, Luiz Capitulino wrote:
> On Mon, 03 Dec 2012 16:55:35 +0100
> Ján Tomko <jtomko@redhat.com> wrote:
> 
>> Hello,
>>
>> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
> 
> Not that I'm aware of. Could you describe your use-case?

It's for libvirt. The detection is broken since the switch from parsing
-help output to QMP and I wanted to fix it.

Assuming it's supported if we do capabilities detection via QMP (since
libvirt 1.0.0 and QEMU 1.2) would work except for this case:
If seccomp sandbox was requested in /etc/libvirt/qemu.conf, but it was
compiled out from qemu, libvirt would try to run QEMU with -sandbox on
instead of printing an error earlier.

Jan

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 14:42   ` Ján Tomko
@ 2012-12-04 15:17     ` Luiz Capitulino
  2012-12-04 15:23     ` Daniel P. Berrange
  1 sibling, 0 replies; 11+ messages in thread
From: Luiz Capitulino @ 2012-12-04 15:17 UTC (permalink / raw)
  To: Ján Tomko; +Cc: qemu-devel, otubo

On Tue, 04 Dec 2012 15:42:32 +0100
Ján Tomko <jtomko@redhat.com> wrote:

> On 12/04/12 12:46, Luiz Capitulino wrote:
> > On Mon, 03 Dec 2012 16:55:35 +0100
> > Ján Tomko <jtomko@redhat.com> wrote:
> > 
> >> Hello,
> >>
> >> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
> > 
> > Not that I'm aware of. Could you describe your use-case?
> 
> It's for libvirt. The detection is broken since the switch from parsing
> -help output to QMP and I wanted to fix it.

Different folks have been adding QMP commands to allow feature detection,
then I believe that's what we should do.

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 14:42   ` Ján Tomko
  2012-12-04 15:17     ` Luiz Capitulino
@ 2012-12-04 15:23     ` Daniel P. Berrange
  2012-12-04 19:13       ` Anthony Liguori
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel P. Berrange @ 2012-12-04 15:23 UTC (permalink / raw)
  To: Ján Tomko; +Cc: otubo, qemu-devel, Luiz Capitulino

On Tue, Dec 04, 2012 at 03:42:32PM +0100, Ján Tomko wrote:
> On 12/04/12 12:46, Luiz Capitulino wrote:
> > On Mon, 03 Dec 2012 16:55:35 +0100
> > Ján Tomko <jtomko@redhat.com> wrote:
> > 
> >> Hello,
> >>
> >> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
> > 
> > Not that I'm aware of. Could you describe your use-case?
> 
> It's for libvirt. The detection is broken since the switch from parsing
> -help output to QMP and I wanted to fix it.
> 
> Assuming it's supported if we do capabilities detection via QMP (since
> libvirt 1.0.0 and QEMU 1.2) would work except for this case:
> If seccomp sandbox was requested in /etc/libvirt/qemu.conf, but it was
> compiled out from qemu, libvirt would try to run QEMU with -sandbox on
> instead of printing an error earlier.

In the absence of any way to detect it via QMP, libvirt should fallback
to hardcoding it based on the version number. This presumes that QEMU was
built with it enabled in configure, but we've no other option for current
released 1.2/1.3 versions.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 15:23     ` Daniel P. Berrange
@ 2012-12-04 19:13       ` Anthony Liguori
  2012-12-04 19:50         ` Daniel P. Berrange
  0 siblings, 1 reply; 11+ messages in thread
From: Anthony Liguori @ 2012-12-04 19:13 UTC (permalink / raw)
  To: Daniel P. Berrange, Ján Tomko; +Cc: Luiz Capitulino, qemu-devel, otubo

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Dec 04, 2012 at 03:42:32PM +0100, Ján Tomko wrote:
>> On 12/04/12 12:46, Luiz Capitulino wrote:
>> > On Mon, 03 Dec 2012 16:55:35 +0100
>> > Ján Tomko <jtomko@redhat.com> wrote:
>> > 
>> >> Hello,
>> >>
>> >> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
>> > 
>> > Not that I'm aware of. Could you describe your use-case?
>> 
>> It's for libvirt. The detection is broken since the switch from parsing
>> -help output to QMP and I wanted to fix it.
>> 
>> Assuming it's supported if we do capabilities detection via QMP (since
>> libvirt 1.0.0 and QEMU 1.2) would work except for this case:
>> If seccomp sandbox was requested in /etc/libvirt/qemu.conf, but it was
>> compiled out from qemu, libvirt would try to run QEMU with -sandbox on
>> instead of printing an error earlier.
>
> In the absence of any way to detect it via QMP, libvirt should fallback
> to hardcoding it based on the version number. This presumes that QEMU was
> built with it enabled in configure, but we've no other option for current
> released 1.2/1.3 versions.

echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on

A non-zero execute means QEMU doesn't support the option.  This will
work for any new command line option introduction and can be considered
a "supported" way of probing for whether options are supported.

Regards,

Anthony Liguori

>
> Daniel
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 19:13       ` Anthony Liguori
@ 2012-12-04 19:50         ` Daniel P. Berrange
  2012-12-04 21:44           ` Anthony Liguori
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel P. Berrange @ 2012-12-04 19:50 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Luiz Capitulino, Ján Tomko, qemu-devel, otubo

On Tue, Dec 04, 2012 at 01:13:46PM -0600, Anthony Liguori wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
> 
> > On Tue, Dec 04, 2012 at 03:42:32PM +0100, Ján Tomko wrote:
> >> On 12/04/12 12:46, Luiz Capitulino wrote:
> >> > On Mon, 03 Dec 2012 16:55:35 +0100
> >> > Ján Tomko <jtomko@redhat.com> wrote:
> >> > 
> >> >> Hello,
> >> >>
> >> >> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
> >> > 
> >> > Not that I'm aware of. Could you describe your use-case?
> >> 
> >> It's for libvirt. The detection is broken since the switch from parsing
> >> -help output to QMP and I wanted to fix it.
> >> 
> >> Assuming it's supported if we do capabilities detection via QMP (since
> >> libvirt 1.0.0 and QEMU 1.2) would work except for this case:
> >> If seccomp sandbox was requested in /etc/libvirt/qemu.conf, but it was
> >> compiled out from qemu, libvirt would try to run QEMU with -sandbox on
> >> instead of printing an error earlier.
> >
> > In the absence of any way to detect it via QMP, libvirt should fallback
> > to hardcoding it based on the version number. This presumes that QEMU was
> > built with it enabled in configure, but we've no other option for current
> > released 1.2/1.3 versions.
> 
> echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on
> 
> A non-zero execute means QEMU doesn't support the option.  This will
> work for any new command line option introduction and can be considered
> a "supported" way of probing for whether options are supported.

One of the significant benefits to libvirt of the QMP based feature
detection, was that we no longer have to invoke QEMU multiple times
to query different data. I don't want to regress in this regard,
because invoking QEMU many times has a noticable performance impact
for some applications eg virt-sandbox were even 100ms delays are
relevant.  So while what you describe does work, I don't think it
is a satisfactory approach for libvirt.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 19:50         ` Daniel P. Berrange
@ 2012-12-04 21:44           ` Anthony Liguori
  2012-12-06  9:11             ` Daniel P. Berrange
  0 siblings, 1 reply; 11+ messages in thread
From: Anthony Liguori @ 2012-12-04 21:44 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Luiz Capitulino, Ján Tomko, qemu-devel, otubo

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Dec 04, 2012 at 01:13:46PM -0600, Anthony Liguori wrote:
>> "Daniel P. Berrange" <berrange@redhat.com> writes:
>> 
>> > On Tue, Dec 04, 2012 at 03:42:32PM +0100, Ján Tomko wrote:
>> >> On 12/04/12 12:46, Luiz Capitulino wrote:
>> >> > On Mon, 03 Dec 2012 16:55:35 +0100
>> >> > Ján Tomko <jtomko@redhat.com> wrote:
>> >> > 
>> >> >> Hello,
>> >> >>
>> >> >> is there a way to check if QEMU was compiled with --enable-seccomp via QMP?
>> >> > 
>> >> > Not that I'm aware of. Could you describe your use-case?
>> >> 
>> >> It's for libvirt. The detection is broken since the switch from parsing
>> >> -help output to QMP and I wanted to fix it.
>> >> 
>> >> Assuming it's supported if we do capabilities detection via QMP (since
>> >> libvirt 1.0.0 and QEMU 1.2) would work except for this case:
>> >> If seccomp sandbox was requested in /etc/libvirt/qemu.conf, but it was
>> >> compiled out from qemu, libvirt would try to run QEMU with -sandbox on
>> >> instead of printing an error earlier.
>> >
>> > In the absence of any way to detect it via QMP, libvirt should fallback
>> > to hardcoding it based on the version number. This presumes that QEMU was
>> > built with it enabled in configure, but we've no other option for current
>> > released 1.2/1.3 versions.
>> 
>> echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on
>> 
>> A non-zero execute means QEMU doesn't support the option.  This will
>> work for any new command line option introduction and can be considered
>> a "supported" way of probing for whether options are supported.
>
> One of the significant benefits to libvirt of the QMP based feature
> detection, was that we no longer have to invoke QEMU multiple times
> to query different data. I don't want to regress in this regard,
> because invoking QEMU many times has a noticable performance impact
> for some applications eg virt-sandbox were even 100ms delays are
> relevant.  So while what you describe does work, I don't think it
> is a satisfactory approach for libvirt.

Okay, so in terms of what exists today, I don't have a better option.
But we could add:

{ 'enum': 'ConfigEntryType',
  'data': [ 'number', 'string', 'bool', 'size' ] }

{ 'type': 'ConfigEntry',
  'data': { 'name': 'str', 'type': 'ConfigEntryType' } }

{ 'type': 'ConfigSection',
  'data': { 'name': 'str', 'fields': [ 'ConfigEntry' ] } }

{ 'command': 'query-config-schema',
  'returns': [ 'ConfigSection' ] }

This technically introspects config sections but obviously could be used
to detect the availability of -sandbox.

If it's useful, I can take a quick swing at implementing (or someone
else certainly could).

Regards,

Anthony Liguori

>
> Regards,
> Daniel
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-04 21:44           ` Anthony Liguori
@ 2012-12-06  9:11             ` Daniel P. Berrange
  2012-12-06 14:00               ` Anthony Liguori
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel P. Berrange @ 2012-12-06  9:11 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Luiz Capitulino, Ján Tomko, qemu-devel, otubo

On Tue, Dec 04, 2012 at 03:44:54PM -0600, Anthony Liguori wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
> 
> > On Tue, Dec 04, 2012 at 01:13:46PM -0600, Anthony Liguori wrote:
> >> "Daniel P. Berrange" <berrange@redhat.com> writes:
> >> 
> >> >
> >> > In the absence of any way to detect it via QMP, libvirt should fallback
> >> > to hardcoding it based on the version number. This presumes that QEMU was
> >> > built with it enabled in configure, but we've no other option for current
> >> > released 1.2/1.3 versions.
> >> 
> >> echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on
> >> 
> >> A non-zero execute means QEMU doesn't support the option.  This will
> >> work for any new command line option introduction and can be considered
> >> a "supported" way of probing for whether options are supported.
> >
> > One of the significant benefits to libvirt of the QMP based feature
> > detection, was that we no longer have to invoke QEMU multiple times
> > to query different data. I don't want to regress in this regard,
> > because invoking QEMU many times has a noticable performance impact
> > for some applications eg virt-sandbox were even 100ms delays are
> > relevant.  So while what you describe does work, I don't think it
> > is a satisfactory approach for libvirt.
> 
> Okay, so in terms of what exists today, I don't have a better option.
> But we could add:
> 
> { 'enum': 'ConfigEntryType',
>   'data': [ 'number', 'string', 'bool', 'size' ] }
> 
> { 'type': 'ConfigEntry',
>   'data': { 'name': 'str', 'type': 'ConfigEntryType' } }
> 
> { 'type': 'ConfigSection',
>   'data': { 'name': 'str', 'fields': [ 'ConfigEntry' ] } }
> 
> { 'command': 'query-config-schema',
>   'returns': [ 'ConfigSection' ] }
> 
> This technically introspects config sections but obviously could be used
> to detect the availability of -sandbox.
> 
> If it's useful, I can take a quick swing at implementing (or someone
> else certainly could).

I'm not sure I entirely understand what information a 'ConfigSection'
would represent. By config here, do you mean any command line argument
or something else ?  Could you give a short example of the actual JSON
you envisage returning for this schema. Your suggestion sounds good,
but I want to make sure I'm not mis-understanding things :-)

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-06  9:11             ` Daniel P. Berrange
@ 2012-12-06 14:00               ` Anthony Liguori
  2012-12-06 14:07                 ` Daniel P. Berrange
  0 siblings, 1 reply; 11+ messages in thread
From: Anthony Liguori @ 2012-12-06 14:00 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Luiz Capitulino, Ján Tomko, qemu-devel, otubo

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Dec 04, 2012 at 03:44:54PM -0600, Anthony Liguori wrote:
>> "Daniel P. Berrange" <berrange@redhat.com> writes:
>> 
>> > On Tue, Dec 04, 2012 at 01:13:46PM -0600, Anthony Liguori wrote:
>> >> "Daniel P. Berrange" <berrange@redhat.com> writes:
>> >> 
>> >> >
>> >> > In the absence of any way to detect it via QMP, libvirt should fallback
>> >> > to hardcoding it based on the version number. This presumes that QEMU was
>> >> > built with it enabled in configure, but we've no other option for current
>> >> > released 1.2/1.3 versions.
>> >> 
>> >> echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on
>> >> 
>> >> A non-zero execute means QEMU doesn't support the option.  This will
>> >> work for any new command line option introduction and can be considered
>> >> a "supported" way of probing for whether options are supported.
>> >
>> > One of the significant benefits to libvirt of the QMP based feature
>> > detection, was that we no longer have to invoke QEMU multiple times
>> > to query different data. I don't want to regress in this regard,
>> > because invoking QEMU many times has a noticable performance impact
>> > for some applications eg virt-sandbox were even 100ms delays are
>> > relevant.  So while what you describe does work, I don't think it
>> > is a satisfactory approach for libvirt.
>> 
>> Okay, so in terms of what exists today, I don't have a better option.
>> But we could add:
>> 
>> { 'enum': 'ConfigEntryType',
>>   'data': [ 'number', 'string', 'bool', 'size' ] }
>> 
>> { 'type': 'ConfigEntry',
>>   'data': { 'name': 'str', 'type': 'ConfigEntryType' } }
>> 
>> { 'type': 'ConfigSection',
>>   'data': { 'name': 'str', 'fields': [ 'ConfigEntry' ] } }
>> 
>> { 'command': 'query-config-schema',
>>   'returns': [ 'ConfigSection' ] }


>> 
>> This technically introspects config sections but obviously could be used
>> to detect the availability of -sandbox.
>> 
>> If it's useful, I can take a quick swing at implementing (or someone
>> else certainly could).
>
> I'm not sure I entirely understand what information a 'ConfigSection'
> would represent. By config here, do you mean any command line argument
> or something else ?

We no longer should be adding command line arguments that don't use
QemuOpts and have a equivalent -readconfig syntax.  We could even
eliminate new options and do something like:

qemu -conf sandbox:enable=on

But that's not user friendly so we'll stick with adding higher level
options like -sandbox.

So what I'm proposing is to introspection on what -readconfig supports
and then from that, you can infer when new higher level command line
arguments are added.

>  Could you give a short example of the actual JSON
> you envisage returning for this schema. Your suggestion sounds good,
> but I want to make sure I'm not mis-understanding things :-)

[ { 'name': 'sandbox',
    'fields': [ { 'name': 'enable', 'type': 'bool' } ] },
  { 'name': 'add-fd',
    'fields': [ { 'name': 'fd', 'type': 'number' },
                { 'name': 'set', 'type': 'number' },
                { 'name': 'opaque', 'type': 'str' } ] },
  ...
]

Regards,

Anthony Liguori

>
> Regards,
> Daniel
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] detecting seccomp sandbox capability via QMP
  2012-12-06 14:00               ` Anthony Liguori
@ 2012-12-06 14:07                 ` Daniel P. Berrange
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel P. Berrange @ 2012-12-06 14:07 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Luiz Capitulino, Ján Tomko, qemu-devel, otubo

On Thu, Dec 06, 2012 at 08:00:56AM -0600, Anthony Liguori wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
> 
> > On Tue, Dec 04, 2012 at 03:44:54PM -0600, Anthony Liguori wrote:
> >> "Daniel P. Berrange" <berrange@redhat.com> writes:
> >> 
> >> > On Tue, Dec 04, 2012 at 01:13:46PM -0600, Anthony Liguori wrote:
> >> >> "Daniel P. Berrange" <berrange@redhat.com> writes:
> >> >> 
> >> >> >
> >> >> > In the absence of any way to detect it via QMP, libvirt should fallback
> >> >> > to hardcoding it based on the version number. This presumes that QEMU was
> >> >> > built with it enabled in configure, but we've no other option for current
> >> >> > released 1.2/1.3 versions.
> >> >> 
> >> >> echo quit | qemu -machine none -S -monitor stdio -vnc none -sandbox on
> >> >> 
> >> >> A non-zero execute means QEMU doesn't support the option.  This will
> >> >> work for any new command line option introduction and can be considered
> >> >> a "supported" way of probing for whether options are supported.
> >> >
> >> > One of the significant benefits to libvirt of the QMP based feature
> >> > detection, was that we no longer have to invoke QEMU multiple times
> >> > to query different data. I don't want to regress in this regard,
> >> > because invoking QEMU many times has a noticable performance impact
> >> > for some applications eg virt-sandbox were even 100ms delays are
> >> > relevant.  So while what you describe does work, I don't think it
> >> > is a satisfactory approach for libvirt.
> >> 
> >> Okay, so in terms of what exists today, I don't have a better option.
> >> But we could add:
> >> 
> >> { 'enum': 'ConfigEntryType',
> >>   'data': [ 'number', 'string', 'bool', 'size' ] }
> >> 
> >> { 'type': 'ConfigEntry',
> >>   'data': { 'name': 'str', 'type': 'ConfigEntryType' } }
> >> 
> >> { 'type': 'ConfigSection',
> >>   'data': { 'name': 'str', 'fields': [ 'ConfigEntry' ] } }
> >> 
> >> { 'command': 'query-config-schema',
> >>   'returns': [ 'ConfigSection' ] }
> 
> 
> >> 
> >> This technically introspects config sections but obviously could be used
> >> to detect the availability of -sandbox.
> >> 
> >> If it's useful, I can take a quick swing at implementing (or someone
> >> else certainly could).
> >
> > I'm not sure I entirely understand what information a 'ConfigSection'
> > would represent. By config here, do you mean any command line argument
> > or something else ?
> 
> We no longer should be adding command line arguments that don't use
> QemuOpts and have a equivalent -readconfig syntax.  We could even
> eliminate new options and do something like:
> 
> qemu -conf sandbox:enable=on
> 
> But that's not user friendly so we'll stick with adding higher level
> options like -sandbox.
> 
> So what I'm proposing is to introspection on what -readconfig supports
> and then from that, you can infer when new higher level command line
> arguments are added.
> 
> >  Could you give a short example of the actual JSON
> > you envisage returning for this schema. Your suggestion sounds good,
> > but I want to make sure I'm not mis-understanding things :-)
> 
> [ { 'name': 'sandbox',
>     'fields': [ { 'name': 'enable', 'type': 'bool' } ] },
>   { 'name': 'add-fd',
>     'fields': [ { 'name': 'fd', 'type': 'number' },
>                 { 'name': 'set', 'type': 'number' },
>                 { 'name': 'opaque', 'type': 'str' } ] },
>   ...
> ]

Ok, that all sounds like a good idea to me - it should address one of the
major gaps in the new QMP based capabilities detection.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

end of thread, other threads:[~2012-12-06 14:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 15:55 [Qemu-devel] detecting seccomp sandbox capability via QMP Ján Tomko
2012-12-04 11:46 ` Luiz Capitulino
2012-12-04 14:42   ` Ján Tomko
2012-12-04 15:17     ` Luiz Capitulino
2012-12-04 15:23     ` Daniel P. Berrange
2012-12-04 19:13       ` Anthony Liguori
2012-12-04 19:50         ` Daniel P. Berrange
2012-12-04 21:44           ` Anthony Liguori
2012-12-06  9:11             ` Daniel P. Berrange
2012-12-06 14:00               ` Anthony Liguori
2012-12-06 14:07                 ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.