vendor: revendor govmm

Update govmm to add RO blk hotplug support.

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
Eric Ernst 2021-01-11 18:00:12 -08:00 committed by Eric Ernst
parent ea069002b7
commit fbc1d123e8
6 changed files with 23 additions and 11 deletions

View File

@ -32,7 +32,7 @@ require (
github.com/gogo/googleapis v1.4.0 // indirect github.com/gogo/googleapis v1.4.0 // indirect
github.com/gogo/protobuf v1.3.1 github.com/gogo/protobuf v1.3.1
github.com/hashicorp/go-multierror v1.0.0 github.com/hashicorp/go-multierror v1.0.0
github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864 github.com/kata-containers/govmm v0.0.0-20210112013750-7d320e8f5dca
github.com/mdlayher/vsock v0.0.0-20191108225356-d9c65923cb8f github.com/mdlayher/vsock v0.0.0-20191108225356-d9c65923cb8f
github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/opencontainers/runc v1.0.0-rc9.0.20200102164712-2b52db75279c github.com/opencontainers/runc v1.0.0-rc9.0.20200102164712-2b52db75279c

View File

@ -198,6 +198,8 @@ github.com/juju/testing v0.0.0-20190613124551-e81189438503/go.mod h1:63prj8cnj0t
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864 h1:ETwjbdr9aU/J90P5D/HAxRW8M4r0HQSPmuBDIaNr9EM= github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864 h1:ETwjbdr9aU/J90P5D/HAxRW8M4r0HQSPmuBDIaNr9EM=
github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864/go.mod h1:VmAHbsL5lLfzHW/MNL96NVLF840DNEV5i683kISgFKk= github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864/go.mod h1:VmAHbsL5lLfzHW/MNL96NVLF840DNEV5i683kISgFKk=
github.com/kata-containers/govmm v0.0.0-20210112013750-7d320e8f5dca h1:UdXFthwasAPnmv37gLJUEFsW9FaabYA+mM6FoSi8kzU=
github.com/kata-containers/govmm v0.0.0-20210112013750-7d320e8f5dca/go.mod h1:VmAHbsL5lLfzHW/MNL96NVLF840DNEV5i683kISgFKk=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=

View File

@ -135,7 +135,7 @@ const (
func isDimmSupported(config *Config) bool { func isDimmSupported(config *Config) bool {
switch runtime.GOARCH { switch runtime.GOARCH {
case "amd64", "386", "ppc64le": case "amd64", "386", "ppc64le", "arm64":
if config != nil && config.Machine.Type == MachineTypeMicrovm { if config != nil && config.Machine.Type == MachineTypeMicrovm {
// microvm does not support NUMA // microvm does not support NUMA
return false return false
@ -2300,6 +2300,9 @@ type Config struct {
// Bios is the -bios parameter // Bios is the -bios parameter
Bios string Bios string
// PFlash specifies the parallel flash images (-pflash parameter)
PFlash []string
// Incoming controls migration source preparation // Incoming controls migration source preparation
Incoming Incoming Incoming Incoming
@ -2490,6 +2493,13 @@ func (config *Config) appendGlobalParam() {
} }
} }
func (config *Config) appendPFlashParam() {
for _, p := range config.PFlash {
config.qemuParams = append(config.qemuParams, "-pflash")
config.qemuParams = append(config.qemuParams, p)
}
}
func (config *Config) appendVGA() { func (config *Config) appendVGA() {
if config.VGA != "" { if config.VGA != "" {
config.qemuParams = append(config.qemuParams, "-vga") config.qemuParams = append(config.qemuParams, "-vga")
@ -2675,6 +2685,7 @@ func LaunchQemu(config Config, logger QMPLog) (string, error) {
config.appendDevices() config.appendDevices()
config.appendRTC() config.appendRTC()
config.appendGlobalParam() config.appendGlobalParam()
config.appendPFlashParam()
config.appendVGA() config.appendVGA()
config.appendKnobs() config.appendKnobs()
config.appendKernel() config.appendKernel()

View File

@ -773,11 +773,12 @@ func (q *QMP) ExecuteQuit(ctx context.Context) error {
return q.executeCommand(ctx, "quit", nil, nil) return q.executeCommand(ctx, "quit", nil, nil)
} }
func (q *QMP) blockdevAddBaseArgs(device, blockdevID string) (map[string]interface{}, map[string]interface{}) { func (q *QMP) blockdevAddBaseArgs(device, blockdevID string, ro bool) (map[string]interface{}, map[string]interface{}) {
var args map[string]interface{} var args map[string]interface{}
blockdevArgs := map[string]interface{}{ blockdevArgs := map[string]interface{}{
"driver": "raw", "driver": "raw",
"read-only": ro,
"file": map[string]interface{}{ "file": map[string]interface{}{
"driver": "file", "driver": "file",
"filename": device, "filename": device,
@ -801,8 +802,8 @@ func (q *QMP) blockdevAddBaseArgs(device, blockdevID string) (map[string]interfa
// path of the device to add, e.g., /dev/rdb0, and blockdevID is an identifier // path of the device to add, e.g., /dev/rdb0, and blockdevID is an identifier
// used to name the device. As this identifier will be passed directly to QMP, // used to name the device. As this identifier will be passed directly to QMP,
// it must obey QMP's naming rules, e,g., it must start with a letter. // it must obey QMP's naming rules, e,g., it must start with a letter.
func (q *QMP) ExecuteBlockdevAdd(ctx context.Context, device, blockdevID string) error { func (q *QMP) ExecuteBlockdevAdd(ctx context.Context, device, blockdevID string, ro bool) error {
args, _ := q.blockdevAddBaseArgs(device, blockdevID) args, _ := q.blockdevAddBaseArgs(device, blockdevID, ro)
return q.executeCommand(ctx, "blockdev-add", args, nil) return q.executeCommand(ctx, "blockdev-add", args, nil)
} }
@ -814,8 +815,8 @@ func (q *QMP) ExecuteBlockdevAdd(ctx context.Context, device, blockdevID string)
// direct denotes whether use of O_DIRECT (bypass the host page cache) // direct denotes whether use of O_DIRECT (bypass the host page cache)
// is enabled. noFlush denotes whether flush requests for the device are // is enabled. noFlush denotes whether flush requests for the device are
// ignored. // ignored.
func (q *QMP) ExecuteBlockdevAddWithCache(ctx context.Context, device, blockdevID string, direct, noFlush bool) error { func (q *QMP) ExecuteBlockdevAddWithCache(ctx context.Context, device, blockdevID string, direct, noFlush, ro bool) error {
args, blockdevArgs := q.blockdevAddBaseArgs(device, blockdevID) args, blockdevArgs := q.blockdevAddBaseArgs(device, blockdevID, ro)
if q.version.Major < 2 || (q.version.Major == 2 && q.version.Minor < 9) { if q.version.Major < 2 || (q.version.Major == 2 && q.version.Minor < 9) {
return fmt.Errorf("versions of qemu (%d.%d) older than 2.9 do not support set cache-related options for block devices", return fmt.Errorf("versions of qemu (%d.%d) older than 2.9 do not support set cache-related options for block devices",

View File

@ -1,7 +1,5 @@
module github.com/sirupsen/logrus module github.com/sirupsen/logrus
go 1.15
require ( require (
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences v1.0.1

View File

@ -222,7 +222,7 @@ github.com/hashicorp/errwrap
# github.com/hashicorp/go-multierror v1.0.0 # github.com/hashicorp/go-multierror v1.0.0
## explicit ## explicit
github.com/hashicorp/go-multierror github.com/hashicorp/go-multierror
# github.com/kata-containers/govmm v0.0.0-20201020052039-99f43ec18864 # github.com/kata-containers/govmm v0.0.0-20210112013750-7d320e8f5dca
## explicit ## explicit
github.com/kata-containers/govmm/qemu github.com/kata-containers/govmm/qemu
# github.com/konsorten/go-windows-terminal-sequences v1.0.1 # github.com/konsorten/go-windows-terminal-sequences v1.0.1