Re: [REPOSTv2 PATCH v3 4/6] qemu: Add VM Generation ID to qemu command line

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

 



On 05/17/2018 02:42 PM, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1149445
> 
> If the domain requests usage of the genid functionality,
> then add the QEMU '-device vmgenid' to the command line
> providing either the supplied or generated GUID value.
> 
> Add tests for both a generated and supplied GUID value.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c                            | 24 +++++++++++++++++
>  .../qemuxml2argvdata/genid-auto.x86_64-latest.args | 30 ++++++++++++++++++++++
>  tests/qemuxml2argvdata/genid.x86_64-latest.args    | 30 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  4 +++
>  4 files changed, 88 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/genid-auto.x86_64-latest.args
>  create mode 100644 tests/qemuxml2argvdata/genid.x86_64-latest.args
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index c4237339bf..78bd685008 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6002,6 +6002,27 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd,
>  }
>  
>  
> +static int
> +qemuBuildVMGenIDCommandLine(virCommandPtr cmd,
> +                            const virDomainDef *def)
> +{
> +    virBuffer opts = VIR_BUFFER_INITIALIZER;
> +    char guid[VIR_UUID_STRING_BUFLEN];
> +
> +    if (!def->genidRequested)
> +        return 0;
> +
> +    virUUIDFormat(def->genid, guid);
> +    virBufferAsprintf(&opts, "vmgenid,guid=%s,id=vmgenid0", guid);
> +
> +    virCommandAddArg(cmd, "-device");
> +    virCommandAddArgBuffer(cmd, &opts);
> +
> +    virBufferFreeAndReset(&opts);
> +    return 0;

As mentioned in previous patch this function must check for
DEVICE_VMGENID capability. Otherwise we might put -device vmgenid on
command line for qemu that doesn't support it.

> +}

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux