提交 80ba4142 编写于 作者: J John Ferlan

network: Modify naming for virNetworkObjList* fetching APIs

Use the structure names in the @data setup - makes it easier than
going back to find the struct fields to make sure the order of the
data is correct.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 8473859a
......@@ -1342,7 +1342,9 @@ virNetworkObjListExport(virConnectPtr conn,
unsigned int flags)
{
int ret = -1;
struct virNetworkObjListData data = { conn, NULL, filter, flags, 0, false};
struct virNetworkObjListData data = {
.conn = conn, .nets = NULL, .filter = filter, .flags = flags,
.nnets = 0, .error = false };
virObjectLock(netobjs);
if (nets && VIR_ALLOC_N(data.nets, virHashSize(netobjs->objs) + 1) < 0)
......@@ -1408,7 +1410,8 @@ virNetworkObjListForEach(virNetworkObjListPtr nets,
virNetworkObjListIterator callback,
void *opaque)
{
struct virNetworkObjListForEachHelperData data = {callback, opaque, 0};
struct virNetworkObjListForEachHelperData data = {
.callback = callback, .opaque = opaque, .ret = 0};
virObjectLock(nets);
virHashForEach(nets->objs, virNetworkObjListForEachHelper, &data);
virObjectUnlock(nets);
......@@ -1474,7 +1477,8 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets,
int ret = -1;
struct virNetworkObjListGetHelperData data = {
conn, filter, names, maxnames, active, 0, false};
.conn = conn, .filter = filter, .names = names,
.maxnames = maxnames, .active = active, .got = 0, .error = false};
virObjectLock(nets);
virHashForEach(nets->objs, virNetworkObjListGetHelper, &data);
......@@ -1500,7 +1504,8 @@ virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets,
virConnectPtr conn)
{
struct virNetworkObjListGetHelperData data = {
conn, filter, NULL, -1, active, 0, false};
.conn = conn, .filter = filter, .names = NULL,
.maxnames = -1, .active = active, .got = 0, .error = false};
virObjectLock(nets);
virHashForEach(nets->objs, virNetworkObjListGetHelper, &data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册