Patchwork [1/3] block: add resize monitor command

login
register
mail settings
Submitter Kevin Wolf
Date Jan. 19, 2011, 4:01 p.m.
Message ID <4D370ACF.2030402@redhat.com>
Download mbox | patch
Permalink /patch/79489/
State New
Headers show

Comments

Kevin Wolf - Jan. 19, 2011, 4:01 p.m.
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

                 while (qemu_isspace(*p)) {
Christoph Hellwig - Jan. 19, 2011, 4:31 p.m.
On Wed, Jan 19, 2011 at 05:01:19PM +0100, Kevin Wolf wrote:
> 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.

The larger sizes work fine on the block branch.

Patch

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;