提交 5d9169e4 编写于 作者: P Peter Krempa

conf: Make virDomainDeviceInfoIterate usable without os type

Make the iterator function usable in the next patches. Also refactor
some parts to avoid strcmp if not necessary.

This commit tweaks and shadows the change that was done in commit
babe7dad and was needed after the
support for multiple console devices was added. Historically the first
<console> element is alias for the <serial> device.
上级 bb98ba5d
......@@ -2299,8 +2299,9 @@ int virDomainDeviceInfoIterate(virDomainDefPtr def,
return -1;
}
for (i = 0; i < def->nconsoles ; i++) {
if ((STREQ(def->os.type, "hvm")) && i == 0 &&
def->consoles[i]->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL)
if (i == 0 &&
def->consoles[i]->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL &&
STREQ_NULLABLE(def->os.type, "hvm"))
continue;
device.data.chr = def->consoles[i];
if (cb(def, &device, &def->consoles[i]->info, opaque) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部