From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>,
armbru@redhat.com, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v6 10/16] net: Use correct type for bool flag
Date: Wed, 23 Dec 2015 13:55:39 -0700 [thread overview]
Message-ID: <1450904145-17721-11-git-send-email-eblake@redhat.com> (raw)
In-Reply-To: <1450904145-17721-1-git-send-email-eblake@redhat.com>
is_netdev is only used as a bool, so make it one.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v6: rebase to latest context
---
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 a5ca4ee..401b91d 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -185,7 +185,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 a6f9be9..14c6021 100644
--- a/net/net.c
+++ b/net/net.c
@@ -973,7 +973,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;
@@ -1083,7 +1083,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;
@@ -1145,7 +1145,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);
@@ -1175,7 +1175,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)
@@ -1461,7 +1461,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;
@@ -1475,7 +1475,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.4.3
next prev parent reply other threads:[~2015-12-23 20:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 20:55 [Qemu-devel] [PATCH v6 00/16] qapi netdev_add introspection (post-introspection cleanups subset F) Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 01/16] net: use Netdev instead of NetClientOptions in client init Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 02/16] qapi: Avoid use of 'data' member of qapi unions Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 03/16] qapi: Forbid empty unions and useless alternates Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 04/16] qapi: Drop useless 'data' member of unions Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 05/16] qapi: Hide tag_name data member of variants Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 06/16] qapi: Plumb in 'box' to qapi generator lower levels Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 07/16] qapi: Implement boxed types for commands/events Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 08/16] qapi: support implicit structs in OptsVisitor Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 09/16] qapi: Change Netdev into a flat union Eric Blake
2015-12-23 20:55 ` Eric Blake [this message]
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 11/16] net: Complete qapi-fication of netdev_add Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 12/16] qapi: Allow anonymous base for flat union Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 13/16] qapi: Use anonymous base in SchemaInfo Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 14/16] qapi: Use anonymous base in Netdev Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 15/16] qapi: Use anonymous base in CpuInfo Eric Blake
2015-12-23 20:55 ` [Qemu-devel] [PATCH v6 16/16] qapi: Populate info['name'] for each entity Eric Blake
2015-12-23 20:58 ` [Qemu-devel] [PATCH v6 00/16] qapi netdev_add introspection (post-introspection cleanups subset F) Eric Blake
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=1450904145-17721-11-git-send-email-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=jasowang@redhat.com \
--cc=kraxel@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).