Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
98d8c811
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98d8c811
编写于
9月 01, 2015
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vmx: Add handling for CDROM devices with SCSI passthru
https://bugzilla.redhat.com/show_bug.cgi?id=1172544
上级
7c959e0d
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
273 addition
and
5 deletion
+273
-5
src/vmx/vmx.c
src/vmx/vmx.c
+31
-5
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx
+6
-0
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml
+24
-0
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx
+85
-0
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml
+35
-0
tests/vmx2xmltest.c
tests/vmx2xmltest.c
+2
-0
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.vmx
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.vmx
+14
-0
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.xml
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.xml
+14
-0
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.vmx
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.vmx
+25
-0
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml
+35
-0
tests/xml2vmxtest.c
tests/xml2vmxtest.c
+2
-0
未找到文件。
src/vmx/vmx.c
浏览文件 @
98d8c811
...
...
@@ -2180,12 +2180,14 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
}
else
if
(
virFileHasSuffix
(
fileName
,
".iso"
)
||
(
deviceType
&&
(
STRCASEEQ
(
deviceType
,
"atapi-cdrom"
)
||
STRCASEEQ
(
deviceType
,
"cdrom-raw"
))))
{
STRCASEEQ
(
deviceType
,
"cdrom-raw"
)
||
(
STRCASEEQ
(
deviceType
,
"scsi-passthru"
)
&&
STRPREFIX
(
fileName
,
"/vmfs/devices/cdrom/"
)))))
{
/*
* This function was called in order to parse a harddisk device,
* but .iso files, 'atapi-cdrom',
and 'cdrom-raw' devices are for
* CDROM devices
only. Just ignore it, another call to this
* function to parse a CDROM device may handle it.
* but .iso files, 'atapi-cdrom',
'cdrom-raw', and 'scsi-passthru'
* CDROM devices
are for CDROM devices only. Just ignore it, another
*
call to this
function to parse a CDROM device may handle it.
*/
goto
ignore
;
}
else
{
...
...
@@ -2243,6 +2245,24 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
}
else
if
(
virDomainDiskSetSource
(
*
def
,
fileName
)
<
0
)
{
goto
cleanup
;
}
}
else
if
(
busType
==
VIR_DOMAIN_DISK_BUS_SCSI
&&
deviceType
&&
STRCASEEQ
(
deviceType
,
"scsi-passthru"
))
{
if
(
STRPREFIX
(
fileName
,
"/vmfs/devices/cdrom/"
))
{
/* SCSI-passthru CD-ROMs actually are device='lun' */
(
*
def
)
->
device
=
VIR_DOMAIN_DISK_DEVICE_LUN
;
virDomainDiskSetType
(
*
def
,
VIR_STORAGE_TYPE_BLOCK
);
if
(
virDomainDiskSetSource
(
*
def
,
fileName
)
<
0
)
goto
cleanup
;
}
else
{
/*
* This function was called in order to parse a CDROM device,
* but the filename does not indicate a CDROM device. Just ignore
* it, another call to this function to parse a harddisk device
* may handle it.
*/
goto
ignore
;
}
}
else
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Invalid or not yet handled value '%s' "
...
...
@@ -3425,6 +3445,12 @@ virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def,
else
vmxDeviceType
=
"atapi-cdrom"
;
}
else
if
(
def
->
device
==
VIR_DOMAIN_DISK_DEVICE_LUN
)
{
const
char
*
src
=
virDomainDiskGetSource
(
def
);
if
(
def
->
bus
==
VIR_DOMAIN_DISK_BUS_SCSI
&&
src
&&
STRPREFIX
(
src
,
"/vmfs/devices/cdrom/"
))
vmxDeviceType
=
"scsi-passthru"
;
else
vmxDeviceType
=
"cdrom-raw"
;
}
else
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
...
...
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx
0 → 100644
浏览文件 @
98d8c811
config.version = "8"
virtualHW.version = "4"
scsi0.present = "true"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-passthru"
scsi0:0.fileName = "/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0"
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml
0 → 100644
浏览文件 @
98d8c811
<domain
type=
'vmware'
>
<uuid>
00000000-0000-0000-0000-000000000000
</uuid>
<memory
unit=
'KiB'
>
32768
</memory>
<currentMemory
unit=
'KiB'
>
32768
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
>
hvm
</type>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<disk
type=
'block'
device=
'lun'
>
<source
dev=
'/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'
/>
<target
dev=
'sda'
bus=
'scsi'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<controller
type=
'scsi'
index=
'0'
/>
<video>
<model
type=
'vmvga'
vram=
'4096'
/>
</video>
</devices>
</domain>
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx
0 → 100644
浏览文件 @
98d8c811
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "8"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
nvram = "esx-rhel6-mini.nvram"
virtualHW.productCompatibility = "hosted"
powerType.powerOff = "soft"
powerType.powerOn = "hard"
powerType.suspend = "hard"
powerType.reset = "soft"
displayName = "esx-rhel6-mini-with-scsi-device"
extendedConfigFile = "esx-rhel6-mini.vmxf"
floppy0.present = "TRUE"
scsi0.present = "TRUE"
scsi0.sharedBus = "none"
scsi0.virtualDev = "pvscsi"
memsize = "2048"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "esx-rhel6-mini.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
ide1:0.present = "TRUE"
ide1:0.clientDevice = "TRUE"
ide1:0.deviceType = "cdrom-raw"
ide1:0.startConnected = "FALSE"
floppy0.startConnected = "FALSE"
floppy0.fileName = ""
floppy0.clientDevice = "TRUE"
ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "vpx"
guestOS = "rhel6-64"
uuid.location = "56 4d 91 76 62 1f 02 39-f5 ad 3a 00 23 71 95 3b"
uuid.bios = "56 4d 91 76 62 1f 02 39-f5 ad 3a 00 23 71 95 3b"
vc.uuid = "52 40 95 33 33 a2 56 c5-36 ce 80 d6 05 f8 ec f4"
scsi0.pciSlotNumber = "160"
ethernet0.generatedAddress = "00:50:56:9f:08:51"
ethernet0.pciSlotNumber = "192"
svga.vramSize = "8388608"
vmci0.id = "594646331"
vmci0.pciSlotNumber = "32"
tools.syncTime = "FALSE"
cleanShutdown = "TRUE"
replay.supported = "FALSE"
sched.swap.derivedName = "/vmfs/volumes/4f59a359-4cc3fa06-cac0-4437e66df86c/esx-rhel6-mini/esx-rhel6-mini-f62c1180.vswp"
replay.filename = ""
scsi0:0.redo = ""
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
scsi0.sasWWID = "50 05 05 66 62 1f 02 30"
ethernet0.generatedAddressOffset = "0"
hostCPUID.0 = "0000000d756e65476c65746e49656e69"
hostCPUID.1 = "000206a70010080017bae3f7bfebfbff"
hostCPUID.80000001 = "00000000000000000000000128100800"
guestCPUID.0 = "0000000d756e65476c65746e49656e69"
guestCPUID.1 = "000206a700010800969822030fabfbff"
guestCPUID.80000001 = "00000000000000000000000128100800"
userCPUID.0 = "0000000d756e65476c65746e49656e69"
userCPUID.1 = "000206a700100800169822030fabfbff"
userCPUID.80000001 = "00000000000000000000000128100800"
evcCompatibilityMode = "FALSE"
vmotion.checkpointFBSize = "8388608"
softPowerOff = "TRUE"
scsi0:1.present = "TRUE"
scsi0:1.deviceType = "scsi-passthru"
scsi0:1.fileName = "/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0"
scsi0:1.allowGuestConnectionControl = "FALSE"
scsi0:3.present = "FALSE"
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml
0 → 100644
浏览文件 @
98d8c811
<domain
type=
'vmware'
>
<name>
esx-rhel6-mini-with-scsi-device
</name>
<uuid>
564d9176-621f-0239-f5ad-3a002371953b
</uuid>
<memory
unit=
'KiB'
>
2097152
</memory>
<currentMemory
unit=
'KiB'
>
2097152
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'x86_64'
>
hvm
</type>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'[datastore] directory/esx-rhel6-mini.vmdk'
/>
<target
dev=
'sda'
bus=
'scsi'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<disk
type=
'block'
device=
'lun'
>
<source
dev=
'/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'
/>
<target
dev=
'sdb'
bus=
'scsi'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'1'
/>
</disk>
<controller
type=
'scsi'
index=
'0'
model=
'vmpvscsi'
/>
<interface
type=
'bridge'
>
<mac
address=
'00:50:56:9f:08:51'
/>
<source
bridge=
'VM Network'
/>
<model
type=
'vmxnet3'
/>
</interface>
<video>
<model
type=
'vmvga'
vram=
'8192'
/>
</video>
</devices>
</domain>
tests/vmx2xmltest.c
浏览文件 @
98d8c811
...
...
@@ -221,6 +221,7 @@ mymain(void)
DO_TEST
(
"cdrom-scsi-device"
,
"cdrom-scsi-device"
);
DO_TEST
(
"cdrom-scsi-raw-device"
,
"cdrom-scsi-raw-device"
);
DO_TEST
(
"cdrom-scsi-raw-auto-detect"
,
"cdrom-scsi-raw-auto-detect"
);
DO_TEST
(
"cdrom-scsi-passthru"
,
"cdrom-scsi-passthru"
);
DO_TEST
(
"cdrom-ide-file"
,
"cdrom-ide-file"
);
DO_TEST
(
"cdrom-ide-device"
,
"cdrom-ide-device"
);
DO_TEST
(
"cdrom-ide-raw-device"
,
"cdrom-ide-raw-device"
);
...
...
@@ -261,6 +262,7 @@ mymain(void)
DO_TEST
(
"esx-in-the-wild-4"
,
"esx-in-the-wild-4"
);
DO_TEST
(
"esx-in-the-wild-5"
,
"esx-in-the-wild-5"
);
DO_TEST
(
"esx-in-the-wild-6"
,
"esx-in-the-wild-6"
);
DO_TEST
(
"esx-in-the-wild-7"
,
"esx-in-the-wild-7"
);
DO_TEST
(
"gsx-in-the-wild-1"
,
"gsx-in-the-wild-1"
);
DO_TEST
(
"gsx-in-the-wild-2"
,
"gsx-in-the-wild-2"
);
...
...
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.vmx
0 → 100644
浏览文件 @
98d8c811
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
guestOS = "other"
uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
displayName = "cdrom-scsi-passthru"
memsize = "4"
numvcpus = "1"
scsi0.present = "true"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-passthru"
scsi0:0.fileName = "/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0"
floppy0.present = "false"
floppy1.present = "false"
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.xml
0 → 100644
浏览文件 @
98d8c811
<domain
type=
'vmware'
>
<name>
cdrom-scsi-passthru
</name>
<uuid>
564d9bef-acd9-b4e0-c8f0-aea8b9103515
</uuid>
<memory
unit=
'KiB'
>
4096
</memory>
<os>
<type>
hvm
</type>
</os>
<devices>
<disk
type=
'block'
device=
'lun'
>
<source
dev=
'/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'
/>
<target
dev=
'sda'
bus=
'scsi'
/>
</disk>
</devices>
</domain>
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.vmx
0 → 100644
浏览文件 @
98d8c811
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
guestOS = "other-64"
uuid.bios = "56 4d 91 76 62 1f 02 39-f5 ad 3a 00 23 71 95 3b"
displayName = "esx-rhel6-mini-with-scsi-device"
memsize = "2048"
numvcpus = "1"
scsi0.present = "true"
scsi0.virtualDev = "pvscsi"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "/vmfs/volumes/datastore/directory/esx-rhel6-mini.vmdk"
scsi0:1.present = "true"
scsi0:1.deviceType = "scsi-passthru"
scsi0:1.fileName = "/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0"
floppy0.present = "false"
floppy1.present = "false"
ethernet0.present = "true"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.connectionType = "bridged"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:9f:08:51"
svga.vramSize = "8388608"
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml
0 → 100644
浏览文件 @
98d8c811
<domain
type=
'vmware'
>
<name>
esx-rhel6-mini-with-scsi-device
</name>
<uuid>
564d9176-621f-0239-f5ad-3a002371953b
</uuid>
<memory
unit=
'KiB'
>
2097152
</memory>
<currentMemory
unit=
'KiB'
>
2097152
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'x86_64'
>
hvm
</type>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'[datastore] directory/esx-rhel6-mini.vmdk'
/>
<target
dev=
'sda'
bus=
'scsi'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'0'
/>
</disk>
<disk
type=
'block'
device=
'lun'
>
<source
dev=
'/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0'
/>
<target
dev=
'sdb'
bus=
'scsi'
/>
<address
type=
'drive'
controller=
'0'
bus=
'0'
target=
'0'
unit=
'1'
/>
</disk>
<controller
type=
'scsi'
index=
'0'
model=
'vmpvscsi'
/>
<interface
type=
'bridge'
>
<mac
address=
'00:50:56:9f:08:51'
/>
<source
bridge=
'VM Network'
/>
<model
type=
'vmxnet3'
/>
</interface>
<video>
<model
type=
'vmvga'
vram=
'8192'
/>
</video>
</devices>
</domain>
tests/xml2vmxtest.c
浏览文件 @
98d8c811
...
...
@@ -237,6 +237,7 @@ mymain(void)
DO_TEST
(
"cdrom-scsi-device"
,
"cdrom-scsi-device"
,
4
);
DO_TEST
(
"cdrom-scsi-raw-device"
,
"cdrom-scsi-raw-device"
,
4
);
DO_TEST
(
"cdrom-scsi-raw-auto-detect"
,
"cdrom-scsi-raw-auto-detect"
,
4
);
DO_TEST
(
"cdrom-scsi-passthru"
,
"cdrom-scsi-passthru"
,
4
);
DO_TEST
(
"cdrom-ide-file"
,
"cdrom-ide-file"
,
4
);
DO_TEST
(
"cdrom-ide-device"
,
"cdrom-ide-device"
,
4
);
DO_TEST
(
"cdrom-ide-raw-device"
,
"cdrom-ide-raw-device"
,
4
);
...
...
@@ -274,6 +275,7 @@ mymain(void)
DO_TEST
(
"esx-in-the-wild-4"
,
"esx-in-the-wild-4"
,
4
);
DO_TEST
(
"esx-in-the-wild-5"
,
"esx-in-the-wild-5"
,
4
);
DO_TEST
(
"esx-in-the-wild-6"
,
"esx-in-the-wild-6"
,
4
);
DO_TEST
(
"esx-in-the-wild-7"
,
"esx-in-the-wild-7"
,
4
);
DO_TEST
(
"gsx-in-the-wild-1"
,
"gsx-in-the-wild-1"
,
4
);
DO_TEST
(
"gsx-in-the-wild-2"
,
"gsx-in-the-wild-2"
,
4
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录