提交 26694daf 编写于 作者: L Laine Stump

util: new functions virNetDev(Save|Read|Set)NetConfig()

These three functions are destined to replace
virNetDev(Replace|Restore)NetConfig() and
virNetDev(Replace|Restore)MacAddress(), which both do the save and set
together as a single step. We need to separate the save, read, and set
steps because there will be situations where we need to do something
else in between (in particular, we will need to rebind a VF's driver
after save but before set).

This patch creates the new functions, but doesn't call them - that
will come in a subsequent patch. Note that the new functions to
read/write the file that stores the original network config now uses
JSON rather than plaintext (it still recognizes the old format as well
though, so it won't get confused during an upgrade).
上级 2af04bde
......@@ -2053,6 +2053,7 @@ virNetDevIfStateTypeFromString;
virNetDevIfStateTypeToString;
virNetDevIsVirtualFunction;
virNetDevPFGetVF;
virNetDevReadNetConfig;
virNetDevReplaceMacAddress;
virNetDevReplaceNetConfig;
virNetDevRestoreMacAddress;
......@@ -2062,11 +2063,13 @@ virNetDevRxFilterFree;
virNetDevRxFilterModeTypeFromString;
virNetDevRxFilterModeTypeToString;
virNetDevRxFilterNew;
virNetDevSaveNetConfig;
virNetDevSetMAC;
virNetDevSetMTU;
virNetDevSetMTUFromDevice;
virNetDevSetName;
virNetDevSetNamespace;
virNetDevSetNetConfig;
virNetDevSetOnline;
virNetDevSetPromiscuous;
virNetDevSetRcvAllMulti;
......
此差异已折叠。
......@@ -194,6 +194,28 @@ int virNetDevGetVirtualFunctions(const char *pfname,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
int virNetDevSaveNetConfig(const char *linkdev, int vf,
const char *stateDir,
bool saveVlan)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
int
virNetDevReadNetConfig(const char *linkdev, int vf,
const char *stateDir,
virMacAddrPtr *adminMAC,
virNetDevVlanPtr *vlan,
virMacAddrPtr *MAC)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;
int
virNetDevSetNetConfig(const char *linkdev, int vf,
const virMacAddr *adminMAC,
virNetDevVlanPtr vlan,
const virMacAddr *MAC,
bool setVLan)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virNetDevReplaceNetConfig(const char *linkdev, int vf,
const virMacAddr *macaddress,
virNetDevVlanPtr vlan,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册