Re: [Qemu-devel] [v2 Patch 1/9]block: Framework for reopening image files safely

2012-08-14 Thread Supriya Kannery
On 08/03/2012 01:49 AM, Luiz Capitulino wrote: > On Tue, 31 Jul 2012 03:04:22 +0530 > Supriya Kannery wrote: > >> + >> +void bdrv_reopen_commit(BlockDriverState *bs, BDRVReopenState *rs) >> +{ >> +BlockDriver *drv = bs->drv; >> + >> +drv-

Re: [Qemu-devel] [v2 Patch 1/9]block: Framework for reopening image files safely

2012-08-14 Thread Supriya Kannery
On 08/09/2012 02:43 AM, Jeff Cody wrote: On 07/30/2012 05:34 PM, Supriya Kannery wrote: Struct BDRVReopenState along with three reopen related functions introduced for handling reopening of images safely. This can be extended by each of the block drivers to reopen respective image files

Re: [Qemu-devel] [v2 Patch 1/9]block: Framework for reopening image files safely

2012-08-14 Thread Supriya Kannery
On 08/09/2012 06:32 PM, Jeff Cody wrote: > On 08/09/2012 05:20 AM, Kevin Wolf wrote: >> Am 09.08.2012 06:26, schrieb Jeff Cody: >>> On 07/30/2012 05:34 PM, Supriya Kannery wrote: >>>> + >>>> +void bdrv_reopen(BlockDriverState *bs, int bdrv_flags, Error

Re: [Qemu-devel] [v2 Patch 2/9]block: raw-posix image file reopen

2012-08-14 Thread Supriya Kannery
On 07/31/2012 10:47 PM, Eric Blake wrote: > On 07/30/2012 03:34 PM, Supriya Kannery wrote: >> +s->fd = dup3(raw_rs->stash_s->fd, s->fd, O_CLOEXEC); > > You called it out in your cover letter, but just pointing out that this > is one of the locations that needs a

Re: [Qemu-devel] [v2 Patch 2/9]block: raw-posix image file reopen

2012-08-14 Thread Supriya Kannery
On 08/10/2012 07:15 PM, Corey Bryant wrote: > > > On 07/30/2012 05:34 PM, Supriya Kannery wrote: >> +static int raw_reopen_prepare(BlockDriverState *bs, BDRVReopenState >> **prs, >> + int flags) >> +{ >> + BDRVRawReopenState *raw_rs = g_malloc0(sizeof(BDR

[Qemu-devel] [RFC Patch 0/7]Qemu: Dynamic host pagecache change

2012-01-31 Thread Supriya Kannery
For changing host pagecache setting of a running VM, it is important to have a safe way of reopening its image file. Following patchset introduces: * a generic way to reopen image files safely. In this approach, before reopening an image, for each block driver, its state will be

[Qemu-devel] [RFC Patch 2/7]Qemu: Error classes for file reopen and data sync failure

2012-01-31 Thread Supriya Kannery
New error classes defined for file reopen failure and data sync error Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig

[Qemu-devel] [RFC Patch 1/7]Qemu: Enhance "info block" to display host cache setting

2012-01-31 Thread Supriya Kannery
-32.raw ro=0 drv=raw encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 20 qmp-commands.hx |2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) Index: qemu/qapi-schema.json === --- qemu.o

[Qemu-devel] [RFC Patch 3/7]Qemu: Cmd "block_set_hostcache" for dynamic cache change

2012-01-31 Thread Supriya Kannery
New command "block_set_hostcache" added for dynamically changing host pagecache setting of a block device. Usage: block_set_hostcache = block device = on/off Example: (qemu) block_set_hostcache ide0-hd0 off Signed-off-by: Supriya Kannery --- block.c

[Qemu-devel] [RFC Patch 4/7]Qemu: Framework for reopening image files safely

2012-01-31 Thread Supriya Kannery
Struct BDRVReopenState along with three reopen related functions introduced for handling reopening of images safely. This can be extended by each of the block drivers to reopen respective image files. Signed-off-by: Supriya Kannery Index: qemu/block.c

[Qemu-devel] [RFC Patch 6/7]Qemu: raw-win32 image file reopen

2012-01-31 Thread Supriya Kannery
win32 driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/raw-win32.c

[Qemu-devel] [RFC Patch 7/7]Qemu: vmdk image file reopen

2012-01-31 Thread Supriya Kannery
vmdk driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache flag dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/vmdk.c

[Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen

2012-01-31 Thread Supriya Kannery
raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/raw.c

Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen

2012-02-13 Thread Supriya Kannery
On 02/02/2012 05:45 AM, Michael Roth wrote: On 01/31/2012 09:07 PM, Supriya Kannery wrote: raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. + + /* Flags that can be set using

Re: [Qemu-devel] [RFC Patch 2/7]Qemu: Error classes for file reopen and data sync failure

2012-02-13 Thread Supriya Kannery
On 02/07/2012 01:26 PM, Stefan Hajnoczi wrote: On Wed, Feb 01, 2012 at 08:36:28AM +0530, Supriya Kannery wrote: Index: qemu/qerror.c === --- qemu.orig/qerror.c +++ qemu/qerror.c @@ -108,6 +108,14 @@ static const QErrorStringTable

Re: [Qemu-devel] [RFC Patch 1/7]Qemu: Enhance "info block" to display host cache setting

2012-02-13 Thread Supriya Kannery
On 02/08/2012 05:30 PM, Luiz Capitulino wrote: On Wed, 01 Feb 2012 08:36:14 +0530 Supriya Kannery wrote: Enhance "info block" to display hostcache setting for each block device. Example: (qemu) info block ide0-hd0: removable=0 file=../rhel6-32.raw ro=0 drv=raw encrypted=0 E

Re: [Qemu-devel] [RFC Patch 3/7]Qemu: Cmd "block_set_hostcache" for dynamic cache change

2012-02-13 Thread Supriya Kannery
On 02/08/2012 05:37 PM, Luiz Capitulino wrote: On Wed, 01 Feb 2012 08:36:41 +0530 Supriya Kannery wrote: +ret = bdrv_open(bs, bs->filename, bdrv_flags, drv); +if (ret< 0) { +/* Reopen failed. Try to open with original flags */ +qerror_report(QERR_REOPEN_FILE_

Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen

2012-02-13 Thread Supriya Kannery
On 02/08/2012 08:24 PM, Kevin Wolf wrote: Am 01.02.2012 04:07, schrieb Supriya Kannery: raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. +typedef struct BDRVRawReopenState

Re: [Qemu-devel] [RFC Patch 6/7]Qemu: raw-win32 image file reopen

2012-02-13 Thread Supriya Kannery
On 02/08/2012 08:32 PM, Kevin Wolf wrote: Am 01.02.2012 04:07, schrieb Supriya Kannery: win32 driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. + +if (osvi.dwMajorVersion>= WINDOWS_VI

Re: [Qemu-devel] [RFC Patch 4/7]Qemu: Framework for reopening image files safely

2012-02-13 Thread Supriya Kannery
On 02/08/2012 08:37 PM, Kevin Wolf wrote: Am 01.02.2012 04:06, schrieb Supriya Kannery: Struct BDRVReopenState along with three reopen related functions introduced for handling reopening of images safely. This can be extended by each of the block drivers to reopen respective image files

Re: [Qemu-devel] [RFC Patch 4/7]Qemu: Framework for reopening image files safely

2012-02-14 Thread Supriya Kannery
On 02/07/2012 03:38 PM, Stefan Hajnoczi wrote: On Wed, Feb 01, 2012 at 08:36:58AM +0530, Supriya Kannery wrote: Struct BDRVReopenState along with three reopen related functions introduced for handling reopening of images safely. This can be extended by each of the block drivers to reopen

Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen

2012-02-14 Thread Supriya Kannery
On 02/07/2012 03:47 PM, Stefan Hajnoczi wrote: On Wed, Feb 01, 2012 at 08:37:12AM +0530, Supriya Kannery wrote: +/* stash state before reopen */ +raw_rs->stash_s = g_malloc0(sizeof(BDRVRawState)); +memcpy(raw_rs->stash_s, s, sizeof(BDRVRawState)); Copying a struct is fragile

[Qemu-devel] [RFC Patch 0/3]Qemu: Enable dynamic cache change through qemu monitor

2011-05-16 Thread Supriya Kannery
 Currently cache setting of a block device cannot be changed without restarting a running VM. Following patchset is for enabling dynamic change of cache setting for block devices through qemu monitor. Code changes are based on patches from Christoph Hellwig and Prerna Saxena. Monitor command

[Qemu-devel] [RFC Patch 1/3]Qemu: Enhance "info block" to display cache setting

2011-05-16 Thread Supriya Kannery
cow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery Signed-off-by: Prerna Saxena --- block.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) Index: qemu/block.c === --- qemu.orig/block.c +++ qem

[Qemu-devel] [RFC Patch 2/3]Qemu: New error classes for file reopen and device insertion

2011-05-16 Thread Supriya Kannery
New errors defined for device insertion and file reopen Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig/qerror.c

[Qemu-devel] [RFC Patch 3/3]Qemu: Add command "cache_set" for dynamic cache change

2011-05-16 Thread Supriya Kannery
Add monitor command "cache_set" for dynamic cache change Signed-off-by: Christoph Hellwig Signed-off-by: Supriya Kannery --- block.c | 53 + block.h |2 ++ blockdev.c | 20

Re: [Qemu-devel] [RFC Patch 1/3]Qemu: Enhance "info block" to display cache setting

2011-05-17 Thread supriya kannery
Kevin Wolf wrote: Am 16.05.2011 20:10, schrieb Supriya Kannery: Enhance "info block" to display cache setting Example: (qemu) info block ide0-hd0: type=hd removable=0 file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Enhanced to include "cache" setting: (qemu) info

Re: [Qemu-devel] [RFC Patch 0/3]Qemu: Enable dynamic cache change through qemu monitor

2011-05-17 Thread supriya kannery
Christoph Hellwig wrote: Why are you even trying this again? Enabling control of cache setting from qemu monitor will help users/admins to accomplish cache value change without depending on the guest. As explained very clearly last time you can't change from a writeback-style to a write-throu

Re: [Qemu-devel] [RFC Patch 0/3]Qemu: Enable dynamic cache change through qemu monitor

2011-05-17 Thread supriya kannery
Anthony Liguori wrote: On 05/16/2011 03:23 PM, Christoph Hellwig wrote: Why are you even trying this again? As explained very clearly last time you can't change from a writeback-style to a write-through style I/O from the monitor without creating massive data integrity problems. To further c

[Qemu-devel] [V2 0/2]Qemu: Enable dynamic hostcache change through monitor

2011-05-19 Thread Supriya Kannery
 Currently host page cache setting for a block device cannot be changed without restarting a running VM. Following patchset [V2] is for enabling dynamic change of host cache setting for devices through qemu monitor. Changes from patchset V1: 1. Support of dynamic cache change only for hostcac

[Qemu-devel] [V2 2/2]Qemu: Add commands "hostcache_set" and "hostcache_get"

2011-05-19 Thread Supriya Kannery
Monitor commands "hostcache_set" and "hostcache_get" added for dynamic host cache change and display of host cache setting respectively. Signed-off-by: Supriya Kannery --- block.c | 48 block.h |2 ++ bl

[Qemu-devel] [V2 1/2]Qemu: New error classes for file reopen and device insertion

2011-05-19 Thread Supriya Kannery
New errors defined for device insertion and file reopen Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig/qerror.c

Re: [Qemu-devel] [RFC Patch 0/3]Qemu: Enable dynamic cache change through qemu monitor

2011-05-19 Thread Supriya Kannery
On 05/17/2011 09:11 PM, Christoph Hellwig wrote: On Mon, May 16, 2011 at 04:10:21PM -0500, Anthony Liguori wrote: To further clarify: Today cache=none|writethrough|writeback does two things. It: 1) Changes the WCE flag that's visible to the guest 2) Determines whether the host page cache is

Re: [Qemu-devel] [V2 2/2]Qemu: Add commands "hostcache_set" and "hostcache_get"

2011-05-22 Thread Supriya Kannery
On 05/20/2011 01:50 PM, Stefan Hajnoczi wrote: On Thu, May 19, 2011 at 10:38:03PM +0530, Supriya Kannery wrote: Monitor commands "hostcache_set" and "hostcache_get" added for dynamic host cache change and display of host cache setting respectively. A generic command for c

[Qemu-devel] [V3 1/3] Enhance "info block" to display hostcache setting

2011-06-17 Thread Supriya Kannery
hostcache=true file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 21 + qmp-commands.hx |2 ++ 2 files changed, 19 insertions(+), 4 deletions(-)

[Qemu-devel] [V3 0/3]block: Dynamically change hostcache setting using new "block_set" command

2011-06-17 Thread Supriya Kannery
Currently host page cache setting for a block device cannot be changed without restarting a running VM. Following patchset [V3] is for enabling dynamic change of hostcache setting for block devices through qemu monitor and QMP. Code changes are based on patches from Christoph Hellwig and Prerna

[Qemu-devel] [V2 3/3] Command "block_set" for dynamic block params change

2011-06-17 Thread Supriya Kannery
New command "block_set" added for dynamically changing any of the block device parameters. For now, dynamic setting of hostcache params using this command is implemented. Other block device parameters, can be integrated in similar lines. Signed-off-by: Supriya Kannery --

[Qemu-devel] [V3 2/3] Error classes for file reopen and device insertion

2011-06-17 Thread Supriya Kannery
New error classes defined for cases where device not inserted and file reopen failed. Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c

Re: [Qemu-devel] [V2 3/3] Command "block_set" for dynamic block params change

2011-06-17 Thread Supriya Kannery
s. For now, dynamic setting of hostcache params using block_set is implemented. Other block device parameter changes can be integrated in similar lines. Signed-off-by: Supriya Kannery --- block.c | 41 + block.h |

Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change

2011-07-25 Thread Supriya Kannery
On 07/25/2011 12:00 PM, Stefan Hajnoczi wrote: On Wed, Jul 13, 2011 at 06:37:05PM +0530, Supriya Kannery wrote: +ret = bdrv_open(bs, bs->filename, bdrv_flags, drv); +if (ret< 0) { +/* Reopen failed. Try to open with original flags */ +error_report("Openin

Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change

2011-07-25 Thread Supriya Kannery
On 07/25/2011 07:04 PM, Kevin Wolf wrote: Am 25.07.2011 14:50, schrieb Stefan Hajnoczi: On Mon, Jul 25, 2011 at 1:52 PM, Supriya Kannery wrote: On 07/25/2011 12:00 PM, Stefan Hajnoczi wrote: On Wed, Jul 13, 2011 at 06:37:05PM +0530, Supriya Kannery wrote: +if (bdrv_is_inserted(bs

[Qemu-devel] [V5 Patch 1/4]Qemu: Enhance "info block" to display host cache setting

2011-07-27 Thread Supriya Kannery
hostcache=true file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 21 + qmp-commands.hx |2 ++ 2 files changed, 19 insertions(+), 4 deletions(-)

[Qemu-devel] [V5 Patch 2/4]Qemu: qerrors for file reopen, data sync and cmd syntax

2011-07-27 Thread Supriya Kannery
New error classes defined for file reopen failure, data sync error and incorrect command syntax Signed-off-by: Supriya Kannery --- qerror.c | 12 qerror.h |8 2 files changed, 20 insertions(+) Index: qemu/qerror.c

[Qemu-devel] [V5 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-07-27 Thread Supriya Kannery
New command "block_set" added for dynamically changing any of the block device parameters. For now, dynamic setting of hostcache params using this command is implemented. Other block device parameter changes, can be integrated in similar lines. Signed-off-by: Supriya Kannery --

[Qemu-devel] [V5 Patch 4/4]Qemu: Add commandline -drive option 'hostcache'

2011-07-27 Thread Supriya Kannery
same commandline. User has to specify only one among these. Signed-off-by: Supriya Kannery --- blockdev.c | 13 + qemu-config.c |4 qemu-options.hx |2 +- 3 files changed, 18 insertions(+), 1 delet

[Qemu-devel] [V5 Patch 0/4]Qemu: Set host cache from cmdline and monitor

2011-07-27 Thread Supriya Kannery
Currently cache setting of a block device cannot be changed without restarting a running VM. Following patchset is for enabling dynamic change of host cache setting for block devices through qemu monitor. Code changes are based on patches from Christoph Hellwig and Prerna Saxena. This pat

Re: [Qemu-devel] [V5 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-07-28 Thread Supriya Kannery
On 07/27/2011 09:32 PM, Anthony Liguori wrote: On 07/27/2011 09:31 AM, Stefan Hajnoczi wrote: On Wed, Jul 27, 2011 at 1:58 PM, Anthony Liguori wrote: Index: qemu/hmp-commands.hx === --- qemu.orig/hmp-commands.hx +++ qemu/hmp-comman

Re: [Qemu-devel] [V5 Patch 1/4]Qemu: Enhance "info block" to display host cache setting

2011-07-28 Thread Supriya Kannery
On 07/27/2011 07:49 PM, Stefan Hajnoczi wrote: On Wed, Jul 27, 2011 at 12:30 PM, Supriya Kannery wrote: Enhance "info block" to display hostcache setting for each block device. Example: (qemu) info block ide0-hd0: type=hd removable=0 file=../rhel6-32.qcow2 ro=0 drv=qcow2 e

[Qemu-devel] [Patch] virtio: security patch

2011-08-03 Thread Supriya Kannery
For security purpose, convert 'int i' to 'unsigned int i' in virtio functions, so that range of index is restricted to positive value. Signed-off-by: Supriya Kannery (supri...@linux.vnet.ibm.com) --- hw/virtio.c | 27 +-- hw/virtio.h |3 ++-

Re: [Qemu-devel] [V5 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-08-04 Thread Supriya Kannery
On 08/01/2011 09:14 PM, Anthony Liguori wrote: On 08/01/2011 10:44 AM, Kevin Wolf wrote: Am 01.08.2011 17:28, schrieb Anthony Liguori: 2. Top-level command for each parameter (e.g. block_set_hostcache). Supported parameters are easily discoverable via query-commands. If individual block devices

Re: [Qemu-devel] [V5 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-08-04 Thread Supriya Kannery
On 08/04/2011 02:02 PM, Supriya Kannery wrote: On 08/01/2011 09:14 PM, Anthony Liguori wrote: On 08/01/2011 10:44 AM, Kevin Wolf wrote: Am 01.08.2011 17:28, schrieb Anthony Liguori: 2. Top-level command for each parameter (e.g. block_set_hostcache). Supported parameters are easily

Re: [Qemu-devel] [V5 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-08-04 Thread Supriya Kannery
On 08/04/2011 02:01 PM, Stefan Hajnoczi wrote: On Thu, Aug 4, 2011 at 9:32 AM, Supriya Kannery wrote: On 08/01/2011 09:14 PM, Anthony Liguori wrote: On 08/01/2011 10:44 AM, Kevin Wolf wrote: Am 01.08.2011 17:28, schrieb Anthony Liguori: 2. Top-level command for each parameter (e.g

[Qemu-devel] [v6 Patch 1/4]Qemu: Enhance "info block" to display host cache setting

2011-08-04 Thread Supriya Kannery
ache=1 file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 20 qmp-commands.hx |2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) Index: qemu/block.c =

[Qemu-devel] [v6 Patch 2/4]Qemu: qerrors for file reopen and data sync

2011-08-04 Thread Supriya Kannery
New error classes defined for file reopen failure and data sync error Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig

[Qemu-devel] [v6 Patch 3/4]Qemu: Command "block_set_hostcache" for dynamic hostcache change

2011-08-04 Thread Supriya Kannery
New command "block_set_hostcache" added for dynamically changing host pagecache setting of a block device. Signed-off-by: Supriya Kannery --- block.c | 54 ++ block.h |2 ++ blockdev.c

[Qemu-devel] [v6 Patch 4/4]Qemu: Add commandline -drive option 'hostcache'

2011-08-04 Thread Supriya Kannery
e commandline. Signed-off-by: Supriya Kannery --- blockdev.c | 13 + qemu-config.c |4 qemu-options.hx |2 +- 3 files changed, 18 insertions(+), 1 deletion(-) Index: qemu/blockdev.c === --- qemu.orig/

[Qemu-devel] [v6 Patch 0/4]Qemu: Set host pagecache from cmdline and monitor

2011-08-04 Thread Supriya Kannery
Currently cache setting of a block device cannot be changed without restarting a running VM. Following patchset is for enabling dynamic change of cache setting for block devices through qemu monitor. Code changes are based on patches from Christoph Hellwig and Prerna Saxena. This patchset introd

Re: [Qemu-devel] Safely reopening image files by stashing fds

2011-08-07 Thread Supriya Kannery
On 08/05/2011 09:19 PM, Anthony Liguori wrote: On 08/05/2011 10:43 AM, Kevin Wolf wrote: Am 05.08.2011 17:24, schrieb Stefan Hajnoczi: On Fri, Aug 5, 2011 at 3:28 PM, Christoph Hellwig wrote: On Fri, Aug 05, 2011 at 02:12:48PM +0100, Daniel P. Berrange wrote: Because you cannot change O_DIREC

Re: [Qemu-devel] Safely reopening image files by stashing fds

2011-08-09 Thread supriya kannery
Kevin Wolf wrote: Am 08.08.2011 09:02, schrieb Supriya Kannery: On 08/05/2011 09:19 PM, Anthony Liguori wrote: On 08/05/2011 10:43 AM, Kevin Wolf wrote: Am 05.08.2011 17:24, schrieb Stefan Hajnoczi: On Fri, Aug 5, 2011 at 3:28 PM, Christoph Hellwig wrote

Re: [Qemu-devel] Safely reopening image files by stashing fds

2011-08-09 Thread supriya kannery
Kevin Wolf wrote: Am 09.08.2011 11:22, schrieb supriya kannery: Kevin Wolf wrote: Am 08.08.2011 09:02, schrieb Supriya Kannery: On 08/05/2011 09:19 PM, Anthony Liguori wrote: On 08/05/2011 10:43 AM, Kevin Wolf wrote: Am 05.08.2011 17:24

Re: [Qemu-devel] [RFC] Safely reopening image files by stashing fds

2011-08-16 Thread Supriya Kannery
On 08/09/2011 03:02 PM, supriya kannery wrote: > Kevin Wolf wrote: >> Am 09.08.2011 11:22, schrieb supriya kannery: >>> Kevin Wolf wrote: >> >> What I meant is that in the end, with a generic bdrv_reopen(), we can >> have raw-posix only call dup() and fcntl(

Re: [Qemu-devel] [RFC] Safely reopening image files by stashing fds

2011-08-16 Thread Supriya Kannery
On 08/09/2011 03:02 PM, supriya kannery wrote: > Kevin Wolf wrote: >> Am 09.08.2011 11:22, schrieb supriya kannery: >>> Kevin Wolf wrote: >> >> What I meant is that in the end, with a generic bdrv_reopen(), we can >> have raw-posix only call dup() and fcntl(

Re: [Qemu-devel] CoW image commit+shrink(= make_empty) support

2012-06-13 Thread Supriya Kannery
On 06/12/2012 04:26 PM, Stefan Hajnoczi wrote: On Mon, Jun 11, 2012 at 4:37 PM, Jeff Cody wrote: On 06/11/2012 10:24 AM, Stefan Hajnoczi wrote: On Mon, Jun 11, 2012 at 1:50 PM, Kevin Wolf wrote: Am 11.06.2012 14:09, schrieb Stefan Hajnoczi: On Fri, Jun 8, 2012 at 6:46 PM, Jeff Cody wrote:

Re: [Qemu-devel] CoW image commit+shrink(= make_empty) support

2012-06-14 Thread Supriya Kannery
On 06/14/2012 07:59 PM, Jeff Cody wrote: On 06/14/2012 10:23 AM, Zhi Hui Li wrote: On 2012年06月11日 23:37, Jeff Cody wrote: On 06/11/2012 10:24 AM, Stefan Hajnoczi wrote: On Mon, Jun 11, 2012 at 1:50 PM, Kevin Wolf wrote: Am 11.06.2012 14:09, schrieb Stefan Hajnoczi: On Fri, Jun 8, 2012 at 6

[Qemu-devel] [v1 Patch 0/10]Qemu: Dynamic host pagecache change and image file reopen

2012-06-15 Thread Supriya Kannery
For changing host pagecache setting of a running VM, it is important to have a safe way of reopening its image file. Following patchset introduces: * a generic way to reopen image files safely. In this approach, before reopening an image, for each block driver, its state will be sta

[Qemu-devel] [v1 Patch 1/10]Qemu: Enhance "info block" to display host cache setting

2012-06-15 Thread Supriya Kannery
-32.raw ro=0 drv=raw encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 20 qmp-commands.hx |2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) Index: qemu/qapi-schema.json === --- qemu.o

[Qemu-devel] [v1 Patch 3/10]Qemu: Cmd "block_set_hostcache" for dynamic cache change

2012-06-15 Thread Supriya Kannery
New command "block_set_hostcache" added for dynamically changing host pagecache setting of a block device. Usage: block_set_hostcache = block device = on/off Example: (qemu) block_set_hostcache ide0-hd0 off Signed-off-by: Supriya Kannery --- block.c

[Qemu-devel] [v1 Patch 7/10]Qemu: vmdk image file reopen

2012-06-15 Thread Supriya Kannery
vmdk driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/vmdk.c === --- qemu.orig

[Qemu-devel] [v1 Patch 10/10]Qemu: qed image file reopen

2012-06-15 Thread Supriya Kannery
qed driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/qed.c === --- qemu.orig

[Qemu-devel] [v1 Patch 8/10]Qemu: qcow2 image file reopen

2012-06-15 Thread Supriya Kannery
qcow2 driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/qcow2.c

Re: [Qemu-devel] CoW image commit+shrink(= make_empty) support

2012-06-15 Thread Supriya Kannery
On 06/14/2012 11:58 PM, Supriya Kannery wrote: On 06/14/2012 07:59 PM, Jeff Cody wrote: On 06/14/2012 10:23 AM, Zhi Hui Li wrote: On 2012年06月11日 23:37, Jeff Cody wrote: On 06/11/2012 10:24 AM, Stefan Hajnoczi wrote: On Mon, Jun 11, 2012 at 1:50 PM, Kevin Wolf wrote: Am 11.06.2012 14:09

[Qemu-devel] [v1 Patch 9/10]Qemu: qcow image file reopen

2012-06-15 Thread Supriya Kannery
qcow driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Shrinidhi Joshi Index: qemu/block/qcow.c === --- qemu.orig/

[Qemu-devel] [v1 Patch 4/10]Qemu: Framework for reopening image files safely

2012-06-15 Thread Supriya Kannery
Struct BDRVReopenState along with three reopen related functions introduced for handling reopening of images safely. This can be extended by each of the block drivers to reopen respective image files. Signed-off-by: Supriya Kannery Index: qemu/block.c

[Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache setting and data sync failures

2012-06-15 Thread Supriya Kannery
New error classes defined for hostcache setting and data sync error Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig

[Qemu-devel] [v1 Patch 5/10]Qemu: raw-posix image file reopen

2012-06-15 Thread Supriya Kannery
raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/raw.c

[Qemu-devel] [v1 Patch 6/10]Qemu: raw-win32 image file reopen

2012-06-15 Thread Supriya Kannery
raw-win32 driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically is handled here. Signed-off-by: Supriya Kannery Signed-off-by: Shrinidhi Joshi Index: qemu/block/raw-win32.c

Re: [Qemu-devel] [V3 1/3] Enhance "info block" to display hostcache setting

2011-06-22 Thread Supriya Kannery
On 06/20/2011 07:53 PM, Kevin Wolf wrote: Am 17.06.2011 18:37, schrieb Supriya Kannery: + int open_flags = qdict_get_int(bs_dict, "open_flags"); + if (open_flags& BDRV_O_NOCACHE) + monitor_printf(mon, " hostcache=false"

Re: [Qemu-devel] [V2 3/3] Command "block_set" for dynamic block params change

2011-06-22 Thread Supriya Kannery
On 06/20/2011 08:04 PM, Kevin Wolf wrote: Am 17.06.2011 18:38, schrieb Supriya Kannery: + if (bdrv_is_inserted(bs)) { + /* cache change applicable only if device inserted */ + return bdrv_change_hostcache(bs, enable

[Qemu-devel] [V4 Patch 1/4]Qemu: Enhance "info block" to display host cache setting

2011-07-04 Thread Supriya Kannery
hostcache=true file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 21 + qmp-commands.hx |2 ++ 2 files changed, 19 insertions(+), 4 deletions(-)

[Qemu-devel] [V4 Patch 2/4]Qemu: Error classes for file reopen and data sync failure

2011-07-04 Thread Supriya Kannery
New error classes defined for cases where device not inserted and file reopen failed. Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c

[Qemu-devel] [V4 Patch 0/4]Qemu: Hostcache setting from cmdline and monitor

2011-07-04 Thread Supriya Kannery
Currently cache setting of a block device cannot be changed without restarting a running VM. Following patchset is for enabling dynamic change of cache setting for block devices through qemu monitor. Code changes are based on patches from Christoph Hellwig and Prerna Saxena. This patchset

[Qemu-devel] [V4 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-07-04 Thread Supriya Kannery
New command "block_set" added for dynamically changing any of the block device parameters. For now, dynamic setting of hostcache params using this command is implemented. Other block device parameters, can be integrated in similar lines. Signed-off-by: Supriya Kannery --

[Qemu-devel] [V4 Patch 4/4]Qemu: Add commandline -drive option 'hostcache'

2011-07-04 Thread Supriya Kannery
same commandline. User has to specify only one among these. Signed-off-by: Supriya Kannery --- blockdev.c | 17 + qemu-config.c |4 qemu-options.hx |2 +- qemu.pod|5 + 4 files changed, 27 insertions(+), 1 delet

Re: [Qemu-devel] [V4 Patch 1/4 -Updated]Qemu: Enhance "info block" to display host cache setting

2011-07-05 Thread Supriya Kannery
./rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Enhanced to display "hostcache" setting: (qemu) info block ide0-hd0: type=hd removable=0 hostcache=true file=../rhel6-32.qcow2 ro=0 drv=qcow2 encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 21 + qmp-comm

Re: [Qemu-devel] [V4 Patch 3/4]Qemu: Command "block_set" for dynamic block params change

2011-07-05 Thread Supriya Kannery
On 07/04/2011 05:59 PM, Stefan Hajnoczi wrote: On Mon, Jul 4, 2011 at 11:43 AM, Supriya Kannery wrote: { +.name = "block_set", +.args_type = "device:B,name:s,enable:b", +.params = "device name enable", Perhaps:

Re: [Qemu-devel] [V4 Patch 4/4 - Updated]Qemu: Add commandline -drive option 'hostcache'

2011-07-05 Thread Supriya Kannery
tion can be used for setting host cache usage for block data access. It is not allowed to specify both 'hostcache' and 'cache' options in the same commandline. User has to specify only one among these. Signed-off-by: Supriya Kannery --- blockdev.c | 13 + qemu

Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change

2011-07-13 Thread Supriya Kannery
lock_set" added for dynamically changing any of the block device parameters. For now, dynamic setting of hostcache params using this command is implemented. Other block device parameters, can be integrated in similar lines. Signed-off-by: Supriya Kannery --- bl

Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change

2011-07-20 Thread Supriya Kannery
On 07/13/2011 06:37 PM, Supriya Kannery wrote: Updated "block_set" command to accept multiple -drive parameters. Also, added code for re-opening of device file with original flags, incase opening file using changed hostcache set

Re: [Qemu-devel] [V4 Patch 4/4 - Updated]Qemu: Add commandline -drive option 'hostcache'

2011-07-20 Thread Supriya Kannery
On 07/05/2011 04:35 PM, Supriya Kannery wrote: Updated patch to use qemu_opt_get_bool() instead of qemu_opt_get() to read 'hostcache' --- qemu command option 'hostcache' added to -drive for block devices. Whil

Re: [Qemu-devel] [V4 Patch 1/4 -Updated]Qemu: Enhance "info block" to display host cache setting

2011-07-20 Thread Supriya Kannery
On 07/05/2011 04:19 PM, Supriya Kannery wrote: Updated patch to display hostcache = 1/0 instead of true/false in monitor. --- Enhance "info block" to display hostcache setting for each block device. Example: (qemu)

[Qemu-devel] [v8 Patch 0/6]Qemu: Host pagecache setting from cmdline and monitor

2011-10-30 Thread Supriya Kannery
Currently cache setting of a block device cannot be changed without restarting a running VM. Following patchset is for enabling dynamic change of cache setting for block devices through qemu monitor. Code changes are based on patches from Christoph Hellwig and Prerna Saxena. This patchset introduc

[Qemu-devel] [v8 Patch 1/6]Qemu: Enhance "info block" to display host cache setting

2011-10-30 Thread Supriya Kannery
-32.raw ro=0 drv=raw encrypted=0 Signed-off-by: Supriya Kannery --- block.c | 20 qmp-commands.hx |2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) Index: qemu/qmp-commands.hx === --- qemu.

[Qemu-devel] [v8 Patch 2/6]Qemu: Error classes for file reopen and data sync failure

2011-10-30 Thread Supriya Kannery
New error classes defined for file reopen failure and data sync error Signed-off-by: Supriya Kannery --- qerror.c |8 qerror.h |6 ++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c === --- qemu.orig

[Qemu-devel] [v8 Patch 4/6]Qemu: Add commandline -drive option 'hostcache'

2011-10-30 Thread Supriya Kannery
qemu command option 'hostcache' added to -drive for block devices. While starting a VM from qemu commandline, this option can be used for setting host cache usage for block data access. 'cache=xx' overrides 'hostcache=yy' when specified simultaneously.

[Qemu-devel] [v8 Patch 6/6]Qemu: raw posix implementation of reopen functions

2011-10-30 Thread Supriya Kannery
raw-posix driver changes for bdrv_reopen_xx functions to safely reopen image files. Reopening of image files while changing hostcache dynamically, is handled here. Signed-off-by: Supriya Kannery Index: qemu/block/raw.c

[Qemu-devel] [v8 Patch 5/6]Qemu: Framework for reopening images safely

2011-10-30 Thread Supriya Kannery
Struct BDRVReopenState along with three reopen related functions introduced for handling reopen state of images safely. This can be extended by each of the block drivers to reopen respective image files. Signed-off-by: Supriya Kannery Index: qemu/block.c

[Qemu-devel] [v8 Patch 3/6]Qemu: Cmd "block_set_hostcache" for dynamic cache change

2011-10-30 Thread Supriya Kannery
New command "block_set_hostcache" added for dynamically changing host pagecache setting of a block device. Usage: block_set_hostcache = block device = on/off Example: (qemu) block_set_hostcache ide0-hd0 off Signed-off-by: Supriya Kannery --- block.c

Re: [Qemu-devel] [v8 Patch 1/6]Qemu: Enhance "info block" to display host cache setting

2011-11-04 Thread Supriya Kannery
On 11/03/2011 07:25 PM, Luiz Capitulino wrote: On Sun, 30 Oct 2011 16:03:54 +0530 Supriya Kannery wrote: +if (qdict_haskey(bs_dict, "hostcache")) { +monitor_printf(mon, " hostcache=%d", + qdict_get_bool(bs_dict, "hostcache")); +

Re: [Qemu-devel] [v8 Patch 3/6]Qemu: Cmd "block_set_hostcache" for dynamic cache change

2011-11-04 Thread Supriya Kannery
On 11/04/2011 03:30 PM, Kevin Wolf wrote: Am 30.10.2011 11:34, schrieb Supriya Kannery: + +if (bdrv_is_inserted(bs)) { +/* Reopen file with changed set of flags */ +return bdrv_reopen(bs, bdrv_flags); +} else { +/* Save hostcache change for future use

Re: [Qemu-devel] [v8 Patch 5/6]Qemu: Framework for reopening images safely

2011-11-04 Thread Supriya Kannery
On 11/04/2011 03:35 PM, Kevin Wolf wrote: Am 30.10.2011 11:35, schrieb Supriya Kannery: +struct BDRVReopenState { +BlockDriverState *bs; +int reopen_flags; + +/* For raw-posix */ +int reopen_fd; +}; I think I commented the same on the previous version: BDRVReopenState

  1   2   >