提交 464c92c0 编写于 作者: D Daniel P. Berrange

Remove some C99 variable decls in parallels driver

The parallels storage driver declared some loop variables
inside the for(;;). This is not allowed by libvirt coding
standards
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 02b90972
......@@ -129,9 +129,11 @@ static char *parallelsMakePoolName(virConnectPtr conn, const char *path)
{
parallelsConnPtr privconn = conn->privateData;
char *name;
unsigned int i;
for (unsigned int i = 0; i < UINT_MAX; i++) {
for (i = 0; i < UINT_MAX; i++) {
bool found = false;
int j;
if (!(name = strdup(path))) {
virReportOOMError();
......@@ -148,11 +150,11 @@ static char *parallelsMakePoolName(virConnectPtr conn, const char *path)
return 0;
}
for (int j = 0; j < strlen(name); j++)
for (j = 0; j < strlen(name); j++)
if (name[j] == '/')
name[j] = '-';
for (int j = 0; j < privconn->pools.count; j++) {
for (j = 0; j < privconn->pools.count; j++) {
if (STREQ(name, privconn->pools.objs[j]->def->name)) {
found = true;
break;
......@@ -226,6 +228,7 @@ parallelsPoolAddByDomain(virConnectPtr conn, virDomainObjPtr dom)
virStoragePoolObjListPtr pools = &privconn->pools;
char *poolPath;
virStoragePoolObjPtr pool = NULL;
int j;
if (!(poolPath = strdup(pdom->home))) {
virReportOOMError();
......@@ -234,7 +237,7 @@ parallelsPoolAddByDomain(virConnectPtr conn, virDomainObjPtr dom)
poolPath = dirname(poolPath);
for (int j = 0; j < pools->count; j++) {
for (j = 0; j < pools->count; j++) {
if (STREQ(poolPath, pools->objs[j]->def->target.path)) {
pool = pools->objs[j];
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册