From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48153 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfaSE-0005tM-GS for qemu-devel@nongnu.org; Wed, 19 Jan 2011 11:00:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfaRr-0006WD-J7 for qemu-devel@nongnu.org; Wed, 19 Jan 2011 11:00:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfaRr-0006Vc-8G for qemu-devel@nongnu.org; Wed, 19 Jan 2011 10:59:51 -0500 Message-ID: <4D370ACF.2030402@redhat.com> Date: Wed, 19 Jan 2011 17:01:19 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command References: <20110114162044.GA19114@lst.de> <20110114162057.GA19184@lst.de> <4D347E0F.4040000@redhat.com> <20110119153544.GA6987@lst.de> <4D3707F0.3050608@redhat.com> <20110119155234.GB7394@lst.de> In-Reply-To: <20110119155234.GB7394@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org, Luiz Capitulino Am 19.01.2011 16:52, schrieb Christoph Hellwig: > On Wed, Jan 19, 2011 at 04:49:04PM +0100, Kevin Wolf wrote: >>> (qemu) resize scratch 2047 >>> resize scratch 2047 >>> (qemu) >>> (qemu) resize scrarch 2048 >>> resize scrarch 2048 >>> invalid size >>> >>> for l these worked fine. >> >> Hm, yeah, 'o' uses ssize_t instead of int64_t, so it's broken on a 32 >> bit host as well. Though I assume that you use a 64 bit host, and I >> can't really see what's the problem there... > > This is a test on a 32-bit host. The target_long of "l" worked fine > because a kvm enabled qemu always builds for an x86-64 target, even > with a 32-bit host. Oh, okay, then it makes perfect sense. We should fix 'o' then to use int64_t. The patch below should do it. strtosz (which is used by 'o') has the same problem in git master. There's a fix by Jes, so be sure to test this on the block branch. Kevin diff --git a/monitor.c b/monitor.c index d291158..0cda3da 100644 --- a/monitor.c +++ b/monitor.c @@ -4162,7 +4162,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, break; case 'o': { - ssize_t val; + int64_t val; char *end; while (qemu_isspace(*p)) {