These patches would do following things: building up the network system CIM
model, building up basic framework and functions below to implement the
configuration, add the bridge and vlan802.1.q configuration capabilities in
CIM model and library below.
Now this patch implement the functionalities with commandline style, which
means it depends on command ip, ifconfig, brctl and /proc/net/vlan/. In this
way it is very sensitive to these command's output format. Maybe another
implemetion could avoid that in the future.
Since libvirt-cim is not a daemon program that would always be brought up
when the emulator was up, so there lacks a mechnism to save the configuration
and set them when system reboot, so these patch uses system directory
/etc/sysconfig/network-script/
to store the settings.
The things above means that a linux kernel later than 2.6 and RedHat
distribution is needed. Other distriution may work but not tested. If
the implemention goes to libvirt the restrict would be removed.
Related profiles: the most important are DSP1050, DSP1097, DSP 2025(draft),
Other are: DSP1041, DSP1014.
Typical usage: assuming you have pNIC eth0. Use following xml files passed
to wbemexec could create bridge testbr with eth0.10 attached, which means all
VMs connecting to testbr would have access to IEEE802.1.q vlan 10.
v2: Changed the eth type defines to filter out lo, sit logical devices.
Removed the ifconfig command.
The patches could be got from following url
https://gitorious.org/~xiaxia347/libvirt-cim/xiawenc
direct git repo is
git://gitorious.org/~xiaxia347/libvirt-cim/xiawenc.git.
XML 1
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<METHODCALL NAME="DefineSystem">
<LOCALINSTANCEPATH>
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"></NAMESPACE><NAMESPACE
NAME="virt"></NAMESPACE>
</LOCALNAMESPACEPATH>
<INSTANCENAME
CLASSNAME="Net_VirtualEthernetSwitchSystemManagementService">
<KEYBINDING NAME="CreationClassName"><KEYVALUE
VALUETYPE="string">Net_VirtualEthernetSwitchSystemManagementService</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="Name"><KEYVALUE
VALUETYPE="string">Management Service</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="SystemCreationClassName"><KEYVALUE
VALUETYPE="string">KVM_HostSystem</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="SystemName"><KEYVALUE
VALUETYPE="string">unknown</KEYVALUE></KEYBINDING>
</INSTANCENAME>
</LOCALINSTANCEPATH>
<PARAMVALUE NAME="SystemSettings" PARAMTYPE="string">
<VALUE>
instance of Net_VirtualEthernetSwitchSystemSettingData {
VirtualSystemIdentifier ="VS_testbr1";
STP = 1;
};
</VALUE>
</PARAMVALUE>
</METHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
XML 2
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<METHODCALL NAME="AddResourceSettings">
<LOCALINSTANCEPATH>
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"></NAMESPACE><NAMESPACE
NAME="virt"></NAMESPACE>
</LOCALNAMESPACEPATH>
<INSTANCENAME
CLASSNAME="Net_VirtualEthernetSwitchSystemManagementService">
<KEYBINDING NAME="CreationClassName"><KEYVALUE
VALUETYPE="string">Net_VirtualEthernetSwitchSystemManagementService</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="Name"><KEYVALUE
VALUETYPE="string">Management Service</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="SystemCreationClassName"><KEYVALUE
VALUETYPE="string">KVM_HostSystem</KEYVALUE></KEYBINDING>
<KEYBINDING NAME="SystemName"><KEYVALUE
VALUETYPE="string">unknown</KEYVALUE></KEYBINDING>
</INSTANCENAME>
</LOCALINSTANCEPATH>
<PARAMVALUE NAME="AffectedConfiguration">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="Net_VirtualEthernetSwitchSettingData">
<KEYBINDING NAME="InstanceID"><KEYVALUE
VALUETYPE="string">Virt:VS_eth0</KEYVALUE></KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</PARAMVALUE>
<PARAMVALUE NAME="ResourceSettings" PARAMTYPE="string">
<VALUE.ARRAY>
<VALUE>
instance of Net_EthernetPortAllocationSettingData {
InstanceID = "VS_eth0/EA_eth0.10";
ElementName = "EA_eth0.10";
VLANType = 1;
Connection = {"VLAN10"};
ReorderHdr = 0;
};
</VALUE>
<VALUE>
instance of Net_EthernetPortAllocationSettingData {
InstanceID = "VS_eth0/EC_eth0.10";
HostResource = {"VS_testbr1"};
Parent = "EA_eth0.10";
};
</VALUE>
</VALUE.ARRAY>
</PARAMVALUE>
</METHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
Wayne Xia (15):
vlan extension - Makefile change
vlan extension - CIM model - add class VESS
vlan extension - CIM model - add class VESSSD
vlan extension - CIM model - add class EthernetPort
vlan extension - CIM model - add class EASD
vlan extension - CIM model - add association SDS
vlan extension - CIM model - add association VESSD
vlan extension - CIM model - add association VESSSDComponent
vlan extension - CIM model - add association ESD
vlan extension - CIM model - add core class VESSMS
vlan extension - CIM model - add help functions
vlan extension - function lib - add the API
vlan extension - function lib - add the core structures
vlan extension - function lib - add the helper
vlan extension - function lib - add the implemention of cmd line
Makefile.am | 16 +-
libxkutil/Makefile.am | 11 +-
libxkutil/host_network_API.c | 182 ++
libxkutil/host_network_API.h | 32 +
libxkutil/host_network_basic.c | 657 +++++++
libxkutil/host_network_basic.h | 168 ++
libxkutil/host_network_error.h | 28 +
libxkutil/host_network_helper.c | 659 +++++++
libxkutil/host_network_helper.h | 192 ++
libxkutil/host_network_implement_cmdline.c | 1835 ++++++++++++++++++++
libxkutil/host_network_implement_cmdline.h | 52 +
libxkutil/network_model.c | 466 +++++
libxkutil/network_model.h | 105 ++
schema/ElementSettingData.mof | 16 +-
schema/ElementSettingData.registration | 4 +-
schema/EthernetPort.mof | 4 +
schema/EthernetPort.registration | 3 +
schema/EthernetPortAllocationSettingData.mof | 21 +
.../EthernetPortAllocationSettingData.registration | 3 +
schema/SettingsDefineState.mof | 9 +-
schema/SettingsDefineState.registration | 3 +-
schema/SystemDevice.mof | 18 +-
schema/SystemDevice.registration | 3 +-
schema/VESSSDComponent.mof | 8 +
schema/VESSSDComponent.registration | 3 +
schema/VirtualEthernetSwitchSystem.mof | 10 +
schema/VirtualEthernetSwitchSystem.registration | 3 +
...irtualEthernetSwitchSystemManagementService.mof | 14 +
...ernetSwitchSystemManagementService.registration | 3 +
schema/VirtualEthernetSwitchSystemSettingData.mof | 27 +
...ualEthernetSwitchSystemSettingData.registration | 3 +
src/Makefile.am | 49 +-
src/Virt_EASD.c | 732 ++++++++
src/Virt_EASD.h | 61 +
src/Virt_ElementSettingData.c | 229 +++-
src/Virt_EthernetPort.c | 565 ++++++
src/Virt_EthernetPort.h | 58 +
src/Virt_HostSystem.c | 2 +-
src/Virt_HostSystem.h | 2 +
src/Virt_SettingsDefineState.c | 256 +++
src/Virt_SystemDevice.c | 126 ++
src/Virt_VESSSD.c | 373 ++++
src/Virt_VESSSD.h | 39 +
src/Virt_VESSSDComponent.c | 181 ++
src/Virt_VirtualEthernetSwitchSystem.c | 483 +++++
src/Virt_VirtualEthernetSwitchSystem.h | 52 +
..._VirtualEthernetSwitchSystemManagementService.c | 1345 ++++++++++++++
..._VirtualEthernetSwitchSystemManagementService.h | 31 +
src/Virt_VirtualSystemManagementService.c | 17 +-
src/Virt_VirtualSystemManagementService.h | 10 +
50 files changed, 9140 insertions(+), 29 deletions(-)
create mode 100644 libxkutil/host_network_API.c
create mode 100644 libxkutil/host_network_API.h
create mode 100644 libxkutil/host_network_basic.c
create mode 100644 libxkutil/host_network_basic.h
create mode 100644 libxkutil/host_network_error.h
create mode 100644 libxkutil/host_network_helper.c
create mode 100644 libxkutil/host_network_helper.h
create mode 100644 libxkutil/host_network_implement_cmdline.c
create mode 100644 libxkutil/host_network_implement_cmdline.h
create mode 100644 libxkutil/network_model.c
create mode 100644 libxkutil/network_model.h
create mode 100644 schema/EthernetPort.mof
create mode 100644 schema/EthernetPort.registration
create mode 100644 schema/EthernetPortAllocationSettingData.mof
create mode 100644 schema/EthernetPortAllocationSettingData.registration
create mode 100644 schema/VESSSDComponent.mof
create mode 100644 schema/VESSSDComponent.registration
create mode 100644 schema/VirtualEthernetSwitchSystem.mof
create mode 100644 schema/VirtualEthernetSwitchSystem.registration
create mode 100644 schema/VirtualEthernetSwitchSystemManagementService.mof
create mode 100644 schema/VirtualEthernetSwitchSystemManagementService.registration
create mode 100644 schema/VirtualEthernetSwitchSystemSettingData.mof
create mode 100644 schema/VirtualEthernetSwitchSystemSettingData.registration
create mode 100644 src/Virt_EASD.c
create mode 100644 src/Virt_EASD.h
create mode 100644 src/Virt_EthernetPort.c
create mode 100644 src/Virt_EthernetPort.h
create mode 100644 src/Virt_VESSSD.c
create mode 100644 src/Virt_VESSSD.h
create mode 100644 src/Virt_VESSSDComponent.c
create mode 100644 src/Virt_VirtualEthernetSwitchSystem.c
create mode 100644 src/Virt_VirtualEthernetSwitchSystem.h
create mode 100644 src/Virt_VirtualEthernetSwitchSystemManagementService.c
create mode 100644 src/Virt_VirtualEthernetSwitchSystemManagementService.h
--
1.7.6