[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 04/10] qemu: capabilities: Detect active block commit via QMP schema probing if possible



On Thu, Aug 23, 2018 at 14:45:35 -0400, John Ferlan wrote:
> 
> 
> On 08/15/2018 05:18 AM, Peter Krempa wrote:
> > For versions where we can probe that the arguments are optional we can
> > perform the probing by a schema query rather than sending a separate
> > command to do so.
> > 
> > Signed-off-by: Peter Krempa <pkrempa redhat com>
> > ---

[...]

> > 
> 
> Until I looked at the history of qapi/block-core.json, the "*" didn't
> make sense. Still, it seems "top" means required argument "top" while
> "*top" means optional argument "top". Does that mean "theoretically
> speaking" we could have used "*tls-creds" since that's listed as
> optional for nbd-server-start?  Suffice to say screendump doesn't make
> much sense either, although in light of this "*", perhaps it too could
> be "*device"?  I dunno, just guessing and grousing.

Some of them may be selected using the '*' modifier. The modifier is
meant to select optional only arguments. For arguments which are not
optional or if you don't care if it's optional no modifier still should
be used.

This is useful only in cases where some argument became optional later
on.

> Different problem for a different day, but documenting the syntax of the
> entries in the virQEMUCapsQMPSchemaQueries would be nice.

The documentation for virQEMUCapsQMPSchemaQueries says:

/* see documentation for virQEMUQAPISchemaPathGet for the query format */
static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
    { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
    { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
    { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS},

Where we document the format of the query string:

/**
 * virQEMUQAPISchemaPathGet:
 * @query: string specifying the required data type (see below)
 * @schema: hash table containing the schema data
 * @entry: filled with the located schema object requested by @query
 *
 * Retrieves the requested schema entry specified by @query to @entry. The
 * @query parameter has the following syntax which is very closely tied to the
 * qemu schema syntax entries separated by slashes with a few special characters:
 *
 * "command_or_event/attribute/subattribute/+variant_discriminator/subattribute"
 *
 * command_or_event: name of the event or attribute to introspect
 * attribute: selects whether arguments or return type should be introspected
 *            ("arg-type" or "ret-type" for commands, "arg-type" for events)
 * subattribute: specifies member name of object types
 * *subattribute: same as above but must be optional (has a property named
 *                'default' field in the schema)
 * +variant_discriminator: In the case of unionized objects, select a
 *                         specific case to introspect.
 *
 * If the name of any (sub)attribute starts with non-alphabetical symbols it
 * needs to be prefixed by a single space.
 *
 * Array types are automatically flattened to the singular type. Alternate
 * types are currently not supported.
 *
 * The above types can be chained arbitrarily using slashes to construct any
 * path into the schema tree.
 *
 * Returns 0 on success (including if the requested schema was not found) and
 * fills @entry appropriately. On failure returns -1 and sets an appropriate
 * error message.
 */

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]