Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
67653160
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
67653160
编写于
5月 04, 2013
作者:
O
Osier Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: Introduce sgio for hostdev
"sgio" is only valid for scsi host device.
上级
ead43915
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
81 addition
and
5 deletion
+81
-5
docs/formatdomain.html.in
docs/formatdomain.html.in
+6
-1
docs/schemas/domaincommon.rng
docs/schemas/domaincommon.rng
+8
-0
src/conf/domain_conf.c
src/conf/domain_conf.c
+30
-4
src/conf/domain_conf.h
src/conf/domain_conf.h
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
+35
-0
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+1
-0
未找到文件。
docs/formatdomain.html.in
浏览文件 @
67653160
...
...
@@ -2414,7 +2414,12 @@
and
<code>
virNodeDeviceReAttach
</code>
(or
<code>
virsh
nodedev-reattach
</code>
) after hot-unplug or stopping the
guest. For SCSI device, user is responsible to make sure the device
is not used by host.
</dd>
is not used by host.
The optional
<code>
sgio
</code>
(
<span
class=
"since"
>
since 1.0.6
</span>
)
attribute indicates whether the kernel will filter unprivileged
SG_IO commands for the disk, valid settings are "filtered" or
"unfiltered". Defaults to "filtered".
</dd>
<dt><code>
source
</code></dt>
<dd>
The source element describes the device as seen from the host.
The USB device can either be addressed by vendor / product id using the
...
...
docs/schemas/domaincommon.rng
浏览文件 @
67653160
...
...
@@ -3234,6 +3234,14 @@
<attribute
name=
"type"
>
<value>
scsi
</value>
</attribute>
<optional>
<attribute
name=
"sgio"
>
<choice>
<value>
filtered
</value>
<value>
unfiltered
</value>
</choice>
</attribute>
</optional>
<element
name=
"source"
>
<interleave>
<ref
name=
"sourceinfoadapter"
/>
...
...
src/conf/domain_conf.c
浏览文件 @
67653160
...
...
@@ -3790,6 +3790,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
{
xmlNodePtr sourcenode;
char *managed = NULL;
char *sgio = NULL;
char *backendStr = NULL;
int backend;
int ret = -1;
...
...
@@ -3804,6 +3805,8 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
def->managed = true;
}
sgio = virXMLPropString(node, "sgio");
/* @type is passed in from the caller rather than read from the
* xml document, because it is specified in different places for
* different kinds of defs - it is an attribute of
...
...
@@ -3840,6 +3843,22 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
goto error;
}
if (sgio) {
if (def->source.subsys.type !=
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("sgio is only supported for scsi host device"));
goto error;
}
if ((def->source.subsys.u.scsi.sgio =
virDomainDeviceSGIOTypeFromString(sgio)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("unknown sgio mode '%s'"), sgio);
goto error;
}
}
switch (def->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
if (virDomainHostdevSubsysPciDefParseXML(sourcenode, def, flags) < 0)
...
...
@@ -3878,6 +3897,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
ret = 0;
error:
VIR_FREE(managed);
VIR_FREE(sgio);
VIR_FREE(backendStr);
return ret;
}
...
...
@@ -15439,10 +15459,16 @@ virDomainHostdevDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, " <hostdev mode='%s' type='%s'",
mode, type);
if (def->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
virBufferAsprintf(buf, " managed='%s'
>\n
",
if (def->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
{
virBufferAsprintf(buf, " managed='%s'",
def->managed ? "yes" : "no");
else
if (def->source.subsys.type ==
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
def->source.subsys.u.scsi.sgio)
virBufferAsprintf(buf, " sgio='%s'",
virDomainDeviceSGIOTypeToString(def->source.subsys.u.scsi.sgio));
}
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 6);
...
...
src/conf/domain_conf.h
浏览文件 @
67653160
...
...
@@ -423,6 +423,7 @@ struct _virDomainHostdevSubsys {
unsigned
bus
;
unsigned
target
;
unsigned
unit
;
int
sgio
;
/* enum virDomainDeviceSGIO */
}
scsi
;
}
u
;
};
...
...
tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
0 → 100644
浏览文件 @
67653160
<domain
type=
'qemu'
>
<name>
QEMUGuest2
</name>
<uuid>
c7a5fdbd-edaf-9466-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219100
</memory>
<currentMemory
unit=
'KiB'
>
219100
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest2'
/>
<target
dev=
'hda'
bus=
'ide'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<controller
type=
'scsi'
index=
'0'
model=
'virtio-scsi'
/>
<controller
type=
'usb'
index=
'0'
/>
<controller
type=
'ide'
index=
'0'
/>
<controller
type=
'pci'
index=
'0'
model=
'pci-root'
/>
<hostdev
mode=
'subsystem'
type=
'scsi'
managed=
'yes'
sgio=
'unfiltered'
>
<source>
<adapter
name=
'scsi_host0'
/>
<address
bus=
'0'
target=
'0'
unit=
'0'
/>
</source>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'4'
unit=
'8'
/>
</hostdev>
<memballoon
model=
'virtio'
/>
</devices>
</domain>
tests/qemuxml2xmltest.c
浏览文件 @
67653160
...
...
@@ -295,6 +295,7 @@ mymain(void)
DO_TEST
(
"disk-copy_on_read"
);
DO_TEST
(
"hostdev-scsi-shareable"
);
DO_TEST
(
"hostdev-scsi-sgio"
);
virObjectUnref
(
driver
.
caps
);
virObjectUnref
(
driver
.
xmlopt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录