Skip to content

Commit 31e1fec

Browse files
committed
Suport vpci-class-guid in the non-containerd backend
IDType `vpci-class-guid` is a synonym of `class`. Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
1 parent cb07afa commit 31e1fec

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

integration/container/devices_windows_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ func TestWindowsDevices(t *testing.T) {
5050
expectedStdout: "/Windows/System32/HostDriverStore/FileRepository",
5151
},
5252
{
53-
doc: "process/vpci-class-guid://5B45201D-F2F2-4F3B-85BB-30FF1F953599 mounted",
54-
devices: []string{"vpci-class-guid://5B45201D-F2F2-4F3B-85BB-30FF1F953599"},
55-
isolation: containertypes.IsolationProcess,
56-
expectedStartFailure: !testEnv.RuntimeIsWindowsContainerd(),
57-
expectedStartFailureMessage: "device assignment of type 'vpci-class-guid' is not supported",
58-
expectedStdout: "/Windows/System32/HostDriverStore/FileRepository",
53+
doc: "process/vpci-class-guid://5B45201D-F2F2-4F3B-85BB-30FF1F953599 mounted",
54+
devices: []string{"vpci-class-guid://5B45201D-F2F2-4F3B-85BB-30FF1F953599"},
55+
isolation: containertypes.IsolationProcess,
56+
expectedStdout: "/Windows/System32/HostDriverStore/FileRepository",
5957
},
6058
{
6159
doc: "hyperv/no device mounted",

libcontainerd/local/local_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ func (c *client) createWindows(id string, spec *specs.Spec, runtimeOptions inter
313313
}
314314
for _, d := range spec.Windows.Devices {
315315
// Per https://github.com/microsoft/hcsshim/blob/v0.9.2/internal/uvm/virtual_device.go#L17-L18,
316-
// this represents an Interface Class GUID.
317-
if d.IDType != "class" {
316+
// these represent an Interface Class GUID.
317+
if d.IDType != "class" && d.IDType != "vpci-class-guid" {
318318
return errors.Errorf("device assignment of type '%s' is not supported", d.IDType)
319319
}
320320
configuration.AssignedDevices = append(configuration.AssignedDevices, hcsshim.AssignedDevice{InterfaceClassGUID: d.ID})

0 commit comments

Comments
 (0)