From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KixLf-0004x9-Um for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:22:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KixLe-0004wO-I1 for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:22:03 -0400 Received: from [199.232.76.173] (port=51305 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KixLe-0004wG-8D for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:22:02 -0400 Received: from el-out-1112.google.com ([209.85.162.178]:56203) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KixLd-0004iV-VP for qemu-devel@nongnu.org; Thu, 25 Sep 2008 16:22:02 -0400 Received: by el-out-1112.google.com with SMTP id s27so151583ele.19 for ; Thu, 25 Sep 2008 13:22:01 -0700 (PDT) Message-ID: <48DBF2AB.1010803@codemonkey.ws> Date: Thu, 25 Sep 2008 15:20:59 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] loadvm not working References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Piotras wrote: > 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. > Heh, I literally just debugged this myself :-) That patch that introduced this is being reverted so it'll be fixed in a few hours. Regards, Anthony Liguori > Hope this helps, > > Piotr > > >