Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-20 Thread Christoph Hellwig
On Thu, Jan 20, 2011 at 08:56:07AM +, Stefan Hajnoczi wrote: > eject, change, block_passwd, and others call the device name argument > "device" instead of "id". In the interest of a consistent external API > it would be nice to use "device" for the block_resize command too. Sure, I can do tha

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-20 Thread Stefan Hajnoczi
On Wed, Jan 19, 2011 at 06:02:48PM +0100, Christoph Hellwig wrote: > Index: qemu/hmp-commands.hx > === > --- qemu.orig/hmp-commands.hx 2011-01-19 17:47:10.444004409 +0100 > +++ qemu/hmp-commands.hx 2011-01-19 17:49:51.673254095 +0

[Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread Christoph Hellwig
Add a monitor command that allows resizing of block devices while qemu is running. It uses the existing bdrv_truncate method already used by qemu-img to do it's work. Compared to qemu-img the size parsing is very simplicistic, but I think having a properly numering object is more useful for non-h

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread Christoph Hellwig
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

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread Kevin Wolf
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,

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread 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 brok

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread Kevin Wolf
Am 19.01.2011 16:35, schrieb Christoph Hellwig: > On Mon, Jan 17, 2011 at 06:36:15PM +0100, Kevin Wolf wrote: >>> +.args_type = "id:s,size:l", >> >> size should be 'o' instead of 'l'. The latter may be too small on 32 bit >> hosts and doesn't support convenient suffixes: > > o actually fa

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-19 Thread Christoph Hellwig
On Mon, Jan 17, 2011 at 06:36:15PM +0100, Kevin Wolf wrote: > > +.args_type = "id:s,size:l", > > size should be 'o' instead of 'l'. The latter may be too small on 32 bit > hosts and doesn't support convenient suffixes: o actually fails for 2GB or more for me: (qemu) resize scratch 2047

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-18 Thread Christoph Hellwig
On Mon, Jan 17, 2011 at 06:36:15PM +0100, Kevin Wolf wrote: > size should be 'o' instead of 'l'. The latter may be too small on 32 bit > hosts and doesn't support convenient suffixes: Fixed. > Hm, is there a real reason except that CD-ROMs are read-only? The code > below seems to take read-only d

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-17 Thread Kevin Wolf
Am 14.01.2011 17:20, schrieb Christoph Hellwig: > Add a monitor command that allows resizing of block devices while > qemu is running. It uses the existing bdrv_truncate method already > used by qemu-img to do it's work. Compared to qemu-img the size > parsing is very simplicistic, but I think ha

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-17 Thread Christoph Hellwig
On Mon, Jan 17, 2011 at 11:28:47AM +, Stefan Hajnoczi wrote: > > + ? ?if (bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM) { > > + ? ? ? ?error_report("Can not resize CDROM devices\n"); > > + ? ? ? ?return -1; > > + ? ?} > > Hrm...BDRV_TYPE_FLOPPY probably too? If we want to be consistent, yes. Or

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-17 Thread Stefan Hajnoczi
On Fri, Jan 14, 2011 at 4:20 PM, Christoph Hellwig wrote: > +STEXI > +@item resize > +@findex resize > +Resize a block image while a guest is running.  Usuaully requires guest s/Usuaully/Usually/ > +action to see the updated size.  Resize to a lower size is supported, > +but should be used with

[Qemu-devel] [PATCH 1/3] block: add resize monitor command

2011-01-14 Thread Christoph Hellwig
Add a monitor command that allows resizing of block devices while qemu is running. It uses the existing bdrv_truncate method already used by qemu-img to do it's work. Compared to qemu-img the size parsing is very simplicistic, but I think having a properly numering object is more useful for non-h