-
Notifications
You must be signed in to change notification settings - Fork 373
Cloud Hypervisor: driver update number 2 #2274
Conversation
Merge #3 of kata-containers/runtime
added logging of stdout and stderr for failed hypervisor Fixes: #2271 Signed-off-by: Johan Kuijpers <[email protected]>
remove type in kill statement for virtiofsd Fixes: #2270 Signed-off-by: Johan Kuijpers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ericooper! Great to see a large dump of new tests like this 😄
supportedMinorVersion) | ||
return errors.New(errorMessage) | ||
if clh.version.Major < supportedMajorVersion && clh.version.Minor < supportedMinorVersion { | ||
errorMessage := fmt.Sprintf("Unsupported version: cloud-hypervisor %d.%d not supported by this driver version (%d.%d)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing the message to say something like: cloud hypervisor version too old (need atleast %d.%d, found %d.%d)
or similar?
|
||
if clh.config.Debug { | ||
cmd.Env = os.Environ() | ||
cmd.Env = append(cmd.Env, "RUST_BACKTRACE=FULL") | ||
cmd.Env = append(cmd.Env, "RUST_BACKTRACE=full") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random thought: we could probably do with this in virtcontainers/fc.go
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. But to me it looks like it only makes sense in combination with capturing stdout and stderr (of the exec/fork cmd output buffers) otherwise you still don't see what's going on.
virtcontainers/clh.go
Outdated
@@ -854,6 +863,11 @@ func (clh *cloudHypervisor) LaunchClh() (string, int, error) { | |||
return errStr, cmd.Process.Pid, nil | |||
} | |||
|
|||
// MaxAcrnVCPUs returns the maximum number of vCPUs supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment doesn't match code (the static analysis script would detect this I believe).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the checks didn't report it but nevertheless this is obviously a cut and paste error and hence corrected.
virtcontainers/clh_test.go
Outdated
// Cli helper functions | ||
// | ||
|
||
func cliToString(args []string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could simplify this (or remove it?) in favour of:
strings.TrimSpace(strings.Join(args, " "))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed and renamed
virtcontainers/clh_test.go
Outdated
assert.NoError(err) | ||
assert.NotNil(cli) | ||
|
||
netarg, errr := getCliOption(cli.args, "--net") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should this be err
? (same comment for other functions below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
virtcontainers/clh_test.go
Outdated
// --cmdline <cmdline> Kernel command line | ||
// | ||
func TestClhCliKernelParameters(t *testing.T) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: blank line at start of lots of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think best practice to not start with newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best practice is what's good for my eyes :)
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do rebase
instead of merge
I see one commit is a merge - LGTM
I'm not sure what you mean with this. The merge you see is the one I do frequently to keep my fork up-to-date with kata-runtime/master ie in opposite direction. Shouldn't be a problem or? |
Not a problem at all, common practice I use to not have
|
- added clh unit tests - removed some inconsistencies in the cli builder to enable unit tests - suppressed version check for in startSandbox to enable unit tests - added clh related constants and methods to virtcontainer test - small corrections after review applied Fixes: #2205 Signed-off-by: Johan Kuijpers <[email protected]>
/test |
Codecov Report
@@ Coverage Diff @@
## master #2274 +/- ##
========================================
Coverage ? 50.5%
========================================
Files ? 111
Lines ? 16073
Branches ? 0
========================================
Hits ? 8118
Misses ? 6968
Partials ? 987 |
supportedMajorVersion, | ||
supportedMinorVersion) | ||
return errors.New(errorMessage) | ||
if clh.version.Major < supportedMajorVersion && clh.version.Minor < supportedMinorVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supportedMajorVersion is 0.
How can clh.version.Major be lower than 0 ?
This check excludes supportedMinorVersion from being 0 as well (e.g. major == 1 and minor == 0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correct condition should be:
if clh.version.Major < supportedMajorVersion || (clh.version.Major == supportedMajorVersion && clh.version.Minor < supportedMinorVersion) {
Submitted #2312
This PR introduces unit tests for clh driver #2205 and fixes for #2271 and #2270 noticed during development of the unit tests.