Merge branch 'tmp'
This commit is contained in:
commit
46b80ce25e
@ -821,8 +821,10 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
|
|||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
ret = openvz_readline(fd, line, sizeof(line));
|
ret = openvz_readline(fd, line, sizeof(line));
|
||||||
if(ret == -1)
|
if(ret == -1) {
|
||||||
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if(ret == 0) { /* EoF, UUID was not found */
|
if(ret == 0) { /* EoF, UUID was not found */
|
||||||
uuidstr[0] = 0;
|
uuidstr[0] = 0;
|
||||||
|
@ -2837,6 +2837,7 @@ static int qemudGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, int pi
|
|||||||
/* startstack -> processor */
|
/* startstack -> processor */
|
||||||
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
|
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
|
||||||
&usertime, &systime, &cpu) != 3) {
|
&usertime, &systime, &cpu) != 3) {
|
||||||
|
fclose(pidinfo);
|
||||||
VIR_WARN0("cannot parse process status data");
|
VIR_WARN0("cannot parse process status data");
|
||||||
errno = -EINVAL;
|
errno = -EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -137,7 +137,7 @@ virStorageBackendSCSIUpdateVolTargetInfo(virConnectPtr conn,
|
|||||||
unsigned long long *allocation,
|
unsigned long long *allocation,
|
||||||
unsigned long long *capacity)
|
unsigned long long *capacity)
|
||||||
{
|
{
|
||||||
int fd, i;
|
int fd, i, ret = -1;
|
||||||
off_t start;
|
off_t start;
|
||||||
unsigned char buffer[1024];
|
unsigned char buffer[1024];
|
||||||
ssize_t bytes;
|
ssize_t bytes;
|
||||||
@ -154,7 +154,7 @@ virStorageBackendSCSIUpdateVolTargetInfo(virConnectPtr conn,
|
|||||||
fd,
|
fd,
|
||||||
allocation,
|
allocation,
|
||||||
capacity) < 0)
|
capacity) < 0)
|
||||||
return -1;
|
goto cleanup;
|
||||||
|
|
||||||
/* make sure to set the target format "unknown" to begin with */
|
/* make sure to set the target format "unknown" to begin with */
|
||||||
target->format = VIR_STORAGE_POOL_DISK_UNKNOWN;
|
target->format = VIR_STORAGE_POOL_DISK_UNKNOWN;
|
||||||
@ -164,14 +164,14 @@ virStorageBackendSCSIUpdateVolTargetInfo(virConnectPtr conn,
|
|||||||
virReportSystemError(conn, errno,
|
virReportSystemError(conn, errno,
|
||||||
_("cannot seek to beginning of file '%s'"),
|
_("cannot seek to beginning of file '%s'"),
|
||||||
target->path);
|
target->path);
|
||||||
return -1;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
bytes = saferead(fd, buffer, sizeof(buffer));
|
bytes = saferead(fd, buffer, sizeof(buffer));
|
||||||
if (bytes < 0) {
|
if (bytes < 0) {
|
||||||
virReportSystemError(conn, errno,
|
virReportSystemError(conn, errno,
|
||||||
_("cannot read beginning of file '%s'"),
|
_("cannot read beginning of file '%s'"),
|
||||||
target->path);
|
target->path);
|
||||||
return -1;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; disk_types[i].part_table_type != -1; i++) {
|
for (i = 0; disk_types[i].part_table_type != -1; i++) {
|
||||||
@ -184,7 +184,12 @@ virStorageBackendSCSIUpdateVolTargetInfo(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
ret = 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
close(fd);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -424,6 +424,7 @@ xenInotifyOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
if (xenInotifyAddDomainConfigInfo(conn, path) < 0 ) {
|
if (xenInotifyAddDomainConfigInfo(conn, path) < 0 ) {
|
||||||
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
|
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Error adding file to config list"));
|
"%s", _("Error adding file to config list"));
|
||||||
|
closedir(dh);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user