From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kix7X-0005nP-Mq for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:07:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kix7W-0005mv-Aw for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:07:27 -0400 Received: from [199.232.76.173] (port=52699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kix7W-0005ms-50 for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:07:26 -0400 Received: from ik-out-1112.google.com ([66.249.90.183]:65413) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kix7V-0002HB-Kc for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:07:25 -0400 Received: by ik-out-1112.google.com with SMTP id c21so454403ika.2 for ; Thu, 25 Sep 2008 13:07:24 -0700 (PDT) Message-ID: Date: Thu, 25 Sep 2008 21:07:24 +0100 From: Piotras MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: [Qemu-devel] loadvm not working 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 Hi, I discovered a bug that prevents loadvm from working correctly in current repository version (related to warning "qemu: warning: instance 0 of device '' not present in current VM"). The implementation of functions qemu_get_be16 and qemu_get_be32 (in file vl.c) relies on implicit conversion of signed byte (int8_t) values returned by qemu_get_byte to multi-byte integer types. When value to be converted is negative, the result is incorrect. There are two fixes possible: 1) change return type of qemu_get_byte to unsigned (uint8_t) 2) add explicit casts in qemu_get_be16 and qemu_get_be32 For consistency with qemu_get_be16 and qemu_get_be32, first solution looks better. However I didn't examine all other calls to qemu_get_byte for possible problems. Hope this helps, Piotr