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

qemu: add disable_image_nvdimm option #2373

Merged
merged 4 commits into from
Dec 26, 2019
Merged

Conversation

bergwolf
Copy link
Member

To control whether an image rootfs is used as nvdimm device or just plain virtio-block device.

@bergwolf
Copy link
Member Author

/test

@codecov
Copy link

codecov bot commented Dec 23, 2019

Codecov Report

Merging #2373 into master will increase coverage by 0.06%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master    #2373      +/-   ##
==========================================
+ Coverage   50.05%   50.12%   +0.06%     
==========================================
  Files         112      112              
  Lines       16131    16171      +40     
==========================================
+ Hits         8074     8105      +31     
- Misses       7043     7048       +5     
- Partials     1014     1018       +4

@Pennyzct
Copy link
Contributor

Hi~ @bergwolf
If we're using virtio-blk as backend with qemu, then we may not support launching more than one containers simultaneously. It will incur write lock error.
We have addressed this scenario in issue #843.

@bergwolf
Copy link
Member Author

@Pennyzct The virtio-block drive has ShareRW bit set so that the image can be shared among multiple qemu instances. Also it is mounted readonly so no write will incur on the guest rootfs image.

@Pennyzct
Copy link
Contributor

@bergwolf thanks for the explanation. ;)

Copy link
Contributor

@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 @bergwolf!

lgtm

We should create an integration test for this in https://github.com/kata-containers/tests/ though too I think.

Do not implement in each arch code. We should have a generic
implementation instead.

-. amd64 and arm64 uses nvdimm
-. ppc64le and s390x uses virtio-blk

Signed-off-by: Peng Tao <[email protected]>
To control whether an image rootfs is used as nvdimm device or just
plain virtio-block device.

Fixes: kata-containers#2372
Signed-off-by: Peng Tao <[email protected]>
ret is uintptr and always >= 0. errno is enough for error checking.
This is causing lint error:
/home/vagrant/workplace/golang/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check.go:446:20: SA4003: no value of type uintptr is less than 0 (staticcheck)
                if errno != 0 || ret <= 0 {
                                 ^

Signed-off-by: Peng Tao <[email protected]>
So that users can use annotations to set it.

Signed-off-by: Peng Tao <[email protected]>
@bergwolf bergwolf changed the title qemu: add use_nvdimm option qemu: add disable_image_nvdimm option Dec 25, 2019
@bergwolf
Copy link
Member Author

/test

@Pennyzct Pennyzct merged commit b9120b2 into kata-containers:master Dec 26, 2019
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.

3 participants