From 701344e96642d12488117c24cf5d196cd54b05da Mon Sep 17 00:00:00 2001 From: Jianyong Wu Date: Mon, 6 May 2019 23:31:58 -0400 Subject: [PATCH] updateInterface: enable hot-add nic on arm64 For now, update interface in agent will fail when hot-add nic to a running containers on arm64 as rescan pci bus will occur between uf and bf of shpc hotplug interrupt handling. Another problem is that the rootBusPath will be "/devices/platform/4010000000.pcie/pci0000:00" on arm64. To enable hot-add nic on arm64, rootBusPath should be changed here and shpc hotplug should be disabled in guest kernel. This patch just change rootBusPath. Fixes: #544 Signed-off-by: Jianyong Wu --- device.go | 3 +-- device_amd64.go | 11 +++++++++++ device_arm64.go | 9 +++++++++ device_ppc64le.go | 11 +++++++++++ device_s390x.go | 11 +++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 device_amd64.go create mode 100644 device_arm64.go create mode 100644 device_ppc64le.go create mode 100644 device_s390x.go diff --git a/device.go b/device.go index 98a2c27f88..487cbd502c 100644 --- a/device.go +++ b/device.go @@ -35,8 +35,7 @@ const ( ) const ( - rootBusPath = "/devices/pci0000:00" - pciBusMode = 0220 + pciBusMode = 0220 ) var ( diff --git a/device_amd64.go b/device_amd64.go new file mode 100644 index 0000000000..9c6c184cd3 --- /dev/null +++ b/device_amd64.go @@ -0,0 +1,11 @@ +// +// Copyright (c) 2019 ARM Limited +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +const ( + rootBusPath = "/devices/pci0000:00" +) diff --git a/device_arm64.go b/device_arm64.go new file mode 100644 index 0000000000..9ccae80941 --- /dev/null +++ b/device_arm64.go @@ -0,0 +1,9 @@ +// +// Copyright (c) 2019 ARM Limited +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +const rootBusPath = "/devices/platform/4010000000.pcie/pci0000:00" diff --git a/device_ppc64le.go b/device_ppc64le.go new file mode 100644 index 0000000000..9c6c184cd3 --- /dev/null +++ b/device_ppc64le.go @@ -0,0 +1,11 @@ +// +// Copyright (c) 2019 ARM Limited +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +const ( + rootBusPath = "/devices/pci0000:00" +) diff --git a/device_s390x.go b/device_s390x.go new file mode 100644 index 0000000000..9c6c184cd3 --- /dev/null +++ b/device_s390x.go @@ -0,0 +1,11 @@ +// +// Copyright (c) 2019 ARM Limited +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +const ( + rootBusPath = "/devices/pci0000:00" +)