[libvirt] [PATCH v2 3/4] qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD
Peter Krempa
pkrempa at redhat.com
Fri Oct 16 04:54:31 UTC 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151016/25d2fd71/attachment-0001.sig>
More information about the libvir-list
mailing list