qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] vl.c -EAGAIN
       [not found] <200405161546.i4GFkHOR031617@treas.simtreas.ru>
@ 2004-05-17  9:14 ` Vladimir N. Oleynik
  2004-05-17  9:34 ` [Qemu-devel] portable to old compiler and kernel Vladimir N. Oleynik
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir N. Oleynik @ 2004-05-17  9:14 UTC (permalink / raw)
  To: qemu-devel

Hi.

I confused with code from vl.c (1714 line in 0.5.5)

	} else if (errno != -EAGAIN) {
		ioh->fd_read(ioh->opaque, NULL, -errno);

Why -EAGAIN? Copy-paste from kernel? ;-)

May be

	} else if (errno != EAGAIN) {
		ioh->fd_read(ioh->opaque, NULL, ioh->max_size);

?


--w
vodz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] portable to old compiler and kernel
       [not found] <200405161546.i4GFkHOR031617@treas.simtreas.ru>
  2004-05-17  9:14 ` [Qemu-devel] vl.c -EAGAIN Vladimir N. Oleynik
@ 2004-05-17  9:34 ` Vladimir N. Oleynik
  2004-05-17 11:17   ` J. Mayer
  1 sibling, 1 reply; 3+ messages in thread
From: Vladimir N. Oleynik @ 2004-05-17  9:34 UTC (permalink / raw)
  To: qemu-devel

Hi.

I make qemu 0.5.5 with egcs and kernel 2.2.X with changes:

1) target-i386.c have duplicate initialize (egcs stoped with errors):

[INDEX_op_cmpxchgb_T0_T1_EAX_cc] = CC_OSZAPC,
[INDEX_op_cmpxchgw_T0_T1_EAX_cc] = CC_OSZAPC,
[INDEX_op_cmpxchgl_T0_T1_EAX_cc] = CC_OSZAPC,
and with generate from
DEF_WRITEF( )


2) oss.c, hw/ dma.c fdc.c sb16.c
change macros
#define lwarn(...)
#define linfo(...)
#define ldebug(...)
to
#define lwarn(...)
#define linfo(args...)
#define ldebug(args...)

3) hw/fdc.c
#define FLOPPY_ERROR(fmt, args...) \
do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0)
to
#define FLOPPY_ERROR(fmt, args...) \
do { printf("FLOPPY ERROR: %s: " fmt, __FUNCTION__ , ##args); } while (0)

4) my glibc have declaration with "int" type from signal.h, I unset from vl.c
//extern void __sigaction();


My kernel 2.2.X dont have linux/if_tun.h
I make new preprocessor CONFIG_IF_TUN option and change vl.c

#ifdef CONFIG_IF_TUN
#include <linux/if_tun.h>
#endif

and

static int tun_open(char *ifname, int ifname_size)
{
#if CONFIG_IF_TUN
     struct ifreq ifr;
     int fd, ret;

     fd = open("/dev/net/tun", O_RDWR);
     if (fd < 0) {
         fprintf(stderr, "warning: could not open /dev/net/tun: no virtual 
network emulation\n");
         return -1;
     }
     memset(&ifr, 0, sizeof(ifr));
     ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
     pstrcpy(ifr.ifr_name, IFNAMSIZ, "tun%d");
     ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
     if (ret != 0) {
         close(fd);
#endif
         fprintf(stderr, "warning: could not configure /dev/net/tun: no virtual 
network emulation\n");
         return -1;
#if CONFIG_IF_TUN
     }
     printf("Connected to host network interface: %s\n", ifr.ifr_name);
     pstrcpy(ifname, ifname_size, ifr.ifr_name);
     fcntl(fd, F_SETFL, O_NONBLOCK);
     return fd;
#endif
}


Its works now.


--w
vodz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] portable to old compiler and kernel
  2004-05-17  9:34 ` [Qemu-devel] portable to old compiler and kernel Vladimir N. Oleynik
@ 2004-05-17 11:17   ` J. Mayer
  0 siblings, 0 replies; 3+ messages in thread
From: J. Mayer @ 2004-05-17 11:17 UTC (permalink / raw)
  To: qemu-devel

On Mon, 2004-05-17 at 11:34, Vladimir N. Oleynik wrote:
> Hi.
> 
Hello,

> 3) hw/fdc.c
> #define FLOPPY_ERROR(fmt, args...) \
> do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0)
> to
> #define FLOPPY_ERROR(fmt, args...) \
> do { printf("FLOPPY ERROR: %s: " fmt, __FUNCTION__ , ##args); } while (0)

Don't do that. __func__ is ISO C, __FUNCTION__ isn't.
You'd better add this somewhere:

#if __GNUC__ <= 2 && __GNUC_MINOR__ < 95
#define __func__ __FUNCTION__
#endif

which makes egcs happy and doesn't make gcc 3.xx warn about deprecated
features.

-- 
J. Mayer <l_indien@magic.fr>
Never organized

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-17 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200405161546.i4GFkHOR031617@treas.simtreas.ru>
2004-05-17  9:14 ` [Qemu-devel] vl.c -EAGAIN Vladimir N. Oleynik
2004-05-17  9:34 ` [Qemu-devel] portable to old compiler and kernel Vladimir N. Oleynik
2004-05-17 11:17   ` J. Mayer

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).