Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

api: To watch the vm console in FetchSandbox api#442

Merged
devimc merged 1 commit intokata-containers:masterfrom
hyperhq:hyper-integration
Jul 4, 2018
Merged

api: To watch the vm console in FetchSandbox api#442
devimc merged 1 commit intokata-containers:masterfrom
hyperhq:hyper-integration

Conversation

@lifupan
Copy link
Copy Markdown
Member

@lifupan lifupan commented Jun 23, 2018

When do sandbox release, the kataBuiltInProxy will
be closed, and it will stop the watch of vm's console;
Thus it needs to restart the proxy to monitor the vm
console once to restore the sandbox.

Fixes: #441

Signed-off-by: fupan lifupan@gmail.com

@katacontainersbot
Copy link
Copy Markdown
Contributor

PSS Measurement:
Qemu: 148601 KB
Proxy: 4742 KB
Shim: 8920 KB

Memory inside container:
Total Memory: 2045972 KB
Free Memory: 2007308 KB

Copy link
Copy Markdown

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lifupan!

lgtm

return fmt.Errorf("sandbox %s missed agent pointer", s.ID())
}

err := s.agent.startProxy(s)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You could simplify this to simply:

return s.agent.startProxy(s)

return nil, err
}

/* If the proxy is KataBuiltInProxyType type, it needs to restart the proxy to watch the
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plase use // instead of /*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll fix it.


func (s *Sandbox) startProxy() error {

/* If the proxy is KataBuiltInProxyType type, it needs to restart the proxy
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will be fix too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Devimc

I had fixed the issues, do you have any comments?

Thanks!

Fupan

When do sandbox release, the kataBuiltInProxy will
be closed, and it will stop the watch of vm's console;
Thus it needs to restart the proxy to monitor the vm
console once to restore the sandbox.

Fixes: kata-containers#441

Signed-off-by: fupan <lifupan@gmail.com>
@lifupan lifupan force-pushed the hyper-integration branch from f54df34 to 9155412 Compare June 26, 2018 00:04
@katacontainersbot
Copy link
Copy Markdown
Contributor

PSS Measurement:
Qemu: 148204 KB
Proxy: 4634 KB
Shim: 9078 KB

Memory inside container:
Total Memory: 2045972 KB
Free Memory: 2007308 KB

@bergwolf
Copy link
Copy Markdown
Member

bergwolf commented Jul 2, 2018

/lgtm

Jenkins failed on 'crio' though. Might be related to kata-containers/tests/issues/361

@bergwolf
Copy link
Copy Markdown
Member

bergwolf commented Jul 4, 2018

@devimc do you want to take another look?

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 4, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@47caba8). Click here to learn what that means.
The diff coverage is 29.26%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #442   +/-   ##
=========================================
  Coverage          ?   64.07%           
=========================================
  Files             ?       87           
  Lines             ?     8874           
  Branches          ?        0           
=========================================
  Hits              ?     5686           
  Misses            ?     2576           
  Partials          ?      612
Impacted Files Coverage Δ
virtcontainers/agent.go 92.15% <ø> (ø)
virtcontainers/proxy.go 97.18% <ø> (ø)
virtcontainers/sandbox.go 66.44% <0%> (ø)
virtcontainers/noop_agent.go 88.46% <0%> (ø)
virtcontainers/kata_builtin_proxy.go 0% <0%> (ø)
virtcontainers/cc_proxy.go 55.55% <0%> (ø)
virtcontainers/kata_proxy.go 0% <0%> (ø)
virtcontainers/no_proxy.go 50% <0%> (ø)
virtcontainers/noop_proxy.go 100% <100%> (ø)
virtcontainers/api.go 62.75% <25%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47caba8...9155412. Read the comment docs.

@devimc
Copy link
Copy Markdown

devimc commented Jul 4, 2018

lgtm

Approved with PullApprove

@devimc devimc merged commit dfed5a5 into kata-containers:master Jul 4, 2018
zklei pushed a commit to zklei/runtime that referenced this pull request Jun 13, 2019
There are 2 phases in Memory Hotplug. 1) Physical Memory Hotplug phase.
2) Logical Memory Hotplug phase.
The First phase is to communicate hardware/firmware and make/erase
environment for hotplugged memory.
If firmware supports notification of connection of new memory to OS,
this phase is triggered automatically. ACPI can notify this event.
This also what kata supports on amd64, memory hotplug via acpi-driven.
But if not, there is another option, probe operation by hand.
And since memory hotplug via acpi is missing on qemu-system-aarch64,
we hope to support the other probe solution.
This whole implementation of memory hotplug via probe interface is
divided into two phases, the first is to check if guest kernel
is capable of memory hot-add via probe interface, which is located at
/sys/devices/system/memory/probe.

Fixes: kata-containers#442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
zklei pushed a commit to zklei/runtime that referenced this pull request Jun 13, 2019
There are 2 phases in Memory Hotplug. 1) Physical Memory Hotplug phase.
2) Logical Memory Hotplug phase.
The First phase is to communicate hardware/firmware and
make/erase environment for hotplugged memory.
If firmware supports notification of connection of new memory to OS,
this phase is triggered automatically. ACPI can notify this event.
This also what kata supports on amd64, memory hotplug via acpi-driven.
But if not, there is another option, probe operation by hand.
And since memory hotplug via acpi is missing on qemu-system-aarch64,
we hope to support the other probe solution.
This whole implementation of memory hotplug via probe interface is
divided into two phases, the first is covered by former commit.
The second is to notify guest kernel about hot-added momery event
by echoing related addresses into /sys/devices/system/memory/probe.

Fixes: kata-containers#442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
zklei pushed a commit to zklei/runtime that referenced this pull request Jun 13, 2019
since we add extra functionality in func GetGuestDetails for memory
hotplug via probe interface, we need to refine its related unit test.

Fixes: kata-containers#442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FetchSandbox api will lost the watching of vm console when used kataBuiltInProxy

5 participants