Skip to content

Commit

Permalink
Merge pull request kata-containers#805 from sboeuf/fix_virt
Browse files Browse the repository at this point in the history
virtcontainers: qemu: Add proper support for virt machine type
  • Loading branch information
mcastelino authored Oct 4, 2018
2 parents a0968ce + dffb4f9 commit c3cfe82
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

[[constraint]]
name = "github.com/intel/govmm"
revision = "9905ae92c5915c07abeb669eaa4d7f7408834b51"
revision = "f03df80fc3dc52f65ed6c7d12806279b44185d32"

[[constraint]]
name = "github.com/kata-containers/agent"
Expand Down
25 changes: 13 additions & 12 deletions vendor/github.com/intel/govmm/qemu/qemu.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 131 additions & 1 deletion vendor/github.com/intel/govmm/qemu/qmp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,8 @@ func (q *qemu) disconnect() {
// genericAppendBridges appends to devices the given bridges
func genericAppendBridges(devices []govmmQemu.Device, bridges []Bridge, machineType string) []govmmQemu.Device {
bus := defaultPCBridgeBus
if machineType == QemuQ35 {
switch machineType {
case QemuQ35, QemuVirt:
bus = defaultBridgeBus
}

Expand Down Expand Up @@ -1227,13 +1228,14 @@ func genericBridges(number uint32, machineType string) []Bridge {
var bt bridgeType

switch machineType {

case QemuQ35:
// currently only pci bridges are supported
// qemu-2.10 will introduce pcie bridges
fallthrough
case QemuPC:
bt = pciBridge
case QemuVirt:
bt = pcieBridge
case QemuPseries:
bt = pciBridge
default:
Expand Down
4 changes: 3 additions & 1 deletion virtcontainers/qemu_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ func newQemuArch(config HypervisorConfig) qemuArch {
func (q *qemuAmd64) capabilities() capabilities {
var caps capabilities

if q.machineType == QemuPC || q.machineType == QemuQ35 {
if q.machineType == QemuPC ||
q.machineType == QemuQ35 ||
q.machineType == QemuVirt {
caps.setBlockDeviceHotplugSupport()
}

Expand Down

0 comments on commit c3cfe82

Please sign in to comment.