提交 73006d2a 编写于 作者: L Luiz Capitulino 提交者: Anthony Liguori

Fix do_commit() behavior

Commit 751c6a17 changed the monitor's
'commit' command to this behavior:

1. Any string you type as argument will cause do_commit() to
call bdrv_commit() to all devices

2. If you enter a device name, it will be the only one ignored
by do_commit() :)

The fix is to call bdrv_commit() to the specified device only and
ignore the others (when 'all' is not specified).
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
Message-Id: 
上级 c3cf0d3f
......@@ -259,7 +259,7 @@ static void do_commit(Monitor *mon, const char *device)
all_devices = !strcmp(device, "all");
TAILQ_FOREACH(dinfo, &drives, next) {
if (!all_devices)
if (!strcmp(bdrv_get_device_name(dinfo->bdrv), device))
if (strcmp(bdrv_get_device_name(dinfo->bdrv), device))
continue;
bdrv_commit(dinfo->bdrv);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册