From 2c00e6b3d5ab32c6ba4ced518f2ff64833f5ea02 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Tue, 5 Sep 2017 16:52:58 +0800 Subject: [PATCH 01/10] Add runv `interface` command Add runv interface command to support CNI networks: This is initial commit, after it's done, it's supposed to be able to: * add new interface into a runv container, with specified ip, mac, mtu, and tapname. * remove an interface from runv container. * update configuration of an interface. * list all network interfaces. Signed-off-by: Zhang Wei --- api/descriptions.pb.go | 169 +++++++++++--------- api/descriptions.proto | 19 ++- cli/interface.go | 108 +++++++++++++ cli/main.go | 1 + cli/network.go | 4 +- hyperstart/api/grpc/hyperstart.pb.go | 205 +++++++++++++++---------- hyperstart/api/grpc/hyperstart.proto | 6 +- hyperstart/libhyperstart/grpc.go | 5 +- hyperstart/libhyperstart/hyperstart.go | 2 +- hyperstart/libhyperstart/json.go | 24 ++- hyperstart/proxy/proxy.go | 2 +- hypervisor/driver.go | 2 +- hypervisor/events.go | 3 +- hypervisor/network.go | 46 +++--- hypervisor/network/network.go | 15 +- hypervisor/network/network_linux.go | 104 ++++++------- hypervisor/persistence.go | 4 +- hypervisor/vbox/network.go | 19 +-- hypervisor/vm_states.go | 2 +- hypervisor/xen/xen.go | 2 +- 20 files changed, 464 insertions(+), 278 deletions(-) create mode 100644 cli/interface.go diff --git a/api/descriptions.pb.go b/api/descriptions.pb.go index 98f5c843..95d42a46 100644 --- a/api/descriptions.pb.go +++ b/api/descriptions.pb.go @@ -307,14 +307,16 @@ func (m *VolumeDescription) GetReadOnly() bool { } type InterfaceDescription struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Lo bool `protobuf:"varint,2,opt,name=lo" json:"lo,omitempty"` - Bridge string `protobuf:"bytes,3,opt,name=bridge" json:"bridge,omitempty"` - Ip string `protobuf:"bytes,4,opt,name=ip" json:"ip,omitempty"` - Mac string `protobuf:"bytes,5,opt,name=mac" json:"mac,omitempty"` - Gw string `protobuf:"bytes,6,opt,name=gw" json:"gw,omitempty"` - TapName string `protobuf:"bytes,7,opt,name=tapName" json:"tapName,omitempty"` - Options string `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Lo bool `protobuf:"varint,3,opt,name=lo" json:"lo,omitempty"` + Bridge string `protobuf:"bytes,4,opt,name=bridge" json:"bridge,omitempty"` + Ip []string `protobuf:"bytes,5,rep,name=ip" json:"ip,omitempty"` + Mac string `protobuf:"bytes,6,opt,name=mac" json:"mac,omitempty"` + Mtu uint64 `protobuf:"varint,7,opt,name=mtu" json:"mtu,omitempty"` + Gw string `protobuf:"bytes,8,opt,name=gw" json:"gw,omitempty"` + TapName string `protobuf:"bytes,9,opt,name=tapName" json:"tapName,omitempty"` + Options string `protobuf:"bytes,10,opt,name=options" json:"options,omitempty"` } func (m *InterfaceDescription) Reset() { *m = InterfaceDescription{} } @@ -329,6 +331,13 @@ func (m *InterfaceDescription) GetId() string { return "" } +func (m *InterfaceDescription) GetName() string { + if m != nil { + return m.Name + } + return "" +} + func (m *InterfaceDescription) GetLo() bool { if m != nil { return m.Lo @@ -343,11 +352,11 @@ func (m *InterfaceDescription) GetBridge() string { return "" } -func (m *InterfaceDescription) GetIp() string { +func (m *InterfaceDescription) GetIp() []string { if m != nil { return m.Ip } - return "" + return nil } func (m *InterfaceDescription) GetMac() string { @@ -357,6 +366,13 @@ func (m *InterfaceDescription) GetMac() string { return "" } +func (m *InterfaceDescription) GetMtu() uint64 { + if m != nil { + return m.Mtu + } + return 0 +} + func (m *InterfaceDescription) GetGw() string { if m != nil { return m.Gw @@ -692,71 +708,72 @@ func init() { func init() { proto.RegisterFile("descriptions.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1050 bytes of a gzipped FileDescriptorProto + // 1069 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94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 0x25, 0xf0, 0xe0, 0x56, - 0x07, 0xb7, 0x83, 0x98, 0x74, 0x06, 0xf1, 0x21, 0x6c, 0x7b, 0xbb, 0x72, 0x79, 0xe3, 0x56, 0xe4, - 0x10, 0x9f, 0x5b, 0xb7, 0x94, 0x21, 0x4e, 0x68, 0xe4, 0x08, 0xf7, 0x61, 0x5d, 0x29, 0xde, 0x8b, - 0x38, 0x71, 0xec, 0x4b, 0x18, 0xd8, 0xb8, 0x48, 0x86, 0xe4, 0xe3, 0x83, 0x8e, 0x8f, 0xf5, 0x42, - 0x11, 0x8d, 0x04, 0xcb, 0xe0, 0x5e, 0x61, 0xf3, 0x0b, 0xe5, 0xe2, 0xe0, 0x8d, 0xa8, 0x82, 0x37, - 0x30, 0x1a, 0x24, 0x25, 0x8b, 0x53, 0x53, 0xae, 0x69, 0x62, 0x86, 0xa2, 0xe5, 0xb3, 0x3f, 0x13, - 0xd8, 0x9f, 0x98, 0xa0, 0xdc, 0x5c, 0xe6, 0xea, 0xdf, 0x56, 0xcf, 0x7d, 0x48, 0x4b, 0x4b, 0x91, - 0x0d, 0x45, 0x5a, 0x5a, 0xf4, 0x7e, 0xe6, 0x74, 0xd1, 0xee, 0x9d, 0xc8, 0x91, 0x5e, 0x15, 0x23, - 0x4a, 0x75, 0x85, 0x15, 0x58, 0xca, 0x9c, 0x36, 0xc9, 0x48, 0x20, 0x89, 0x12, 0x8b, 0xab, 0xb8, - 0x41, 0xd2, 0xc5, 0x15, 0x0e, 0x5b, 0x90, 0xd5, 0x89, 0x8c, 0x6b, 0x63, 0x24, 0x1a, 0x16, 0xbf, - 0x74, 0x33, 0x31, 0x6a, 0xc3, 0xce, 0x2c, 0xec, 0x4e, 0xad, 0x0b, 0x5d, 0x87, 0xe3, 0x96, 0x47, - 0x98, 0xdc, 0xee, 0x8b, 0x96, 0x67, 0x8f, 0x61, 0x27, 0x6f, 0x66, 0x82, 0x04, 0x52, 0x12, 0xb8, - 0x09, 0xa2, 0x05, 0xba, 0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xda, 0xa7, 0x91, 0x8d, 0xf6, 0x69, 0x60, 0x19, - 0xf4, 0xce, 0xa5, 0x2b, 0xc8, 0x7c, 0x4f, 0x10, 0x8d, 0x98, 0xb7, 0xf3, 0x7a, 0xe4, 0x7b, 0x82, - 0xe8, 0xec, 0xef, 0x04, 0x06, 0x53, 0x67, 0x73, 0xe5, 0xe9, 0x87, 0xa0, 0xdd, 0xd2, 0xd1, 0xd8, - 0x35, 0x80, 0x23, 0x32, 0x29, 0xa2, 0xbb, 0xe9, 0x84, 0xac, 0x61, 0x98, 0x31, 0x67, 0x44, 0x63, - 0x54, 0xe4, 0x5d, 0x9c, 0xb5, 0x9a, 0x61, 0x87, 0xb0, 0xfb, 0xea, 0xa6, 0xf7, 0xf1, 0x77, 0x63, - 0x13, 0xc6, 0x32, 0xfd, 0xa0, 0xdc, 0x52, 0x37, 0xe7, 0x7c, 0x28, 0x5a, 0x1e, 0xdf, 0x7b, 0x85, - 0x17, 0x6d, 0x50, 0x5f, 0x34, 0xa4, 0x11, 0xc3, 0x75, 0xce, 0x87, 0x35, 0xf6, 0x36, 0xde, 0xc9, - 0x9f, 0xe2, 0x9d, 0xac, 0x2f, 0x74, 0xc3, 0xce, 0xb6, 0x69, 0x72, 0x9e, 0xfd, 0x13, 0x00, 0x00, - 0xff, 0xff, 0xb9, 0xd4, 0x30, 0xfc, 0xa7, 0x09, 0x00, 0x00, + 0x13, 0xe7, 0xce, 0x92, 0x25, 0x8d, 0xe2, 0xd8, 0x59, 0xfc, 0x84, 0x7d, 0x42, 0x29, 0xe6, 0x9a, + 0x14, 0x93, 0x82, 0x5f, 0x38, 0xd0, 0x34, 0x85, 0x40, 0x43, 0x12, 0x82, 0xa0, 0x8d, 0xc5, 0xba, + 0x69, 0xe9, 0xcb, 0xd5, 0xdd, 0x4a, 0xde, 0xfa, 0xb4, 0x7b, 0xec, 0xae, 0xec, 0xa8, 0x1f, 0xa2, + 0x9f, 0xa5, 0xef, 0xfa, 0x5d, 0x4a, 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 0x01, 0x38, 0x22, 0x93, 0x22, 0xba, 0x9b, 0x4e, 0xc8, 0x1a, 0x86, 0x19, + 0x73, 0x46, 0x34, 0x46, 0x45, 0xde, 0xc5, 0x89, 0xac, 0x19, 0x76, 0x08, 0xbb, 0xaf, 0xae, 0x7b, + 0x1f, 0xa7, 0x73, 0x13, 0xc6, 0x32, 0xfd, 0xa8, 0xdc, 0x52, 0x37, 0xbf, 0x04, 0x43, 0xd1, 0xf2, + 0xf8, 0xde, 0x2b, 0xbc, 0x8a, 0x83, 0xfa, 0x2a, 0x22, 0x8d, 0x18, 0x2e, 0x7d, 0x3e, 0xac, 0xb1, + 0xb7, 0xf1, 0xd6, 0xfe, 0x1c, 0x6f, 0x6d, 0x1c, 0xdd, 0xc8, 0xce, 0xb6, 0x69, 0x72, 0x9e, 0xfd, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x35, 0x50, 0x07, 0xf9, 0xeb, 0x09, 0x00, 0x00, } diff --git a/api/descriptions.proto b/api/descriptions.proto index 2ecde84e..70660ce7 100644 --- a/api/descriptions.proto +++ b/api/descriptions.proto @@ -2,6 +2,9 @@ syntax = "proto3"; package api; +// To generate description.pb.go, run: +// $ protoc --go_out=plugins=grpc:. descriptions.proto + message SandboxConfig { string hostname = 1; repeated string dns = 2; @@ -52,13 +55,15 @@ message VolumeDescription { message InterfaceDescription { string id = 1; - bool lo = 2; - string bridge = 3; - string ip = 4; - string mac = 5; - string gw = 6; - string tapName = 7; - string options = 8; + string name = 2; + bool lo = 3; + string bridge = 4; + repeated string ip = 5; + string mac = 6; + uint64 mtu = 7; + string gw = 8; + string tapName = 9; + string options = 10; } message PortDescription { diff --git a/cli/interface.go b/cli/interface.go new file mode 100644 index 00000000..d56b90ef --- /dev/null +++ b/cli/interface.go @@ -0,0 +1,108 @@ +package main + +import ( + "fmt" + "path/filepath" + + "github.com/hyperhq/runv/api" + "github.com/urfave/cli" +) + +var interfaceCommand = cli.Command{ + Name: "interface", + Usage: "manage interfaces for container", + Subcommands: []cli.Command{ + infAddCommand, + infRmCommand, + infUpdateCommand, + infListCommand, + }, + Before: func(context *cli.Context) error { + return cmdPrepare(context, true, context.Bool("detach")) + }, + Action: func(context *cli.Context) error { + return nil + }, +} + +var infAddCommand = cli.Command{ + Name: "add", + Usage: "add an interface into a container", + ArgsUsage: `add `, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "tapname", + Usage: "set tap name, if interface with same name exists, use existing one instead of creating new one", + }, + cli.StringFlag{ + Name: "name", + Usage: "set interface name in container", + }, + cli.StringFlag{ + Name: "ip", + Usage: "set ip address with a mask, format: 192.168.0.2/24", + }, + cli.StringFlag{ + Name: "mac", + Usage: "set mac address", + }, + cli.IntFlag{ + Name: "mtu", + Usage: "set mtu", + }, + }, + Action: func(context *cli.Context) error { + container := context.Args().First() + + if container == "" { + return cli.NewExitError("Please specify container ID", -1) + } + + vm, lockfile, err := getSandbox(filepath.Join(context.GlobalString("root"), container, "sandbox")) + if err != nil { + return fmt.Errorf("failed to get sandbox for container %q: %v", container, err) + } + defer putSandbox(vm, lockfile) + + ip := context.String("ip") + conf := &api.InterfaceDescription{ + Name: context.String("name"), + Ip: []string{ip}, + Mac: context.String("mac"), + TapName: context.String("tapname"), + Mtu: context.Uint64("mtu"), + } + + return vm.AddNic(conf) + }, +} + +var infListCommand = cli.Command{ + Name: "ls", + Usage: "list network interfaces in a container", + ArgsUsage: `ls `, + Flags: []cli.Flag{}, + Action: func(context *cli.Context) error { + return nil + }, +} + +var infRmCommand = cli.Command{ + Name: "rm", + Usage: "remove an interface from container", + ArgsUsage: `rm `, + Flags: []cli.Flag{}, + Action: func(context *cli.Context) error { + return nil + }, +} + +var infUpdateCommand = cli.Command{ + Name: "update", + Usage: "update configuration of interface", + ArgsUsage: `update `, + Flags: []cli.Flag{}, + Action: func(context *cli.Context) error { + return nil + }, +} diff --git a/cli/main.go b/cli/main.go index 04c9b477..3e6a2259 100644 --- a/cli/main.go +++ b/cli/main.go @@ -128,6 +128,7 @@ func main() { app.Commands = []cli.Command{ createCommand, execCommand, + interfaceCommand, killCommand, listCommand, psCommand, diff --git a/cli/network.go b/cli/network.go index f393c3d6..1ced4dba 100644 --- a/cli/network.go +++ b/cli/network.go @@ -160,7 +160,7 @@ func initSandboxNetwork(vm *hypervisor.Vm, enc *gob.Encoder, dec *gob.Decoder) e Id: nicId, //ip as an id Lo: false, Bridge: bridge, - Ip: info.Ip, + Ip: []string{info.Ip}, Options: options, } @@ -253,7 +253,7 @@ func nsListenerStrap(vm *hypervisor.Vm, enc *gob.Encoder, dec *gob.Decoder) { Id: strconv.Itoa(link.Attrs().Index), Lo: false, Bridge: bridge, - Ip: update.Addr.LinkAddress.String(), + Ip: []string{update.Addr.LinkAddress.String()}, Options: options, } diff --git a/hyperstart/api/grpc/hyperstart.pb.go b/hyperstart/api/grpc/hyperstart.pb.go index a509f707..5a9b49aa 100644 --- a/hyperstart/api/grpc/hyperstart.pb.go +++ b/hyperstart/api/grpc/hyperstart.pb.go @@ -367,9 +367,8 @@ func (*DestroySandboxRequest) ProtoMessage() {} func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } type UpdateInterfaceRequest struct { - Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` - Mask string `protobuf:"bytes,3,opt,name=mask" json:"mask,omitempty"` + Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` + Address []string `protobuf:"bytes,2,rep,name=address" json:"address,omitempty"` } func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } @@ -384,18 +383,11 @@ func (m *UpdateInterfaceRequest) GetDevice() string { return "" } -func (m *UpdateInterfaceRequest) GetAddress() string { +func (m *UpdateInterfaceRequest) GetAddress() []string { if m != nil { return m.Address } - return "" -} - -func (m *UpdateInterfaceRequest) GetMask() string { - if m != nil { - return m.Mask - } - return "" + return nil } type AddRouteRequest struct { @@ -1195,69 +1187,128 @@ var _HyperstartService_serviceDesc = grpc1.ServiceDesc{ func init() { proto.RegisterFile("hyperstart.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1023 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0x6d, 0x6b, 0x1b, 0x47, - 0x10, 0x46, 0xd6, 0x59, 0xb2, 0x46, 0x7e, 0x89, 0x57, 0xb1, 0x7d, 0x51, 0x42, 0x71, 0xaf, 0x90, - 0x08, 0x4a, 0x14, 0x70, 0xa0, 0x6d, 0x0a, 0xa1, 0xa8, 0x8a, 0x49, 0x4b, 0x6b, 0x1a, 0x4e, 0x35, - 0x86, 0x42, 0x4b, 0xd7, 0xda, 0xb5, 0xbc, 0x58, 0xda, 0x55, 0x77, 0xf7, 0xac, 0xaa, 0xff, 0xa2, - 0xff, 0xa4, 0x9f, 0xfa, 0xfb, 0xca, 0xbe, 0x9d, 0x4e, 0xd6, 0x29, 0x90, 0xc6, 0xdf, 0x66, 0x66, - 0xe7, 0x9e, 0x79, 0xd9, 0x99, 0x7d, 0x0e, 0x1e, 0x5c, 0xcf, 0xa7, 0x54, 0x2a, 0x8d, 0xa5, 0xee, - 0x4e, 0xa5, 0xd0, 0x02, 0x45, 0x23, 0x39, 0x1d, 0xb6, 0x1f, 0x8f, 0x84, 0x18, 0x8d, 0xe9, 0x0b, - 0x6b, 0xbb, 0xcc, 0xae, 0x5e, 0xd0, 0xc9, 0x54, 0xcf, 0x9d, 0x4b, 0x32, 0x82, 0x56, 0x8f, 0x90, - 0xbe, 0xe0, 0x1a, 0x33, 0x4e, 0x65, 0x4a, 0xff, 0xc8, 0xa8, 0xd2, 0xe8, 0x39, 0x34, 0x86, 0xc1, - 0x16, 0x57, 0x8e, 0x2b, 0x9d, 0xe6, 0xc9, 0x5e, 0xd7, 0xa0, 0x75, 0x17, 0xae, 0x0b, 0x0f, 0xf4, - 0x29, 0x44, 0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 0x1e, 0x80, 0x27, 0x2e, 0xc2, 0x78, 0x0e, 0xb1, - 0x42, 0x96, 0x39, 0x44, 0x09, 0xc9, 0x7d, 0x03, 0xe0, 0x38, 0x87, 0x88, 0x4c, 0x87, 0x56, 0xac, - 0x90, 0x5c, 0x3b, 0x5e, 0x3d, 0x58, 0x01, 0xa0, 0x52, 0xfe, 0x1f, 0x80, 0xd7, 0x00, 0x0b, 0x2e, - 0x0b, 0x00, 0x2b, 0xec, 0xb6, 0xb6, 0x8f, 0x3d, 0xd8, 0x2e, 0xb2, 0x57, 0x18, 0x87, 0x12, 0x46, - 0x7b, 0x1f, 0x44, 0x91, 0x87, 0x02, 0x44, 0x09, 0x37, 0xad, 0x85, 0x38, 0x85, 0xdd, 0x65, 0x16, - 0x42, 0xfe, 0xf1, 0x2d, 0xe5, 0xa6, 0xb5, 0x30, 0x6f, 0x61, 0xef, 0x0e, 0x67, 0xa1, 0x27, 0xfe, - 0x59, 0x2a, 0xa5, 0xb2, 0xb5, 0x40, 0xaf, 0x60, 0x2b, 0x90, 0x13, 0x3a, 0xc8, 0xe7, 0xbb, 0x48, - 0x56, 0xef, 0xeb, 0x46, 0x91, 0x9f, 0x42, 0x37, 0x4a, 0x38, 0x6b, 0x1d, 0xc4, 0x65, 0xcd, 0xea, - 0x2f, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xec, 0xb2, 0xa0, 0x1c, 0x9a, 0x0b, 0x00, 0x00, + // 1968 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x6e, 0x1b, 0xb9, + 0x15, 0xae, 0xe4, 0x91, 0x65, 0x1d, 0xc9, 0x3f, 0xa2, 0x6c, 0x47, 0x51, 0xb6, 0xbb, 0xc9, 0x2c, + 0x9a, 0x35, 0x1a, 0xac, 0x82, 0x3a, 0x8b, 0x6e, 0xb6, 0x45, 0x50, 0x38, 0x8e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, 0x36, 0xc9, 0x0d, 0xf7, 0x60, + 0xed, 0x92, 0x09, 0x99, 0x04, 0x31, 0xb1, 0x76, 0x0b, 0x5a, 0x81, 0x47, 0x89, 0x32, 0xb9, 0xb2, + 0xd7, 0xc0, 0x6a, 0xe9, 0xdf, 0x83, 0x9d, 0x57, 0x44, 0x48, 0xce, 0xa6, 0xb3, 0x30, 0xfe, 0x37, + 0xb0, 0x7b, 0x96, 0x46, 0x81, 0x24, 0x6f, 0x12, 0x49, 0xf8, 0x45, 0x10, 0x16, 0x91, 0xed, 0xc2, + 0x6a, 0x44, 0xae, 0x69, 0x98, 0xc3, 0x5b, 0x4a, 0xc5, 0x14, 0x44, 0x11, 0x37, 0x31, 0x29, 0x03, + 0x39, 0xe9, 0xff, 0x14, 0x36, 0x0f, 0xa2, 0x08, 0xb3, 0x4c, 0x16, 0x20, 0x9f, 0xc2, 0x2a, 0x57, + 0xb4, 0xba, 0xae, 0x2b, 0x7b, 0xcd, 0xfd, 0xa6, 0xa9, 0x51, 0x23, 0x63, 0xb7, 0xfc, 0x1d, 0xe8, + 0xfc, 0x3a, 0x19, 0xd3, 0x84, 0x1c, 0x9e, 0x9c, 0x1d, 0x93, 0xfc, 0xca, 0xf8, 0xff, 0xac, 0x40, + 0xa3, 0xe8, 0x27, 0x68, 0x03, 0xaa, 0x34, 0xb2, 0xae, 0x54, 0x69, 0xa4, 0x90, 0x63, 0x96, 0x25, + 0xd2, 0x78, 0x51, 0x20, 0x1f, 0x2b, 0x1e, 0xb6, 0x5b, 0xe8, 0x19, 0xac, 0x8a, 0xa9, 0x08, 0xa5, + 0x2a, 0x55, 0x25, 0xf4, 0x60, 0xae, 0x4b, 0xf5, 0x4f, 0xf5, 0xee, 0x51, 0x22, 0xf9, 0x14, 0x5b, + 0x51, 0x75, 0xa4, 0x98, 0x08, 0x96, 0xf1, 0x90, 0x08, 0x7d, 0x16, 0x0d, 0x5c, 0x32, 0x7a, 0x5f, + 0x41, 0xd3, 0x51, 0x52,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b0, 0xba, 0x66, 0xac, 0x0e, 0x1c, 0xab, 0x83, 0xd2, 0x6a, 0x23, 0xd7, 0xb5, 0x56, 0xfd, + 0xbf, 0x57, 0x60, 0xed, 0x30, 0xcd, 0xce, 0x44, 0x30, 0x22, 0xe8, 0x13, 0x68, 0x4a, 0x26, 0x83, + 0xf1, 0x30, 0x53, 0xa4, 0xce, 0x89, 0x87, 0x41, 0xb3, 0x8c, 0xc0, 0x23, 0x68, 0xa5, 0x84, 0x87, + 0x69, 0x66, 0x25, 0x54, 0x9d, 0x78, 0xb8, 0x69, 0x78, 0x46, 0xa4, 0x0f, 0x1d, 0xbd, 0x37, 0xa4, + 0xc9, 0xf0, 0x8a, 0xf0, 0x84, 0x8c, 0x63, 0x16, 0x11, 0x9b, 0xaa, 0xb6, 0xde, 0x7a, 0x93, 0x7c, + 0x5b, 0x6c, 0xa0, 0x1f, 0x43, 0xbb, 0x90, 0x57, 0x25, 0xa2, 0xa5, 0x4d, 0xea, 0x36, 0xad, 0xf4, + 0x99, 0x65, 0xfb, 0x7f, 0x82, 0x8d, 0xc1, 0x25, 0x67, 0x52, 0x8e, 0x69, 0x32, 0x7a, 0x15, 0xc8, + 0x40, 0x7f, 0x3d, 0x08, 0xa7, 0x2c, 0x12, 0xd6, 0xdb, 0x9c, 0x44, 0x4f, 0xa0, 0x2d, 0x8d, 0x2c, + 0x89, 0x86, 0xb9, 0x8c, 0x39, 0xcd, 0xad, 0x62, 0xe3, 0xc4, 0x0a, 0xff, 0x08, 0x36, 0x4a, 0x61, + 0xf5, 0xc2, 0xb3, 0xfe, 0xae, 0x17, 0xdc, 0x01, 0x8d, 0x89, 0xff, 0x57, 0x93, 0x2c, 0x73, 0x73, + 0x9e, 0x40, 0xa3, 0x4c, 0x84, 0x79, 0xe1, 0x6d, 0xd8, 0xde, 0x69, 0x73, 0x81, 0xd7, 0x8a, 0xac, + 0xbc, 0x80, 0x4d, 0x59, 0x78, 0x3e, 0xd4, 0x9f, 0x61, 0xf3,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06, 0x37, 0x43, + 0xe7, 0x94, 0x9f, 0x43, 0xa3, 0x98, 0xcc, 0xd8, 0x76, 0xde, 0xeb, 0x9b, 0xd9, 0x4d, 0x3f, 0x9f, + 0xdd, 0xf4, 0x07, 0xb9, 0x04, 0x2e, 0x85, 0xfd, 0x8f, 0xa1, 0x65, 0x3d, 0x37, 0xff, 0xc7, 0xe6, + 0xfe, 0x13, 0xec, 0xff, 0xbb, 0x0e, 0xed, 0xd7, 0xc5, 0xe4, 0xc8, 0xd6, 0x3f, 0x3a, 0x80, 0x96, + 0x3b, 0xf6, 0x41, 0xf7, 0x8d, 0x7f, 0x4b, 0x46, 0x41, 0xbd, 0xdd, 0x05, 0x3f, 0x8e, 0xe2, 0x54, + 0x4e, 0xd1, 0x0b, 0x80, 0x72, 0xa0, 0x83, 0xee, 0x15, 0x00, 0xb3, 0xd3, 0x91, 0x5b, 0xd5, 0x0f, + 0x61, 0x7d, 0x66, 0x66, 0x83, 0x7a, 0x06, 0x61, 0xd9, 0x20, 0xe7, 0x56, 0x90, 0x97, 0xd0, 0x74, + 0x46, 0x28, 0xa8, 0x6b, 0x20, 0x16, 0x67, 0x34, 0xbd, 0xfb, 0x4b, 0x76, 0xec, 0x49, 0xef, 0x43, + 0xcd, 0xbe, 0xa5, 0xad, 0x03, 0x4e, 0x36, 0x7b, 0x9d, 0x19, 0x9e, 0xd1, 0xf0, 0x7f, 0x80, 0x0e, + 0x00, 0xec, 0xa4, 0x24, 0xa2, 0x49, 0x61, 0x76, 0x61, 0x3a, 0x53, 0x98, 0x5d, 0x32, 0x55, 0xf9, + 0x05, 0x80, 0x19, 0x72, 0x44, 0x2c, 0x93, 0x79, 0xfa, 0x16, 0xa6, 0x2a, 0xbd, 0xee, 0xe2, 0xc6, + 0x02, 0x00, 0xe1, 0xfc, 0x7f, 0x01, 0x78, 0x01, 0x50, 0x0e, 0x4f, 0x72, 0x80, 0x85, 0x71, 0xca, + 0xad, 0xb9, 0x3f, 0x80, 0x96, 0x3b, 0x2e, 0xc9, 0xaf, 0xd0, 0x92, 0x11, 0xca, 0x5d, 0x10, 0xee, + 0xe0, 0x23, 0x87, 0x58, 0x32, 0x0c, 0xb9, 0x15, 0xe2, 0x08, 0x36, 0x66, 0xc7, 0x1e, 0xc8, 0x4e, + 0x00, 0x96, 0x0e, 0x43, 0x6e, 0x85, 0xf9, 0x1a, 0x36, 0xe7, 0x86, 0x24, 0xc8, 0x3e, 0x90, 0x96, + 0xcf, 0x4e, 0x6e, 0x05, 0xfa, 0x0a, 0xd6, 0xf2, 0x09, 0x09, 0xda, 0x29, 0x6a, 0xc2, 0x9d, 0x98, + 0xdc, 0x95, 0x0d, 0x77, 0x48, 0x92, 0x67, 0x63, 0xc9, 0xe0, 0xe4, 0x36, 0x88, 0xf3, 0x55, 0x4d, + 0x3f, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x72, 0x54, 0x12, 0x2c, 0x16, 0x00, 0x00, } diff --git a/hyperstart/api/grpc/hyperstart.proto b/hyperstart/api/grpc/hyperstart.proto index 00dad0ca..61ee7f4a 100644 --- a/hyperstart/api/grpc/hyperstart.proto +++ b/hyperstart/api/grpc/hyperstart.proto @@ -4,6 +4,9 @@ package grpc; import "google/protobuf/empty.proto"; +// To generate hyperstart.pb.go, run: +// $ protoc --go_out=plugins=grpc:. hyperstart.proto + // unstable service HyperstartService { // execution @@ -94,8 +97,7 @@ message DestroySandboxRequest { message UpdateInterfaceRequest { string device = 1; - string address = 2; - string mask = 3; + repeated string address = 2; } message AddRouteRequest { diff --git a/hyperstart/libhyperstart/grpc.go b/hyperstart/libhyperstart/grpc.go index 3c2811a1..a0bbfcc4 100644 --- a/hyperstart/libhyperstart/grpc.go +++ b/hyperstart/libhyperstart/grpc.go @@ -86,11 +86,10 @@ func (h *grpcBasedHyperstart) AddRoute(routes []hyperstartjson.Route) error { return err } -func (h *grpcBasedHyperstart) UpdateInterface(dev, ip, mask string) error { +func (h *grpcBasedHyperstart) UpdateInterface(dev string, ipnet []string) error { _, err := h.grpc.UpdateInterface(h.ctx, &hyperstartgrpc.UpdateInterfaceRequest{ Device: dev, - Address: ip, - Mask: mask, + Address: ipnet, }) return err } diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index 24d9006b..8231182b 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -32,7 +32,7 @@ type Hyperstart interface { WriteFile(container, path string, data []byte) error ReadFile(container, path string) ([]byte, error) AddRoute(r []hyperstartapi.Route) error - UpdateInterface(dev, ip, mask string) error + UpdateInterface(dev string, ipnet []string) error OnlineCpuMem() error } diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index b74f7ecb..c6073d01 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "net" "sync" "syscall" "time" @@ -646,12 +647,23 @@ func (h *jsonBasedHyperstart) AddRoute(r []hyperstartapi.Route) error { return h.hyperstartCommand(hyperstartapi.INIT_SETUPROUTE, hyperstartapi.Routes{Routes: r}) } -func (h *jsonBasedHyperstart) UpdateInterface(dev, ip, mask string) error { - return h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, hyperstartapi.NetworkInf{ - Device: dev, - IpAddress: ip, - NetMask: mask, - }) +func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string) error { + for _, ipstr := range ipnet { + ip, net, err := net.ParseCIDR(ipstr) + if err != nil { + return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) + } + mask := fmt.Sprintf("%d.%d.%d.%d", int(net.Mask[0]), int(net.Mask[1]), int(net.Mask[2]), int(net.Mask[3])) + err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, hyperstartapi.NetworkInf{ + Device: dev, + IpAddress: ip.String(), + NetMask: mask, + }) + if err != nil { + return fmt.Errorf("json: pailed to send update command to hyperstart: %v", err) + } + } + return nil } func (h *jsonBasedHyperstart) WriteStdin(container, process string, data []byte) (int, error) { diff --git a/hyperstart/proxy/proxy.go b/hyperstart/proxy/proxy.go index b4ff48a6..4f2f6ced 100644 --- a/hyperstart/proxy/proxy.go +++ b/hyperstart/proxy/proxy.go @@ -122,7 +122,7 @@ func (proxy *jsonProxy) DestroySandbox(ctx context.Context, req *hyperstartgrpc. return pbEmpty(err), err } func (proxy *jsonProxy) UpdateInterface(ctx context.Context, req *hyperstartgrpc.UpdateInterfaceRequest) (*google_protobuf.Empty, error) { - err := proxy.json.UpdateInterface(req.Device, req.Address, req.Mask) + err := proxy.json.UpdateInterface(req.Device, req.Address) return pbEmpty(err), err } func (proxy *jsonProxy) AddRoute(ctx context.Context, req *hyperstartgrpc.AddRouteRequest) (*google_protobuf.Empty, error) { diff --git a/hypervisor/driver.go b/hypervisor/driver.go index 16508a62..11f975f9 100644 --- a/hypervisor/driver.go +++ b/hypervisor/driver.go @@ -41,7 +41,7 @@ type HostNicInfo struct { type GuestNicInfo struct { Device string - Ipaddr string + Ipaddr []string Index int Busaddr int } diff --git a/hypervisor/events.go b/hypervisor/events.go index e2986047..0a73fc20 100644 --- a/hypervisor/events.go +++ b/hypervisor/events.go @@ -61,8 +61,7 @@ type InterfaceCreated struct { HostDevice string DeviceName string MacAddr string - IpAddr string - NetMask string + IpAddr []string RouteTable []*RouteRule } diff --git a/hypervisor/network.go b/hypervisor/network.go index 7388f740..0e2ab691 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -2,7 +2,6 @@ package hypervisor import ( "fmt" - "net" "sync" "github.com/hyperhq/runv/api" @@ -84,19 +83,21 @@ func (nc *NetworkContext) freeSlot(slot int) { func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result chan api.Result) { if inf.Lo { - if inf.Ip == "" { + if inf.Ip == nil || len(inf.Ip) == 0 { estr := fmt.Sprintf("creating an interface without an IP address: %#v", inf) nc.sandbox.Log(ERROR, estr) result <- NewSpecError(inf.Id, estr) return } + if inf.Id == "" { + inf.Id = "0" + } i := &InterfaceCreated{ Id: inf.Id, DeviceName: DEFAULT_LO_DEVICE_NAME, IpAddr: inf.Ip, - NetMask: "255.255.255.255", } - nc.lo[inf.Ip] = i + nc.lo[inf.Ip[0]] = i nc.idMap[inf.Id] = i result <- &api.ResultBase{ @@ -121,7 +122,7 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha return } - nc.configureInterface(idx, nc.sandbox.NextPciAddr(), fmt.Sprintf("eth%d", idx), inf, devChan) + nc.configureInterface(idx, nc.sandbox.NextPciAddr(), inf, devChan) }() go func() { @@ -158,7 +159,7 @@ func (nc *NetworkContext) removeInterface(id string, result chan api.Result) { return } else if inf.HostDevice == "" { // a virtual interface delete(nc.idMap, id) - delete(nc.lo, inf.IpAddr) + delete(nc.lo, inf.IpAddr[0]) result <- api.NewResultBase(id, true, "") return } else { @@ -217,12 +218,22 @@ func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { nc.freeSlot(idx) } -func (nc *NetworkContext) configureInterface(index, pciAddr int, name string, inf *api.InterfaceDescription, result chan<- VmEvent) { +func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.InterfaceDescription, result chan<- VmEvent) { var ( err error settings *network.Settings + name string = fmt.Sprintf("eth%d", index) ) + if len(inf.Name) > 0 { + name = inf.Name + } + + // TODO: what should be a proper Id? + if inf.Id == "" { + inf.Id = fmt.Sprintf("%d", index) + } + if HDriver.BuildinNetwork() { /* VBox doesn't support join to bridge */ settings, err = nc.sandbox.DCtx.ConfigureNetwork(inf) @@ -245,12 +256,14 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, name string, in h := &HostNicInfo{ Id: created.Id, - Fd: uint64(created.Fd.Fd()), Device: created.HostDevice, Mac: created.MacAddr, Bridge: created.Bridge, Gateway: created.Bridge, } + if created.Fd != nil { + h.Fd = uint64(created.Fd.Fd()) + } g := &GuestNicInfo{ Device: created.DeviceName, Ipaddr: created.IpAddr, @@ -288,7 +301,7 @@ func (nc *NetworkContext) getIpAddrs() []string { res := []string{} for _, inf := range nc.eth { - res = append(res, inf.IpAddr) + res = append(res, inf.IpAddr...) } return res @@ -325,13 +338,6 @@ func (nc *NetworkContext) close() { } func interfaceGot(id string, index int, pciAddr int, name string, inf *network.Settings) (*InterfaceCreated, error) { - ip, nw, err := net.ParseCIDR(fmt.Sprintf("%s/%d", inf.IPAddress, inf.IPPrefixLen)) - if err != nil { - return &InterfaceCreated{Index: index, PCIAddr: pciAddr, DeviceName: name}, err - } - var tmp []byte = nw.Mask - var mask net.IP = tmp - rt := []*RouteRule{} /* Route rule is generated automaticly on first interface, * or generated on the gateway configured interface. */ @@ -342,7 +348,7 @@ func interfaceGot(id string, index int, pciAddr int, name string, inf *network.S }) } - return &InterfaceCreated{ + infc := &InterfaceCreated{ Id: id, Index: index, PCIAddr: pciAddr, @@ -351,8 +357,8 @@ func interfaceGot(id string, index int, pciAddr int, name string, inf *network.S DeviceName: name, Fd: inf.File, MacAddr: inf.Mac, - IpAddr: ip.String(), - NetMask: mask.String(), + IpAddr: inf.IP, RouteTable: rt, - }, nil + } + return infc, nil } diff --git a/hypervisor/network/network.go b/hypervisor/network/network.go index bcde2d03..1ba50875 100644 --- a/hypervisor/network/network.go +++ b/hypervisor/network/network.go @@ -8,14 +8,13 @@ import ( ) type Settings struct { - Mac string - IPAddress string - IPPrefixLen int - Gateway string - Bridge string - Device string - File *os.File - Automatic bool + Mac string + IP []string + Gateway string + Bridge string + Device string + File *os.File + Automatic bool } const ( diff --git a/hypervisor/network/network_linux.go b/hypervisor/network/network_linux.go index c2f8f81c..fa4ade15 100644 --- a/hypervisor/network/network_linux.go +++ b/hypervisor/network/network_linux.go @@ -789,6 +789,15 @@ func GetTapFd(tapname, bridge, options string) (device string, tapFile *os.File, errno syscall.Errno ) + // check if tapname exists, if true, use existing one instead of create new one + if tapname != "" { + _, err = netlink.LinkByName(tapname) + // link exist, use it + if err == nil { + return tapname, nil, nil + } + } + tapFile, err = os.OpenFile("/dev/net/tun", os.O_RDWR, 0) if err != nil { return "", nil, err @@ -816,20 +825,21 @@ func GetTapFd(tapname, bridge, options string) (device string, tapFile *os.File, return "", nil, err } - bIface, err := net.InterfaceByName(bridge) - if err != nil { - glog.Errorf("get interface by name %s failed", bridge) - tapFile.Close() - return "", nil, err - } + if len(bridge) != 0 { + bIface, err := net.InterfaceByName(bridge) + if err != nil { + glog.Errorf("get bridge by name %s failed: %v", bridge, err) + tapFile.Close() + return "", nil, err + } - err = AddToBridge(tapIface, bIface, options) - if err != nil { - glog.Errorf("Add to bridge failed %s %s", bridge, device) - tapFile.Close() - return "", nil, err + err = AddToBridge(tapIface, bIface, options) + if err != nil { + glog.Errorf("Add to bridge failed %s %s", bridge, device) + tapFile.Close() + return "", nil, err + } } - err = NetworkLinkUp(tapIface) if err != nil { glog.Errorf("Link up device %s failed", device) @@ -848,46 +858,32 @@ func AllocateAddr(requestedIP string) (*Settings, error) { return nil, err } - maskSize, _ := BridgeIPv4Net.Mask.Size() - mac, err := GenRandomMac() if err != nil { glog.Errorf("Generate Random Mac address failed") return nil, err } + ipnet := net.IPNet{ + IP: ip, + Mask: BridgeIPv4Net.Mask, + } + return &Settings{ - Mac: mac, - IPAddress: ip.String(), - Gateway: BridgeIPv4Net.IP.String(), - Bridge: BridgeIface, - IPPrefixLen: maskSize, - Device: "", - File: nil, - Automatic: true, + Mac: mac, + IP: []string{ipnet.String()}, + Gateway: BridgeIPv4Net.IP.String(), + Bridge: BridgeIface, + Device: "", + File: nil, + Automatic: true, }, nil } func Configure(addrOnly bool, inf *api.InterfaceDescription) (*Settings, error) { - - ip, mask, err := ipParser(inf.Ip) - if err != nil { - glog.Errorf("Parse config IP failed %s", err) - return nil, err - } - - maskSize, _ := mask.Size() - - /* TODO: Move port maps out of the plugging procedure - err = SetupPortMaps(ip.String(), maps) - if err != nil { - glog.Errorf("Setup Port Map failed %s", err) - return nil, err - } - */ - mac := inf.Mac if mac == "" { + var err error mac, err = GenRandomMac() if err != nil { glog.Errorf("Generate Random Mac address failed") @@ -897,14 +893,13 @@ func Configure(addrOnly bool, inf *api.InterfaceDescription) (*Settings, error) if addrOnly { return &Settings{ - Mac: mac, - IPAddress: ip.String(), - Gateway: inf.Gw, - Bridge: inf.Bridge, - IPPrefixLen: maskSize, - Device: inf.TapName, - File: nil, - Automatic: false, + Mac: mac, + IP: inf.Ip, + Gateway: inf.Gw, + Bridge: inf.Bridge, + Device: inf.TapName, + File: nil, + Automatic: false, }, nil } @@ -914,14 +909,13 @@ func Configure(addrOnly bool, inf *api.InterfaceDescription) (*Settings, error) } return &Settings{ - Mac: mac, - IPAddress: ip.String(), - Gateway: inf.Gw, - Bridge: inf.Bridge, - IPPrefixLen: maskSize, - Device: device, - File: tapFile, - Automatic: false, + Mac: mac, + IP: inf.Ip, + Gateway: inf.Gw, + Bridge: inf.Bridge, + Device: device, + File: tapFile, + Automatic: false, }, nil } diff --git a/hypervisor/persistence.go b/hypervisor/persistence.go index b8f0c28a..086b34d2 100644 --- a/hypervisor/persistence.go +++ b/hypervisor/persistence.go @@ -39,7 +39,7 @@ type PersistNetworkInfo struct { Index int PciAddr int DeviceName string - IpAddr string + IpAddr []string } type PersistInfo struct { @@ -215,7 +215,7 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { } // use device name distinguish from lo and eth if ifc.DeviceName == DEFAULT_LO_DEVICE_NAME { - nc.lo[pi.IpAddr] = ifc + nc.lo[pi.IpAddr[0]] = ifc } else { nc.eth[pi.Index] = ifc } diff --git a/hypervisor/vbox/network.go b/hypervisor/vbox/network.go index 4358675a..c57666f4 100644 --- a/hypervisor/vbox/network.go +++ b/hypervisor/vbox/network.go @@ -61,22 +61,15 @@ func (vd *VBoxDriver) InitNetwork(bIface, bIP string, disableIptables bool) erro } func (vc *VBoxContext) ConfigureNetwork(config *api.InterfaceDescription) (*network.Settings, error) { - ip, ipnet, err := net.ParseCIDR(config.Ip) - if err != nil { - glog.Errorf("Parse interface IP failed %s", err) - return nil, err - } - maskSize, _ := ipnet.Mask.Size() return &network.Settings{ - Mac: config.Mac, - IPAddress: ip.String(), - Gateway: config.Gw, - Bridge: "", - IPPrefixLen: maskSize, - Device: "", - File: nil, + Mac: config.Mac, + IPAddress: config.Ip, + Gateway: config.Gw, + Bridge: "", + Device: "", + File: nil, }, nil } diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index 538532a6..cf99feaa 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -114,7 +114,7 @@ func (ctx *VmContext) updateInterface(id string) error { if inf := ctx.networks.getInterface(id); inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } else { - return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.IpAddr, inf.NetMask) + return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.IpAddr) } } diff --git a/hypervisor/xen/xen.go b/hypervisor/xen/xen.go index cf195471..6bf1b146 100644 --- a/hypervisor/xen/xen.go +++ b/hypervisor/xen/xen.go @@ -250,7 +250,7 @@ func (xc *XenContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNic glog.V(1).Infof("add network for %d - ip: %s, br: %s, gw: %s, dev: %s, hw: %s", xc.domId, guest.Ipaddr, host.Bridge, host.Bridge, dev, hw.String()) - res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr, host.Bridge, host.Bridge, dev, []byte(hw)) + res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr[0], host.Bridge, host.Bridge, dev, []byte(hw)) if res == 0 { glog.V(1).Infof("nic %s insert succeeded", guest.Device) From 7ff8dfbffe32c76a3d7b1593f64c10b3e1a066eb Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Tue, 5 Sep 2017 19:28:18 +0800 Subject: [PATCH 02/10] Support setting mtu for network interface Add interface for setting mtu. Signed-off-by: Zhang Wei --- hyperstart/api/grpc/hyperstart.pb.go | 253 +++++++++++++------------ hyperstart/api/grpc/hyperstart.proto | 1 + hyperstart/api/json/spec.go | 1 + hyperstart/libhyperstart/grpc.go | 3 +- hyperstart/libhyperstart/hyperstart.go | 2 +- hyperstart/libhyperstart/json.go | 3 +- hyperstart/proxy/proxy.go | 2 +- hypervisor/events.go | 1 + hypervisor/network.go | 4 +- hypervisor/network/network.go | 1 + hypervisor/network/network_linux.go | 2 + hypervisor/vm_states.go | 2 +- 12 files changed, 147 insertions(+), 128 deletions(-) diff --git a/hyperstart/api/grpc/hyperstart.pb.go b/hyperstart/api/grpc/hyperstart.pb.go index 5a9b49aa..102b67fe 100644 --- a/hyperstart/api/grpc/hyperstart.pb.go +++ b/hyperstart/api/grpc/hyperstart.pb.go @@ -369,6 +369,7 @@ func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescript type UpdateInterfaceRequest struct { Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` Address []string `protobuf:"bytes,2,rep,name=address" json:"address,omitempty"` + Mtu uint64 `protobuf:"varint,3,opt,name=mtu" json:"mtu,omitempty"` } func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } @@ -390,6 +391,13 @@ func (m *UpdateInterfaceRequest) GetAddress() []string { return nil } +func (m *UpdateInterfaceRequest) GetMtu() uint64 { + if m != nil { + return m.Mtu + } + return 0 +} + type AddRouteRequest struct { Routes []*Route `protobuf:"bytes,1,rep,name=routes" json:"routes,omitempty"` } @@ -1187,128 +1195,129 @@ var _HyperstartService_serviceDesc = grpc1.ServiceDesc{ func init() { proto.RegisterFile("hyperstart.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1968 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x6e, 0x1b, 0xb9, - 0x15, 0xae, 0xe4, 0x91, 0x65, 0x1d, 0xc9, 0x3f, 0xa2, 0x6c, 0x47, 0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0x2c, 0x4e, 0xba, 0x9e, 0xb9, 0x56, 0x86, - 0xf2, 0x0f, 0xa1, 0x73, 0xaa, 0xca, 0xfa, 0x34, 0x48, 0xa2, 0x73, 0x36, 0xc9, 0x0d, 0xf7, 0x60, - 0xed, 0x92, 0x09, 0x99, 0x04, 0x31, 0xb1, 0x76, 0x0b, 0x5a, 0x81, 0x47, 0x89, 0x32, 0xb9, 0xb2, - 0xd7, 0xc0, 0x6a, 0xe9, 0xdf, 0x83, 0x9d, 0x57, 0x44, 0x48, 0xce, 0xa6, 0xb3, 0x30, 0xfe, 0x37, + // 1975 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x72, 0x1b, 0x49, + 0x15, 0x46, 0xf2, 0xc8, 0xb2, 0x8e, 0xe4, 0x1f, 0xb5, 0x6c, 0x47, 0x51, 0x96, 0xdd, 0x64, 0xb6, + 0xc8, 0xba, 0x48, 0xad, 0x52, 0x38, 0x5b, 0x6c, 0x16, 0x2a, 0x45, 0x39, 0x8e, 0x6b, 0x13, 0x16, + 0x83, 0x69, 0xcb, 0x95, 0x2a, 0x0a, 0x4a, 0x8c, 0x67, 0xda, 0x72, 0x63, 0xcd, 0xf4, 0xa4, 0xbb, + 0xc7, 0x96, 0xb8, 0xe0, 0x11, 0xa8, 0xe2, 0x92, 0x2b, 0xee, 0x79, 0x02, 0x9e, 0x82, 0x47, 0xe0, + 0x01, 0xb8, 0xe4, 0x09, 0xa8, 0xfe, 0x99, 0x99, 0xd6, 0x8f, 0x9d, 0x5a, 0x36, 0xdc, 0xa8, 0xfa, + 0x9c, 0x3e, 0xe7, 0x3b, 0x3f, 0xdd, 0xe7, 0x4c, 0xeb, 0xc0, 0xd6, 0xe5, 0x34, 0x25, 0x5c, 0xc8, + 0x80, 0xcb, 0x7e, 0xca, 0x99, 0x64, 0xc8, 0x1b, 0xf1, 0x34, 0xec, 0x3d, 0x18, 0x31, 0x36, 0x1a, + 0x93, 0xa7, 0x9a, 0x77, 0x9e, 0x5d, 0x3c, 0x25, 0x71, 0x2a, 0xa7, 0x46, 0xa4, 0xf7, 0xc9, 0xfc, + 0xa6, 0xa4, 0x31, 0x11, 0x32, 0x88, 0x53, 0x23, 0xe0, 0x8f, 0xa0, 0x73, 0x10, 0x45, 0x87, 0x2c, + 0x91, 0x01, 0x4d, 0x08, 0xc7, 0xe4, 0x5d, 0x46, 0x84, 0x44, 0x9f, 0x43, 0x23, 0xcc, 0x79, 0xdd, + 0xca, 0xc3, 0xca, 0x5e, 0x73, 0x7f, 0xb3, 0xaf, 0xcc, 0xf5, 0x4b, 0xd1, 0x52, 0x02, 0x3d, 0x02, + 0x8f, 0x26, 0x54, 0x76, 0xab, 0x5a, 0x72, 0xdd, 0x48, 0x9e, 0x70, 0x16, 0x12, 0x21, 0xb0, 0xde, + 0xf2, 0x7f, 0x03, 0xed, 0x83, 0x28, 0xca, 0x79, 0xd6, 0xcc, 0x47, 0xf3, 0x66, 0x1a, 0x2e, 0xea, + 0x67, 0x50, 0x4f, 0x8d, 0xfc, 0x72, 0xe0, 0x7c, 0xd7, 0xbf, 0x80, 0xed, 0x53, 0x3a, 0x4a, 0x82, + 0xf1, 0xb7, 0x82, 0xef, 0xce, 0xc2, 0x37, 0x0a, 0x3c, 0xb4, 0x0b, 0xab, 0x42, 0xe3, 0x75, 0x57, + 0x1e, 0x56, 0xf6, 0xd6, 0xb1, 0xa5, 0xfc, 0x5f, 0x00, 0x7a, 0x1b, 0x50, 0xf9, 0x61, 0xac, 0xf8, + 0x9f, 0x43, 0x67, 0x06, 0x4d, 0xa4, 0x2c, 0x11, 0x44, 0x1b, 0x97, 0x81, 0xcc, 0x84, 0xc6, 0xaa, + 0x61, 0x4b, 0xf9, 0xbf, 0x07, 0xf4, 0x96, 0x53, 0x49, 0x4e, 0x25, 0x27, 0x41, 0xfc, 0x5d, 0x43, + 0x44, 0xe0, 0x45, 0x81, 0x0c, 0x74, 0x80, 0x2d, 0xac, 0xd7, 0xfe, 0x67, 0xd0, 0x99, 0xb1, 0x60, + 0x1d, 0xda, 0x82, 0x95, 0x31, 0x49, 0x34, 0xf8, 0x3a, 0x56, 0x4b, 0xff, 0x77, 0xd0, 0xc6, 0x24, + 0x88, 0x3e, 0x8c, 0x27, 0x16, 0x7e, 0xa5, 0x84, 0xdf, 0x03, 0xe4, 0xc2, 0x5b, 0x37, 0x72, 0x8f, + 0x2b, 0x8e, 0xc7, 0xdf, 0x40, 0xfb, 0x70, 0xcc, 0x04, 0x39, 0x95, 0x11, 0x4d, 0xbe, 0xeb, 0x79, + 0xdc, 0x40, 0x67, 0x20, 0xa7, 0x6f, 0x15, 0x90, 0xa0, 0x7f, 0x24, 0x1f, 0x20, 0x2e, 0xce, 0x6e, + 0xf2, 0xb8, 0x38, 0xbb, 0x51, 0x27, 0x1b, 0xb2, 0x71, 0x16, 0x27, 0x5d, 0xcf, 0x5c, 0x2b, 0x43, + 0xf9, 0x87, 0xd0, 0x39, 0x55, 0x65, 0x7d, 0x1a, 0x24, 0xd1, 0x39, 0x9b, 0xe4, 0x86, 0x7b, 0xb0, + 0x76, 0xc9, 0x84, 0x4c, 0x82, 0x98, 0x58, 0xbb, 0x05, 0xad, 0xc0, 0xa3, 0x44, 0x99, 0x5c, 0xd9, + 0x6b, 0x60, 0xb5, 0xf4, 0xef, 0xc1, 0xce, 0x2b, 0x22, 0x24, 0x67, 0xd3, 0x59, 0x18, 0xff, 0xb7, 0xb0, 0x7b, 0x96, 0x46, 0x81, 0x24, 0x6f, 0x12, 0x49, 0xf8, 0x45, 0x10, 0x16, 0x91, 0xed, 0xc2, 0x6a, 0x44, 0xae, 0x69, 0x98, 0xc3, 0x5b, 0x4a, 0xc5, 0x14, 0x44, 0x11, 0x37, 0x31, 0x29, 0x03, - 0x39, 0xe9, 0xff, 0x14, 0x36, 0x0f, 0xa2, 0x08, 0xb3, 0x4c, 0x16, 0x20, 0x9f, 0x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0x15, 0x91, 0x2a, 0xe9, 0xa7, - 0x32, 0x90, 0xba, 0x8d, 0x3b, 0xfd, 0x41, 0xaf, 0xd1, 0x7d, 0x58, 0xe3, 0x93, 0xe1, 0xf9, 0x54, - 0xd5, 0xa4, 0xf1, 0xaf, 0xce, 0x27, 0x2f, 0x15, 0x89, 0x7e, 0x08, 0xc0, 0x27, 0xc3, 0x93, 0x20, - 0xbc, 0x22, 0x52, 0x58, 0x47, 0x1b, 0x7c, 0x62, 0x19, 0xe8, 0x01, 0x34, 0xf0, 0x64, 0x48, 0x38, - 0x67, 0xdc, 0xd4, 0x85, 0x87, 0xd7, 0xf0, 0xe4, 0x48, 0xd3, 0x4a, 0x17, 0x4f, 0x86, 0x11, 0x67, - 0x69, 0x4a, 0x22, 0x7d, 0xfc, 0x1e, 0x6e, 0xe0, 0xc9, 0x2b, 0xc3, 0x50, 0x56, 0x07, 0xb9, 0xd5, - 0x55, 0x63, 0x75, 0x50, 0x5a, 0x1d, 0x4c, 0x86, 0xa9, 0xb5, 0x5a, 0x37, 0x9a, 0x03, 0xd7, 0xea, - 0xa0, 0xb0, 0xba, 0x66, 0xac, 0x0e, 0x1c, 0xab, 0x83, 0xd2, 0x6a, 0x23, 0xd7, 0xb5, 0x56, 0xfd, - 0xbf, 0x57, 0x60, 0xed, 0x30, 0xcd, 0xce, 0x44, 0x30, 0x22, 0xe8, 0x13, 0x68, 0x4a, 0x26, 0x83, - 0xf1, 0x30, 0x53, 0xa4, 0xce, 0x89, 0x87, 0x41, 0xb3, 0x8c, 0xc0, 0x23, 0x68, 0xa5, 0x84, 0x87, - 0x69, 0x66, 0x25, 0x54, 0x9d, 0x78, 0xb8, 0x69, 0x78, 0x46, 0xa4, 0x0f, 0x1d, 0xbd, 0x37, 0xa4, - 0xc9, 0xf0, 0x8a, 0xf0, 0x84, 0x8c, 0x63, 0x16, 0x11, 0x9b, 0xaa, 0xb6, 0xde, 0x7a, 0x93, 0x7c, - 0x5b, 0x6c, 0xa0, 0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x5b, 0xd5, 0x0f, - 0x61, 0x7d, 0x66, 0x66, 0x83, 0x7a, 0x06, 0x61, 0xd9, 0x20, 0xe7, 0x56, 0x90, 0x97, 0xd0, 0x74, - 0x46, 0x28, 0xa8, 0x6b, 0x20, 0x16, 0x67, 0x34, 0xbd, 0xfb, 0x4b, 0x76, 0xec, 0x49, 0xef, 0x43, - 0xcd, 0xbe, 0xa5, 0xad, 0x03, 0x4e, 0x36, 0x7b, 0x9d, 0x19, 0x9e, 0xd1, 0xf0, 0x7f, 0x80, 0x0e, - 0x00, 0xec, 0xa4, 0x24, 0xa2, 0x49, 0x61, 0x76, 0x61, 0x3a, 0x53, 0x98, 0x5d, 0x32, 0x55, 0xf9, - 0x05, 0x80, 0x19, 0x72, 0x44, 0x2c, 0x93, 0x79, 0xfa, 0x16, 0xa6, 0x2a, 0xbd, 0xee, 0xe2, 0xc6, - 0x02, 0x00, 0xe1, 0xfc, 0x7f, 0x01, 0x78, 0x01, 0x50, 0x0e, 0x4f, 0x72, 0x80, 0x85, 0x71, 0xca, - 0xad, 0xb9, 0x3f, 0x80, 0x96, 0x3b, 0x2e, 0xc9, 0xaf, 0xd0, 0x92, 0x11, 0xca, 0x5d, 0x10, 0xee, - 0xe0, 0x23, 0x87, 0x58, 0x32, 0x0c, 0xb9, 0x15, 0xe2, 0x08, 0x36, 0x66, 0xc7, 0x1e, 0xc8, 0x4e, - 0x00, 0x96, 0x0e, 0x43, 0x6e, 0x85, 0xf9, 0x1a, 0x36, 0xe7, 0x86, 0x24, 0xc8, 0x3e, 0x90, 0x96, - 0xcf, 0x4e, 0x6e, 0x05, 0xfa, 0x0a, 0xd6, 0xf2, 0x09, 0x09, 0xda, 0x29, 0x6a, 0xc2, 0x9d, 0x98, - 0xdc, 0x95, 0x0d, 0x77, 0x48, 0x92, 0x67, 0x63, 0xc9, 0xe0, 0xe4, 0x36, 0x88, 0xf3, 0x55, 0x4d, - 0x3f, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff,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xff, 0xe8, 0x00, 0x5a, 0xee, 0x20, 0x08, 0xdd, 0x37, 0xfe, 0x2d, 0x19, 0x0e, + 0xf5, 0x76, 0x17, 0xfc, 0x38, 0x8a, 0x53, 0x39, 0x45, 0x2f, 0x00, 0xca, 0x11, 0x0f, 0xba, 0x57, + 0x00, 0xcc, 0xce, 0x4b, 0x6e, 0x55, 0x3f, 0x84, 0xf5, 0x99, 0x29, 0x0e, 0xea, 0x19, 0x84, 0x65, + 0xa3, 0x9d, 0x5b, 0x41, 0x5e, 0x42, 0xd3, 0x19, 0xaa, 0xa0, 0xae, 0x81, 0x58, 0x9c, 0xda, 0xf4, + 0xee, 0x2f, 0xd9, 0xb1, 0x27, 0xbd, 0x0f, 0x35, 0xfb, 0x96, 0xb6, 0x0e, 0x38, 0xd9, 0xec, 0x75, + 0x66, 0x78, 0x46, 0xc3, 0xff, 0x1e, 0x3a, 0x00, 0xb0, 0xb3, 0x93, 0x88, 0x26, 0x85, 0xd9, 0x85, + 0x79, 0x4d, 0x61, 0x76, 0xc9, 0x9c, 0xe5, 0x67, 0x00, 0x66, 0xec, 0x11, 0xb1, 0x4c, 0xe6, 0xe9, + 0x5b, 0x98, 0xb3, 0xf4, 0xba, 0x8b, 0x1b, 0x0b, 0x00, 0x84, 0xf3, 0xff, 0x05, 0xe0, 0x05, 0x40, + 0x39, 0x4e, 0xc9, 0x01, 0x16, 0x06, 0x2c, 0xb7, 0xe6, 0xfe, 0x00, 0x5a, 0xee, 0x00, 0x25, 0xbf, + 0x42, 0x4b, 0x86, 0x2a, 0x77, 0x41, 0xb8, 0xa3, 0x90, 0x1c, 0x62, 0xc9, 0x78, 0xe4, 0x56, 0x88, + 0x23, 0xd8, 0x98, 0x1d, 0x84, 0x20, 0x3b, 0x01, 0x58, 0x3a, 0x1e, 0xb9, 0x15, 0xe6, 0x6b, 0xd8, + 0x9c, 0x1b, 0x9b, 0x20, 0xfb, 0x40, 0x5a, 0x3e, 0x4d, 0xb9, 0x15, 0xe8, 0x2b, 0x58, 0xcb, 0x27, + 0x24, 0x68, 0xa7, 0xa8, 0x09, 0x77, 0x62, 0x72, 0x57, 0x36, 0xdc, 0x21, 0x49, 0x9e, 0x8d, 0x25, + 0x83, 0x93, 0xdb, 0x20, 0xce, 0x57, 0x35, 0xfd, 0xec, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xce, + 0xd7, 0x84, 0x05, 0x3e, 0x16, 0x00, 0x00, } diff --git a/hyperstart/api/grpc/hyperstart.proto b/hyperstart/api/grpc/hyperstart.proto index 61ee7f4a..ecc4fbb8 100644 --- a/hyperstart/api/grpc/hyperstart.proto +++ b/hyperstart/api/grpc/hyperstart.proto @@ -98,6 +98,7 @@ message DestroySandboxRequest { message UpdateInterfaceRequest { string device = 1; repeated string address = 2; + uint64 mtu = 3; } message AddRouteRequest { diff --git a/hyperstart/api/json/spec.go b/hyperstart/api/json/spec.go index ba9ba498..dc5f3ecb 100644 --- a/hyperstart/api/json/spec.go +++ b/hyperstart/api/json/spec.go @@ -81,6 +81,7 @@ type NetworkInf struct { Device string `json:"device"` IpAddress string `json:"ipAddress"` NetMask string `json:"netMask"` + Mtu uint64 `json:"mtu"` } type Route struct { diff --git a/hyperstart/libhyperstart/grpc.go b/hyperstart/libhyperstart/grpc.go index a0bbfcc4..0d81fee6 100644 --- a/hyperstart/libhyperstart/grpc.go +++ b/hyperstart/libhyperstart/grpc.go @@ -86,10 +86,11 @@ func (h *grpcBasedHyperstart) AddRoute(routes []hyperstartjson.Route) error { return err } -func (h *grpcBasedHyperstart) UpdateInterface(dev string, ipnet []string) error { +func (h *grpcBasedHyperstart) UpdateInterface(dev string, ipnet []string, mtu uint64) error { _, err := h.grpc.UpdateInterface(h.ctx, &hyperstartgrpc.UpdateInterfaceRequest{ Device: dev, Address: ipnet, + Mtu: mtu, }) return err } diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index 8231182b..19dd25c2 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -32,7 +32,7 @@ type Hyperstart interface { WriteFile(container, path string, data []byte) error ReadFile(container, path string) ([]byte, error) AddRoute(r []hyperstartapi.Route) error - UpdateInterface(dev string, ipnet []string) error + UpdateInterface(dev string, ipnet []string, mtu uint64) error OnlineCpuMem() error } diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index c6073d01..18bef4b9 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -647,7 +647,7 @@ func (h *jsonBasedHyperstart) AddRoute(r []hyperstartapi.Route) error { return h.hyperstartCommand(hyperstartapi.INIT_SETUPROUTE, hyperstartapi.Routes{Routes: r}) } -func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string) error { +func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string, mtu uint64) error { for _, ipstr := range ipnet { ip, net, err := net.ParseCIDR(ipstr) if err != nil { @@ -658,6 +658,7 @@ func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string) error Device: dev, IpAddress: ip.String(), NetMask: mask, + Mtu: mtu, }) if err != nil { return fmt.Errorf("json: pailed to send update command to hyperstart: %v", err) diff --git a/hyperstart/proxy/proxy.go b/hyperstart/proxy/proxy.go index 4f2f6ced..629504d9 100644 --- a/hyperstart/proxy/proxy.go +++ b/hyperstart/proxy/proxy.go @@ -122,7 +122,7 @@ func (proxy *jsonProxy) DestroySandbox(ctx context.Context, req *hyperstartgrpc. return pbEmpty(err), err } func (proxy *jsonProxy) UpdateInterface(ctx context.Context, req *hyperstartgrpc.UpdateInterfaceRequest) (*google_protobuf.Empty, error) { - err := proxy.json.UpdateInterface(req.Device, req.Address) + err := proxy.json.UpdateInterface(req.Device, req.Address, req.Mtu) return pbEmpty(err), err } func (proxy *jsonProxy) AddRoute(ctx context.Context, req *hyperstartgrpc.AddRouteRequest) (*google_protobuf.Empty, error) { diff --git a/hypervisor/events.go b/hypervisor/events.go index 0a73fc20..c4bf3a2e 100644 --- a/hypervisor/events.go +++ b/hypervisor/events.go @@ -61,6 +61,7 @@ type InterfaceCreated struct { HostDevice string DeviceName string MacAddr string + Mtu uint64 IpAddr []string RouteTable []*RouteRule } diff --git a/hypervisor/network.go b/hypervisor/network.go index 0e2ab691..af0e591f 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -96,6 +96,7 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha Id: inf.Id, DeviceName: DEFAULT_LO_DEVICE_NAME, IpAddr: inf.Ip, + Mtu: inf.Mtu, } nc.lo[inf.Ip[0]] = i nc.idMap[inf.Id] = i @@ -243,7 +244,7 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.Interf if err != nil { nc.sandbox.Log(ERROR, "interface creating failed: %v", err.Error()) - session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: name} + session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: name, Mtu: inf.Mtu} result <- &DeviceFailed{Session: session} return } @@ -358,6 +359,7 @@ func interfaceGot(id string, index int, pciAddr int, name string, inf *network.S Fd: inf.File, MacAddr: inf.Mac, IpAddr: inf.IP, + Mtu: inf.Mtu, RouteTable: rt, } return infc, nil diff --git a/hypervisor/network/network.go b/hypervisor/network/network.go index 1ba50875..6d313bba 100644 --- a/hypervisor/network/network.go +++ b/hypervisor/network/network.go @@ -13,6 +13,7 @@ type Settings struct { Gateway string Bridge string Device string + Mtu uint64 File *os.File Automatic bool } diff --git a/hypervisor/network/network_linux.go b/hypervisor/network/network_linux.go index fa4ade15..3a534797 100644 --- a/hypervisor/network/network_linux.go +++ b/hypervisor/network/network_linux.go @@ -898,6 +898,7 @@ func Configure(addrOnly bool, inf *api.InterfaceDescription) (*Settings, error) Gateway: inf.Gw, Bridge: inf.Bridge, Device: inf.TapName, + Mtu: inf.Mtu, File: nil, Automatic: false, }, nil @@ -914,6 +915,7 @@ func Configure(addrOnly bool, inf *api.InterfaceDescription) (*Settings, error) Gateway: inf.Gw, Bridge: inf.Bridge, Device: device, + Mtu: inf.Mtu, File: tapFile, Automatic: false, }, nil diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index cf99feaa..cd71d31a 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -114,7 +114,7 @@ func (ctx *VmContext) updateInterface(id string) error { if inf := ctx.networks.getInterface(id); inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } else { - return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.IpAddr) + return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.IpAddr, inf.Mtu) } } From 373c4d662bae1499422638fd5cc91208d52beda0 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Tue, 5 Sep 2017 20:05:03 +0800 Subject: [PATCH 03/10] Support modify network interface name This commit enables setting new name for network interface in guest VM. Signed-off-by: Zhang Wei --- hyperstart/api/grpc/hyperstart.pb.go | 263 +++++++++++++------------ hyperstart/api/grpc/hyperstart.proto | 5 +- hyperstart/api/json/spec.go | 1 + hyperstart/libhyperstart/grpc.go | 3 +- hyperstart/libhyperstart/hyperstart.go | 2 +- hyperstart/libhyperstart/json.go | 3 +- hyperstart/proxy/proxy.go | 2 +- hypervisor/events.go | 1 + hypervisor/network.go | 13 +- hypervisor/vm_states.go | 2 +- 10 files changed, 153 insertions(+), 142 deletions(-) diff --git a/hyperstart/api/grpc/hyperstart.pb.go b/hyperstart/api/grpc/hyperstart.pb.go index 102b67fe..29e41ff5 100644 --- a/hyperstart/api/grpc/hyperstart.pb.go +++ b/hyperstart/api/grpc/hyperstart.pb.go @@ -368,8 +368,9 @@ func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescript type UpdateInterfaceRequest struct { Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` - Address []string `protobuf:"bytes,2,rep,name=address" json:"address,omitempty"` - Mtu uint64 `protobuf:"varint,3,opt,name=mtu" json:"mtu,omitempty"` + NewName string `protobuf:"bytes,2,opt,name=newName" json:"newName,omitempty"` + Address []string `protobuf:"bytes,3,rep,name=address" json:"address,omitempty"` + Mtu uint64 `protobuf:"varint,4,opt,name=mtu" json:"mtu,omitempty"` } func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } @@ -384,6 +385,13 @@ func (m *UpdateInterfaceRequest) GetDevice() string { return "" } +func (m *UpdateInterfaceRequest) GetNewName() string { + if m != nil { + return m.NewName + } + return "" +} + func (m *UpdateInterfaceRequest) GetAddress() []string { if m != nil { return m.Address @@ -1195,129 +1203,130 @@ var _HyperstartService_serviceDesc = grpc1.ServiceDesc{ func init() { proto.RegisterFile("hyperstart.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1975 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x72, 0x1b, 0x49, - 0x15, 0x46, 0xf2, 0xc8, 0xb2, 0x8e, 0xe4, 0x1f, 0xb5, 0x6c, 0x47, 0x51, 0x96, 0xdd, 0x64, 0xb6, - 0xc8, 0xba, 0x48, 0xad, 0x52, 0x38, 0x5b, 0x6c, 0x16, 0x2a, 0x45, 0x39, 0x8e, 0x6b, 0x13, 0x16, - 0x83, 0x69, 0xcb, 0x95, 0x2a, 0x0a, 0x4a, 0x8c, 0x67, 0xda, 0x72, 0x63, 0xcd, 0xf4, 0xa4, 0xbb, - 0xc7, 0x96, 0xb8, 0xe0, 0x11, 0xa8, 0xe2, 0x92, 0x2b, 0xee, 0x79, 0x02, 0x9e, 0x82, 0x47, 0xe0, - 0x01, 0xb8, 0xe4, 0x09, 0xa8, 0xfe, 0x99, 0x99, 0xd6, 0x8f, 0x9d, 0x5a, 0x36, 0xdc, 0xa8, 0xfa, - 0x9c, 0x3e, 0xe7, 0x3b, 0x3f, 0xdd, 0xe7, 0x4c, 0xeb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x61, 0x4b, 0xf9, 0xbf, 0x07, 0xf4, 0x96, 0x53, 0x49, 0x4e, 0x25, 0x27, 0x41, 0xfc, 0x5d, 0x43, - 0x44, 0xe0, 0x45, 0x81, 0x0c, 0x74, 0x80, 0x2d, 0xac, 0xd7, 0xfe, 0x67, 0xd0, 0x99, 0xb1, 0x60, - 0x1d, 0xda, 0x82, 0x95, 0x31, 0x49, 0x34, 0xf8, 0x3a, 0x56, 0x4b, 0xff, 0x77, 0xd0, 0xc6, 0x24, - 0x88, 0x3e, 0x8c, 0x27, 0x16, 0x7e, 0xa5, 0x84, 0xdf, 0x03, 0xe4, 0xc2, 0x5b, 0x37, 0x72, 0x8f, - 0x2b, 0x8e, 0xc7, 0xdf, 0x40, 0xfb, 0x70, 0xcc, 0x04, 0x39, 0x95, 0x11, 0x4d, 0xbe, 0xeb, 0x79, - 0xdc, 0x40, 0x67, 0x20, 0xa7, 0x6f, 0x15, 0x90, 0xa0, 0x7f, 0x24, 0x1f, 0x20, 0x2e, 0xce, 0x6e, - 0xf2, 0xb8, 0x38, 0xbb, 0x51, 0x27, 0x1b, 0xb2, 0x71, 0x16, 0x27, 0x5d, 0xcf, 0x5c, 0x2b, 0x43, - 0xf9, 0x87, 0xd0, 0x39, 0x55, 0x65, 0x7d, 0x1a, 0x24, 0xd1, 0x39, 0x9b, 0xe4, 0x86, 0x7b, 0xb0, - 0x76, 0xc9, 0x84, 0x4c, 0x82, 0x98, 0x58, 0xbb, 0x05, 0xad, 0xc0, 0xa3, 0x44, 0x99, 0x5c, 0xd9, - 0x6b, 0x60, 0xb5, 0xf4, 0xef, 0xc1, 0xce, 0x2b, 0x22, 0x24, 0x67, 0xd3, 0x59, 0x18, 0xff, 0xb7, - 0xb0, 0x7b, 0x96, 0x46, 0x81, 0x24, 0x6f, 0x12, 0x49, 0xf8, 0x45, 0x10, 0x16, 0x91, 0xed, 0xc2, - 0x6a, 0x44, 0xae, 0x69, 0x98, 0xc3, 0x5b, 0x4a, 0xc5, 0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, 0x5a, 0xee, 0x20, 0x08, 0xdd, 0x37, 0xfe, 0x2d, 0x19, 0x0e, - 0xf5, 0x76, 0x17, 0xfc, 0x38, 0x8a, 0x53, 0x39, 0x45, 0x2f, 0x00, 0xca, 0x11, 0x0f, 0xba, 0x57, - 0x00, 0xcc, 0xce, 0x4b, 0x6e, 0x55, 0x3f, 0x84, 0xf5, 0x99, 0x29, 0x0e, 0xea, 0x19, 0x84, 0x65, - 0xa3, 0x9d, 0x5b, 0x41, 0x5e, 0x42, 0xd3, 0x19, 0xaa, 0xa0, 0xae, 0x81, 0x58, 0x9c, 0xda, 0xf4, - 0xee, 0x2f, 0xd9, 0xb1, 0x27, 0xbd, 0x0f, 0x35, 0xfb, 0x96, 0xb6, 0x0e, 0x38, 0xd9, 0xec, 0x75, - 0x66, 0x78, 0x46, 0xc3, 0xff, 0x1e, 0x3a, 0x00, 0xb0, 0xb3, 0x93, 0x88, 0x26, 0x85, 0xd9, 0x85, - 0x79, 0x4d, 0x61, 0x76, 0xc9, 0x9c, 0xe5, 0x67, 0x00, 0x66, 0xec, 0x11, 0xb1, 0x4c, 0xe6, 0xe9, - 0x5b, 0x98, 0xb3, 0xf4, 0xba, 0x8b, 0x1b, 0x0b, 0x00, 0x84, 0xf3, 0xff, 0x05, 0xe0, 0x05, 0x40, - 0x39, 0x4e, 0xc9, 0x01, 0x16, 0x06, 0x2c, 0xb7, 0xe6, 0xfe, 0x00, 0x5a, 0xee, 0x00, 0x25, 0xbf, - 0x42, 0x4b, 0x86, 0x2a, 0x77, 0x41, 0xb8, 0xa3, 0x90, 0x1c, 0x62, 0xc9, 0x78, 0xe4, 0x56, 0x88, - 0x23, 0xd8, 0x98, 0x1d, 0x84, 0x20, 0x3b, 0x01, 0x58, 0x3a, 0x1e, 0xb9, 0x15, 0xe6, 0x6b, 0xd8, - 0x9c, 0x1b, 0x9b, 0x20, 0xfb, 0x40, 0x5a, 0x3e, 0x4d, 0xb9, 0x15, 0xe8, 0x2b, 0x58, 0xcb, 0x27, - 0x24, 0x68, 0xa7, 0xa8, 0x09, 0x77, 0x62, 0x72, 0x57, 0x36, 0xdc, 0x21, 0x49, 0x9e, 0x8d, 0x25, - 0x83, 0x93, 0xdb, 0x20, 0xce, 0x57, 0x35, 0xfd, 0xec, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xce, - 0xd7, 0x84, 0x05, 0x3e, 0x16, 0x00, 0x00, + // 1987 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x6e, 0x1b, 0xb9, + 0x15, 0xae, 0xe4, 0x91, 0x65, 0x1d, 0xc9, 0x3f, 0xa2, 0x6c, 0x47, 0x51, 0xb6, 0xbb, 0xc9, 0x2c, + 0x9a, 0x35, 0x1a, 0xac, 0x82, 0x3a, 0x8b, 0x6e, 0xb6, 0x45, 0x50, 0x38, 0x8e, 0xb1, 0x49, 0xb7, + 0xde, 0xba, 0xb4, 0x8c, 0x00, 0x05, 0x0a, 0x75, 0x3c, 0x43, 0xcb, 0xac, 0x35, 0xc3, 0x09, 0xc9, + 0xb1, 0xa5, 0x5e, 0xf4, 0x11, 0x0a, 0xf4, 0xb2, 0x57, 0xbd, 0xef, 0x13, 0xf4, 0x29, 0xfa, 0x08, + 0x7d, 0x80, 0x5e, 0xf6, 0x09, 0x0a, 0xfe, 0xcc, 0x0c, 0xf5, 0x63, 0x07, 0xdb, 0x4d, 0x6f, 0x04, + 0x9e, 0xc3, 0x73, 0xbe, 0xf3, 0x43, 0x9e, 0x33, 0xd4, 0x81, 0xad, 0xcb, 0x69, 0x4a, 0xb8, 0x90, + 0x01, 0x97, 0xfd, 0x94, 0x33, 0xc9, 0x90, 0x37, 0xe2, 0x69, 0xd8, 0x7b, 0x30, 0x62, 0x6c, 0x34, + 0x26, 0x4f, 0x35, 0xef, 0x3c, 0xbb, 0x78, 0x4a, 0xe2, 0x54, 0x4e, 0x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 0x4b, 0x06, 0x27, 0xb7, 0x41, + 0x9c, 0xaf, 0x6a, 0xfa, 0xd9, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x22, 0x9d, 0xb1, 0xc4, 0x58, + 0x16, 0x00, 0x00, } diff --git a/hyperstart/api/grpc/hyperstart.proto b/hyperstart/api/grpc/hyperstart.proto index ecc4fbb8..4d45d19e 100644 --- a/hyperstart/api/grpc/hyperstart.proto +++ b/hyperstart/api/grpc/hyperstart.proto @@ -97,8 +97,9 @@ message DestroySandboxRequest { message UpdateInterfaceRequest { string device = 1; - repeated string address = 2; - uint64 mtu = 3; + string newName = 2; + repeated string address = 3; + uint64 mtu = 4; } message AddRouteRequest { diff --git a/hyperstart/api/json/spec.go b/hyperstart/api/json/spec.go index dc5f3ecb..bdc70d46 100644 --- a/hyperstart/api/json/spec.go +++ b/hyperstart/api/json/spec.go @@ -79,6 +79,7 @@ type Container struct { type NetworkInf struct { Device string `json:"device"` + NewName string `json:"newDeviceName"` IpAddress string `json:"ipAddress"` NetMask string `json:"netMask"` Mtu uint64 `json:"mtu"` diff --git a/hyperstart/libhyperstart/grpc.go b/hyperstart/libhyperstart/grpc.go index 0d81fee6..19664396 100644 --- a/hyperstart/libhyperstart/grpc.go +++ b/hyperstart/libhyperstart/grpc.go @@ -86,9 +86,10 @@ func (h *grpcBasedHyperstart) AddRoute(routes []hyperstartjson.Route) error { return err } -func (h *grpcBasedHyperstart) UpdateInterface(dev string, ipnet []string, mtu uint64) error { +func (h *grpcBasedHyperstart) UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error { _, err := h.grpc.UpdateInterface(h.ctx, &hyperstartgrpc.UpdateInterfaceRequest{ Device: dev, + NewName: newName, Address: ipnet, Mtu: mtu, }) diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index 19dd25c2..fd6d76e2 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -32,7 +32,7 @@ type Hyperstart interface { WriteFile(container, path string, data []byte) error ReadFile(container, path string) ([]byte, error) AddRoute(r []hyperstartapi.Route) error - UpdateInterface(dev string, ipnet []string, mtu uint64) error + UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error OnlineCpuMem() error } diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index 18bef4b9..4adee8f7 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -647,7 +647,7 @@ func (h *jsonBasedHyperstart) AddRoute(r []hyperstartapi.Route) error { return h.hyperstartCommand(hyperstartapi.INIT_SETUPROUTE, hyperstartapi.Routes{Routes: r}) } -func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string, mtu uint64) error { +func (h *jsonBasedHyperstart) UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error { for _, ipstr := range ipnet { ip, net, err := net.ParseCIDR(ipstr) if err != nil { @@ -656,6 +656,7 @@ func (h *jsonBasedHyperstart) UpdateInterface(dev string, ipnet []string, mtu ui mask := fmt.Sprintf("%d.%d.%d.%d", int(net.Mask[0]), int(net.Mask[1]), int(net.Mask[2]), int(net.Mask[3])) err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, hyperstartapi.NetworkInf{ Device: dev, + NewName: newName, IpAddress: ip.String(), NetMask: mask, Mtu: mtu, diff --git a/hyperstart/proxy/proxy.go b/hyperstart/proxy/proxy.go index 629504d9..2d636640 100644 --- a/hyperstart/proxy/proxy.go +++ b/hyperstart/proxy/proxy.go @@ -122,7 +122,7 @@ func (proxy *jsonProxy) DestroySandbox(ctx context.Context, req *hyperstartgrpc. return pbEmpty(err), err } func (proxy *jsonProxy) UpdateInterface(ctx context.Context, req *hyperstartgrpc.UpdateInterfaceRequest) (*google_protobuf.Empty, error) { - err := proxy.json.UpdateInterface(req.Device, req.Address, req.Mtu) + err := proxy.json.UpdateInterface(req.Device, req.NewName, req.Address, req.Mtu) return pbEmpty(err), err } func (proxy *jsonProxy) AddRoute(ctx context.Context, req *hyperstartgrpc.AddRouteRequest) (*google_protobuf.Empty, error) { diff --git a/hypervisor/events.go b/hypervisor/events.go index c4bf3a2e..b92264c6 100644 --- a/hypervisor/events.go +++ b/hypervisor/events.go @@ -61,6 +61,7 @@ type InterfaceCreated struct { HostDevice string DeviceName string MacAddr string + NewName string Mtu uint64 IpAddr []string RouteTable []*RouteRule diff --git a/hypervisor/network.go b/hypervisor/network.go index af0e591f..96b267c4 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -223,13 +223,9 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.Interf var ( err error settings *network.Settings - name string = fmt.Sprintf("eth%d", index) + devName string = fmt.Sprintf("eth%d", index) ) - if len(inf.Name) > 0 { - name = inf.Name - } - // TODO: what should be a proper Id? if inf.Id == "" { inf.Id = fmt.Sprintf("%d", index) @@ -244,12 +240,12 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.Interf if err != nil { nc.sandbox.Log(ERROR, "interface creating failed: %v", err.Error()) - session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: name, Mtu: inf.Mtu} + session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: devName, NewName: inf.Name, Mtu: inf.Mtu} result <- &DeviceFailed{Session: session} return } - created, err := interfaceGot(inf.Id, index, pciAddr, name, settings) + created, err := interfaceGot(inf.Id, index, pciAddr, inf.Name, settings) if err != nil { result <- &DeviceFailed{Session: created} return @@ -355,7 +351,8 @@ func interfaceGot(id string, index int, pciAddr int, name string, inf *network.S PCIAddr: pciAddr, Bridge: inf.Bridge, HostDevice: inf.Device, - DeviceName: name, + DeviceName: fmt.Sprintf("eth%d", index), + NewName: name, Fd: inf.File, MacAddr: inf.Mac, IpAddr: inf.IP, diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index cd71d31a..3c2c01ad 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -114,7 +114,7 @@ func (ctx *VmContext) updateInterface(id string) error { if inf := ctx.networks.getInterface(id); inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } else { - return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.IpAddr, inf.Mtu) + return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.NewName, inf.IpAddr, inf.Mtu) } } From 37799211758beddb384921d1c7f3a7c393911b62 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Wed, 6 Sep 2017 11:03:51 +0800 Subject: [PATCH 04/10] bugfix & enhancement: add more nic with new name Previous implementation includes one issue that if we add some interfaces with different new name, it will fail sometimes. This is caused by the rename machanism in Guest VM. All devices have an inital device name counting from eth0, eth1... to ethN, then we rename it to some new name such as myDev1 or eth123, we need to pass device in format eth0, eth1... too. For example, we insert first interface with device name eth0 and new name eth2, guest kernel will first find newly added device eth0, then rename it to eth2. Latter comming new nic device would go back to eth0. So for adding a new nic, we should give it same device name eth0, then rename it to something else like eth3. In a word, try this example: ``` $ runv interface add --name eth2 --ip xxx ... $ runv interface add --name eth4 ... $ runv interface add --name eth8 ... $ runv interface add --name eth3 ... ``` If it works, everything would be fine! Signed-off-by: Zhang Wei --- cli/container.go | 2 +- cli/network.go | 30 ++++++++++++-------- cli/proxy.go | 6 ++-- hyperstart/libhyperstart/json.go | 2 +- hypervisor/events.go | 2 +- hypervisor/network.go | 47 +++++++++++++++++++++++--------- hypervisor/persistence.go | 10 +++++++ 7 files changed, 69 insertions(+), 30 deletions(-) diff --git a/cli/container.go b/cli/container.go index dd9e55fc..f6af066b 100644 --- a/cli/container.go +++ b/cli/container.go @@ -148,7 +148,7 @@ func createContainer(options runvOptions, vm *hypervisor.Vm, container, bundle, } // If runv is launched via docker/containerd, we start netlistener to watch/collect network changes. - // TODO: if runv is launched by cni compatible tools, the cni script can use `runv cni` cmdline to update the network. + // TODO: if runv is launched by cni compatible tools, the cni script can use `runv interface` cmdline to update the network. // Create the listener process which will enters into the netns of the shim options.withContainer = state if err = startNsListener(options, vm); err != nil { diff --git a/cli/network.go b/cli/network.go index 1ced4dba..b2821f58 100644 --- a/cli/network.go +++ b/cli/network.go @@ -44,7 +44,10 @@ type NetlinkUpdate struct { type InterfaceInfo struct { Index int PeerIndex int - Ip string + IP []string + Mac string + Name string + Mtu uint64 } type nsListener struct { @@ -154,13 +157,13 @@ func initSandboxNetwork(vm *hypervisor.Vm, enc *gob.Encoder, dec *gob.Decoder) e continue } - nicId := strconv.Itoa(info.Index) - conf := &api.InterfaceDescription{ - Id: nicId, //ip as an id Lo: false, Bridge: bridge, - Ip: []string{info.Ip}, + Ip: info.IP, + Name: info.Name, + Mac: info.Mac, + Mtu: info.Mtu, Options: options, } @@ -430,15 +433,20 @@ func collectionInterfaceInfo() []InterfaceInfo { return infos } + info := InterfaceInfo{ + Name: link.Attrs().Name, + Mac: link.Attrs().HardwareAddr.String(), + Mtu: uint64(link.Attrs().MTU), + PeerIndex: link.Attrs().ParentIndex, + } + for _, addr := range addrs { - info := InterfaceInfo{ - Ip: addr.IPNet.String(), - Index: link.Attrs().Index, - PeerIndex: link.Attrs().ParentIndex, + if addr.IPNet.String() == "" { + continue } - glog.Infof("get interface %v", info) - infos = append(infos, info) + info.IP = append(info.IP, addr.IPNet.String()) } + infos = append(infos, info) // set link down, tap device take over it netlink.LinkSetDown(link) diff --git a/cli/proxy.go b/cli/proxy.go index 5f3d336a..c1821dcb 100644 --- a/cli/proxy.go +++ b/cli/proxy.go @@ -176,9 +176,9 @@ func createProxy(context *cli.Context, VMID, ctlSock, streamSock, grpcSock strin args := []string{ "runv", "--root", context.GlobalString("root"), } - if context.GlobalBool("debug") { - args = append(args, "--debug") - } + //if context.GlobalBool("debug") { + args = append(args, "--debug") + //} if context.GlobalString("log_dir") != "" { args = append(args, "--log_dir", context.GlobalString("log_dir")) } diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index 4adee8f7..083d77a4 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -662,7 +662,7 @@ func (h *jsonBasedHyperstart) UpdateInterface(dev, newName string, ipnet []strin Mtu: mtu, }) if err != nil { - return fmt.Errorf("json: pailed to send update command to hyperstart: %v", err) + return fmt.Errorf("json: failed to send update command to hyperstart: %v", err) } } return nil diff --git a/hypervisor/events.go b/hypervisor/events.go index b92264c6..cd094afd 100644 --- a/hypervisor/events.go +++ b/hypervisor/events.go @@ -60,7 +60,7 @@ type InterfaceCreated struct { Bridge string HostDevice string DeviceName string - MacAddr string + Mac string NewName string Mtu uint64 IpAddr []string diff --git a/hypervisor/network.go b/hypervisor/network.go index 96b267c4..19301157 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -81,6 +81,23 @@ func (nc *NetworkContext) freeSlot(slot int) { delete(nc.eth, slot) } +func (nc *NetworkContext) nextAvailableDevName() string { + for i := 0; i <= MAX_NIC; i++ { + find := false + for _, inf := range nc.eth { + if inf != nil && inf.NewName == fmt.Sprintf("eth%d", i) { + find = true + break + } + } + if !find { + return fmt.Sprintf("eth%d", i) + } + } + + return "" +} + func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result chan api.Result) { if inf.Lo { if inf.Ip == nil || len(inf.Ip) == 0 { @@ -115,15 +132,16 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha defer nc.slotLock.Unlock() idx := nc.applySlot() - if idx < 0 { - estr := fmt.Sprintf("no available ethernet slot for interface %#v", inf) + devName := nc.nextAvailableDevName() + if idx < 0 || devName == "" { + estr := fmt.Sprintf("no available ethernet slot/name for interface %#v", inf) nc.sandbox.Log(ERROR, estr) result <- NewBusyError(inf.Id, estr) close(devChan) return } - nc.configureInterface(idx, nc.sandbox.NextPciAddr(), inf, devChan) + nc.configureInterface(idx, nc.sandbox.NextPciAddr(), devName, inf, devChan) }() go func() { @@ -219,11 +237,10 @@ func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { nc.freeSlot(idx) } -func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.InterfaceDescription, result chan<- VmEvent) { +func (nc *NetworkContext) configureInterface(index, pciAddr int, deviceName string, inf *api.InterfaceDescription, result chan<- VmEvent) { var ( err error settings *network.Settings - devName string = fmt.Sprintf("eth%d", index) ) // TODO: what should be a proper Id? @@ -240,12 +257,12 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.Interf if err != nil { nc.sandbox.Log(ERROR, "interface creating failed: %v", err.Error()) - session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: devName, NewName: inf.Name, Mtu: inf.Mtu} + session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: deviceName, NewName: inf.Name, Mtu: inf.Mtu} result <- &DeviceFailed{Session: session} return } - created, err := interfaceGot(inf.Id, index, pciAddr, inf.Name, settings) + created, err := interfaceGot(inf.Id, index, pciAddr, deviceName, inf.Name, settings) if err != nil { result <- &DeviceFailed{Session: created} return @@ -254,15 +271,19 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, inf *api.Interf h := &HostNicInfo{ Id: created.Id, Device: created.HostDevice, - Mac: created.MacAddr, + Mac: created.Mac, Bridge: created.Bridge, Gateway: created.Bridge, } if created.Fd != nil { h.Fd = uint64(created.Fd.Fd()) } + + // Note: Use created.NewName add tap name + // this is because created.DeviceName isn't always uniq, + // instead NewName is real nic name in VM which is certainly uniq g := &GuestNicInfo{ - Device: created.DeviceName, + Device: created.NewName, Ipaddr: created.IpAddr, Index: created.Index, Busaddr: created.PCIAddr, @@ -334,7 +355,7 @@ func (nc *NetworkContext) close() { nc.idMap = map[string]*InterfaceCreated{} } -func interfaceGot(id string, index int, pciAddr int, name string, inf *network.Settings) (*InterfaceCreated, error) { +func interfaceGot(id string, index int, pciAddr int, deviceName, newName string, inf *network.Settings) (*InterfaceCreated, error) { rt := []*RouteRule{} /* Route rule is generated automaticly on first interface, * or generated on the gateway configured interface. */ @@ -351,10 +372,10 @@ func interfaceGot(id string, index int, pciAddr int, name string, inf *network.S PCIAddr: pciAddr, Bridge: inf.Bridge, HostDevice: inf.Device, - DeviceName: fmt.Sprintf("eth%d", index), - NewName: name, + DeviceName: deviceName, + NewName: newName, Fd: inf.File, - MacAddr: inf.Mac, + Mac: inf.Mac, IpAddr: inf.IP, Mtu: inf.Mtu, RouteTable: rt, diff --git a/hypervisor/persistence.go b/hypervisor/persistence.go index 086b34d2..3f1e547b 100644 --- a/hypervisor/persistence.go +++ b/hypervisor/persistence.go @@ -39,7 +39,10 @@ type PersistNetworkInfo struct { Index int PciAddr int DeviceName string + NewName string IpAddr []string + Mac string + Mtu uint64 } type PersistInfo struct { @@ -120,7 +123,10 @@ func (ctx *VmContext) dump() (*PersistInfo, error) { Index: nic.Index, PciAddr: nic.PCIAddr, DeviceName: nic.DeviceName, + NewName: nic.NewName, IpAddr: nic.IpAddr, + Mac: nic.Mac, + Mtu: nic.Mtu, } nid++ } @@ -207,7 +213,10 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { Index: pi.Index, PCIAddr: pi.PciAddr, DeviceName: pi.DeviceName, + NewName: pi.NewName, IpAddr: pi.IpAddr, + Mtu: pi.Mtu, + Mac: pi.Mac, } // if empty, may be old data, generate one for compatibility. if ifc.Id == "" { @@ -225,6 +234,7 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { func vmDeserialize(s []byte) (*PersistInfo, error) { info := &PersistInfo{} + // TODO: REMOVE THIS err := json.Unmarshal(s, info) return info, err } From 50bd8edb0ddf2d2dda3632bfc5d199ddc7e1b1e4 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Fri, 8 Sep 2017 14:27:57 +0800 Subject: [PATCH 05/10] Add `interface ls` command Add command `interface ls` to list all interfaces in a container. Signed-off-by: Zhang Wei --- cli/interface.go | 22 ++++++++++++++++++++++ cli/main.go | 1 + cli/proxy.go | 6 +++--- hypervisor/context.go | 4 ++++ hypervisor/network.go | 13 +++++++++++++ hypervisor/vm.go | 4 ++++ 6 files changed, 47 insertions(+), 3 deletions(-) diff --git a/cli/interface.go b/cli/interface.go index d56b90ef..6d1ac8ea 100644 --- a/cli/interface.go +++ b/cli/interface.go @@ -2,7 +2,10 @@ package main import ( "fmt" + "os" "path/filepath" + "strings" + "text/tabwriter" "github.com/hyperhq/runv/api" "github.com/urfave/cli" @@ -83,6 +86,25 @@ var infListCommand = cli.Command{ ArgsUsage: `ls `, Flags: []cli.Flag{}, Action: func(context *cli.Context) error { + container := context.Args().First() + + if container == "" { + return cli.NewExitError("Please specify container ID", -1) + } + + vm, lockfile, err := getSandbox(filepath.Join(context.GlobalString("root"), container, "sandbox")) + if err != nil { + return fmt.Errorf("failed to get sandbox for container %q: %v", container, err) + } + defer putSandbox(vm, lockfile) + + tw := tabwriter.NewWriter(os.Stdout, 10, 1, 3, ' ', 0) + fmt.Fprintln(tw, "Name\tMac\tIP\tMtu") + nics := vm.AllNics() + for _, i := range nics { + fmt.Fprintf(tw, "%s\t%s\t%s\t%d\n", i.NewName, i.Mac, strings.Join(i.IpAddr, ","), i.Mtu) + } + tw.Flush() return nil }, } diff --git a/cli/main.go b/cli/main.go index 3e6a2259..27d25599 100644 --- a/cli/main.go +++ b/cli/main.go @@ -69,6 +69,7 @@ func main() { }, cli.StringFlag{ Name: "log", + Value: "/dev/null", Usage: "[ignored on runv] set the log file path where internal debug information is written", }, cli.StringFlag{ diff --git a/cli/proxy.go b/cli/proxy.go index c1821dcb..5f3d336a 100644 --- a/cli/proxy.go +++ b/cli/proxy.go @@ -176,9 +176,9 @@ func createProxy(context *cli.Context, VMID, ctlSock, streamSock, grpcSock strin args := []string{ "runv", "--root", context.GlobalString("root"), } - //if context.GlobalBool("debug") { - args = append(args, "--debug") - //} + if context.GlobalBool("debug") { + args = append(args, "--debug") + } if context.GlobalString("log_dir") != "" { args = append(args, "--log_dir", context.GlobalString("log_dir")) } diff --git a/hypervisor/context.go b/hypervisor/context.go index d8887438..9c23a095 100644 --- a/hypervisor/context.go +++ b/hypervisor/context.go @@ -270,6 +270,10 @@ func (ctx *VmContext) RemoveInterface(id string, result chan api.Result) { ctx.networks.removeInterface(id, result) } +func (ctx *VmContext) AllInterfaces() []*InterfaceCreated { + return ctx.networks.allInterfaces() +} + func (ctx *VmContext) validateContainer(c *api.ContainerDescription) error { for vn, vr := range c.Volumes { if _, ok := ctx.volumes[vn]; !ok { diff --git a/hypervisor/network.go b/hypervisor/network.go index 19301157..c5d4d0ec 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -224,6 +224,19 @@ func (nc *NetworkContext) removeInterface(id string, result chan api.Result) { } } +// allInterfaces return all the network interfaces except loop +func (nc *NetworkContext) allInterfaces() (nics []*InterfaceCreated) { + nc.slotLock.Lock() + defer nc.slotLock.Unlock() + + for _, v := range nc.eth { + if v != nil { + nics = append(nics, v) + } + } + return +} + func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { nc.slotLock.Lock() defer nc.slotLock.Unlock() diff --git a/hypervisor/vm.go b/hypervisor/vm.go index b5602a15..94ed7cd4 100644 --- a/hypervisor/vm.go +++ b/hypervisor/vm.go @@ -319,6 +319,10 @@ func (vm *Vm) AddNic(info *api.InterfaceDescription) error { return vm.ctx.updateInterface(info.Id) } +func (vm *Vm) AllNics() []*InterfaceCreated { + return vm.ctx.AllInterfaces() +} + func (vm *Vm) DeleteNic(id string) error { client := make(chan api.Result, 1) vm.ctx.RemoveInterface(id, client) From 13f308afe390668e23d04485a9da40a71b8427de Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Fri, 8 Sep 2017 15:10:24 +0800 Subject: [PATCH 06/10] Using existing tap device in host instead of creating new one This commit enables using existing tap device in host, we can use `runv interface add --tapname xxx` to specify preferred tap device. This is useful when you want more customized feature on your tapdevice and give you more control over runv. Signed-off-by: Zhang Wei --- api/descriptions.proto | 4 +-- hypervisor/qemu/qemu.go | 2 +- hypervisor/qemu/qmp_wrapper_amd64.go | 48 ++++++++++++++++++---------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/api/descriptions.proto b/api/descriptions.proto index 70660ce7..1c21c35f 100644 --- a/api/descriptions.proto +++ b/api/descriptions.proto @@ -55,12 +55,12 @@ message VolumeDescription { message InterfaceDescription { string id = 1; - string name = 2; + string name = 2; bool lo = 3; string bridge = 4; repeated string ip = 5; string mac = 6; - uint64 mtu = 7; + uint64 mtu = 7; string gw = 8; string tapName = 9; string options = 10; diff --git a/hypervisor/qemu/qemu.go b/hypervisor/qemu/qemu.go index e426a57c..54912b34 100644 --- a/hypervisor/qemu/qemu.go +++ b/hypervisor/qemu/qemu.go @@ -258,7 +258,7 @@ func (qc *QemuContext) RemoveDisk(ctx *hypervisor.VmContext, blockInfo *hypervis } func (qc *QemuContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNicInfo, guest *hypervisor.GuestNicInfo, result chan<- hypervisor.VmEvent) { - newNetworkAddSession(ctx, qc, host.Id, host.Fd, guest.Device, host.Mac, guest.Index, guest.Busaddr, result) + newNetworkAddSession(ctx, qc, host.Id, host.Device, host.Fd, guest.Device, host.Mac, guest.Index, guest.Busaddr, result) } func (qc *QemuContext) RemoveNic(ctx *hypervisor.VmContext, n *hypervisor.InterfaceCreated, callback hypervisor.VmEvent, result chan<- hypervisor.VmEvent) { diff --git a/hypervisor/qemu/qmp_wrapper_amd64.go b/hypervisor/qemu/qmp_wrapper_amd64.go index 8a4166fe..11d9acd3 100644 --- a/hypervisor/qemu/qmp_wrapper_amd64.go +++ b/hypervisor/qemu/qmp_wrapper_amd64.go @@ -10,25 +10,39 @@ import ( "github.com/hyperhq/runv/hypervisor" ) -func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, fd uint64, device, mac string, index, addr int, result chan<- hypervisor.VmEvent) { +func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id, hostDevice string, fd uint64, device, mac string, index, addr int, result chan<- hypervisor.VmEvent) { busAddr := fmt.Sprintf("0x%x", addr) - commands := make([]*QmpCommand, 3) - scm := syscall.UnixRights(int(fd)) - glog.V(1).Infof("send net to qemu at %d", int(fd)) - commands[0] = &QmpCommand{ - Execute: "getfd", - Arguments: map[string]interface{}{ - "fdname": "fd" + device, - }, - Scm: scm, - } - commands[1] = &QmpCommand{ - Execute: "netdev_add", - Arguments: map[string]interface{}{ - "type": "tap", "id": device, "fd": "fd" + device, + commands := []*QmpCommand{} + if fd > 0 { + scm := syscall.UnixRights(int(fd)) + glog.V(3).Infof("send net to qemu at %d", int(fd)) + commands = append(commands, &QmpCommand{ + Execute: "getfd", + Arguments: map[string]interface{}{ + "fdname": "fd" + device, + }, + Scm: scm, }, + &QmpCommand{ + Execute: "netdev_add", + Arguments: map[string]interface{}{ + "type": "tap", "id": device, "fd": "fd" + device, + }, + }) + } else if len(hostDevice) != 0 { + glog.V(3).Infof("netdev add device %q", hostDevice) + commands = append(commands, &QmpCommand{ + Execute: "netdev_add", + Arguments: map[string]interface{}{ + "type": "tap", "id": device, "ifname": hostDevice, "script": "no", + }, + }) + } else { + glog.Errorf("could not find associated tap device!") + return } - commands[2] = &QmpCommand{ + + commands = append(commands, &QmpCommand{ Execute: "device_add", Arguments: map[string]interface{}{ "driver": "virtio-net-pci", @@ -38,7 +52,7 @@ func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, "addr": busAddr, "id": device, }, - } + }) qc.qmp <- &QmpSession{ commands: commands, From 84e1f86f40d5dd2d3ced128d92008bf06f1ca913 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Mon, 11 Sep 2017 17:21:21 +0800 Subject: [PATCH 07/10] Add "interface rm" command Now we support some interface now Signed-off-by: Zhang Wei --- cli/interface.go | 66 ++++-- hyperstart/api/grpc/hyperstart.pb.go | 268 +++++++++++++------------ hyperstart/api/grpc/hyperstart.proto | 9 +- hyperstart/api/json/constants.go | 1 + hyperstart/libhyperstart/grpc.go | 3 +- hyperstart/libhyperstart/hyperstart.go | 13 +- hyperstart/libhyperstart/json.go | 37 ++-- hyperstart/proxy/proxy.go | 2 +- hypervisor/network.go | 2 +- hypervisor/persistence.go | 4 + hypervisor/qemu/qemu.go | 2 +- hypervisor/vm.go | 5 +- hypervisor/vm_states.go | 13 +- 13 files changed, 251 insertions(+), 174 deletions(-) diff --git a/cli/interface.go b/cli/interface.go index 6d1ac8ea..ff2b055a 100644 --- a/cli/interface.go +++ b/cli/interface.go @@ -8,6 +8,7 @@ import ( "text/tabwriter" "github.com/hyperhq/runv/api" + "github.com/hyperhq/runv/hypervisor" "github.com/urfave/cli" ) @@ -56,16 +57,11 @@ var infAddCommand = cli.Command{ }, Action: func(context *cli.Context) error { container := context.Args().First() - - if container == "" { - return cli.NewExitError("Please specify container ID", -1) - } - - vm, lockfile, err := getSandbox(filepath.Join(context.GlobalString("root"), container, "sandbox")) + vm, releaseFunc, err := vmByContainerID(context, container) if err != nil { - return fmt.Errorf("failed to get sandbox for container %q: %v", container, err) + return err } - defer putSandbox(vm, lockfile) + defer releaseFunc() ip := context.String("ip") conf := &api.InterfaceDescription{ @@ -76,27 +72,27 @@ var infAddCommand = cli.Command{ Mtu: context.Uint64("mtu"), } - return vm.AddNic(conf) + if err = vm.AddNic(conf); err != nil { + return err + } + fmt.Println("Add interface successfully.") + return nil }, } var infListCommand = cli.Command{ Name: "ls", + Aliases: []string{"list"}, Usage: "list network interfaces in a container", ArgsUsage: `ls `, Flags: []cli.Flag{}, Action: func(context *cli.Context) error { container := context.Args().First() - - if container == "" { - return cli.NewExitError("Please specify container ID", -1) - } - - vm, lockfile, err := getSandbox(filepath.Join(context.GlobalString("root"), container, "sandbox")) + vm, releaseFunc, err := vmByContainerID(context, container) if err != nil { - return fmt.Errorf("failed to get sandbox for container %q: %v", container, err) + return err } - defer putSandbox(vm, lockfile) + defer releaseFunc() tw := tabwriter.NewWriter(os.Stdout, 10, 1, 3, ' ', 0) fmt.Fprintln(tw, "Name\tMac\tIP\tMtu") @@ -111,10 +107,32 @@ var infListCommand = cli.Command{ var infRmCommand = cli.Command{ Name: "rm", + Aliases: []string{"delete"}, Usage: "remove an interface from container", ArgsUsage: `rm `, Flags: []cli.Flag{}, Action: func(context *cli.Context) error { + container := context.Args().First() + inf := context.Args().Get(1) + if inf == "" { + return cli.NewExitError("please specify an interface to delete", -1) + } + vm, releaseFunc, err := vmByContainerID(context, container) + if err != nil { + return err + } + defer releaseFunc() + + nics := vm.AllNics() + for _, i := range nics { + if i.NewName == inf { + if err = vm.DeleteNic(i.Id); err != nil { + return cli.NewExitError(fmt.Sprintf("failed to delete interface %q: %v", inf, err), -1) + } + fmt.Println("Interface %q is deleted", inf) + break + } + } return nil }, } @@ -128,3 +146,17 @@ var infUpdateCommand = cli.Command{ return nil }, } + +type releaseFunc func() + +func vmByContainerID(context *cli.Context, cid string) (*hypervisor.Vm, releaseFunc, error) { + if cid == "" { + return nil, nil, cli.NewExitError("Please specify container ID", -1) + } + + vm, lockfile, err := getSandbox(filepath.Join(context.GlobalString("root"), cid, "sandbox")) + if err != nil { + return nil, nil, fmt.Errorf("failed to get sandbox for container %q: %v", cid, err) + } + return vm, func() { putSandbox(vm, lockfile) }, nil +} diff --git a/hyperstart/api/grpc/hyperstart.pb.go b/hyperstart/api/grpc/hyperstart.pb.go index 29e41ff5..f0e0994f 100644 --- a/hyperstart/api/grpc/hyperstart.pb.go +++ b/hyperstart/api/grpc/hyperstart.pb.go @@ -367,10 +367,11 @@ func (*DestroySandboxRequest) ProtoMessage() {} func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } type UpdateInterfaceRequest struct { - Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` - NewName string `protobuf:"bytes,2,opt,name=newName" json:"newName,omitempty"` - Address []string `protobuf:"bytes,3,rep,name=address" json:"address,omitempty"` - Mtu uint64 `protobuf:"varint,4,opt,name=mtu" json:"mtu,omitempty"` + Type uint64 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` + Device string `protobuf:"bytes,2,opt,name=device" json:"device,omitempty"` + NewName string `protobuf:"bytes,3,opt,name=newName" json:"newName,omitempty"` + Address []string `protobuf:"bytes,4,rep,name=address" json:"address,omitempty"` + Mtu uint64 `protobuf:"varint,5,opt,name=mtu" json:"mtu,omitempty"` } func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } @@ -378,6 +379,13 @@ func (m *UpdateInterfaceRequest) String() string { return proto.Compa func (*UpdateInterfaceRequest) ProtoMessage() {} func (*UpdateInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +func (m *UpdateInterfaceRequest) GetType() uint64 { + if m != nil { + return m.Type + } + return 0 +} + func (m *UpdateInterfaceRequest) GetDevice() string { if m != nil { return m.Device @@ -1203,130 +1211,130 @@ var _HyperstartService_serviceDesc = grpc1.ServiceDesc{ func init() { proto.RegisterFile("hyperstart.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1987 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x6e, 0x1b, 0xb9, - 0x15, 0xae, 0xe4, 0x91, 0x65, 0x1d, 0xc9, 0x3f, 0xa2, 0x6c, 0x47, 0x51, 0xb6, 0xbb, 0xc9, 0x2c, - 0x9a, 0x35, 0x1a, 0xac, 0x82, 0x3a, 0x8b, 0x6e, 0xb6, 0x45, 0x50, 0x38, 0x8e, 0xb1, 0x49, 0xb7, - 0xde, 0xba, 0xb4, 0x8c, 0x00, 0x05, 0x0a, 0x75, 0x3c, 0x43, 0xcb, 0xac, 0x35, 0xc3, 0x09, 0xc9, - 0xb1, 0xa5, 0x5e, 0xf4, 0x11, 0x0a, 0xf4, 0xb2, 0x57, 0xbd, 0xef, 0x13, 0xf4, 0x29, 0xfa, 0x08, - 0x7d, 0x80, 0x5e, 0xf6, 0x09, 0x0a, 0xfe, 0xcc, 0x0c, 0xf5, 0x63, 0x07, 0xdb, 0x4d, 0x6f, 0x04, - 0x9e, 0xc3, 0x73, 0xbe, 0xf3, 0x43, 0x9e, 0x33, 0xd4, 0x81, 0xad, 0xcb, 0x69, 0x4a, 0xb8, 0x90, - 0x01, 0x97, 0xfd, 0x94, 0x33, 0xc9, 0x90, 0x37, 0xe2, 0x69, 0xd8, 0x7b, 0x30, 0x62, 0x6c, 0x34, - 0x26, 0x4f, 0x35, 0xef, 0x3c, 0xbb, 0x78, 0x4a, 0xe2, 0x54, 0x4e, 0x8d, 0x48, 0xef, 0x93, 0xf9, - 0x4d, 0x49, 0x63, 0x22, 0x64, 0x10, 0xa7, 0x46, 0xc0, 0x1f, 0x41, 0xe7, 0x20, 0x8a, 0x0e, 0x59, - 0x22, 0x03, 0x9a, 0x10, 0x8e, 0xc9, 0xbb, 0x8c, 0x08, 0x89, 0x3e, 0x87, 0x46, 0x98, 0xf3, 0xba, - 0x95, 0x87, 0x95, 0xbd, 0xe6, 0xfe, 0x66, 0x5f, 0x99, 0xeb, 0x97, 0xa2, 0xa5, 0x04, 0x7a, 0x04, - 0x1e, 0x4d, 0xa8, 0xec, 0x56, 0xb5, 0xe4, 0xba, 0x91, 0x3c, 0xe1, 0x2c, 0x24, 0x42, 0x60, 0xbd, - 0xe5, 0xff, 0x16, 0xda, 0x07, 0x51, 0x94, 0xf3, 0xac, 0x99, 0x8f, 0xe6, 0xcd, 0x34, 0x5c, 0xd4, - 0xcf, 0xa0, 0x9e, 0x1a, 0xf9, 0xe5, 0xc0, 0xf9, 0xae, 0x7f, 0x01, 0xdb, 0xa7, 0x74, 0x94, 0x04, - 0xe3, 0xef, 0x04, 0xdf, 0x9d, 0x85, 0x6f, 0x14, 0x78, 0x68, 0x17, 0x56, 0x85, 0xc6, 0xeb, 0xae, - 0x3c, 0xac, 0xec, 0xad, 0x63, 0x4b, 0xf9, 0xbf, 0x02, 0xf4, 0x36, 0xa0, 0xf2, 0xc3, 0x58, 0xf1, - 0x3f, 0x87, 0xce, 0x0c, 0x9a, 0x48, 0x59, 0x22, 0x88, 0x36,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22, 0x41, 0x76, 0x02, 0xb0, 0x74, 0x70, 0x72, 0x2b, 0xcc, 0xd7, 0xb0, 0x39, 0x37, 0x50, 0x41, - 0xf6, 0x81, 0xb4, 0x7c, 0xce, 0x72, 0x2b, 0xd0, 0x57, 0xb0, 0x96, 0x4f, 0x48, 0xd0, 0x4e, 0x51, - 0x13, 0xee, 0xc4, 0xe4, 0xae, 0x6c, 0xb8, 0x43, 0x92, 0x3c, 0x1b, 0x4b, 0x06, 0x27, 0xb7, 0x41, - 0x9c, 0xaf, 0x6a, 0xfa, 0xd9, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x22, 0x9d, 0xb1, 0xc4, 0x58, - 0x16, 0x00, 0x00, + // 1994 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6e, 0x1b, 0xc9, + 0xf1, 0xff, 0x93, 0x1a, 0x8a, 0x62, 0x91, 0xfa, 0x60, 0x53, 0x92, 0x69, 0x7a, 0xff, 0xbb, 0xf6, + 0x2c, 0xe2, 0x15, 0x62, 0x2c, 0x8d, 0xc8, 0x8b, 0xac, 0x37, 0x81, 0x11, 0xc8, 0xb2, 0xb0, 0x76, + 0x36, 0xda, 0x28, 0x2d, 0x0a, 0x06, 0x02, 0x04, 0xcc, 0x68, 0xa6, 0x45, 0x75, 0xc4, 0x99, 0x1e, + 0xf7, 0xf4, 0x48, 0x64, 0x0e, 0x79, 0x80, 0x1c, 0x02, 0xe4, 0x98, 0x53, 0xee, 0x79, 0x82, 0x3c, + 0x45, 0x1e, 0x21, 0x0f, 0x90, 0x63, 0x9e, 0x20, 0xe8, 0xaf, 0x99, 0xe6, 0x87, 0x64, 0x6c, 0xd6, + 0xb9, 0x10, 0x5d, 0xd5, 0x55, 0xbf, 0xfa, 0xe8, 0xae, 0x9a, 0x66, 0xc1, 0xd6, 0xe5, 0x34, 0x25, + 0x3c, 0x13,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d, 0xe5, 0x54, 0x90, 0x53, 0xc1, 0x49, 0x10, + 0x7f, 0xdf, 0x10, 0x11, 0x78, 0x51, 0x20, 0x02, 0x15, 0x60, 0x0b, 0xab, 0xb5, 0xff, 0x19, 0x74, + 0x66, 0x2c, 0x18, 0x87, 0xb6, 0x60, 0x65, 0x4c, 0x12, 0x05, 0xbe, 0x8e, 0xe5, 0xd2, 0xff, 0x0d, + 0xb4, 0x31, 0x09, 0xa2, 0x0f, 0xe3, 0x89, 0x81, 0x5f, 0x29, 0xe1, 0xf7, 0x00, 0xb9, 0xf0, 0xc6, + 0x0d, 0xeb, 0x71, 0xc5, 0xf1, 0xf8, 0x1b, 0x68, 0x1f, 0x8e, 0x59, 0x46, 0x4e, 0x45, 0x44, 0x93, + 0xef, 0x7b, 0x1e, 0x37, 0xd0, 0x19, 0x88, 0xe9, 0x5b, 0x09, 0x94, 0xd1, 0xdf, 0x93, 0x0f, 0x10, + 0x17, 0x67, 0x37, 0x36, 0x2e, 0xce, 0x6e, 0xe4, 0xc9, 0x86, 0x6c, 0x9c, 0xc7, 0x49, 0xd7, 0xd3, + 0xd7, 0x4a, 0x53, 0xfe, 0x21, 0x74, 0x4e, 0x65, 0x59, 0x9f, 0x06, 0x49, 0x74, 0xce, 0x26, 0xd6, + 0x70, 0x0f, 0xd6, 0x2e, 0x59, 0x26, 0x92, 0x20, 0x26, 0xc6, 0x6e, 0x41, 0x4b, 0xf0, 0x28, 0x91, + 0x26, 0x57, 0xf6, 0x1a, 0x58, 0x2e, 0xfd, 0x7b, 0xb0, 0xf3, 0x8a, 0x64, 0x82, 0xb3, 0xe9, 0x2c, + 0x8c, 0xff, 0xc7, 0x0a, 0xec, 0x9e, 0xa5, 0x51, 0x20, 0xc8, 0x9b, 0x44, 0x10, 0x7e, 0x11, 0x84, + 0x45, 0x68, 0x08, 0x3c, 0x31, 0x4d, 0x35, 0xba, 0x87, 0xd5, 0x5a, 0x3a, 0x19, 0x91, 0x6b, 0x1a, + 0x12, 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, 0xd6, 0xaa, 0x33, 0x28, 0x13, 0xf6, 0x68, 0x34, 0x55, + 0x1c, 0xa3, 0x3e, 0x17, 0x7d, 0x8c, 0x5d, 0xa8, 0xb3, 0x54, 0x50, 0x96, 0x14, 0x87, 0x62, 0x48, + 0xff, 0xcf, 0x55, 0xa8, 0x9b, 0x9e, 0xb3, 0x90, 0x31, 0x04, 0x5e, 0xc0, 0x47, 0xf6, 0x5e, 0xa9, + 0x35, 0x7a, 0x02, 0x1e, 0x49, 0xae, 0x33, 0x93, 0x9e, 0x7b, 0x33, 0x2d, 0xb8, 0x7f, 0x94, 0x5c, + 0x67, 0x3a, 0x35, 0x4a, 0x08, 0x7d, 0x0c, 0x5e, 0x9e, 0x11, 0xae, 0x72, 0xd2, 0xdc, 0x07, 0x2d, + 0x7c, 0x96, 0x11, 0x8e, 0x15, 0x5f, 0xba, 0x75, 0xc3, 0xf8, 0x55, 0x44, 0xb9, 0xba, 0x15, 0x0d, + 0x6c, 0x49, 0x79, 0xdb, 0x05, 0xe1, 0x31, 0x95, 0x5d, 0x77, 0xf5, 0x61, 0x65, 0x6f, 0x0d, 0x17, + 0x34, 0x7a, 0x0c, 0x75, 0x3e, 0xa6, 0x31, 0x15, 0x59, 0xb7, 0xae, 0xbc, 0x68, 0x99, 0x3b, 0xa2, + 0x98, 0xd8, 0x6e, 0xf6, 0xbe, 0x84, 0x46, 0xe1, 0xd0, 0x77, 0x4a, 0x3b, 0x06, 0x4f, 0x3a, 0x29, + 0x75, 0xf2, 0x22, 0x21, 0x72, 0x29, 0x39, 0x23, 0x1a, 0x19, 0x0d, 0xb9, 0x44, 0x8f, 0x61, 0x23, + 0x88, 0x22, 0x2a, 0x93, 0x19, 0x8c, 0xbf, 0xa6, 0x91, 0xce, 0xcc, 0x3a, 0x9e, 0xe3, 0xfa, 0xaf, + 0x60, 0x55, 0xfb, 0x37, 0x53, 0x66, 0xf6, 0x7c, 0x10, 0x78, 0x97, 0x01, 0xd7, 0xc0, 0x1e, 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20, 0xf3, 0x40, 0x5a, 0x3e, 0x7b, 0xb9, 0x15, 0xe8, 0x2b, + 0x58, 0xb3, 0x13, 0x12, 0xb4, 0x53, 0xd4, 0x84, 0x3b, 0x31, 0xb9, 0x2b, 0x1b, 0xee, 0x90, 0xc4, + 0x66, 0x63, 0xc9, 0xe0, 0xe4, 0x36, 0x88, 0xf3, 0x55, 0x45, 0x3f, 0xfb, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x8d, 0x39, 0xda, 0x36, 0x6d, 0x16, 0x00, 0x00, } diff --git a/hyperstart/api/grpc/hyperstart.proto b/hyperstart/api/grpc/hyperstart.proto index 4d45d19e..c332dc3e 100644 --- a/hyperstart/api/grpc/hyperstart.proto +++ b/hyperstart/api/grpc/hyperstart.proto @@ -96,10 +96,11 @@ message DestroySandboxRequest { } message UpdateInterfaceRequest { - string device = 1; - string newName = 2; - repeated string address = 3; - uint64 mtu = 4; + uint64 type =1; + string device = 2; + string newName = 3; + repeated string address = 4; + uint64 mtu = 5; } message AddRouteRequest { diff --git a/hyperstart/api/json/constants.go b/hyperstart/api/json/constants.go index 4577e985..b9bedfdd 100644 --- a/hyperstart/api/json/constants.go +++ b/hyperstart/api/json/constants.go @@ -29,6 +29,7 @@ const ( INIT_REMOVECONTAINER INIT_PROCESSASYNCEVENT INIT_SIGNALPROCESS + INIT_DELETEINTERFACE // 25 ) // "hyperstart" is the special container ID for adding processes. diff --git a/hyperstart/libhyperstart/grpc.go b/hyperstart/libhyperstart/grpc.go index 19664396..acbe4688 100644 --- a/hyperstart/libhyperstart/grpc.go +++ b/hyperstart/libhyperstart/grpc.go @@ -86,8 +86,9 @@ func (h *grpcBasedHyperstart) AddRoute(routes []hyperstartjson.Route) error { return err } -func (h *grpcBasedHyperstart) UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error { +func (h *grpcBasedHyperstart) UpdateInterface(t InfUpdateType, dev, newName string, ipnet []string, mtu uint64) error { _, err := h.grpc.UpdateInterface(h.ctx, &hyperstartgrpc.UpdateInterfaceRequest{ + Type: uint64(t), Device: dev, NewName: newName, Address: ipnet, diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index fd6d76e2..513cad21 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -6,6 +6,17 @@ import ( hyperstartapi "github.com/hyperhq/runv/hyperstart/api/json" ) +type InfUpdateType uint64 + +const ( + AddInf InfUpdateType = 1 << iota + DelInf + AddIP + DelIP + SetName + SetMtu +) + // Hyperstart interface to hyperstart API type Hyperstart interface { Close() @@ -32,7 +43,7 @@ type Hyperstart interface { WriteFile(container, path string, data []byte) error ReadFile(container, path string) ([]byte, error) AddRoute(r []hyperstartapi.Route) error - UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error + UpdateInterface(t InfUpdateType, dev, newName string, ipnet []string, mtu uint64) error OnlineCpuMem() error } diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index 083d77a4..45771468 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -647,21 +647,28 @@ func (h *jsonBasedHyperstart) AddRoute(r []hyperstartapi.Route) error { return h.hyperstartCommand(hyperstartapi.INIT_SETUPROUTE, hyperstartapi.Routes{Routes: r}) } -func (h *jsonBasedHyperstart) UpdateInterface(dev, newName string, ipnet []string, mtu uint64) error { - for _, ipstr := range ipnet { - ip, net, err := net.ParseCIDR(ipstr) - if err != nil { - return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) - } - mask := fmt.Sprintf("%d.%d.%d.%d", int(net.Mask[0]), int(net.Mask[1]), int(net.Mask[2]), int(net.Mask[3])) - err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, hyperstartapi.NetworkInf{ - Device: dev, - NewName: newName, - IpAddress: ip.String(), - NetMask: mask, - Mtu: mtu, - }) - if err != nil { +func (h *jsonBasedHyperstart) UpdateInterface(t InfUpdateType, dev, newName string, ipnet []string, mtu uint64) error { + inf := hyperstartapi.NetworkInf{ + Device: dev, + } + switch t { + case AddInf: + inf.NewName = newName + inf.Mtu = mtu + for _, ipstr := range ipnet { + ip, net, err := net.ParseCIDR(ipstr) + if err != nil { + return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) + } + mask := fmt.Sprintf("%d.%d.%d.%d", int(net.Mask[0]), int(net.Mask[1]), int(net.Mask[2]), int(net.Mask[3])) + inf.IpAddress = ip.String() + inf.NetMask = mask + if err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { + return fmt.Errorf("json: failed to send command to hyperstart: %v", err) + } + } + case DelInf: + if err := h.hyperstartCommand(hyperstartapi.INIT_DELETEINTERFACE, inf); err != nil { return fmt.Errorf("json: failed to send update command to hyperstart: %v", err) } } diff --git a/hyperstart/proxy/proxy.go b/hyperstart/proxy/proxy.go index 2d636640..4cb1ee1b 100644 --- a/hyperstart/proxy/proxy.go +++ b/hyperstart/proxy/proxy.go @@ -122,7 +122,7 @@ func (proxy *jsonProxy) DestroySandbox(ctx context.Context, req *hyperstartgrpc. return pbEmpty(err), err } func (proxy *jsonProxy) UpdateInterface(ctx context.Context, req *hyperstartgrpc.UpdateInterfaceRequest) (*google_protobuf.Empty, error) { - err := proxy.json.UpdateInterface(req.Device, req.NewName, req.Address, req.Mtu) + err := proxy.json.UpdateInterface(libhyperstart.InfUpdateType(req.Type), req.Device, req.NewName, req.Address, req.Mtu) return pbEmpty(err), err } func (proxy *jsonProxy) AddRoute(ctx context.Context, req *hyperstartgrpc.AddRouteRequest) (*google_protobuf.Empty, error) { diff --git a/hypervisor/network.go b/hypervisor/network.go index c5d4d0ec..5f03ff20 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -107,7 +107,7 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha return } if inf.Id == "" { - inf.Id = "0" + inf.Id = "lo" } i := &InterfaceCreated{ Id: inf.Id, diff --git a/hypervisor/persistence.go b/hypervisor/persistence.go index 3f1e547b..d334b968 100644 --- a/hypervisor/persistence.go +++ b/hypervisor/persistence.go @@ -38,6 +38,7 @@ type PersistNetworkInfo struct { Id string Index int PciAddr int + HostDevice string DeviceName string NewName string IpAddr []string @@ -111,6 +112,7 @@ func (ctx *VmContext) dump() (*PersistInfo, error) { Id: nic.Id, Index: nic.Index, PciAddr: nic.PCIAddr, + HostDevice: nic.HostDevice, DeviceName: nic.DeviceName, IpAddr: nic.IpAddr, } @@ -122,6 +124,7 @@ func (ctx *VmContext) dump() (*PersistInfo, error) { Id: nic.Id, Index: nic.Index, PciAddr: nic.PCIAddr, + HostDevice: nic.HostDevice, DeviceName: nic.DeviceName, NewName: nic.NewName, IpAddr: nic.IpAddr, @@ -212,6 +215,7 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { Id: pi.Id, Index: pi.Index, PCIAddr: pi.PciAddr, + HostDevice: pi.HostDevice, DeviceName: pi.DeviceName, NewName: pi.NewName, IpAddr: pi.IpAddr, diff --git a/hypervisor/qemu/qemu.go b/hypervisor/qemu/qemu.go index 54912b34..a2478128 100644 --- a/hypervisor/qemu/qemu.go +++ b/hypervisor/qemu/qemu.go @@ -262,7 +262,7 @@ func (qc *QemuContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNi } func (qc *QemuContext) RemoveNic(ctx *hypervisor.VmContext, n *hypervisor.InterfaceCreated, callback hypervisor.VmEvent, result chan<- hypervisor.VmEvent) { - newNetworkDelSession(ctx, qc, n.DeviceName, callback, result) + newNetworkDelSession(ctx, qc, n.NewName, callback, result) } func (qc *QemuContext) SetCpus(ctx *hypervisor.VmContext, cpus int) error { diff --git a/hypervisor/vm.go b/hypervisor/vm.go index 94ed7cd4..e9a064e8 100644 --- a/hypervisor/vm.go +++ b/hypervisor/vm.go @@ -316,7 +316,7 @@ func (vm *Vm) AddNic(info *api.InterfaceDescription) error { if vm.ctx.LogLevel(TRACE) { vm.Log(TRACE, "finial vmSpec.Interface is %#v", vm.ctx.networks.getInterface(info.Id)) } - return vm.ctx.updateInterface(info.Id) + return vm.ctx.hyperstartUpdateInterface(info.Id) } func (vm *Vm) AllNics() []*InterfaceCreated { @@ -324,6 +324,9 @@ func (vm *Vm) AllNics() []*InterfaceCreated { } func (vm *Vm) DeleteNic(id string) error { + if err := vm.ctx.hyperstartDeleteInterface(id); err != nil { + return err + } client := make(chan api.Result, 1) vm.ctx.RemoveInterface(id, client) diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index 3c2c01ad..77c0d5de 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -110,11 +110,20 @@ func (ctx *VmContext) restoreContainer(id string) (alive bool, err error) { return true, nil } -func (ctx *VmContext) updateInterface(id string) error { +func (ctx *VmContext) hyperstartUpdateInterface(id string) error { if inf := ctx.networks.getInterface(id); inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } else { - return ctx.hyperstart.UpdateInterface(inf.DeviceName, inf.NewName, inf.IpAddr, inf.Mtu) + return ctx.hyperstart.UpdateInterface(libhyperstart.AddInf, inf.DeviceName, inf.NewName, inf.IpAddr, inf.Mtu) + } +} + +func (ctx *VmContext) hyperstartDeleteInterface(id string) error { + if inf := ctx.networks.getInterface(id); inf == nil { + return fmt.Errorf("can't find interface whose ID is %s", id) + } else { + // using new name as device name + return ctx.hyperstart.UpdateInterface(libhyperstart.DelInf, inf.NewName, "", nil, 0) } } From a87b6c4ebfec5521d24b695a15172cf62d40a2e2 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Tue, 12 Sep 2017 11:38:53 +0800 Subject: [PATCH 08/10] Support update interface This commit enables interface update, now we can add ip address, delete ip address and update mtu of an interface Signed-off-by: Zhang Wei --- cli/interface.go | 58 +++++++++++++++++++++++++- hyperstart/libhyperstart/hyperstart.go | 2 - hyperstart/libhyperstart/json.go | 40 ++++++++++++++++-- hypervisor/context.go | 14 +++++++ hypervisor/network.go | 42 +++++++++++++++++++ hypervisor/vm.go | 10 ++++- hypervisor/vm_states.go | 22 +++++++++- 7 files changed, 179 insertions(+), 9 deletions(-) diff --git a/cli/interface.go b/cli/interface.go index ff2b055a..cb75bb5b 100644 --- a/cli/interface.go +++ b/cli/interface.go @@ -129,7 +129,7 @@ var infRmCommand = cli.Command{ if err = vm.DeleteNic(i.Id); err != nil { return cli.NewExitError(fmt.Sprintf("failed to delete interface %q: %v", inf, err), -1) } - fmt.Println("Interface %q is deleted", inf) + fmt.Printf("Interface %q is deleted\n", inf) break } } @@ -141,8 +141,62 @@ var infUpdateCommand = cli.Command{ Name: "update", Usage: "update configuration of interface", ArgsUsage: `update `, - Flags: []cli.Flag{}, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "add-ip", + Usage: "add a new ip address with mask (format: 192.168.0.2/24)", + }, + cli.StringFlag{ + Name: "delete-ip", + Usage: "add a new ip address with mask (format: 192.168.0.2/24)", + }, + cli.IntFlag{ + Name: "mtu", + Usage: "update mtu", + }, + }, Action: func(context *cli.Context) error { + container := context.Args().First() + vm, releaseFunc, err := vmByContainerID(context, container) + if err != nil { + return err + } + defer releaseFunc() + + targetInf := context.Args().Get(1) + if targetInf == "" { + return cli.NewExitError("please specify an interface name to update", -1) + } + + conf := &api.InterfaceDescription{ + Id: "-1", + Name: context.String("name"), + Mtu: context.Uint64("mtu"), + } + if ip := context.String("add-ip"); ip != "" { + conf.Ip = append(conf.Ip, ip) + } + if ip := context.String("delete-ip"); ip != "" { + // an IP address prefixed with "-" indicates deleting an ip + conf.Ip = append(conf.Ip, "-"+ip) + } + + nics := vm.AllNics() + for _, i := range nics { + if i.NewName == targetInf { + conf.Id = i.Id + break + } + } + + if conf.Id == "-1" { + return cli.NewExitError(fmt.Sprintf("Can't find target interface name %q", targetInf), -1) + } + + if err = vm.UpdateNic(conf); err != nil { + return err + } + fmt.Printf("Interface %q is updated\n", targetInf) return nil }, } diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index 513cad21..6f62de2c 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -12,8 +12,6 @@ const ( AddInf InfUpdateType = 1 << iota DelInf AddIP - DelIP - SetName SetMtu ) diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index 45771468..04cf4431 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -656,11 +656,11 @@ func (h *jsonBasedHyperstart) UpdateInterface(t InfUpdateType, dev, newName stri inf.NewName = newName inf.Mtu = mtu for _, ipstr := range ipnet { - ip, net, err := net.ParseCIDR(ipstr) + ip, ipnet, err := net.ParseCIDR(ipstr) if err != nil { return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) } - mask := fmt.Sprintf("%d.%d.%d.%d", int(net.Mask[0]), int(net.Mask[1]), int(net.Mask[2]), int(net.Mask[3])) + mask := fmt.Sprintf("%d.%d.%d.%d", int(ipnet.Mask[0]), int(ipnet.Mask[1]), int(ipnet.Mask[2]), int(ipnet.Mask[3])) inf.IpAddress = ip.String() inf.NetMask = mask if err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { @@ -669,7 +669,41 @@ func (h *jsonBasedHyperstart) UpdateInterface(t InfUpdateType, dev, newName stri } case DelInf: if err := h.hyperstartCommand(hyperstartapi.INIT_DELETEINTERFACE, inf); err != nil { - return fmt.Errorf("json: failed to send update command to hyperstart: %v", err) + return fmt.Errorf("json: failed to send command to hyperstart: %v", err) + } + case AddIP: + for _, ipstr := range ipnet { + // an ip string with prefix "-" indicates deleting an ip address from interface + var ( + ip net.IP + ipnet *net.IPNet + err error + ) + if ipstr[0] == '-' { + ip, ipnet, err = net.ParseCIDR(ipstr[1:]) + if err != nil { + return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) + } + inf.IpAddress = "-" + ip.String() + } else { + ip, ipnet, err = net.ParseCIDR(ipstr) + if err != nil { + return fmt.Errorf("jsonhyperstart: failed to parse ipnet %q: %v", ipstr, err) + } + inf.IpAddress = ip.String() + } + mask := fmt.Sprintf("%d.%d.%d.%d", int(ipnet.Mask[0]), int(ipnet.Mask[1]), int(ipnet.Mask[2]), int(ipnet.Mask[3])) + inf.NetMask = mask + if err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { + return fmt.Errorf("json: failed to send command to hyperstart: %v", err) + } + } + case SetMtu: + if mtu > 0 { + inf.Mtu = mtu + if err := h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { + return fmt.Errorf("json: failed to send command to hyperstart: %v", err) + } } } return nil diff --git a/hypervisor/context.go b/hypervisor/context.go index 9c23a095..ce9dbf48 100644 --- a/hypervisor/context.go +++ b/hypervisor/context.go @@ -270,7 +270,21 @@ func (ctx *VmContext) RemoveInterface(id string, result chan api.Result) { ctx.networks.removeInterface(id, result) } +func (ctx *VmContext) UpdateInterface(inf *api.InterfaceDescription) error { + ctx.lock.Lock() + defer ctx.lock.Unlock() + + if ctx.current != StateRunning { + ctx.Log(DEBUG, "update interface %s during %v", inf.Name, ctx.current) + return fmt.Errorf("pod not running") + } + + return ctx.networks.updateInterface(inf) +} + func (ctx *VmContext) AllInterfaces() []*InterfaceCreated { + ctx.lock.Lock() + defer ctx.lock.Unlock() return ctx.networks.allInterfaces() } diff --git a/hypervisor/network.go b/hypervisor/network.go index 5f03ff20..ae041779 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -237,6 +237,48 @@ func (nc *NetworkContext) allInterfaces() (nics []*InterfaceCreated) { return } +func (nc *NetworkContext) updateInterface(inf *api.InterfaceDescription) error { + oldInf, ok := nc.idMap[inf.Id] + if !ok { + nc.sandbox.Log(WARNING, "trying update a non-exist interface %s", inf.Id) + return fmt.Errorf("interface %q not exists", inf.Id) + } + + // only support update some fields: Name, ip addresses, mtu + nc.slotLock.Lock() + defer nc.slotLock.Unlock() + + if inf.Name != "" { + oldInf.NewName = inf.Name + } + + if inf.Mtu > 0 { + oldInf.Mtu = inf.Mtu + } + + if inf.Ip != nil && len(inf.Ip) > 0 { + for _, ip := range inf.Ip { + var found bool + if ip[0] == '-' { // to delete + ip = ip[1:] + for k, i := range oldInf.IpAddr { + if i == ip { + oldInf.IpAddr = append(oldInf.IpAddr[:k], oldInf.IpAddr[k+1:]...) + found = true + break + } + } + if !found { + return fmt.Errorf("failed to delete %q: not found", ip) + } + } else { // to add + oldInf.IpAddr = append(oldInf.IpAddr, ip) + } + } + } + return nil +} + func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { nc.slotLock.Lock() defer nc.slotLock.Unlock() diff --git a/hypervisor/vm.go b/hypervisor/vm.go index e9a064e8..916130e2 100644 --- a/hypervisor/vm.go +++ b/hypervisor/vm.go @@ -316,7 +316,7 @@ func (vm *Vm) AddNic(info *api.InterfaceDescription) error { if vm.ctx.LogLevel(TRACE) { vm.Log(TRACE, "finial vmSpec.Interface is %#v", vm.ctx.networks.getInterface(info.Id)) } - return vm.ctx.hyperstartUpdateInterface(info.Id) + return vm.ctx.hyperstartAddInterface(info.Id) } func (vm *Vm) AllNics() []*InterfaceCreated { @@ -338,9 +338,17 @@ func (vm *Vm) DeleteNic(id string) error { if !ev.IsSuccess() { return fmt.Errorf("remove device failed") } + return nil } +func (vm *Vm) UpdateNic(inf *api.InterfaceDescription) error { + if err := vm.ctx.hyperstartUpdateInterface(inf.Id, inf.Ip, inf.Mtu); err != nil { + return err + } + return vm.ctx.UpdateInterface(inf) +} + func (vm *Vm) SetCpus(cpus int) error { if vm.Cpu >= cpus { return nil diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index 77c0d5de..0b531c52 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -110,7 +110,7 @@ func (ctx *VmContext) restoreContainer(id string) (alive bool, err error) { return true, nil } -func (ctx *VmContext) hyperstartUpdateInterface(id string) error { +func (ctx *VmContext) hyperstartAddInterface(id string) error { if inf := ctx.networks.getInterface(id); inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } else { @@ -127,6 +127,26 @@ func (ctx *VmContext) hyperstartDeleteInterface(id string) error { } } +func (ctx *VmContext) hyperstartUpdateInterface(id string, addIP []string, mtu uint64) error { + inf := ctx.networks.getInterface(id) + if inf == nil { + return fmt.Errorf("can't find interface whose ID is %s", id) + } + + if addIP != nil && len(addIP) != 0 { + if err := ctx.hyperstart.UpdateInterface(libhyperstart.AddIP, inf.NewName, "", addIP, 0); err != nil { + return err + } + } + + if mtu > 0 { + if err := ctx.hyperstart.UpdateInterface(libhyperstart.SetMtu, inf.NewName, "", nil, mtu); err != nil { + return err + } + } + return nil +} + // TODO remove attachCmd and move streamCopy to hyperd func (ctx *VmContext) attachCmd(cmd *AttachCommand) error { ctx.lock.Lock() From d40bd49ac762d86bc6687ec0643e4afa7a072ac4 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Sat, 23 Sep 2017 14:26:23 +0800 Subject: [PATCH 09/10] Fix errors during merge Signed-off-by: Zhang Wei --- api/descriptions.pb.go | 159 ++++++++++++------------- api/descriptions.proto | 2 +- cli/interface.go | 9 +- cli/network.go | 12 +- hyperstart/api/json/spec.go | 2 - hyperstart/libhyperstart/hyperstart.go | 1 + hyperstart/libhyperstart/json.go | 21 ++-- hypervisor/driver.go | 2 +- hypervisor/network.go | 55 +++++---- hypervisor/network/network_linux.go | 19 +-- hypervisor/persistence.go | 8 +- hypervisor/qemu/network.go | 10 ++ hypervisor/qemu/qmp_wrapper_amd64.go | 32 ++--- hypervisor/vm.go | 2 +- hypervisor/vm_states.go | 46 ++++++- 15 files changed, 220 insertions(+), 160 deletions(-) diff --git a/api/descriptions.pb.go b/api/descriptions.pb.go index 95d42a46..31865f40 100644 --- a/api/descriptions.pb.go +++ b/api/descriptions.pb.go @@ -307,16 +307,16 @@ func (m *VolumeDescription) GetReadOnly() bool { } type InterfaceDescription struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Lo bool `protobuf:"varint,3,opt,name=lo" json:"lo,omitempty"` - Bridge string `protobuf:"bytes,4,opt,name=bridge" json:"bridge,omitempty"` - Ip []string `protobuf:"bytes,5,rep,name=ip" json:"ip,omitempty"` - Mac string `protobuf:"bytes,6,opt,name=mac" json:"mac,omitempty"` - Mtu uint64 `protobuf:"varint,7,opt,name=mtu" json:"mtu,omitempty"` - Gw string `protobuf:"bytes,8,opt,name=gw" json:"gw,omitempty"` - TapName string `protobuf:"bytes,9,opt,name=tapName" json:"tapName,omitempty"` - Options string `protobuf:"bytes,10,opt,name=options" json:"options,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Lo bool `protobuf:"varint,3,opt,name=lo" json:"lo,omitempty"` + Bridge string `protobuf:"bytes,4,opt,name=bridge" json:"bridge,omitempty"` + Ip string `protobuf:"bytes,5,opt,name=ip" json:"ip,omitempty"` + Mac string `protobuf:"bytes,6,opt,name=mac" json:"mac,omitempty"` + Mtu uint64 `protobuf:"varint,7,opt,name=mtu" json:"mtu,omitempty"` + Gw string `protobuf:"bytes,8,opt,name=gw" json:"gw,omitempty"` + TapName string `protobuf:"bytes,9,opt,name=tapName" json:"tapName,omitempty"` + Options string `protobuf:"bytes,10,opt,name=options" json:"options,omitempty"` } func (m *InterfaceDescription) Reset() { *m = InterfaceDescription{} } @@ -352,11 +352,11 @@ func (m *InterfaceDescription) GetBridge() string { return "" } -func (m *InterfaceDescription) GetIp() []string { +func (m *InterfaceDescription) GetIp() string { if m != nil { return m.Ip } - return nil + return "" } func (m *InterfaceDescription) GetMac() string { @@ -708,72 +708,71 @@ func init() { func init() { proto.RegisterFile("descriptions.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1069 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00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0x34, 0x4b, 0x85, 0x18, 0xac, 0x88, 0x2c, 0x0a, 0x8d, 0x61, 0xc8, 0x92, 0x0c, 0xe0, - 0x2f, 0x03, 0x55, 0x64, 0x13, 0xcf, 0xde, 0xc0, 0x76, 0xbd, 0xfd, 0xd1, 0x3e, 0x0d, 0x76, 0xb4, - 0x4f, 0x63, 0xcd, 0xa0, 0x77, 0x26, 0x5d, 0x41, 0xe6, 0x7b, 0x82, 0x68, 0xc4, 0xbc, 0x9d, 0xd7, - 0x8b, 0xa1, 0x27, 0x88, 0xce, 0xfe, 0x49, 0x60, 0x30, 0x75, 0x36, 0x57, 0x9e, 0x7e, 0x2a, 0xda, - 0x4d, 0x1f, 0x8d, 0x5d, 0x01, 0x38, 0x22, 0x93, 0x22, 0xba, 0x9b, 0x4e, 0xc8, 0x1a, 0x86, 0x19, - 0x73, 0x46, 0x34, 0x46, 0x45, 0xde, 0xc5, 0x89, 0xac, 0x19, 0x76, 0x08, 0xbb, 0xaf, 0xae, 0x7b, - 0x1f, 0xa7, 0x73, 0x13, 0xc6, 0x32, 0xfd, 0xa8, 0xdc, 0x52, 0x37, 0xbf, 0x04, 0x43, 0xd1, 0xf2, - 0xf8, 0xde, 0x2b, 0xbc, 0x8a, 0x83, 0xfa, 0x2a, 0x22, 0x8d, 0x18, 0x2e, 0x7d, 0x3e, 0xac, 0xb1, - 0xb7, 0xf1, 0xd6, 0xfe, 0x1c, 0x6f, 0x6d, 0x1c, 0xdd, 0xc8, 0xce, 0xb6, 0x69, 0x72, 0x9e, 0xfd, - 0x1b, 0x00, 0x00, 0xff, 0xff, 0x35, 0x50, 0x07, 0xf9, 0xeb, 0x09, 0x00, 0x00, + // 1056 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x56, 0xef, 0x6a, 0x1b, 0x47, + 0x10, 0xe7, 0x64, 0xc9, 0x92, 0x46, 0x71, 0x6c, 0x2f, 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0x9f, 0xc6, 0x9a, 0x41, 0xf7, 0x42, 0xba, 0x9c, 0xcc, 0x77, 0x05, 0xd1, 0x88, 0x79, + 0x3b, 0xab, 0x16, 0x43, 0x57, 0x10, 0x9d, 0xfe, 0x9b, 0x40, 0x7f, 0xe2, 0x6c, 0xa6, 0x3c, 0xfd, + 0x36, 0x34, 0xbb, 0x3c, 0x1a, 0xbb, 0x01, 0x70, 0x44, 0xc6, 0x79, 0x74, 0xb7, 0x33, 0x26, 0x6b, + 0x18, 0x66, 0xcc, 0x19, 0xd1, 0x18, 0x15, 0x79, 0x17, 0x27, 0xb2, 0x62, 0xd8, 0x21, 0x6c, 0xbf, + 0xb9, 0xed, 0x7d, 0xfc, 0x29, 0x59, 0x87, 0xb1, 0x4c, 0x3f, 0x29, 0xb7, 0xd0, 0xf5, 0xd1, 0x1f, + 0x88, 0x86, 0xc7, 0xf7, 0xde, 0xe0, 0xdd, 0xeb, 0x57, 0x77, 0x0f, 0x69, 0xc4, 0x70, 0xe9, 0xf3, + 0x41, 0x85, 0x9d, 0xc4, 0x6b, 0xfa, 0x4b, 0xbc, 0xa6, 0x71, 0x74, 0x23, 0x3b, 0xdd, 0xa4, 0xc9, + 0x79, 0xf1, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x19, 0x4a, 0x06, 0xcd, 0x09, 0x00, 0x00, } diff --git a/api/descriptions.proto b/api/descriptions.proto index 1c21c35f..3027519e 100644 --- a/api/descriptions.proto +++ b/api/descriptions.proto @@ -58,7 +58,7 @@ message InterfaceDescription { string name = 2; bool lo = 3; string bridge = 4; - repeated string ip = 5; + string ip = 5; string mac = 6; uint64 mtu = 7; string gw = 8; diff --git a/cli/interface.go b/cli/interface.go index cb75bb5b..5727bf34 100644 --- a/cli/interface.go +++ b/cli/interface.go @@ -4,7 +4,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "text/tabwriter" "github.com/hyperhq/runv/api" @@ -66,7 +65,7 @@ var infAddCommand = cli.Command{ ip := context.String("ip") conf := &api.InterfaceDescription{ Name: context.String("name"), - Ip: []string{ip}, + Ip: ip, Mac: context.String("mac"), TapName: context.String("tapname"), Mtu: context.Uint64("mtu"), @@ -98,7 +97,7 @@ var infListCommand = cli.Command{ fmt.Fprintln(tw, "Name\tMac\tIP\tMtu") nics := vm.AllNics() for _, i := range nics { - fmt.Fprintf(tw, "%s\t%s\t%s\t%d\n", i.NewName, i.Mac, strings.Join(i.IpAddr, ","), i.Mtu) + fmt.Fprintf(tw, "%s\t%s\t%s\t%d\n", i.NewName, i.MacAddr, i.IpAddr, i.Mtu) } tw.Flush() return nil @@ -174,11 +173,11 @@ var infUpdateCommand = cli.Command{ Mtu: context.Uint64("mtu"), } if ip := context.String("add-ip"); ip != "" { - conf.Ip = append(conf.Ip, ip) + conf.Ip = ip } if ip := context.String("delete-ip"); ip != "" { // an IP address prefixed with "-" indicates deleting an ip - conf.Ip = append(conf.Ip, "-"+ip) + conf.Ip += ",-" + ip } nics := vm.AllNics() diff --git a/cli/network.go b/cli/network.go index f02f2e4c..c8087dfc 100644 --- a/cli/network.go +++ b/cli/network.go @@ -45,7 +45,7 @@ type NetlinkUpdate struct { type InterfaceInfo struct { Index int PeerIndex int - IP []string + Ip string Mac string Name string Mtu uint64 @@ -393,6 +393,9 @@ func collectionInterfaceInfo() []InterfaceInfo { info := InterfaceInfo{ Index: link.Attrs().Index, PeerIndex: link.Attrs().ParentIndex, + Name: link.Attrs().Name, + Mac: link.Attrs().HardwareAddr.String(), + Mtu: uint64(link.Attrs().MTU), } ipAddrs := []string{} addrs, err := netlink.AddrList(link, netlink.FAMILY_V4) @@ -401,13 +404,6 @@ func collectionInterfaceInfo() []InterfaceInfo { return infos } - info := InterfaceInfo{ - Name: link.Attrs().Name, - Mac: link.Attrs().HardwareAddr.String(), - Mtu: uint64(link.Attrs().MTU), - PeerIndex: link.Attrs().ParentIndex, - } - for _, addr := range addrs { ipAddrs = append(ipAddrs, addr.IPNet.String()) } diff --git a/hyperstart/api/json/spec.go b/hyperstart/api/json/spec.go index 67d83da4..3d334b21 100644 --- a/hyperstart/api/json/spec.go +++ b/hyperstart/api/json/spec.go @@ -85,8 +85,6 @@ type IpAddress struct { type NetworkInf struct { Device string `json:"device"` NewName string `json:"newDeviceName"` - IpAddress string `json:"ipAddress,omitempty"` - NetMask string `json:"netMask,omitempty"` IpAddresses []IpAddress `json:"ipAddresses"` Mtu uint64 `json:"mtu"` } diff --git a/hyperstart/libhyperstart/hyperstart.go b/hyperstart/libhyperstart/hyperstart.go index f91df59a..c7a8e31f 100644 --- a/hyperstart/libhyperstart/hyperstart.go +++ b/hyperstart/libhyperstart/hyperstart.go @@ -12,6 +12,7 @@ const ( AddInf InfUpdateType = 1 << iota DelInf AddIP + DelIP SetMtu ) diff --git a/hyperstart/libhyperstart/json.go b/hyperstart/libhyperstart/json.go index ea3ce613..d7a0aeb2 100644 --- a/hyperstart/libhyperstart/json.go +++ b/hyperstart/libhyperstart/json.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "net" "sync" "syscall" "time" @@ -649,28 +648,28 @@ func (h *jsonBasedHyperstart) AddRoute(r []hyperstartapi.Route) error { func (h *jsonBasedHyperstart) UpdateInterface(t InfUpdateType, dev, newName string, ipAddresses []hyperstartapi.IpAddress, mtu uint64) error { inf := hyperstartapi.NetworkInf{ - Device: dev, + Device: dev, + IpAddresses: []hyperstartapi.IpAddress{}, } switch t { case AddInf: inf.NewName = newName inf.Mtu = mtu - for _, ipstr := range ipnet { - inf.IpAddress = ipAddresses - inf.NetMask = mask - if err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { - return fmt.Errorf("json: failed to send command to hyperstart: %v", err) - } + inf.IpAddresses = ipAddresses + if err := h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { + return fmt.Errorf("json: failed to send command to hyperstart: %v", err) } case DelInf: if err := h.hyperstartCommand(hyperstartapi.INIT_DELETEINTERFACE, inf); err != nil { - return fmt.Errorf("json: failed to send command to hyperstart: %v", err) + return fmt.Errorf("json: failed to send command to hyperstart. inf: %#v, error: %v", inf, err) } case AddIP: - inf.IpAddress = ipAddresses - if err = h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { + inf.IpAddresses = ipAddresses + if err := h.hyperstartCommand(hyperstartapi.INIT_SETUPINTERFACE, inf); err != nil { return fmt.Errorf("json: failed to send command to hyperstart: %v", err) } + case DelIP: + // TODO: add new interface to handle hyperstart delete interface @weizhang555 case SetMtu: if mtu > 0 { inf.Mtu = mtu diff --git a/hypervisor/driver.go b/hypervisor/driver.go index c262bf15..65250df8 100644 --- a/hypervisor/driver.go +++ b/hypervisor/driver.go @@ -42,7 +42,7 @@ type HostNicInfo struct { type GuestNicInfo struct { Device string - Ipaddr []string + Ipaddr string Index int Busaddr int } diff --git a/hypervisor/network.go b/hypervisor/network.go index 4ac431cb..834bc6b5 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -2,6 +2,7 @@ package hypervisor import ( "fmt" + "strings" "sync" "github.com/hyperhq/runv/api" @@ -81,6 +82,13 @@ func (nc *NetworkContext) freeSlot(slot int) { delete(nc.eth, slot) } +// nextAvailableDevName find the initial device name in guest when add a new tap device +// then rename it to some new name. +// For example: user want to insert a new nic named "eth5" into container, which already owns +// "eth0", "eth3" and "eth4". After tap device is added to VM, guest will detect a new device +// named "eth1" which is first available "ethX" device, then guest will try to rename "eth1" to +// "eth5". Then container will have "eth0", "eth3", "eth4" and "eth5" in the last. +// This function try to find the first available "ethX" as said above. @WeiZhang555 func (nc *NetworkContext) nextAvailableDevName() string { for i := 0; i <= MAX_NIC; i++ { find := false @@ -100,7 +108,7 @@ func (nc *NetworkContext) nextAvailableDevName() string { func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result chan api.Result) { if inf.Lo { - if inf.Ip == nil || len(inf.Ip) == 0 { + if len(inf.Ip) == 0 { estr := fmt.Sprintf("creating an interface without an IP address: %#v", inf) nc.sandbox.Log(ERROR, estr) result <- NewSpecError(inf.Id, estr) @@ -115,7 +123,7 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha IpAddr: inf.Ip, Mtu: inf.Mtu, } - nc.lo[inf.Ip[0]] = i + nc.lo[inf.Ip] = i nc.idMap[inf.Id] = i result <- &api.ResultBase{ @@ -132,8 +140,11 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha defer nc.slotLock.Unlock() idx := nc.applySlot() - devName := nc.nextAvailableDevName() - if idx < 0 || devName == "" { + initialDevName := nc.nextAvailableDevName() + if inf.Id == "" { + inf.Id = fmt.Sprintf("%d", idx) + } + if idx < 0 || initialDevName == "" { estr := fmt.Sprintf("no available ethernet slot/name for interface %#v", inf) nc.sandbox.Log(ERROR, estr) result <- NewBusyError(inf.Id, estr) @@ -141,7 +152,7 @@ func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result cha return } - nc.configureInterface(idx, nc.sandbox.NextPciAddr(), devName, inf, devChan) + nc.configureInterface(idx, nc.sandbox.NextPciAddr(), initialDevName, inf, devChan) }() go func() { @@ -178,7 +189,7 @@ func (nc *NetworkContext) removeInterface(id string, result chan api.Result) { return } else if inf.HostDevice == "" { // a virtual interface delete(nc.idMap, id) - delete(nc.lo, inf.IpAddr[0]) + delete(nc.lo, inf.IpAddr) result <- api.NewResultBase(id, true, "") return } else { @@ -256,14 +267,16 @@ func (nc *NetworkContext) updateInterface(inf *api.InterfaceDescription) error { oldInf.Mtu = inf.Mtu } - if inf.Ip != nil && len(inf.Ip) > 0 { - for _, ip := range inf.Ip { + if len(inf.Ip) > 0 { + addrs := strings.Split(inf.Ip, ",") + oldAddrs := strings.Split(oldInf.IpAddr, ",") + for _, ip := range addrs { var found bool if ip[0] == '-' { // to delete ip = ip[1:] - for k, i := range oldInf.IpAddr { + for k, i := range oldAddrs { if i == ip { - oldInf.IpAddr = append(oldInf.IpAddr[:k], oldInf.IpAddr[k+1:]...) + oldAddrs = append(oldAddrs[:k], oldAddrs[k+1:]...) found = true break } @@ -272,9 +285,10 @@ func (nc *NetworkContext) updateInterface(inf *api.InterfaceDescription) error { return fmt.Errorf("failed to delete %q: not found", ip) } } else { // to add - oldInf.IpAddr = append(oldInf.IpAddr, ip) + oldAddrs = append(oldAddrs, ip) } } + oldInf.IpAddr = strings.Join(oldAddrs, ",") } return nil } @@ -294,18 +308,18 @@ func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { func (nc *NetworkContext) configureInterface(index, pciAddr int, name string, inf *api.InterfaceDescription, result chan<- VmEvent) { if inf.TapName == "" { - inf.TapName = network.NicName(nc.sandbox.Id, index) + inf.TapName = inf.Name + nc.sandbox.Id[3:] } settings, err := network.Configure(inf) if err != nil { nc.sandbox.Log(ERROR, "interface creating failed: %v", err.Error()) - session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: deviceName, NewName: inf.Name, Mtu: inf.Mtu} + session := &InterfaceCreated{Id: inf.Id, Index: index, PCIAddr: pciAddr, DeviceName: name, NewName: inf.Name, Mtu: inf.Mtu} result <- &DeviceFailed{Session: session} return } - created, err := interfaceGot(inf.Id, index, pciAddr, deviceName, inf.Name, settings) + created, err := interfaceGot(inf.Id, index, pciAddr, name, inf.Name, settings) if err != nil { result <- &DeviceFailed{Session: created} return @@ -314,14 +328,11 @@ func (nc *NetworkContext) configureInterface(index, pciAddr int, name string, in h := &HostNicInfo{ Id: created.Id, Device: created.HostDevice, - Mac: created.Mac, + Mac: created.MacAddr, Bridge: created.Bridge, Gateway: created.Bridge, Options: inf.Options, } - if created.Fd != nil { - h.Fd = uint64(created.Fd.Fd()) - } // Note: Use created.NewName add tap name // this is because created.DeviceName isn't always uniq, @@ -353,13 +364,16 @@ func (nc *NetworkContext) getInterface(id string) *InterfaceCreated { return nil } -func (nc *NetworkContext) getIpAddrs() []string { +func (nc *NetworkContext) getIPAddrs() []string { nc.slotLock.RLock() defer nc.slotLock.RUnlock() res := []string{} for _, inf := range nc.eth { - res = append(res, inf.IpAddr...) + if inf.IpAddr != "" { + addrs := strings.Split(inf.IpAddr, ",") + res = append(res, addrs...) + } } return res @@ -414,7 +428,6 @@ func interfaceGot(id string, index int, pciAddr int, deviceName, newName string, HostDevice: inf.Device, DeviceName: deviceName, NewName: newName, - Fd: inf.File, MacAddr: inf.Mac, IpAddr: inf.IPAddress, Mtu: inf.Mtu, diff --git a/hypervisor/network/network_linux.go b/hypervisor/network/network_linux.go index 66123caa..49034e9e 100644 --- a/hypervisor/network/network_linux.go +++ b/hypervisor/network/network_linux.go @@ -201,14 +201,16 @@ func UpAndAddToBridge(name, bridge, options string) error { if bridge == "" { bridge = BridgeIface } - master, err := netlink.LinkByName(bridge) - if err != nil { - glog.Error("cannot find bridge interface ", bridge) - return err - } - if err = addToBridge(iface, master, options); err != nil { - glog.Errorf("cannot add %s to %s ", name, bridge) - return err + if bridge != "" { + master, err := netlink.LinkByName(bridge) + if err != nil { + glog.Error("cannot find bridge interface ", bridge) + return err + } + if err = addToBridge(iface, master, options); err != nil { + glog.Errorf("cannot add %s to %s ", name, bridge) + return err + } } if err = netlink.LinkSetUp(iface); err != nil { glog.Error("cannot up interface ", name) @@ -258,6 +260,7 @@ func Configure(inf *api.InterfaceDescription) (*Settings, error) { Gateway: inf.Gw, Bridge: inf.Bridge, Device: inf.TapName, + Mtu: inf.Mtu, Automatic: false, }, nil } diff --git a/hypervisor/persistence.go b/hypervisor/persistence.go index d334b968..e9fa9a81 100644 --- a/hypervisor/persistence.go +++ b/hypervisor/persistence.go @@ -41,7 +41,7 @@ type PersistNetworkInfo struct { HostDevice string DeviceName string NewName string - IpAddr []string + IpAddr string Mac string Mtu uint64 } @@ -128,7 +128,7 @@ func (ctx *VmContext) dump() (*PersistInfo, error) { DeviceName: nic.DeviceName, NewName: nic.NewName, IpAddr: nic.IpAddr, - Mac: nic.Mac, + Mac: nic.MacAddr, Mtu: nic.Mtu, } nid++ @@ -220,7 +220,7 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { NewName: pi.NewName, IpAddr: pi.IpAddr, Mtu: pi.Mtu, - Mac: pi.Mac, + MacAddr: pi.Mac, } // if empty, may be old data, generate one for compatibility. if ifc.Id == "" { @@ -228,7 +228,7 @@ func (nc *NetworkContext) load(pinfo *PersistInfo) { } // use device name distinguish from lo and eth if ifc.DeviceName == DEFAULT_LO_DEVICE_NAME { - nc.lo[pi.IpAddr[0]] = ifc + nc.lo[pi.IpAddr] = ifc } else { nc.eth[pi.Index] = ifc } diff --git a/hypervisor/qemu/network.go b/hypervisor/qemu/network.go index dc58f425..2cd91809 100644 --- a/hypervisor/qemu/network.go +++ b/hypervisor/qemu/network.go @@ -12,6 +12,7 @@ import ( "github.com/golang/glog" "github.com/hyperhq/runv/hypervisor/network" + "github.com/vishvananda/netlink" ) const ( @@ -33,6 +34,15 @@ func GetTapFd(device, bridge, options string) (int, error) { errno syscall.Errno ) + // check if tapname exists, if true, use existing one instead of create new one + if device != "" { + _, err := netlink.LinkByName(device) + // link exist, use it + if err == nil { + return -1, nil + } + } + tapFile, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0) if err != nil { return -1, err diff --git a/hypervisor/qemu/qmp_wrapper_amd64.go b/hypervisor/qemu/qmp_wrapper_amd64.go index 01b9eec7..59223a9b 100644 --- a/hypervisor/qemu/qmp_wrapper_amd64.go +++ b/hypervisor/qemu/qmp_wrapper_amd64.go @@ -10,12 +10,12 @@ import ( "github.com/hyperhq/runv/hypervisor" ) -func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, fd int, device, mac string, index, addr int, result chan<- hypervisor.VmEvent) { +func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id, tapname string, fd int, device, mac string, index, addr int, result chan<- hypervisor.VmEvent) { busAddr := fmt.Sprintf("0x%x", addr) - commands := make([]*QmpCommand, 3) + commands := []*QmpCommand{} if ctx.Boot.EnableVhostUser { chardevId := device + "-chardev" - commands[0] = &QmpCommand{ + commands = append(commands, &QmpCommand{ Execute: "chardev-add", Arguments: map[string]interface{}{ "id": chardevId, @@ -33,8 +33,7 @@ func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, }, }, }, - } - commands[1] = &QmpCommand{ + }, &QmpCommand{ Execute: "netdev_add", Arguments: map[string]interface{}{ "type": "vhost-user", @@ -42,26 +41,31 @@ func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, "chardev": chardevId, "vhostforce": true, }, - } - } else { + }) + } else if fd > 0 { scm := syscall.UnixRights(fd) glog.V(1).Infof("send net to qemu at %d", fd) - commands[0] = &QmpCommand{ + commands = append(commands, &QmpCommand{ Execute: "getfd", Arguments: map[string]interface{}{ "fdname": "fd" + device, }, Scm: scm, - } - commands[1] = &QmpCommand{ + }, &QmpCommand{ Execute: "netdev_add", Arguments: map[string]interface{}{ "type": "tap", "id": device, "fd": "fd" + device, }, - } + }) + } else if tapname != "" { + commands = append(commands, &QmpCommand{ + Execute: "netdev_add", + Arguments: map[string]interface{}{ + "type": "tap", "id": device, "ifname": tapname, "script": "no", + }, + }) } - - commands[2] = &QmpCommand{ + commands = append(commands, &QmpCommand{ Execute: "device_add", Arguments: map[string]interface{}{ "driver": "virtio-net-pci", @@ -71,7 +75,7 @@ func newNetworkAddSession(ctx *hypervisor.VmContext, qc *QemuContext, id string, "addr": busAddr, "id": device, }, - } + }) qc.qmp <- &QmpSession{ commands: commands, diff --git a/hypervisor/vm.go b/hypervisor/vm.go index 916130e2..eb09d91f 100644 --- a/hypervisor/vm.go +++ b/hypervisor/vm.go @@ -728,7 +728,7 @@ func (vm *Vm) GetIPAddrs() []string { return ips } - res := vm.ctx.networks.getIpAddrs() + res := vm.ctx.networks.getIPAddrs() ips = append(ips, res...) return ips diff --git a/hypervisor/vm_states.go b/hypervisor/vm_states.go index fff03869..b495562b 100644 --- a/hypervisor/vm_states.go +++ b/hypervisor/vm_states.go @@ -123,8 +123,10 @@ func (ctx *VmContext) hyperstartAddInterface(id string) error { if err != nil { return err } - size, _ := mask.Size() - addrs = append(addrs, hyperstartapi.IpAddress{ip.String(), fmt.Sprintf("%d", size)}) + // size, _ := mask.Size() + // addrs = append(addrs, hyperstartapi.IpAddress{ip.String(), fmt.Sprintf("%d", size)}) + maskStr := fmt.Sprintf("%d.%d.%d.%d", mask[0], mask[1], mask[2], mask[3]) + addrs = append(addrs, hyperstartapi.IpAddress{ip.String(), maskStr}) } if err := ctx.hyperstart.UpdateInterface(libhyperstart.AddInf, inf.DeviceName, inf.NewName, addrs, inf.Mtu); err != nil { return err @@ -143,18 +145,54 @@ func (ctx *VmContext) hyperstartDeleteInterface(id string) error { } } -func (ctx *VmContext) hyperstartUpdateInterface(id string, addIP []string, mtu uint64) error { +func (ctx *VmContext) hyperstartUpdateInterface(id string, addresses string, mtu uint64) error { + var ( + addIP, delIP []hyperstartapi.IpAddress + ) inf := ctx.networks.getInterface(id) if inf == nil { return fmt.Errorf("can't find interface whose ID is %s", id) } - if addIP != nil && len(addIP) != 0 { + if addresses != "" { + addrs := strings.Split(addresses, ",") + // TODO: currently if an IP address start with a '-', + // we treat it as deleting an IP which is not very elegant. + // Try to add one new field and function to handle this! @weizhang555 + for _, addr := range addrs { + var del bool + if addr[0] == '-' { + del = true + addr = addr[1:] + } + ip, mask, err := network.IpParser(addr) + if err != nil { + return err + } + // size, _ := mask.Size() + // addrs = append(addrs, hyperstartapi.IpAddress{ip.String(), fmt.Sprintf("%d", size)}) + maskStr := fmt.Sprintf("%d.%d.%d.%d", mask[0], mask[1], mask[2], mask[3]) + + if del { + delIP = append(delIP, hyperstartapi.IpAddress{ip.String(), maskStr}) + } else { + addIP = append(addIP, hyperstartapi.IpAddress{ip.String(), maskStr}) + } + } + } + + if len(addIP) != 0 { if err := ctx.hyperstart.UpdateInterface(libhyperstart.AddIP, inf.NewName, "", addIP, 0); err != nil { return err } } + if len(delIP) != 0 { + if err := ctx.hyperstart.UpdateInterface(libhyperstart.DelIP, inf.NewName, "", delIP, 0); err != nil { + return err + } + } + if mtu > 0 { if err := ctx.hyperstart.UpdateInterface(libhyperstart.SetMtu, inf.NewName, "", nil, mtu); err != nil { return err From 01239f9f20ad1a443c71bd888ac63e3265c7077a Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Wed, 27 Sep 2017 16:51:41 +0800 Subject: [PATCH 10/10] Fix some review comments Signed-off-by: Zhang Wei --- cli/interface.go | 17 +++++++---------- hypervisor/network.go | 2 +- hypervisor/network/network.go | 7 +++++++ hypervisor/qemu/network.go | 10 ---------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/cli/interface.go b/cli/interface.go index 5727bf34..4e833e7c 100644 --- a/cli/interface.go +++ b/cli/interface.go @@ -21,10 +21,10 @@ var interfaceCommand = cli.Command{ infListCommand, }, Before: func(context *cli.Context) error { - return cmdPrepare(context, true, context.Bool("detach")) + return cmdPrepare(context, true, true) }, Action: func(context *cli.Context) error { - return nil + return cli.ShowSubcommandHelp(context) }, } @@ -34,7 +34,7 @@ var infAddCommand = cli.Command{ ArgsUsage: `add `, Flags: []cli.Flag{ cli.StringFlag{ - Name: "tapname", + Name: "host-device", Usage: "set tap name, if interface with same name exists, use existing one instead of creating new one", }, cli.StringFlag{ @@ -61,13 +61,11 @@ var infAddCommand = cli.Command{ return err } defer releaseFunc() - - ip := context.String("ip") conf := &api.InterfaceDescription{ Name: context.String("name"), - Ip: ip, + Ip: context.String("ip"), Mac: context.String("mac"), - TapName: context.String("tapname"), + TapName: context.String("host-device"), Mtu: context.Uint64("mtu"), } @@ -168,9 +166,8 @@ var infUpdateCommand = cli.Command{ } conf := &api.InterfaceDescription{ - Id: "-1", - Name: context.String("name"), - Mtu: context.Uint64("mtu"), + Id: "-1", + Mtu: context.Uint64("mtu"), } if ip := context.String("add-ip"); ip != "" { conf.Ip = ip diff --git a/hypervisor/network.go b/hypervisor/network.go index 834bc6b5..190f366f 100644 --- a/hypervisor/network.go +++ b/hypervisor/network.go @@ -308,7 +308,7 @@ func (nc *NetworkContext) netdevInsertFailed(idx int, name string) { func (nc *NetworkContext) configureInterface(index, pciAddr int, name string, inf *api.InterfaceDescription, result chan<- VmEvent) { if inf.TapName == "" { - inf.TapName = inf.Name + nc.sandbox.Id[3:] + inf.TapName = network.NicName(nc.sandbox.Id, index) } settings, err := network.Configure(inf) diff --git a/hypervisor/network/network.go b/hypervisor/network/network.go index 7bd1173b..c76f8299 100644 --- a/hypervisor/network/network.go +++ b/hypervisor/network/network.go @@ -30,6 +30,13 @@ var ( ) func NicName(id string, index int) string { + // make sure nic name has less than 15 chars + // hold 3 chars for index. + // TODO: index could be larger than 3 chars, make it more robust + if len(id) > 12 { + id = string([]rune(id)[:12]) + } + return fmt.Sprintf("%s%d", id, index) } diff --git a/hypervisor/qemu/network.go b/hypervisor/qemu/network.go index 2cd91809..dc58f425 100644 --- a/hypervisor/qemu/network.go +++ b/hypervisor/qemu/network.go @@ -12,7 +12,6 @@ import ( "github.com/golang/glog" "github.com/hyperhq/runv/hypervisor/network" - "github.com/vishvananda/netlink" ) const ( @@ -34,15 +33,6 @@ func GetTapFd(device, bridge, options string) (int, error) { errno syscall.Errno ) - // check if tapname exists, if true, use existing one instead of create new one - if device != "" { - _, err := netlink.LinkByName(device) - // link exist, use it - if err == nil { - return -1, nil - } - } - tapFile, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0) if err != nil { return -1, err