From patchwork Fri Jan 22 19:30:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 60192 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp51274lbb; Fri, 22 Jan 2016 11:33:16 -0800 (PST) X-Received: by 10.140.30.197 with SMTP id d63mr5863322qgd.81.1453491191981; Fri, 22 Jan 2016 11:33:11 -0800 (PST) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id w188si8534809qha.132.2016.01.22.11.33.11 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 11:33:11 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUt6n001579; Fri, 22 Jan 2016 14:30:55 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUjLh019940 for ; Fri, 22 Jan 2016 14:30:45 -0500 Received: from colepc.redhat.com (ovpn-113-198.phx2.redhat.com [10.3.113.198]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MJUaPX002518; Fri, 22 Jan 2016 14:30:45 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 22 Jan 2016 14:30:25 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/17] qemu: command: drop QEMU_CAPS_DEVICE for serial/parallel cli X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com -serial none and -parallel none are never required anymore, even platforms that can't use -device abide -nodefaults. Additionally we conditionalized the cli building on nparallels != 0, but that was pointless. --- src/qemu/qemu_command.c | 50 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 55c869e..e3c6a51 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10403,38 +10403,28 @@ qemuBuildCommandLine(virConnectPtr conn, actualSerials++; } - /* If we have -device, then we set -nodefault already */ - if (!actualSerials && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) - virCommandAddArgList(cmd, "-serial", "none", NULL); - - if (!def->nparallels) { - /* If we have -device, then we set -nodefault already */ - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) - virCommandAddArgList(cmd, "-parallel", "none", NULL); - } else { - for (i = 0; i < def->nparallels; i++) { - virDomainChrDefPtr parallel = def->parallels[i]; - char *devstr; + for (i = 0; i < def->nparallels; i++) { + virDomainChrDefPtr parallel = def->parallels[i]; + char *devstr; - /* Use -chardev with -device if they are available */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) { - virCommandAddArg(cmd, "-chardev"); - if (!(devstr = qemuBuildChrChardevStr(¶llel->source, - parallel->info.alias, - qemuCaps))) - goto error; - virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); + /* Use -chardev with -device if they are available */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) { + virCommandAddArg(cmd, "-chardev"); + if (!(devstr = qemuBuildChrChardevStr(¶llel->source, + parallel->info.alias, + qemuCaps))) + goto error; + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); - if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, qemuCaps) < 0) - goto error; - } else { - virCommandAddArg(cmd, "-parallel"); - if (!(devstr = qemuBuildChrArgStr(¶llel->source, NULL))) - goto error; - virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); - } + if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, qemuCaps) < 0) + goto error; + } else { + virCommandAddArg(cmd, "-parallel"); + if (!(devstr = qemuBuildChrArgStr(¶llel->source, NULL))) + goto error; + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); } }