* [Qemu-devel] [PATCH] warnings in net.c
@ 2009-06-17 15:47 Ulrich Hecht
2009-06-17 16:06 ` Filip Navara
2009-06-17 16:23 ` [Qemu-devel] " Blue Swirl
0 siblings, 2 replies; 8+ messages in thread
From: Ulrich Hecht @ 2009-06-17 15:47 UTC (permalink / raw)
To: qemu-devel
removes unused slirp code and initializes ret in net_client_init()
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
net.c | 51 +--------------------------------------------------
1 files changed, 1 insertions(+), 50 deletions(-)
diff --git a/net.c b/net.c
index af9de73..91976b9 100644
--- a/net.c
+++ b/net.c
@@ -691,55 +691,6 @@ int slirp_is_inited(void)
return slirp_inited;
}
-static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
-{
-#ifdef DEBUG_SLIRP
- printf("slirp input:\n");
- hex_dump(stdout, buf, size);
-#endif
- slirp_input(buf, size);
- return size;
-}
-
-static int slirp_in_use;
-
-static void net_slirp_cleanup(VLANClientState *vc)
-{
- slirp_in_use = 0;
-}
-
-static int net_slirp_init(VLANState *vlan, const char *model, const char *name,
- int restricted, const char *ip)
-{
- if (slirp_in_use) {
- /* slirp only supports a single instance so far */
- return -1;
- }
- if (!slirp_inited) {
- slirp_inited = 1;
- slirp_init(restricted, ip);
-
- while (slirp_redirs) {
- struct slirp_config_str *config = slirp_redirs;
-
- slirp_redirection(NULL, config->str);
- slirp_redirs = config->next;
- qemu_free(config);
- }
-#ifndef _WIN32
- if (slirp_smb_export) {
- slirp_smb(slirp_smb_export);
- }
-#endif
- }
-
- slirp_vc = qemu_new_vlan_client(vlan, model, name, NULL, slirp_receive,
- NULL, net_slirp_cleanup, NULL);
- slirp_vc->info_str[0] = '\0';
- slirp_in_use = 1;
- return 0;
-}
-
static void net_slirp_redir_print(void *opaque, int is_udp,
struct in_addr *laddr, u_int lport,
struct in_addr *faddr, u_int fport)
@@ -2088,7 +2039,7 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
"vlan", "name", "fd", NULL
};
char buf[1024];
- int vlan_id, ret;
+ int vlan_id, ret = 0;
VLANState *vlan;
char *name = NULL;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] warnings in net.c
2009-06-17 15:47 [Qemu-devel] [PATCH] warnings in net.c Ulrich Hecht
@ 2009-06-17 16:06 ` Filip Navara
2009-06-17 16:37 ` [Qemu-devel] " Jan Kiszka
2009-06-18 9:56 ` [Qemu-devel] " Ulrich Hecht
2009-06-17 16:23 ` [Qemu-devel] " Blue Swirl
1 sibling, 2 replies; 8+ messages in thread
From: Filip Navara @ 2009-06-17 16:06 UTC (permalink / raw)
To: Ulrich Hecht; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
On Wed, Jun 17, 2009 at 5:47 PM, Ulrich Hecht <uli@suse.de> wrote:
> removes unused slirp code and initializes ret in net_client_init()
>
> Signed-off-by: Ulrich Hecht <uli@suse.de>
It is definitely not unused when CONFIG_SLIRP is defined. I'm damn sure I
use the code and that I was debugging it two days ago.
Best regards,
Filip Navara
[-- Attachment #2: Type: text/html, Size: 664 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] warnings in net.c
2009-06-17 15:47 [Qemu-devel] [PATCH] warnings in net.c Ulrich Hecht
2009-06-17 16:06 ` Filip Navara
@ 2009-06-17 16:23 ` Blue Swirl
1 sibling, 0 replies; 8+ messages in thread
From: Blue Swirl @ 2009-06-17 16:23 UTC (permalink / raw)
To: Ulrich Hecht; +Cc: qemu-devel
On 6/17/09, Ulrich Hecht <uli@suse.de> wrote:
> removes unused slirp code and initializes ret in net_client_init()
Totally bogus, you must be compiling without CONFIG_SLIRP.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] Re: [PATCH] warnings in net.c
2009-06-17 16:06 ` Filip Navara
@ 2009-06-17 16:37 ` Jan Kiszka
2009-06-18 10:01 ` Ulrich Hecht
2009-06-18 9:56 ` [Qemu-devel] " Ulrich Hecht
1 sibling, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2009-06-17 16:37 UTC (permalink / raw)
To: Filip Navara; +Cc: qemu-devel
Filip Navara wrote:
> On Wed, Jun 17, 2009 at 5:47 PM, Ulrich Hecht <uli@suse.de> wrote:
>
>> removes unused slirp code and initializes ret in net_client_init()
>>
>> Signed-off-by: Ulrich Hecht <uli@suse.de>
>
>
> It is definitely not unused when CONFIG_SLIRP is defined. I'm damn sure I
> use the code and that I was debugging it two days ago.
Right, the patch is incorrect. And even with --disable-slirp, it builds
fine for me as-is. Ulrich, what is your setup (configure parameters etc.)?
Also, the ret initialization appears to be unneeded on first glance. No
compiler around has a problem with it. What is your version / setup
here? And more important: What path requires the initialization (because
it remains unclear if ret=0 is the correct until we know the precise case).
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] warnings in net.c
2009-06-17 16:06 ` Filip Navara
2009-06-17 16:37 ` [Qemu-devel] " Jan Kiszka
@ 2009-06-18 9:56 ` Ulrich Hecht
2009-06-18 18:31 ` [Qemu-devel] " Jan Kiszka
1 sibling, 1 reply; 8+ messages in thread
From: Ulrich Hecht @ 2009-06-18 9:56 UTC (permalink / raw)
To: Filip Navara; +Cc: qemu-devel
On Wednesday 17 June 2009, Filip Navara wrote:
> On Wed, Jun 17, 2009 at 5:47 PM, Ulrich Hecht <uli@suse.de> wrote:
> > removes unused slirp code and initializes ret in net_client_init()
> >
> > Signed-off-by: Ulrich Hecht <uli@suse.de>
>
> It is definitely not unused when CONFIG_SLIRP is defined. I'm damn
> sure I use the code and that I was debugging it two days ago.
Er, yes, now that you mention it... I even grepped for net_client_init,
but I didn't find it.
Still, it dies thanks to -Werror with a plain "./configure". I guess
framing it with #ifdef CONFIG_SLIRP will do.
CU
Uli
--
Heute ist
- Tag der Aussiedlung (in Ägypten)
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] Re: [PATCH] warnings in net.c
2009-06-17 16:37 ` [Qemu-devel] " Jan Kiszka
@ 2009-06-18 10:01 ` Ulrich Hecht
0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Hecht @ 2009-06-18 10:01 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel
On Wednesday 17 June 2009, Jan Kiszka wrote:
> Also, the ret initialization appears to be unneeded on first glance.
> No compiler around has a problem with it. What is your version / setup
> here? And more important: What path requires the initialization
> (because it remains unclear if ret=0 is the correct until we know the
> precise case).
Honestly, I can't reproduce it. I guess this whole thing is bogus after
all. I shouldn't get up before 11 AM any more...
CU
Uli
--
Heute ist
- Tag der Aussiedlung (in Ägypten)
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] Re: [PATCH] warnings in net.c
2009-06-18 9:56 ` [Qemu-devel] " Ulrich Hecht
@ 2009-06-18 18:31 ` Jan Kiszka
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2009-06-18 18:31 UTC (permalink / raw)
To: Ulrich Hecht; +Cc: Filip Navara, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
Ulrich Hecht wrote:
> On Wednesday 17 June 2009, Filip Navara wrote:
>> On Wed, Jun 17, 2009 at 5:47 PM, Ulrich Hecht <uli@suse.de> wrote:
>>> removes unused slirp code and initializes ret in net_client_init()
>>>
>>> Signed-off-by: Ulrich Hecht <uli@suse.de>
>> It is definitely not unused when CONFIG_SLIRP is defined. I'm damn
>> sure I use the code and that I was debugging it two days ago.
>
> Er, yes, now that you mention it... I even grepped for net_client_init,
> but I didn't find it.
>
> Still, it dies thanks to -Werror with a plain "./configure". I guess
> framing it with #ifdef CONFIG_SLIRP will do.
It _is_ already framed, and it _does_ build flawlessly with
--disable-slirp here. You must be looking at a different version.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH] warnings in net.c
2009-07-03 15:09 ` [Qemu-devel] [PATCH 1/4] pipe argument should not be signed Ulrich Hecht
@ 2009-07-03 15:09 ` Ulrich Hecht
0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Hecht @ 2009-07-03 15:09 UTC (permalink / raw)
To: qemu-devel
removes unused slirp code and initializes ret in net_client_init()
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
net.c | 51 +--------------------------------------------------
1 files changed, 1 insertions(+), 50 deletions(-)
diff --git a/net.c b/net.c
index af9de73..91976b9 100644
--- a/net.c
+++ b/net.c
@@ -691,55 +691,6 @@ int slirp_is_inited(void)
return slirp_inited;
}
-static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
-{
-#ifdef DEBUG_SLIRP
- printf("slirp input:\n");
- hex_dump(stdout, buf, size);
-#endif
- slirp_input(buf, size);
- return size;
-}
-
-static int slirp_in_use;
-
-static void net_slirp_cleanup(VLANClientState *vc)
-{
- slirp_in_use = 0;
-}
-
-static int net_slirp_init(VLANState *vlan, const char *model, const char *name,
- int restricted, const char *ip)
-{
- if (slirp_in_use) {
- /* slirp only supports a single instance so far */
- return -1;
- }
- if (!slirp_inited) {
- slirp_inited = 1;
- slirp_init(restricted, ip);
-
- while (slirp_redirs) {
- struct slirp_config_str *config = slirp_redirs;
-
- slirp_redirection(NULL, config->str);
- slirp_redirs = config->next;
- qemu_free(config);
- }
-#ifndef _WIN32
- if (slirp_smb_export) {
- slirp_smb(slirp_smb_export);
- }
-#endif
- }
-
- slirp_vc = qemu_new_vlan_client(vlan, model, name, NULL, slirp_receive,
- NULL, net_slirp_cleanup, NULL);
- slirp_vc->info_str[0] = '\0';
- slirp_in_use = 1;
- return 0;
-}
-
static void net_slirp_redir_print(void *opaque, int is_udp,
struct in_addr *laddr, u_int lport,
struct in_addr *faddr, u_int fport)
@@ -2088,7 +2039,7 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
"vlan", "name", "fd", NULL
};
char buf[1024];
- int vlan_id, ret;
+ int vlan_id, ret = 0;
VLANState *vlan;
char *name = NULL;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-07-03 15:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 15:47 [Qemu-devel] [PATCH] warnings in net.c Ulrich Hecht
2009-06-17 16:06 ` Filip Navara
2009-06-17 16:37 ` [Qemu-devel] " Jan Kiszka
2009-06-18 10:01 ` Ulrich Hecht
2009-06-18 9:56 ` [Qemu-devel] " Ulrich Hecht
2009-06-18 18:31 ` [Qemu-devel] " Jan Kiszka
2009-06-17 16:23 ` [Qemu-devel] " Blue Swirl
-- strict thread matches above, loose matches on Subject: below --
2009-07-03 15:09 [Qemu-devel] [PATCH 0/4] linux-user syscall bugs Ulrich Hecht
2009-07-03 15:09 ` [Qemu-devel] [PATCH 1/4] pipe argument should not be signed Ulrich Hecht
2009-07-03 15:09 ` [Qemu-devel] [PATCH] warnings in net.c Ulrich Hecht
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).