On Wed, Feb 03, 2021 at 11:39:07AM -0600, Jonathon Jongsma wrote:
> It will be useful to be able to specify a particular UUID for a mediated
> device when defining the node device. To accomodate that, allow this to
> be specified in the xml schema. This patch also parses and formats that
> value to the xml, but does not yet use it.
>
> Signed-off-by: Jonathon Jongsma <[email protected]>
> ---
...
>
> + if ((uuidstr = virXPathString("string(./uuid[1])", ctxt))) {
> + /* make sure that the provided uuid is valid */
> + if (virUUIDParse(uuidstr, uuidbuf) < 0) {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("Invalid uuid '%s' for '%s'"), mdev->uuid,
we don't have mdev->uuid at this point yet, so:
s/mdev->uuid/uuidstr
> + def->name);
we also haven't generated any name yet, so ^this yields "new device". I'd
suggest to hardcode the message with "new mdev device" instead of using
def->name.
Being able to specify UUIDs with mdevs directly is great.
Reviewed-by: Erik Skultety <[email protected]>