[Qemu-devel] sparc-linux-user fails to build on Linux/ppc

2007-11-27 Thread Thiemo Seufer
Some recent change broke compilation of sparc-linux-user on
Linux/ppc.


Thiemo


make -C i386-linux-user all
make[1]: Entering directory `/home/ths/qemu/qemu-work/i386-linux-user'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ths/qemu/qemu-work/i386-linux-user'
make -C arm-linux-user all
make[1]: Entering directory `/home/ths/qemu/qemu-work/arm-linux-user'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ths/qemu/qemu-work/arm-linux-user'
make -C armeb-linux-user all
make[1]: Entering directory `/home/ths/qemu/qemu-work/armeb-linux-user'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ths/qemu/qemu-work/armeb-linux-user'
make -C sparc-linux-user all
make[1]: Entering directory `/home/ths/qemu/qemu-work/sparc-linux-user'
gcc-3.4 -g  -Wl,-T,/home/ths/qemu/qemu-work/ppc.ld   -o qemu-sparc main.o 
syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o elfload.o linuxload.o 
uaccess.o libqemu.a gdbstub.o   -lm -lrt -lpthread
libqemu.a(translate-op.o): In function `dyngen_code':
/home/ths/qemu/qemu-work/sparc-linux-user/./op.h:5035: undefined reference to 
`do_fitoq'
/home/ths/qemu/qemu-work/sparc-linux-user/./op.h:5035: undefined reference to 
`do_fitoq'
libqemu.a(op.o): In function `op_fitoq':
/home/ths/qemu/qemu-work/target-sparc/op.c:1806: undefined reference to 
`do_fitoq'
collect2: ld returned 1 exit status
make[1]: *** [qemu-sparc] Error 1
make[1]: Leaving directory `/home/ths/qemu/qemu-work/sparc-linux-user'
make: *** [subdir-sparc-linux-user] Error 2




[Qemu-devel] [PATCH] [repost] Collecting block device statistics (v2)

2007-11-27 Thread Richard W.M. Jones
This is an updated patch for collecting block device statistics.  Thanks 
to several people on #qemu channel for giving me feedback about the 
first version[1].


This patch collects per-block-device statistics and allows them to be 
displayed in the monitor through a 'info blockstats' command.  It 
generalises the VMDK-only support for this which was added to KVM's 
version of QEMU.


Screenshot showing 'info blockstats' command being run for a Solaris 
guest which is doing some moderate disk activity:


http://www.annexia.org/tmp/Screenshot-QEMU-2.png

Rich.

[1] Previous patch was: 
http://lists.gnu.org/archive/html/qemu-devel/2007-11/msg00489.html


--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
Index: block.c
===
RCS file: /sources/qemu/qemu/block.c,v
retrieving revision 1.49
diff -u -r1.49 block.c
--- block.c	18 Nov 2007 01:44:35 -	1.49
+++ block.c	27 Nov 2007 11:33:04 -
@@ -521,8 +521,11 @@
 return ret;
 else if (ret != len)
 return -EINVAL;
-else
+else {
+	bs-rd_bytes += (unsigned) len;
+	bs-rd_ops ++;
 return 0;
+	}
 } else {
 return drv-bdrv_read(bs, sector_num, buf, nb_sectors);
 }
@@ -553,8 +556,11 @@
 return ret;
 else if (ret != len)
 return -EIO;
-else
+else {
+	bs-wr_bytes += (unsigned) len;
+	bs-wr_ops ++;
 return 0;
+	}
 } else {
 return drv-bdrv_write(bs, sector_num, buf, nb_sectors);
 }
@@ -902,6 +908,24 @@
 term_printf(\n);
 }
 }
+
+/* The info blockstats command. */
+void bdrv_info_stats (void)
+{
+BlockDriverState *bs;
+
+for (bs = bdrv_first; bs != NULL; bs = bs-next) {
+	term_printf (%s:
+		  rd_bytes=% PRIu64
+		  wr_bytes=% PRIu64
+		  rd_operations=% PRIu64
+		  wr_operations=% PRIu64
+		 \n,
+		 bs-device_name,
+		 bs-rd_bytes, bs-wr_bytes,
+		 bs-rd_ops, bs-wr_ops);
+}
+}
 #endif
 
 void bdrv_get_backing_filename(BlockDriverState *bs,
@@ -1064,6 +1088,7 @@
 BlockDriverCompletionFunc *cb, void *opaque)
 {
 BlockDriver *drv = bs-drv;
+BlockDriverAIOCB *ret;
 
 if (!drv)
 return NULL;
@@ -1076,7 +1101,15 @@
 buf += 512;
 }
 
