From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 15 17:48:36 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9E1E16A4CE for ; Mon, 15 Nov 2004 17:48:36 +0000 (GMT) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2522F43D2D for ; Mon, 15 Nov 2004 17:48:36 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.1/8.13.1/NinthNine) with SMTP id iAFHmYQ1019323; Tue, 16 Nov 2004 02:48:34 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Tue, 16 Nov 2004 02:48:34 +0900 (JST) Message-Id: <200411151748.iAFHmYQ1019323@sakura.ninth-nine.com> From: Norikatsu Shigemura To: qemu-devel@nongnu.org X-Mailer: Sylpheed version 0.9.99-gtk2-20041024 (GTK+ 2.4.13; i386-portbld-freebsd6.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.11 (sakura.ninth-nine.com [219.127.74.121]); Tue, 16 Nov 2004 02:48:34 +0900 (JST) cc: freebsd-hackers@FreeBSD.org Subject: qemu -boot d -cdrom /dev/cd0 on FreeBSD is not good X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 17:48:36 -0000 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?