Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTl7Y-0000sH-Gg for qemu-devel@nongnu.org; Mon, 15 Nov 2004 12:58:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTl7X-0000rv-Q1 for qemu-devel@nongnu.org; Mon, 15 Nov 2004 12:58:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTl7X-0000rZ-G1 for qemu-devel@nongnu.org; Mon, 15 Nov 2004 12:58:31 -0500 Received: from [219.127.74.120] (helo=sakura.ninth-nine.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CTky0-0000aN-Ni for qemu-devel@nongnu.org; Mon, 15 Nov 2004 12:48:41 -0500 Date: Tue, 16 Nov 2004 02:48:34 +0900 (JST) Message-Id: <200411151748.iAFHmYQ1019323@sakura.ninth-nine.com> From: Norikatsu Shigemura Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] qemu -boot d -cdrom /dev/cd0 on FreeBSD is not good Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: freebsd-hackers@FreeBSD.org I tried to install Windows XP SP2 on qemu over FreeBSD 6-current like following command, but failed. # qemu -boot d -cdrom /dev/cd0 windows.img Because find_image_format on qemu/block.c is failed. This problem can be confirmed like following program. - - - - - - - - - - - - - - - - - - - - - - - - #include #include #include int main(void) { char buf[2048]; int fd = open("/dev/cd0", O_RDONLY); if( read(fd, buf, sizeof(buf)) < 0 ) { /* no problem */ perror("[1] read error."); } if( read(fd, buf, sizeof(buf) / 2) < 0 ) { /* problem */ perror("[2] read error."); } } - - - - - - - - - - - - - - - - - - - - - - - - Adhoc-ly, I changed "buf" size to 2048. and confirmed this problem was fixed. - - - - - - - - - - - - - - - - - - - - - - - - static BlockDriver *find_image_format(const char *filename) { int fd, ret, score, score_max; BlockDriver *drv1, *drv; uint8_t buf[1024]; => buf[2048] (snip) ret = read(fd, buf, sizeof(buf)); if (ret < 0) { close(fd); return NULL; } (snip) - - - - - - - - - - - - - - - - - - - - - - - - Obtained from: qemu-0.6.1 I think magic number 2048 is sector size, but I don't know how to get valid read size. Anyone, do you have any idea?