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

Allow to change internetworking model #887

Closed

Conversation

jcarlosv
Copy link

@jcarlosv jcarlosv commented Jan 2, 2018

This PR add configuation option to allow change how VM will be connected to container network.

Allowed options are : bridged and macvtap

Depends on containers/virtcontainers#528

config.go Outdated
}

ccLog.WithFields(
logrus.Fields{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: as you are only logging a single field, you could make this:

ccLog.WithField("model", modelName).Info("Setting internetworking model")

config.go Outdated
ccLog.WithFields(
logrus.Fields{
"model": modelName,
}).Infof("Setting internetworking model")
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be Info() rather than Infof() here.

config.go Outdated
if err != nil {
return vc.ModelDefault, err
}
return model, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing blank line between closing brace and return.

config.go Outdated
@@ -265,6 +286,10 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
if err != nil {
return vc.HypervisorConfig{}, err
}
internetworkingModel, err := h.internetworkingModel()
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing blank line before this one.

# the container network interface
# Options:
#
# - bridged
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be tempted to indent these two options (and indent their descriptions further) for clarity:

# Options:
#
#   - bridged
#
#     Uses a linux bridge to interconnect
#     the container interface to the VM. ...
#          :
#
#   - macvtap
#
#     Used when the Container network
#          :
#

@jcvenegas
Copy link
Contributor

Hi @jodh-intel thanks for the review, changes applied.

@jcvenegas jcvenegas added the wip label Jan 3, 2018
@jodh-intel
Copy link
Contributor

jodh-intel commented Jan 3, 2018

I noticed that the PR was raised using an alternative github id, but the commit authorship and sign-offs are as expected, so

lgtm.

Now, we just need to wait for containers/virtcontainers#528 to land and be re-vendored into the runtime.

Approved with PullApprove Approved with PullApprove

Copy link
Contributor

@sboeuf sboeuf left a comment

Choose a reason for hiding this comment

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

Please make sure you will remove commit number 2 (vc: Apply vc patch manually) so that we can merge this PR when virtcontainers PR will be merged.

config.go Outdated
@@ -219,6 +220,24 @@ func (h hypervisor) defaultBridges() uint32 {
return h.DefaultBridges
}

func (h hypervisor) internetworkingModel() (vc.NetInterworkingModel, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please rename every internetworkingModel occurrences into interNetworkingModel.

Internetworking model is the way the hypervisor will be connected to
the container network.

Add option to define how to connect the vm.

Fixes: clearcontainers#886

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
For testing

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
delete before merge

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
@sboeuf
Copy link
Contributor

sboeuf commented Feb 9, 2018

@jcvenegas containers/virtcontainers#528 has been merged. Could you please rebase this PR on latest origin/master and update the vendoring too ?

@jcvenegas jcvenegas closed this Feb 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants