From: Supriya Kannery <supriyak@in.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Supriya Kannery <supriyak@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] [V2 2/2]Qemu: Add commands "hostcache_set" and "hostcache_get"
Date: Mon, 23 May 2011 12:34:41 +0530 [thread overview]
Message-ID: <4DDA0709.4080601@in.ibm.com> (raw)
In-Reply-To: <20110520082033.GA6003@stefanha-thinkpad.localdomain>
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 changing block device options would be nice,
> althought I don't see other options where it makes sense to change them
> at runtime.
>
> The alternative would be:
>
> block_set hostcache on
>
> "block_set", {"device": "ide1-cd0", "name": "hostcache", "enable": true}
>
> The hostcache_get information would be part of query-block output:
> {
> "device":"ide0-hd0",
> "locked":false,
> "removable":false,
> "inserted":{
> "ro":false,
> "drv":"qcow2",
> "encrypted":false,
> "file":"disks/test.img"
> "hostcache":true,
> },
> "type":"hd"
> },
>
> This approach is extensible if more options need to be exposed.
Sure, I will resubmit this patchset, after making this feature more
generic. Can you pls help finding atleast one or two options (other than
hostcache) which can be changed dynamically. This will help me evaluate
the generic approach.
>> + .params = "device",
>> + .help = "retrieve host cache settings for device",
>
> Please make it clear these operations affect block devices:
> "for block device"
ok
>
>> + /*
>> + * A failed attempt to reopen the image file must lead to 'abort()'
>> + */
>> + if (ret != 0) {
>> + qerror_report(QERR_REOPEN_FILE_FAILED, bs->filename);
>> + abort();
>
> The error is never reported on a QMP monitor because qerror_report()
> simply stashes away the qerror. The QMP client doesn't have a chance to
> read the error before QEMU terminates.
>
Verified this from qemu command line and the error got displayed before
aborting (when the image file was renamed while VM was running).
>> +
>> +int bdrv_change_hostcache(BlockDriverState *bs, bool enable_host_cache)
>
> Consistently using "hostcache" or "host_cache" would be nice.
>
ok
>
>> + return -1;
>
> This shouldn't be a failure and please don't use -1 when a negative
> errno indicates failure. -1 == -EPERM. The return value should be 0
> here.
>
>> + }
>
> Anyway, this whole check is unnecessary since bdrv_reopen() already
> performs it.
>
will take this off
> Please run scripts/checkpatch.pl before submitting patches.
>
ok..will do
>> +
>> +Arguments:
>> +
>> +- "device": the device's ID, must be unique (json-string)
>> +- "cache": host cache value "off" or "on" (json-string)
>
> There is a boolean value that can be used instead of string on|off. See
> the set_link command.
>
ok
> Stefan
>
next prev parent reply other threads:[~2011-05-23 6:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 17:07 [Qemu-devel] [V2 0/2]Qemu: Enable dynamic hostcache change through monitor Supriya Kannery
2011-05-19 17:07 ` [Qemu-devel] [V2 1/2]Qemu: New error classes for file reopen and device insertion Supriya Kannery
2011-05-19 17:08 ` [Qemu-devel] [V2 2/2]Qemu: Add commands "hostcache_set" and "hostcache_get" Supriya Kannery
2011-05-20 8:20 ` Stefan Hajnoczi
2011-05-23 7:04 ` Supriya Kannery [this message]
2011-05-23 10:00 ` Stefan Hajnoczi
2011-05-23 12:58 ` Kevin Wolf
2011-05-23 15:32 ` Stefan Hajnoczi
2011-05-23 16:01 ` Markus Armbruster
2011-05-24 7:51 ` Kevin Wolf
2011-05-24 8:27 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DDA0709.4080601@in.ibm.com \
--to=supriyak@in.ibm.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=supriyak@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).