mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-22 06:43:41 +00:00
Compare commits
3 Commits
zizmor-upd
...
fupan_test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c376ab5de7 | ||
|
|
200abc815c | ||
|
|
333d12dc47 |
@@ -603,15 +603,15 @@ impl QemuInner {
|
||||
}
|
||||
};
|
||||
|
||||
let coldplugged_mem = megs_to_bytes(self.config.memory_info.default_memory);
|
||||
let coldplugged_mem_mb = self.config.memory_info.default_memory;
|
||||
let coldplugged_mem = megs_to_bytes(coldplugged_mem_mb);
|
||||
let new_total_mem = megs_to_bytes(new_total_mem_mb);
|
||||
|
||||
if new_total_mem < coldplugged_mem {
|
||||
return Err(anyhow!(
|
||||
"asked to resize to {} M but that is less than cold-plugged memory size ({})",
|
||||
new_total_mem_mb,
|
||||
bytes_to_megs(coldplugged_mem)
|
||||
));
|
||||
warn!(sl!(), "asked to resize to {} M but that is less than cold-plugged memory size ({}), nothing to do",new_total_mem_mb,
|
||||
bytes_to_megs(coldplugged_mem));
|
||||
|
||||
return Ok((coldplugged_mem_mb, MemoryConfig::default()));
|
||||
}
|
||||
|
||||
let guest_mem_block_size = qmp.guest_memory_block_size();
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/rootless"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils/retry"
|
||||
|
||||
ctrAnnotations "github.com/containerd/containerd/pkg/cri/annotations"
|
||||
crioAnnotations "github.com/cri-o/cri-o/pkg/annotations"
|
||||
@@ -597,7 +598,31 @@ func (k *kataAgent) updateInterface(ctx context.Context, ifc *pbTypes.Interface)
|
||||
ifcReq := &grpc.UpdateInterfaceRequest{
|
||||
Interface: ifc,
|
||||
}
|
||||
resultingInterface, err := k.sendReq(ctx, ifcReq)
|
||||
// Since the network device hotplug is an asynchronous operation,
|
||||
// it's possible that the hotplug operation had returned, but the network device
|
||||
// hasn't ready in guest, thus it's better to retry on this operation to
|
||||
// wait until the device ready in guest.
|
||||
|
||||
var resultingInterface interface{}
|
||||
|
||||
err := retry.Do(func() error {
|
||||
if resInterface, nerr := k.sendReq(ctx, ifcReq); nerr != nil {
|
||||
errMsg := nerr.Error()
|
||||
if !strings.Contains(errMsg, "Link not found") {
|
||||
return retry.Unrecoverable(nerr)
|
||||
}
|
||||
|
||||
return nerr
|
||||
} else {
|
||||
resultingInterface = resInterface
|
||||
return nil
|
||||
}
|
||||
},
|
||||
|
||||
retry.Attempts(20),
|
||||
retry.LastErrorOnly(true),
|
||||
retry.Delay(20*time.Millisecond))
|
||||
|
||||
if err != nil {
|
||||
k.Logger().WithFields(logrus.Fields{
|
||||
"interface-requested": fmt.Sprintf("%+v", ifc),
|
||||
|
||||
@@ -82,6 +82,9 @@ setup() {
|
||||
[ "$total_cpus_container" -eq "$total_cpus" ] && break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
info "total_cpus_container = $total_cpus_container"
|
||||
|
||||
[ "$total_cpus_container" -eq "$total_cpus" ]
|
||||
|
||||
# Check the total of requests
|
||||
@@ -117,10 +120,8 @@ setup() {
|
||||
teardown() {
|
||||
[ "${KATA_HYPERVISOR}" == "firecracker" ] && skip "test not working see: ${fc_limitations}"
|
||||
[ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}"
|
||||
[ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "test not working see: ${dragonball_limitations}"
|
||||
[ "${KATA_HYPERVISOR}" == "qemu-runtime-rs" ] && skip "Requires CPU hotplug which isn't supported on ${KATA_HYPERVISOR} yet"
|
||||
[ "${KATA_HYPERVISOR}" == "qemu-se-runtime-rs" ] && skip "Requires CPU hotplug which isn't supported on ${KATA_HYPERVISOR} yet"
|
||||
[ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ] && skip "https://github.com/kata-containers/kata-containers/issues/9039"
|
||||
[ "${KATA_HYPERVISOR}" == "qemu-coco-dev*" ] && skip "test not working see: ${fc_limitations}"
|
||||
( [ "${KATA_HYPERVISOR}" == "qemu-tdx" ] || [ "${KATA_HYPERVISOR}" == "qemu-snp" ] || \
|
||||
[ "${KATA_HYPERVISOR}" == "qemu-se" ] ) \
|
||||
&& skip "TEEs do not support memory / CPU hotplug"
|
||||
|
||||
Reference in New Issue
Block a user