提交 319ed264 编写于 作者: M Michal Privoznik

qemu_monitor: Fix tray-open attribute in query-block

With our code, we fail to query for tray-open attribute currently.
That's because in HMP it is 'tray-open' and in QMP it's 'tray_open'.
It always has been. However, we got it exactly the opposite.
上级 c29eafc8
...@@ -1585,10 +1585,10 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, ...@@ -1585,10 +1585,10 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
goto cleanup; goto cleanup;
} }
/* Don't check for success here, because 'tray-open' is presented iff /* Don't check for success here, because 'tray_open' is presented iff
* medium is ejected. * medium is ejected.
*/ */
ignore_value(virJSONValueObjectGetBoolean(dev, "tray-open", ignore_value(virJSONValueObjectGetBoolean(dev, "tray_open",
&info->tray_open)); &info->tray_open));
/* Missing io-status indicates no error */ /* Missing io-status indicates no error */
......
...@@ -809,10 +809,10 @@ int qemuMonitorTextGetBlockInfo(qemuMonitorPtr mon, ...@@ -809,10 +809,10 @@ int qemuMonitorTextGetBlockInfo(qemuMonitorPtr mon,
VIR_DEBUG("error reading locked: %s", p); VIR_DEBUG("error reading locked: %s", p);
else else
info->locked = (tmp != 0); info->locked = (tmp != 0);
} else if (STRPREFIX(p, "tray_open=")) { } else if (STRPREFIX(p, "tray-open=")) {
p += strlen("tray_open="); p += strlen("tray-open=");
if (virStrToLong_i(p, &dummy, 10, &tmp) == -1) if (virStrToLong_i(p, &dummy, 10, &tmp) == -1)
VIR_DEBUG("error reading tray_open: %s", p); VIR_DEBUG("error reading tray-open: %s", p);
else else
info->tray_open = (tmp != 0); info->tray_open = (tmp != 0);
} else if (STRPREFIX(p, "io-status=")) { } else if (STRPREFIX(p, "io-status=")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册