diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index e8af89c2e9..62db626b46 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -1256,14 +1256,16 @@ static int parallelsApplySerialParams(virDomainChrDefPtr *oldserials, int nold, virDomainChrDefPtr *newserials, int nnew) { + int i, j; + if (nold != nnew) goto error; - for (int i = 0; i < nold; i++) { + for (i = 0; i < nold; i++) { virDomainChrDefPtr oldserial = oldserials[i]; virDomainChrDefPtr newserial = NULL; - for (int j = 0; j < nnew; j++) { + for (j = 0; j < nnew; j++) { if (newserials[j]->target.port == oldserial->target.port) { newserial = newserials[j]; break; diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index 112e288342..76d885c362 100644 --- a/src/parallels/parallels_storage.c +++ b/src/parallels/parallels_storage.c @@ -123,6 +123,8 @@ parallelsStorageOpen(virConnectPtr conn, virStorageDriverStatePtr storageState; int privileged = (geteuid() == 0); parallelsConnPtr privconn = conn->privateData; + size_t i; + virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); if (STRNEQ(conn->driver->name, "Parallels")) @@ -176,7 +178,7 @@ parallelsStorageOpen(virConnectPtr conn, goto error; } - for (size_t i = 0; i < privconn->pools.count; i++) { + for (i = 0; i < privconn->pools.count; i++) { virStoragePoolObjLock(privconn->pools.objs[i]); virStoragePoolObjPtr pool;