
On Tue, Jul 05, 2011 at 11:58:31AM -0600, Eric Blake wrote:
On 07/05/2011 01:25 AM, Hu Tao wrote:
Add --cache option to allow user to specify cache mode of disk device from virsh command line when attaching a disk device. --- tools/virsh.c | 10 ++++++++-- tools/virsh.pod | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 9a189fd..cab5a35 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -10176,6 +10176,7 @@ static const vshCmdOptDef opts_attach_disk[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")}, {"driver", VSH_OT_STRING, 0, N_("driver of disk device")}, {"subdriver", VSH_OT_STRING, 0, N_("subdriver of disk device")}, + {"cache", VSH_OT_STRING, 0, N_("cache mode of disk device")},
Nice.
+ ignore_value(vshCommandOptString(cmd, "cache", &cache));
Not so nice.
--cache ''
will make vshCommandOptString return -1, because that usage is a virsh usage error and should be diagnosed as such up front, rather than accidentally passing cache='' through the XML to the libvirt API.
Thanks for reply. Will fix in v2.
Patch 2/3 shares the same problem. And since all three patches are touching the same 'virsh attach-disk' command, I'd be fine if you wanted to squash them into a single patch for v2.
ok. -- Thanks, Hu Tao