From patchwork Tue Jun 19 16:40:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139226 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428714lji; Tue, 19 Jun 2018 09:41:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuaGyny7b6rUmB0s73i7UYmf7bQdYiFYp788KAC7sxghOJmkOK/FqIqw7wI6yj2cYWgGIs X-Received: by 2002:aca:30ce:: with SMTP id w197-v6mr9957513oiw.264.1529426490754; Tue, 19 Jun 2018 09:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426490; cv=none; d=google.com; s=arc-20160816; b=XENNY/LZGUR8Rq2jtgdcnhtHgyT5wWJTePgzB0H59pivaMTz6siDSB9g1UsVxGsvNe ndZfKqAsIB3IIiZ0ShzBSZC3RmS02Rj1EtmuRaAGzn6o1kl0Hi7FIaetP6Fks0h55iw/ SVh5kQ5PYBavD5hkpxkQucsaZrJZFRvbwbG6mhe6aOFacV27/wyHdWlMEe6/6Ly/yvgF pRujW5De/oK7nqswr0eB2yhR3AKWhTuwg2W7ZtN77PH5fM5eURLhAjlrQDS1FOCMDwr2 ZGvsDMtmEEIRMWx4zgf/eWGWonsbCdT5ra/Uoq5naw+EgXFK279XdZM/M3JD7dzefjjk UAew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=BhPNHCQK7AdH0aor20cwWypJqzq0VLMrYAGN4x7fLP8=; b=bRWIoRbEsgnS5eSkLpzK2Tp00Xs63viyYXDI8NW4PDJ1cGy/6bhSm46LBGW3XwGcAB wiPv7IZ5ktVMCl5BRiaQoCJYyuGWo4nGp6Ri13HtuhxbhoUKGbHziWM7rjtv6rhHuK7v UW7FHXzpf1iTPLyVygf1Tm5IRM85rdNOMKJztWLBIhDLMmd8CnB0rQkIHGwq4xO9l9+A Cftv63sv7LLIjtsu+r5cN7djvOwxtecTIjReUDsn24Wdua/towWpewkreggBH74Crq+y 6vLI/PTgTPXcBM5fTGQnrpfmXhVrzqBAE57ZmYB39C8n8VppC7aS8XK8gGmw5j3G/b3r vlyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q62-v6si33339oif.340.2018.06.19.09.41.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CDC4308A973; Tue, 19 Jun 2018 16:41:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF7015D9C5; Tue, 19 Jun 2018 16:41:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A27694A46C; Tue, 19 Jun 2018 16:41:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfEe2011275 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDAAC2018062; Tue, 19 Jun 2018 16:41:13 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3EAB2026D68; Tue, 19 Jun 2018 16:41:13 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:47 -0400 Message-Id: <9f395feb77f34ec3d8d6aafcea6b534de93b2890.1529426092.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] qemu: command: Make qemuBuildNicStr static 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 19 Jun 2018 16:41:29 +0000 (UTC) It doesn't have any external callers Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_command.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) -- 2.17.1 -- 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 20c6ac2a04..4625851dc5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3352,7 +3352,7 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) } -char * +static char * qemuBuildNicStr(virDomainNetDefPtr net, const char *prefix, int vlan) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index da75645ac5..0bcbf3018b 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -92,11 +92,6 @@ char *qemuBuildHostNetStr(virDomainNetDefPtr net, char **vhostfd, size_t vhostfdSize); -/* Legacy, pre device support */ -char *qemuBuildNicStr(virDomainNetDefPtr net, - const char *prefix, - int vlan); - /* Current, best practice */ char *qemuBuildNicDevStr(virDomainDefPtr def, virDomainNetDefPtr net, From patchwork Tue Jun 19 16:40:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139223 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428489lji; Tue, 19 Jun 2018 09:41:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLl295I87Fs/AsS215NuvJiqjSmNRucg3M8hocBjAgKOIWnAoQki6w1aXcx9dPQf9wVfVjA X-Received: by 2002:a9d:443:: with SMTP id 61-v6mr10241271otc.285.1529426479824; Tue, 19 Jun 2018 09:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426479; cv=none; d=google.com; s=arc-20160816; b=GbdzQGiCDufIoABTBgEs7goQfHffTmkmFi1tsJsoiUs5bRClFADhryiqurcc+VO0RU dISAz7m/7GzT9s5cvoKq608fy09Oqw1GuVozy6EWSuzFT/7n8jM9zn50JITWzRvt6tdF jeq8wriWslErKibS6YczOgrilUm7WlhxwOBJkN6PQiPsUoJMYCmXbrUKPMrxZBCNjvG2 GpJMoJJsy4qHBbzNgYxXHVIaNXuxQA5C8FiP1WaSKnaiiS9hoYc+8EgYVk8+hfwwOjEw cexAQuzVyjn4B1HgHPg7BYeYfxZP0EMa+HWvMXRk6b9t9yQHlanvMOGQRn2Vixwjzus+ S6aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=zyBKLY/fXyWRB3kdVIVhSJwk+aMOfzlDF0Dhs6JcH1E=; b=lDj1OJsAk70gbxKTMOQk3bRjxH4EPbXmejCpOSSMwDDrdD0rUEKFenSGHW249TJNS7 UCO7jKcJ3zNV7E80aAg1sD/yEt4YOpYaqWp5ubypiFfV+/SUBMwE+crTkYCmlUE7n0yn yFgJIWrOnQvQFGMzuvbsLwRczUipM49z87IvkhZkJzJ5oUw05rnO9Ce/AMeX4LcrJZgU qe4zK7CUoaivVS0R5CC9BosZhY1RrEq9H4OhS1XbG9ehjH/CTEXijQa8A/2By72A9SOz Yg+VTfSyxV0tvVAUR/QlUBJ5DgGQXfMlh8G9rifXVEXt1Xc8C5na8ucXS3i4k8Mrut2w 4zGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id w16-v6si36110oie.255.2018.06.19.09.41.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 294DE308FB8B; Tue, 19 Jun 2018 16:41:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7F6E600C0; Tue, 19 Jun 2018 16:41:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AD6444A464; Tue, 19 Jun 2018 16:41:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfERE011280 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1DF0E2018076; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03DA32026D68; Tue, 19 Jun 2018 16:41:13 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:48 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] qemu: command: Rename BuildNicStr to BuildLegacyNicStr 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 19 Jun 2018 16:41:18 +0000 (UTC) Makes it less ambiguous Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 -- 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 4625851dc5..f7038a8c5e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3353,9 +3353,9 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) static char * -qemuBuildNicStr(virDomainNetDefPtr net, - const char *prefix, - int vlan) +qemuBuildLegacyNicStr(virDomainNetDefPtr net, + const char *prefix, + int vlan) { char *str; char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -8517,7 +8517,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, goto cleanup; virCommandAddArgList(cmd, "-device", nic, NULL); } else { - if (!(nic = qemuBuildNicStr(net, "nic,", vlan))) + if (!(nic = qemuBuildLegacyNicStr(net, "nic,", vlan))) goto cleanup; virCommandAddArgList(cmd, "-net", nic, NULL); From patchwork Tue Jun 19 16:40:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139228 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428813lji; Tue, 19 Jun 2018 09:41:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/igcUmoaY+llmkqA9eozMUbeyzzdI1gg9TYREpKn8OEQSgtdnSmiYtSQWIxldxCJXof8U X-Received: by 2002:a9d:2466:: with SMTP id p93-v6mr10257355ota.98.1529426495629; Tue, 19 Jun 2018 09:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426495; cv=none; d=google.com; s=arc-20160816; b=F861P7L7WcA55y65wP8GT9jynr/N0uj+xC/GcCa+POL2NXm8zR/DsqcRxm4PYhbjt9 Cv0veJ2O1rPN3JZKCcI4P7EtgNbD1qfBlHAUdRL1TcV6fjONqnHa3lzjoWPZOkxJEyE+ m1Xidw+j4cKF2A1NWGd2KAj2/5NHx3yThtxfioTJlIn29NJpsUiE8R2bTxdAad4oY7XA bgTxr/FLq+RYped5HWv4ODTXRtOOtR68v1H5oc0bgcpqyyU4d2hleJ0U03LrP4dY9E6n hixJeeVBFQ+Q58hq8n99ne/gD6INuXZEV5o8ymPJEU2cFRPVmIEnIOK36Gql9l6vBXeS Tauw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=WYB/aBSoatwM76L0H1kGyp3PrvG/efuWWFhGt151O80=; b=z6eZTZmfXels0E6cAosg0mERSohFP6jbdbLSliCsDfDsocF5109L3G9jvTq+XlB/ZO ZMCuBoKZtbNigDzpatusQSJotVyPPVpiWe8c2gXQouQ++sueMtAPladAqZvj2XEZwGsj MA9Sqr83sOHaE3CGddR94xhzSb7Bpkz9Gv3Oy8zeU4gwGH/opiLsLksBMibWm+iOQW+L Ld2uKQSh6yeH4AV8M12vik4gq19/z5WmTqGqpohOnPw50fuEcg/LVarRfvzZqsFbTu4Z GH5d8JJ8FznAtO/X1l70PeHJ6hv0Tp59AP63lrv4apT+smOd7Hq6h/X9nPC2RRaOebsC 1VYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f127-v6si38017oic.302.2018.06.19.09.41.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D0C4356DE; Tue, 19 Jun 2018 16:41:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21DB0308332C; Tue, 19 Jun 2018 16:41:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BAE7E41091; Tue, 19 Jun 2018 16:41:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfEXd011290 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42D002018061; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 290622026D68; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:49 -0400 Message-Id: <439f1d8e3e1e6ff7e5ac3e71931e27c24e4acaf3.1529426092.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/6] qemu: command: remove unused LegacyNicStr arg 'prefix' 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 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Jun 2018 16:41:34 +0000 (UTC) Hardcode the only string that's passed in Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 -- 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 f7038a8c5e..31a0b7761a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3354,15 +3354,13 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) static char * qemuBuildLegacyNicStr(virDomainNetDefPtr net, - const char *prefix, int vlan) { char *str; char macaddr[VIR_MAC_STRING_BUFLEN]; ignore_value(virAsprintf(&str, - "%smacaddr=%s,vlan=%d%s%s%s%s", - prefix ? prefix : "", + "nic,macaddr=%s,vlan=%d%s%s%s%s", virMacAddrFormat(&net->mac, macaddr), vlan, (net->model ? ",model=" : ""), @@ -8517,7 +8515,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, goto cleanup; virCommandAddArgList(cmd, "-device", nic, NULL); } else { - if (!(nic = qemuBuildLegacyNicStr(net, "nic,", vlan))) + if (!(nic = qemuBuildLegacyNicStr(net, vlan))) goto cleanup; virCommandAddArgList(cmd, "-net", nic, NULL); From patchwork Tue Jun 19 16:40:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139224 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428487lji; Tue, 19 Jun 2018 09:41:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLu4lcnAR8veXQU+YHL1I9tIj50oKs7K9Rxqawo80ePGTRSTefDE6qJAVmkL1nRhi7o5Usk X-Received: by 2002:a9d:2713:: with SMTP id r19-v6mr11648668ota.93.1529426479772; Tue, 19 Jun 2018 09:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426479; cv=none; d=google.com; s=arc-20160816; b=hJWRZm1vf5GxI0wBBLK1alTm8OOeNFKMzTy0htlcPEnA6RnvK4ZtiZSvZXo58KzFy6 rEOUrhaNjvZK/KvlXbF9nRVy1k7xqjNtUxmbGhJ47CjscscFyXe0GY2wzkI5KVoQK6TG +quLegphP8W2DujO22AfgJuYxrODOn38a5ve0Fh0sgsqnSPd9yQq/+hmX6giLlcECOyZ BeEHnvEeFksztEPVUoqnnx28je8rYt9ipLoirD0th5qwh7gIe8FeWGKpt+eHd6AVg5vN HMId1BRwGB2bN0OWlJTgtaB56YTe0cjBs1iYEN9aYVfkEwaGFMhKNuOHykZZGFLw7v93 gu8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=pIOvFYEPB2irNwtbo8se6yvirzNoD0K2gqS5s9kK/L0=; b=tX0XzqpW6255wC7TEs+Dru8Z7sbtFxkz21OHXDntwVeSVGIJqULB713UENBc1MKqin ASznpLMzK5OXWHZWnsEMxPJSNqh2t8O3gdSFDNb4VlqggMgLimkevWy9T/Q3jCbT7bp+ Ymr96txXttGFzanXj77YfZxtqr4AnL0TofDJtn875wZKRtp13EpepA+spNQjfGURloU6 6meohN8p8hec9HncHJQS11lgdhnsd72vw8awxcCTpZk1scdN1x7bXBHgYjbchd3BF24Z M6Inqs3yCYCocXV/IyBkdDw96xMTlIVj2rH7UYwkkvuaPFtg6Ouc7ZVOi9aeL4syZjLS TAIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id r25-v6si44891otd.76.2018.06.19.09.41.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A7DA83F3E; Tue, 19 Jun 2018 16:41:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEDAF5D9C5; Tue, 19 Jun 2018 16:41:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2EC171800538; Tue, 19 Jun 2018 16:41:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfEWs011289 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 668812018077; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D55C2026D68; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:50 -0400 Message-Id: <0d6bfcf551588a39759879580fb8ab0163fbe589.1529426092.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] qemu: command: replace vlan= with netdev= for legacy nic 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Jun 2018 16:41:18 +0000 (UTC) VMs with hardcoded platform network devices are forced to use old style '-net nic' command line config. Current we use qemu's vlan option to hook this with the '-netdev' host side of things. However since qemu 1.2 there is '-net nic,netdev=X' option for explicitly referencing a netdev ID, which is more inline with typical VM commandlines, so let's switch to that Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 52 ++++++------------- .../arm-vexpressa9-basic.args | 4 +- 2 files changed, 19 insertions(+), 37 deletions(-) -- 2.17.1 -- 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 31a0b7761a..a2687c5693 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3354,15 +3354,15 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) static char * qemuBuildLegacyNicStr(virDomainNetDefPtr net, - int vlan) + int vlan ATTRIBUTE_UNUSED) { char *str; char macaddr[VIR_MAC_STRING_BUFLEN]; ignore_value(virAsprintf(&str, - "nic,macaddr=%s,vlan=%d%s%s%s%s", + "nic,macaddr=%s,netdev=host%s%s%s%s%s", virMacAddrFormat(&net->mac, macaddr), - vlan, + net->info.alias, (net->model ? ",model=" : ""), (net->model ? net->model : ""), (net->info.alias ? ",name=" : ""), @@ -3374,7 +3374,7 @@ qemuBuildLegacyNicStr(virDomainNetDefPtr net, char * qemuBuildNicDevStr(virDomainDefPtr def, virDomainNetDefPtr net, - int vlan, + int vlan ATTRIBUTE_UNUSED, unsigned int bootindex, size_t vhostfdSize, virQEMUCapsPtr qemuCaps) @@ -3523,10 +3523,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, virBufferAsprintf(&buf, ",host_mtu=%u", net->mtu); } - if (vlan == -1) - virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias); - else - virBufferAsprintf(&buf, ",vlan=%d", vlan); + virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias); virBufferAsprintf(&buf, ",id=%s", net->info.alias); virBufferAsprintf(&buf, ",mac=%s", virMacAddrFormat(&net->mac, macaddr)); @@ -3555,7 +3552,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, char * qemuBuildHostNetStr(virDomainNetDefPtr net, virQEMUDriverPtr driver, - int vlan, + int vlan ATTRIBUTE_UNUSED, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -3670,13 +3667,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, break; } - if (vlan >= 0) { - virBufferAsprintf(&buf, "vlan=%d,", vlan); - if (net->info.alias) - virBufferAsprintf(&buf, "name=host%s,", net->info.alias); - } else { - virBufferAsprintf(&buf, "id=host%s,", net->info.alias); - } + virBufferAsprintf(&buf, "id=host%s,", net->info.alias); if (is_tap) { if (vhostfdSize) { @@ -8494,22 +8485,20 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, goto cleanup; } + if (!(host = qemuBuildHostNetStr(net, driver, + vlan, + tapfdName, tapfdSize, + vhostfdName, vhostfdSize))) + goto cleanup; + virCommandAddArgList(cmd, "-netdev", host, NULL); + /* Possible combinations: * - * 1. Old way: -net nic,model=e1000,vlan=1 -net tap,vlan=1 - * 2. New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1 - * - * NB: The backend and frontend are reversed above + * Old way: -netdev type=tap,id=netdev1 \ + * -net nic,model=e1000,netdev=netdev1 + * New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1 */ - if (qemuDomainSupportsNicdev(def, net)) { - if (!(host = qemuBuildHostNetStr(net, driver, - vlan, - tapfdName, tapfdSize, - vhostfdName, vhostfdSize))) - goto cleanup; - virCommandAddArgList(cmd, "-netdev", host, NULL); - if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex, vhostfdSize, qemuCaps))) goto cleanup; @@ -8518,13 +8507,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, if (!(nic = qemuBuildLegacyNicStr(net, vlan))) goto cleanup; virCommandAddArgList(cmd, "-net", nic, NULL); - - if (!(host = qemuBuildHostNetStr(net, driver, - vlan, - tapfdName, tapfdSize, - vhostfdName, vhostfdSize))) - goto cleanup; - virCommandAddArgList(cmd, "-net", host, NULL); } ret = 0; diff --git a/tests/qemuxml2argvdata/arm-vexpressa9-basic.args b/tests/qemuxml2argvdata/arm-vexpressa9-basic.args index d9689b8ea8..1821ed4d38 100644 --- a/tests/qemuxml2argvdata/arm-vexpressa9-basic.args +++ b/tests/qemuxml2argvdata/arm-vexpressa9-basic.args @@ -27,7 +27,7 @@ server,nowait \ -dtb /arm.dtb \ -usb \ -drive file=/arm.raw,format=raw,if=sd,index=0 \ --net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=lan9118,name=net0 \ --net user,vlan=0,name=hostnet0 \ +-netdev user,id=hostnet0 \ +-net nic,macaddr=52:54:00:09:a4:37,netdev=hostnet0,model=lan9118,name=net0 \ -chardev pty,id=charserial0 \ -serial chardev:charserial0 From patchwork Tue Jun 19 16:40:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139227 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428738lji; Tue, 19 Jun 2018 09:41:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgPk8WS/U1l/cP6DHY+rFq1ZsHwkKOdIHau2IL6OjV4+Ug9k4smUHpx5VTWwcoVUxtyxeU X-Received: by 2002:a9d:2c26:: with SMTP id f35-v6mr11348411otb.336.1529426491439; Tue, 19 Jun 2018 09:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426491; cv=none; d=google.com; s=arc-20160816; b=huuIGM0zB/1IFdVFTj5RKVf3tjqZZpPGF21NJLMydFT8UMYyDpyKrpMzhpxgkJGiMw R2G2oBW3V8P+FvJAr16C38nYjKIHuUNNQKP9VAFfxTAyfde4cgPGYoYrEEDeH+6ot5A7 iVxE3ILZnaZ19ZyXaot2MX891csk/5PuyhAoUDfTkxP+Y07yTkX5Y1dRFQGDWeVjPN5H /jmo4EijTpZrxsJwlHfXH33VA6i0yAFD9Y9NdPwQiDVGHqbIbwJBBoVIXLZUVL4I6w/Z xNpvi2r7l1FDAiUofF3JHTfXohtwUSGZexlyi5FRgQ0ewQ6n6J5zPKgVS6Kn94WP2CBc 5SSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=6IQXMulBnoSGThq0DOhS5p0afk334vF4x87TWfkiO8E=; b=kF2ST/MhX0btrcRo0rFjloiSVdozv3xc2MyKBXN5+W6L0SGlYrswla1ZwOkzKZwGj4 rOqggFkzgnxL/83FWRARR9hCVIV65kJ8RGjS/uPcYQ8Muk6bKpC9ZPTHbn6TCmwSAxGM bCtemJuxbGg5JiSZWOPqx2D89j5Xt04SXUo+d+no4HlztcI2KNqkgd6jPQGJJptVN0Su svRoAJ0sXD+8UzMZ+LsauRWf1Szu7ck08VQ7CJ7SrNYevtzQT07gmxP+mfuuCAbm7gNs QJe+yKckokdNAxpO6pl52nXM3Po4iATdkGJ444MGbNBwJLXuL/UVnIZzRlAKD/MYEYlS AJ+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 22-v6si36025otj.449.2018.06.19.09.41.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A37FC04AC53; Tue, 19 Jun 2018 16:41:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03A06308BDB2; Tue, 19 Jun 2018 16:41:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A3860180053B; Tue, 19 Jun 2018 16:41:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfE9D011291 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8BC022018078; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 712592026D68; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:51 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] qemu: Remove vlan function arguments 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 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Jun 2018 16:41:30 +0000 (UTC) They are all unused now Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 23 +++++------------------ src/qemu/qemu_command.h | 3 --- src/qemu/qemu_hotplug.c | 3 +-- 3 files changed, 6 insertions(+), 23 deletions(-) -- 2.17.1 -- 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 a2687c5693..f2dbb3fadd 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3353,8 +3353,7 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) static char * -qemuBuildLegacyNicStr(virDomainNetDefPtr net, - int vlan ATTRIBUTE_UNUSED) +qemuBuildLegacyNicStr(virDomainNetDefPtr net) { char *str; char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -3374,7 +3373,6 @@ qemuBuildLegacyNicStr(virDomainNetDefPtr net, char * qemuBuildNicDevStr(virDomainDefPtr def, virDomainNetDefPtr net, - int vlan ATTRIBUTE_UNUSED, unsigned int bootindex, size_t vhostfdSize, virQEMUCapsPtr qemuCaps) @@ -3552,7 +3550,6 @@ qemuBuildNicDevStr(virDomainDefPtr def, char * qemuBuildHostNetStr(virDomainNetDefPtr net, virQEMUDriverPtr driver, - int vlan ATTRIBUTE_UNUSED, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -8194,7 +8191,6 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, } if (!(netdev = qemuBuildHostNetStr(net, driver, - -1, NULL, 0, NULL, 0))) goto error; @@ -8210,7 +8206,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, virCommandAddArg(cmd, netdev); VIR_FREE(netdev); - if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex, + if (!(nic = qemuBuildNicDevStr(def, net, bootindex, queues, qemuCaps))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error generating NIC -device string")); @@ -8239,7 +8235,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, virDomainDefPtr def, virDomainNetDefPtr net, virQEMUCapsPtr qemuCaps, - int vlan, unsigned int bootindex, virNetDevVPortProfileOp vmop, bool standalone, @@ -8486,7 +8481,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, } if (!(host = qemuBuildHostNetStr(net, driver, - vlan, tapfdName, tapfdSize, vhostfdName, vhostfdSize))) goto cleanup; @@ -8499,12 +8493,12 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, * New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1 */ if (qemuDomainSupportsNicdev(def, net)) { - if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex, + if (!(nic = qemuBuildNicDevStr(def, net, bootindex, vhostfdSize, qemuCaps))) goto cleanup; virCommandAddArgList(cmd, "-device", nic, NULL); } else { - if (!(nic = qemuBuildLegacyNicStr(net, vlan))) + if (!(nic = qemuBuildLegacyNicStr(net))) goto cleanup; virCommandAddArgList(cmd, "-net", nic, NULL); } @@ -8577,16 +8571,9 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver, for (i = 0; i < def->nnets; i++) { virDomainNetDefPtr net = def->nets[i]; - int vlan; - - /* VLANs are not used with -netdev and -device, so don't record them */ - if (qemuDomainSupportsNicdev(def, net)) - vlan = -1; - else - vlan = i; if (qemuBuildInterfaceCommandLine(driver, logManager, cmd, def, net, - qemuCaps, vlan, bootNet, vmop, + qemuCaps, bootNet, vmop, standalone, nnicindexes, nicindexes, chardevStdioLogd) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 0bcbf3018b..c78282eb09 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -83,10 +83,8 @@ qemuBuildChrDeviceStr(char **deviceStr, virDomainChrDefPtr chr, virQEMUCapsPtr qemuCaps); -/* With vlan == -1, use netdev syntax, else old hostnet */ char *qemuBuildHostNetStr(virDomainNetDefPtr net, virQEMUDriverPtr driver, - int vlan, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -95,7 +93,6 @@ char *qemuBuildHostNetStr(virDomainNetDefPtr net, /* Current, best practice */ char *qemuBuildNicDevStr(virDomainDefPtr def, virDomainNetDefPtr net, - int vlan, unsigned int bootindex, size_t vhostfdSize, virQEMUCapsPtr qemuCaps); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7c0c366b99..7a1bbc7c8c 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -994,7 +994,6 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, } if (!(netstr = qemuBuildHostNetStr(net, driver, - -1, tapfdName, tapfdSize, vhostfdName, vhostfdSize))) goto cleanup; @@ -1027,7 +1026,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, for (i = 0; i < vhostfdSize; i++) VIR_FORCE_CLOSE(vhostfd[i]); - if (!(nicstr = qemuBuildNicDevStr(vm->def, net, -1, 0, + if (!(nicstr = qemuBuildNicDevStr(vm->def, net, 0, queueSize, priv->qemuCaps))) goto try_remove; From patchwork Tue Jun 19 16:40:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 139229 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5428906lji; Tue, 19 Jun 2018 09:41:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJft1JRT3YrnFugssPAhgwU06aMeJ3iU1RXFsiMEJzyE76gLwxb6sP6Zw2YuErzUpbqShT6 X-Received: by 2002:a9d:1846:: with SMTP id t6-v6mr11683993ott.63.1529426500944; Tue, 19 Jun 2018 09:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529426500; cv=none; d=google.com; s=arc-20160816; b=GdA+9pYHw7TIahkUuZV0QM+TXkaFUBUwLn/jSZDEe8Jy9zYU1BfFibwxFnYfB4ct2l dJgeNrKQxNUndsEsK2AneG4d54pjiWYsF7MPQPH8XkmxV1Th1GaK32w0z/gFgCxVX7Xn 9paVYvPLa+rjjWQnXW/24GXOpADF1n5jz6yYJ3NI1xQwLWJZfaFQkqvTAi43k7kcQWBh txSHPBKOKXmaRcMgTWqQUROTDiLwEFx+jmepVPTL7tlfLdA9JX8qZcxr/Id4EaSkrb1d n5bIbCU2eloFQHeiVrcvmaFk9hjgcslsOnp4Fnfj7MG4Oyb0FBWuPq0lDHOa4sVg4SJy k7Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Pvn3JDVlC3z66dxdQUsXODZxaBJnXXUvyUeEjA2RI0s=; b=XKCJSfSBZhFc8Se9En/l0FM5s364PnXxA5txLaODa4H2kBJ5e33HOsSDucIHBUhmj6 iUmulorWRApiW4fIO4XaL9XAKRLcfd/eqjvKzEeDD+Qk5LXxs/EuScuSKEXHcndZQHge oAywx5FrH3zrfu6oxSAHdTz3c/+NUk736vdyS6kWP2DglA7p6sjJXgU1ZeksEAeyrRHN dRbxOe2hULN/o93VzgjqoRL8zDD9jW29rkBCATT0fPlIfDGqtgYcG/Ctr0QSslBD51p+ sKfrw5siGmebyMiztkacj6mYDj4arMmVYm7utkN7J6p6xB76DM3ubjMHtVz6R8Y14NlL RhDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id a20-v6si38645oiy.296.2018.06.19.09.41.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:41:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5923B13AA4; Tue, 19 Jun 2018 16:41:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FE165D9C7; Tue, 19 Jun 2018 16:41:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BFA4518052EA; Tue, 19 Jun 2018 16:41:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGfECw011292 for ; Tue, 19 Jun 2018 12:41:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE479201807A; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94A882026D68; Tue, 19 Jun 2018 16:41:14 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 19 Jun 2018 12:40:52 -0400 Message-Id: <9db0a71c70e54b2774892ef62cfa1c12bf4ee717.1529426092.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] qemu: command: vhost: cleanup error reporting 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 19 Jun 2018 16:41:40 +0000 (UTC) - Switch to cleanup: label and share free calls - Don't overwrite qemuBuildNicDevStr error Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) -- 2.17.1 -- 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 f2dbb3fadd..1ffcb5b1ae 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8147,11 +8147,12 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, char *netdev = NULL; unsigned int queues = net->driver.virtio.queues; char *nic = NULL; + int ret = -1; if (!qemuDomainSupportsNicdev(def, net)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Nicdev support unavailable")); - goto error; + goto cleanup; } switch ((virDomainChrType)net->data.vhostuser->type) { @@ -8160,7 +8161,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, net->data.vhostuser, net->info.alias, qemuCaps, false, chardevStdioLogd))) - goto error; + goto cleanup; break; case VIR_DOMAIN_CHR_TYPE_NULL: @@ -8179,7 +8180,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, virReportError(VIR_ERR_INTERNAL_ERROR, _("vhost-user type '%s' not supported"), virDomainChrTypeToString(net->data.vhostuser->type)); - goto error; + goto cleanup; } if (queues > 1 && @@ -8187,45 +8188,38 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("multi-queue is not supported for vhost-user " "with this QEMU binary")); - goto error; + goto cleanup; } if (!(netdev = qemuBuildHostNetStr(net, driver, NULL, 0, NULL, 0))) - goto error; + goto cleanup; if (virNetDevOpenvswitchGetVhostuserIfname(net->data.vhostuser->data.nix.path, &net->ifname) < 0) - goto error; + goto cleanup; virCommandAddArg(cmd, "-chardev"); virCommandAddArg(cmd, chardev); - VIR_FREE(chardev); virCommandAddArg(cmd, "-netdev"); virCommandAddArg(cmd, netdev); - VIR_FREE(netdev); if (!(nic = qemuBuildNicDevStr(def, net, bootindex, queues, qemuCaps))) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Error generating NIC -device string")); - goto error; + goto cleanup; } virCommandAddArgList(cmd, "-device", nic, NULL); - VIR_FREE(nic); - virObjectUnref(cfg); - return 0; - - error: + ret = 0; + cleanup: virObjectUnref(cfg); VIR_FREE(netdev); VIR_FREE(chardev); VIR_FREE(nic); - return -1; + return ret; } static int