Re: [PATCH v2 3/4] qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD

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

 



On Thu, Oct 15, 2015 at 16:43:54 -0400, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1249981

...

> ---
>  src/qemu/qemu_command.c                            | 19 +++++------
>  src/qemu/qemu_process.c                            | 26 ++++++++++++++-
>  .../qemuxml2argv-cputune-numatune.args             |  1 +
>  .../qemuxml2argv-iothreads-nocap.xml               | 37 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  2 ++
>  5 files changed, 73 insertions(+), 12 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-nocap.xml
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index f99e363..ae04a69 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c

[...]

> @@ -9462,8 +9454,13 @@ qemuBuildCommandLine(virConnectPtr conn,
>      virCommandAddArg(cmd, smp);
>      VIR_FREE(smp);
>  
> -    if (def->niothreadids > 0 &&
> -        virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)) {
> +    if (def->niothreadids &&
> +        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)) {

This case can be folded ...

> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("IOThreads not supported for this QEMU"));
> +        goto error;
> +    }
> +    if (def->niothreadids) {

... here so that you don't have to test def->niothreadids twice in 6
lines of code where it can't change.

>          /* Create iothread objects using the defined iothreadids list
>           * and the defined id and name from the list. These may be used
>           * by a disk definition which will associate to an iothread by

ACK with the above stuff optimized.

Peter

Attachment: signature.asc
Description: Digital signature

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