[libvirt PATCH 2/3] qemuBuildMemoryDeviceStr: check return of qemuBuildDeviceAddressStr

Tim Wiederhake twiederh at redhat.com
Thu Dec 10 10:15:10 UTC 2020


On Thu, 2020-12-10 at 10:41 +0100, Ján Tomko wrote:
> Although the function currently only returns errors for PCI
> addresses,
> check it here too, in case that chamges in the future.
typo                                 ^ changes
> 
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>  src/qemu/qemu_command.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 76edc3c617..b06a086e18 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3317,7 +3317,8 @@ qemuBuildMemoryDeviceStr(const virDomainDef
> *def,
>          virBufferAsprintf(&buf, "memdev=mem%s,id=%s",
>                            mem->info.alias, mem->info.alias);
>  
> -        qemuBuildDeviceAddressStr(&buf, def, &mem->info, qemuCaps);
> +        if (qemuBuildDeviceAddressStr(&buf, def, &mem->info,
> qemuCaps) < 0)
> +            return NULL;
>          break;
>  
>      case VIR_DOMAIN_MEMORY_MODEL_NONE:




More information about the libvir-list mailing list