-
Notifications
You must be signed in to change notification settings - Fork 374
Conversation
/test |
// Attach for virtual endpoint bridges the network pair and adds the | ||
// tap interface of the network pair to the hypervisor. | ||
func (endpoint *BridgedMacvlanEndpoint) Attach(h hypervisor) error { | ||
networkLogger().Info("Attaching macvlan endpoint") |
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.
For consistency, this should be:
networkLogger().WithField("endpoint-type", "bridged-macvlan").Info("Attaching endpoint")
But as mentioned recently, it would be good if we could factor out all these log calls for Attach()
and Detach()
and maybe get the caller to call Type()
on the endpoint and log that in a single location (maybe in add()
and remove()
in virtcontainers/default_network.go
?)
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.
@jodh-intel Missed that from our previous conversation! I have fixed this now, by getting rid of all those calls and logging at a single location.
Hi @amshinde - our friendly neighbourhood CI has found a minor issue:
|
676b792
to
f68d964
Compare
/retest |
@sboeuf PTAL |
Codecov Report
@@ Coverage Diff @@
## master #811 +/- ##
==========================================
+ Coverage 65.64% 66.09% +0.44%
==========================================
Files 87 87
Lines 10802 10505 -297
==========================================
- Hits 7091 6943 -148
+ Misses 3004 2863 -141
+ Partials 707 699 -8 |
/retest |
I think macvtap hotplug is supported now. So what is relationship between XconnectNetModel and type of endpoint? like this NetXConnectBridgedModel->VethEndpoint NetXConnectMacVtapModel->MacvtapEndpoint? |
Thanks @amshinde. lgtm |
@@ -833,7 +833,7 @@ func (q *qemu) hotplugVFIODevice(device *config.VFIODev, op operation) error { | |||
return nil | |||
} | |||
|
|||
func (q *qemu) hotplugMacvtap(drive *VirtualEndpoint) error { | |||
func (q *qemu) hotplugMacvtap(drive *VethEndpoint) error { |
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.
This function is for macvtap
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.
@caoruidong Yes, but the underlying interface is the Veth interface. Macvtap is used as the bridging mechanism. Answering your previous question, the difference is when you get a macvtap interface from the network plugin that you can directly pass to the VM vs an interface such as a veth that you get from the plugin wherein you use a macvtap or a bridge+tap for bridging the interface to the VM.
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.
Oh, so the new MacvtapEndpoint is without veth pair? Got it.
Why not create a sub-directory under virtcontainers? |
Split endpoint implementations into their own file. Fixes kata-containers#799 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Split network_test.go into separate test files. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
As this really represents a veth pair rather than a generic virtual interface, rename VirtualEndpoint to VethEndpoint. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Explicitly check for "veth" intergace type while creating a veth endpoint. Error out for unsupported network interfaces. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Log Attach, Detach, HotAttach and HotDetach at a single location. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
b6c6378
to
b04691e
Compare
/retest |
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 @amshinde ! I bet this was not fun but it helps clarifying the code base a lot :)
/retest |
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 @amshinde
Thanks @amshinde ! It makes the code a lot more clear. |
Split network.go into separate endpoint implementations.