Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xenmgr: Change libxl disk-spec for blktap #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions xenmgr/Vm/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -688,20 +688,26 @@ diskSpec :: Uuid -> Disk -> Rpc DiskSpec
diskSpec uuid d = do
stubdom <- readConfigPropertyDef uuid vmStubdom False
hd_type <- readConfigPropertyDef uuid vmHdType "ide"
return $ printf "'format=raw,backendtype=%s,vdev=%s,access=%s,devtype=%s,script=%s,target=%s'"
(cdType stubdom d)
return $ printf "'format=%s,backendtype=%s,vdev=%s,access=%s,devtype=%s,script=%s,target=%s'"
(format disk_type)
(backendType disk_type disk_dev_type)
(adjDiskDevice d hd_type)
(enumMarshall $ diskMode d)
(if (disk_dev_type == "cdrom") then disk_dev_type else "disk")
(script disk_type)
(target disk_type (diskPath d))
(diskPath d)
where
disk_type = enumMarshall $ diskType d
disk_dev_type = enumMarshall $ diskDeviceType d
cdType stubdom d =
case disk_dev_type of
"cdrom" -> "phy"
_ -> "phy"
format "vhd" = "vhd"
format "aio" = "aio"
format _ = "raw"
backendType disk_type disk_dev_type =
case (disk_dev_type, disk_type) of
("cdrom", _ ) -> "phy"
(_ , "vhd") -> "tap"
(_ , "aio") -> "tap"
(_ , _ ) -> "phy"
-- convert hdX -> xvdX if hdtype is 'ahci'
adjDiskDevice d hd_type =
case hd_type of
Expand All @@ -710,9 +716,6 @@ diskSpec uuid d = do
script "vhd" = "block-tap"
script "aio" = "block-tap"
script _ = "block"
target "vhd" path = printf "vhd:%s" path
target "aio" path = printf "aio:%s" path
target _ path = path

-- Next section: information about Network Interfaces
nicSpecs :: VmConfig -> Rpc [NicSpec]
Expand Down