mirror of https://gitee.com/openkylin/libvirt.git
createRawFileOpHook: avoid dead stores
* src/storage/storage_backend.c (createRawFileOpHook): Remove dead stores and declaration of each stored-to variable.
This commit is contained in:
parent
5874c6de5c
commit
2cdf29eda9
|
@ -308,12 +308,11 @@ static int createRawFileOpHook(int fd, void *data) {
|
||||||
* update every 9s is a fair-enough trade-off
|
* update every 9s is a fair-enough trade-off
|
||||||
*/
|
*/
|
||||||
unsigned long long bytes = 512 * 1024 * 1024;
|
unsigned long long bytes = 512 * 1024 * 1024;
|
||||||
int r;
|
|
||||||
|
|
||||||
if (bytes > remain)
|
if (bytes > remain)
|
||||||
bytes = remain;
|
bytes = remain;
|
||||||
if ((r = safezero(fd, 0, hdata->vol->allocation - remain,
|
if (safezero(fd, 0, hdata->vol->allocation - remain,
|
||||||
bytes)) != 0) {
|
bytes) != 0) {
|
||||||
ret = errno;
|
ret = errno;
|
||||||
virReportSystemError(errno, _("cannot fill file '%s'"),
|
virReportSystemError(errno, _("cannot fill file '%s'"),
|
||||||
hdata->vol->target.path);
|
hdata->vol->target.path);
|
||||||
|
@ -322,9 +321,7 @@ static int createRawFileOpHook(int fd, void *data) {
|
||||||
remain -= bytes;
|
remain -= bytes;
|
||||||
}
|
}
|
||||||
} else { /* No progress bars to be shown */
|
} else { /* No progress bars to be shown */
|
||||||
int r;
|
if (safezero(fd, 0, 0, remain) != 0) {
|
||||||
|
|
||||||
if ((r = safezero(fd, 0, 0, remain)) != 0) {
|
|
||||||
ret = errno;
|
ret = errno;
|
||||||
virReportSystemError(errno, _("cannot fill file '%s'"),
|
virReportSystemError(errno, _("cannot fill file '%s'"),
|
||||||
hdata->vol->target.path);
|
hdata->vol->target.path);
|
||||||
|
|
Loading…
Reference in New Issue