On Tue, Jun 11, 2024 at 10:08:20AM +0200, Markus Armbruster wrote:
> Daniel P. Berrangé <berra...@redhat.com> writes:
> 
> > Any command that is known to be unimplemented on a given build target
> > must be disabled using a QAPI schema conditional. Only use dynamidc
> 
> Suggest "should be disabled", for consistency with the comment below.
> 
> s/dynamidc/dynamic/
> 
> > disabling for commands that require a runtime feature check.
> >
> > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
> > ---
> >  qga/commands-posix.c | 8 +++++++-
> >  qga/commands-win32.c | 8 +++++++-
> >  2 files changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> > index f4104f2760..8f09162562 100644
> > --- a/qga/commands-posix.c
> > +++ b/qga/commands-posix.c
> > @@ -1136,7 +1136,13 @@ error:
> >  
> >  #endif /* HAVE_GETIFADDRS */
> >  
> > -/* add unsupported commands to the list of blocked RPCs */
> > +/*
> > + * Add commands that cannot be supported based on the results of
> > + * dynamic check of the running OS installation.
> > + *
> > + * Commands that cannot be supported at all on a given platform
> > + * should be disabled with a condition in the QAPI schema.
> > + */
> >  GList *ga_command_init_blockedrpcs(GList *blockedrpcs)
> >  {
> >      return blockedrpcs;
> > diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> > index 2533e4c748..0198e37a96 100644
> > --- a/qga/commands-win32.c
> > +++ b/qga/commands-win32.c
> > @@ -1958,7 +1958,13 @@ done:
> >      g_free(rawpasswddata);
> >  }
> >  
> > -/* add unsupported commands to the list of blocked RPCs */
> > +/*
> > + * Add commands that cannot be supported based on the results of
> > + * dynamic check of the running OS installation.
> > + *
> > + * Commands that cannot be supported at all on Wnidows
> 
> s/Wnidows/Windows/
> 
> > + * should be disabled with a condition in the QAPI schema.
> > + */
> >  GList *ga_command_init_blockedrpcs(GList *blockedrpcs)
> >  {
> >      if (!vss_init(true)) {
> 
> Both functions will be unused after PATCH 20.  Remove them there, and
> drop this patch?

Hmm, they shouldn't be unused. I've made a mistake in Patch 20.

We still need to run these methods, since the Windows impl has todo
a runtime check to determine whether snapshot APIs are supported by
the system or not - that's the vss_init() call just seen in the
diff context here.

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 :|


Reply via email to