From patchwork Mon Sep 21 21:58:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 520648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 304E81401CD for ; Tue, 22 Sep 2015 08:26:05 +1000 (AEST) Received: from localhost ([::1]:34466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze9X9-0001xi-4n for incoming@patchwork.ozlabs.org; Mon, 21 Sep 2015 18:26:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze96m-0008PA-1t for qemu-devel@nongnu.org; Mon, 21 Sep 2015 17:58:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze96l-0001GM-0u for qemu-devel@nongnu.org; Mon, 21 Sep 2015 17:58:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze96k-0001G1-Oa for qemu-devel@nongnu.org; Mon, 21 Sep 2015 17:58:46 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6710348; Mon, 21 Sep 2015 21:58:46 +0000 (UTC) Received: from red.redhat.com (ovpn-113-166.phx2.redhat.com [10.3.113.166]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8LLw4c6027229; Mon, 21 Sep 2015 17:58:45 -0400 From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 21 Sep 2015 15:58:00 -0600 Message-Id: <1442872682-6523-45-git-send-email-eblake@redhat.com> In-Reply-To: <1442872682-6523-1-git-send-email-eblake@redhat.com> References: <1442872682-6523-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: ehabkost@redhat.com, Jason Wang , armbru@redhat.com, Gerd Hoffmann , DirtY.iCE.hu@gmail.com, marcandre.lureau@redhat.com Subject: [Qemu-devel] [PATCH v5 44/46] net: Use correct type for bool flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org is_netdev is only used as a bool, so make it one. Signed-off-by: Eric Blake --- hw/usb/dev-network.c | 2 +- include/net/net.h | 2 +- net/net.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 97b2c2a..174bad4 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1392,7 +1392,7 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) qemu_opt_set(opts, "type", "nic", &error_abort); qemu_opt_set(opts, "model", "usb", &error_abort); - idx = net_client_init(opts, 0, &local_err); + idx = net_client_init(opts, false, &local_err); if (local_err) { error_report_err(local_err); return NULL; diff --git a/include/net/net.h b/include/net/net.h index c0e00ef..8c12eff 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -189,7 +189,7 @@ extern const char *host_net_devices[]; extern const char *legacy_tftp_prefix; extern const char *legacy_bootp_filename; -int net_client_init(QemuOpts *opts, int is_netdev, Error **errp); +int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp); int net_client_parse(QemuOptsList *opts_list, const char *str); int net_init_clients(void); void net_check_clients(void); diff --git a/net/net.c b/net/net.c index c1d407e..d1ec9aa 100644 --- a/net/net.c +++ b/net/net.c @@ -911,7 +911,7 @@ static int (* const net_client_init_fun[NET_CLIENT_DRIVER_MAX])( }; -static int net_client_init1(const void *object, int is_netdev, Error **errp) +static int net_client_init1(const void *object, bool is_netdev, Error **errp) { Netdev legacy = {0}; const Netdev *netdev; @@ -1021,7 +1021,7 @@ static void net_visit(Visitor *v, int is_netdev, void **object, Error **errp) } -int net_client_init(QemuOpts *opts, int is_netdev, Error **errp) +int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp) { void *object = NULL; Error *err = NULL; @@ -1083,7 +1083,7 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdict) qemu_opt_set(opts, "type", device, &error_abort); - net_client_init(opts, 0, &local_err); + net_client_init(opts, false, &local_err); if (local_err) { error_report_err(local_err); monitor_printf(mon, "adding host network device %s failed\n", device); @@ -1113,7 +1113,7 @@ void hmp_host_net_remove(Monitor *mon, const QDict *qdict) void netdev_add(QemuOpts *opts, Error **errp) { - net_client_init(opts, 1, errp); + net_client_init(opts, true, errp); } void qmp_netdev_add(QDict *qdict, QObject **ret, Error **errp) @@ -1381,7 +1381,7 @@ static int net_init_client(void *dummy, QemuOpts *opts, Error **errp) { Error *local_err = NULL; - net_client_init(opts, 0, &local_err); + net_client_init(opts, false, &local_err); if (local_err) { error_report_err(local_err); return -1; @@ -1395,7 +1395,7 @@ static int net_init_netdev(void *dummy, QemuOpts *opts, Error **errp) Error *local_err = NULL; int ret; - ret = net_client_init(opts, 1, &local_err); + ret = net_client_init(opts, true, &local_err); if (local_err) { error_report_err(local_err); return -1;