qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL for-2.7 15/15] net: Use correct type for bool flag
Date: Tue, 19 Jul 2016 13:39:37 +0200	[thread overview]
Message-ID: <1468928377-20384-16-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1468928377-20384-1-git-send-email-armbru@redhat.com>

From: Eric Blake <eblake@redhat.com>

is_netdev is only used as a bool, so make it one.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1468468228-27827-14-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 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 3ced4ba..c0f1193 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1396,7 +1396,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 48382c3..e8d9e9e 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -203,7 +203,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 4a7f392..c124b11 100644
--- a/net/net.c
+++ b/net/net.c
@@ -960,7 +960,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;
@@ -1060,7 +1060,7 @@ static int net_client_init1(const void *object, int is_netdev, 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;
@@ -1153,7 +1153,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);
@@ -1183,7 +1183,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)
@@ -1481,7 +1481,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;
@@ -1495,7 +1495,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;
-- 
2.5.5

  parent reply	other threads:[~2016-07-19 11:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 11:39 [Qemu-devel] [PULL for-2.7 00/15] QAPI patches for 2016-07-19 Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 01/15] qapi: change QmpOutputVisitor to QSLIST Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 02/15] qapi: change QmpInputVisitor " Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 03/15] net: use Netdev instead of NetClientOptions in client init Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 04/15] qapi: Require all branches of flat union enum to be covered Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 05/15] qapi: Special case c_name() for empty type Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 06/15] qapi: Hide tag_name data member of variants Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 07/15] qapi: Add type.is_empty() helper Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 08/15] qapi: Drop useless gen_err_check() Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 09/15] qapi-event: Simplify visit of non-implicit data Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 10/15] qapi: Plumb in 'boxed' to qapi generator lower levels Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 11/15] qapi: Implement boxed types for commands/events Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 12/15] block: Simplify block_set_io_throttle Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 13/15] block: Simplify drive-mirror Markus Armbruster
2016-07-19 11:39 ` [Qemu-devel] [PULL for-2.7 14/15] qapi: Change Netdev into a flat union Markus Armbruster
2016-07-19 17:22   ` [Qemu-devel] [PATCH 14/15] fixup! " Eric Blake
2016-07-19 11:39 ` Markus Armbruster [this message]
2016-07-19 16:56 ` [Qemu-devel] [PULL for-2.7 00/15] QAPI patches for 2016-07-19 Peter Maydell
2016-07-19 17:05   ` Eric Blake
2016-07-19 17:06   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468928377-20384-16-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).