mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	Revert "hypervisors: Confidential Guests do not support Device hotplug"
This reverts commit df8ffecde0, as device
hotplug *is* supported and, more than that, is very much needed when
using virtio-blk instead of virtio-fs.
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
			
			
This commit is contained in:
		| @@ -25,7 +25,6 @@ image = "@IMAGEPATH@" | ||||
| # Known limitations: | ||||
| # * Does not work by design: | ||||
| #   - CPU Hotplug  | ||||
| #   - Device Hotplug | ||||
| #   - Memory Hotplug | ||||
| #   - NVDIMM devices | ||||
| # | ||||
|   | ||||
| @@ -26,7 +26,6 @@ machine_type = "@MACHINETYPE@" | ||||
| # Known limitations: | ||||
| # * Does not work by design: | ||||
| #   - CPU Hotplug  | ||||
| #   - Device Hotplug | ||||
| #   - Memory Hotplug | ||||
| #   - NVDIMM devices | ||||
| # | ||||
|   | ||||
| @@ -638,10 +638,6 @@ func (clh *cloudHypervisor) HotplugAddDevice(ctx context.Context, devInfo interf | ||||
| 	span, _ := katatrace.Trace(ctx, clh.Logger(), "HotplugAddDevice", clhTracingTags, map[string]string{"sandbox_id": clh.id}) | ||||
| 	defer span.End() | ||||
|  | ||||
| 	if clh.config.ConfidentialGuest { | ||||
| 		return nil, errors.New("Device hotplug addition is not supported in confidential mode") | ||||
| 	} | ||||
|  | ||||
| 	switch devType { | ||||
| 	case BlockDev: | ||||
| 		drive := devInfo.(*config.BlockDrive) | ||||
| @@ -659,10 +655,6 @@ func (clh *cloudHypervisor) HotplugRemoveDevice(ctx context.Context, devInfo int | ||||
| 	span, _ := katatrace.Trace(ctx, clh.Logger(), "HotplugRemoveDevice", clhTracingTags, map[string]string{"sandbox_id": clh.id}) | ||||
| 	defer span.End() | ||||
|  | ||||
| 	if clh.config.ConfidentialGuest { | ||||
| 		return nil, errors.New("Device hotplug removal is not supported in confidential mode") | ||||
| 	} | ||||
|  | ||||
| 	var deviceID string | ||||
|  | ||||
| 	switch devType { | ||||
| @@ -917,9 +909,7 @@ func (clh *cloudHypervisor) Capabilities(ctx context.Context) types.Capabilities | ||||
| 	clh.Logger().WithField("function", "Capabilities").Info("get Capabilities") | ||||
| 	var caps types.Capabilities | ||||
| 	caps.SetFsSharingSupport() | ||||
| 	if !clh.config.ConfidentialGuest { | ||||
| 		caps.SetBlockDeviceHotplugSupport() | ||||
| 	} | ||||
| 	caps.SetBlockDeviceHotplugSupport() | ||||
| 	return caps | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -158,9 +158,8 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) { | ||||
| func (q *qemuAmd64) capabilities() types.Capabilities { | ||||
| 	var caps types.Capabilities | ||||
|  | ||||
| 	if (q.qemuMachine.Type == QemuQ35 || | ||||
| 		q.qemuMachine.Type == QemuVirt) && | ||||
| 		q.protection == noneProtection { | ||||
| 	if q.qemuMachine.Type == QemuQ35 || | ||||
| 		q.qemuMachine.Type == QemuVirt { | ||||
| 		caps.SetBlockDeviceHotplugSupport() | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -277,9 +277,7 @@ func (q *qemuArchBase) kernelParameters(debug bool) []Param { | ||||
|  | ||||
| func (q *qemuArchBase) capabilities() types.Capabilities { | ||||
| 	var caps types.Capabilities | ||||
| 	if q.protection == noneProtection { | ||||
| 		caps.SetBlockDeviceHotplugSupport() | ||||
| 	} | ||||
| 	caps.SetBlockDeviceHotplugSupport() | ||||
| 	caps.SetMultiQueueSupport() | ||||
| 	caps.SetFsSharingSupport() | ||||
| 	return caps | ||||
|   | ||||
| @@ -101,8 +101,7 @@ func (q *qemuPPC64le) capabilities() types.Capabilities { | ||||
| 	var caps types.Capabilities | ||||
|  | ||||
| 	// pseries machine type supports hotplugging drives | ||||
| 	if q.qemuMachine.Type == QemuPseries && | ||||
| 		q.protection == noneProtection { | ||||
| 	if q.qemuMachine.Type == QemuPseries { | ||||
| 		caps.SetBlockDeviceHotplugSupport() | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user