-return drv-bdrv_aio_read(bs, sector_num, buf, nb_sectors, cb, opaque);
+ret = drv-bdrv_aio_read(bs, sector_num, buf, nb_sectors, cb, opaque);
+
+if (ret) {
+	/* Update stats even though technically transfer has not happened. */
+	bs-rd_bytes += (unsigned) nb_sectors * SECTOR_SIZE;
+	bs-rd_ops ++;
+}
+
+return ret;
 }
 
 BlockDriverAIOCB *bdrv_aio_write(BlockDriverState *bs, int64_t sector_num,
@@ -1084,6 +1117,7 @@
  BlockDriverCompletionFunc *cb, void *opaque)
 {
 BlockDriver *drv = bs-drv;
+BlockDriverAIOCB *ret;
 
 if (!drv)
 return NULL;
@@ -1093,7 +1127,15 @@
 memcpy(bs-boot_sector_data, buf, 512);
 }
 
-return drv-bdrv_aio_write(bs, sector_num, buf, nb_sectors, cb, opaque);
+ret = drv-bdrv_aio_write(bs, sector_num, buf, nb_sectors, cb, opaque);
+
+if (ret) {
+	/* Update stats even though technically transfer has not happened. */
+	bs-wr_bytes += (unsigned) nb_sectors * SECTOR_SIZE;
+	bs-wr_ops ++;
+}
+
+return ret;
 }
 
 void bdrv_aio_cancel(BlockDriverAIOCB *acb)
Index: block.h
===
RCS file: /sources/qemu/qemu/block.h,v
retrieving revision 1.2
diff -u -r1.2 block.h
--- block.h	17 Nov 2007 17:14:37 -	1.2
+++ block.h	27 Nov 2007 11:33:04 -
@@ -47,6 +47,7 @@
 
 #ifndef QEMU_IMG
 void bdrv_info(void);
+void bdrv_info_stats(void);
 #endif
 
 void bdrv_init(void);
Index: block_int.h
===
RCS file: /sources/qemu/qemu/block_int.h,v
retrieving revision 1.14
diff -u -r1.14 block_int.h
--- block_int.h	11 Nov 2007 02:51:16 -	1.14
+++ block_int.h	27 Nov 2007 11:33:04 -
@@ -114,6 +114,12 @@
 
 void *sync_aiocb;
 
+/* I/O stats (display with info blockstats). */
+uint64_t rd_bytes;
+uint64_t wr_bytes;
+uint64_t rd_ops;
+uint64_t wr_ops;
+
 /* NOTE: the following infos are only hints for real hardware
drivers. They are not used by the block driver */
 int cyls, heads, secs, translation;
Index: monitor.c
===
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.87
diff -u -r1.87 monitor.c
--- monitor.c	18 Nov 2007 01:44:35 -	1.87
+++ monitor.c	27 Nov 2007 11:33:05 -
@@ -260,6 +260,11 @@
 bdrv_info();
 }
 
+static void 

[Qemu-devel] another patch against head

2007-11-27 Thread Hotmail
The following is another patch against the head that lets me build it on 
Windows, as well as makes the adlib.c file debuggable.

Index: Makefile
===
RCS file: /sources/qemu/qemu/Makefile,v
retrieving revision 1.136
diff -r1.136 Makefile
17a18,20
 ifdef CONFIG_WIN32
 LIBS= -lmingw32 -mno-cygwin
 else
18a22
 endif
Index: cocoa.m
===
RCS file: /sources/qemu/qemu/cocoa.m,v
retrieving revision 1.14
diff -r1.14 cocoa.m
754c754
 [op beginSheetForDirectory:nil file:nil types:[NSArray 
arrayWithObjects:@img,@iso,@dmg,@qcow,@cow,@cloop,@vmdk,nil]
---
 [op beginSheetForDirectory:nil file:nil types:[NSArray 
 arrayWithObjects:@img,@iso,@dmg,@qcow,@qcow2,@cow,@cloop,@vmdk,nil]
Index: monitor.c
===
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.87
diff -r1.87 monitor.c
31a32
 #include qemu-timer.h
Index: hw/adlib.c
===
RCS file: /sources/qemu/qemu/hw/adlib.c,v
retrieving revision 1.8
diff -r1.8 adlib.c
25a26
 #include audio/audio.h
26a28
 #include qemu-timer.h





[Qemu-devel] [security bug]code_gen_buffer can be overflowed

2007-11-27 Thread TeLeMan

dyngen_code() can generate more than CODE_GEN_MAX_SIZE bytes, code_gen_buffer
can be overflowed. I hope this security bug will be fixed soon.
-- 
View this message in context: 
http://www.nabble.com/-security-bug-code_gen_buffer-can-be-overflowed-tf4886083.html#a13985284
Sent from the QEMU - Dev mailing list archive at Nabble.com.