virshControlPtr priv = ctl->privData;
unsigned int flags = 0;
virshStreamCallbackData cbData;
+ struct stat sb;
if (vshCommandOptULongLong(ctl, cmd, "offset", &offset) < 0)
return false;
goto cleanup;
}
+ if (fstat(fd, &sb) < 0) {
+ vshError(ctl, _("unable to stat %s"), file);
+ goto cleanup;
+ }
+
cbData.ctl = ctl;
cbData.fd = fd;
+ cbData.isBlock = !!S_ISBLK(sb.st_mode);
if (vshCommandOptBool(cmd, "sparse"))
flags |= VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM;
virshControlPtr priv = ctl->privData;
virshStreamCallbackData cbData;
unsigned int flags = 0;
+ struct stat sb;
if (vshCommandOptULongLong(ctl, cmd, "offset", &offset) < 0)
return false;
created = true;
}
+ if (fstat(fd, &sb) < 0) {
+ vshError(ctl, _("unable to stat %s"), file);
+ goto cleanup;
+ }
+
cbData.ctl = ctl;
cbData.fd = fd;
+ cbData.isBlock = !!S_ISBLK(sb.st_mode);
if (!(st = virStreamNew(priv->conn, 0))) {
vshError(ctl, _("cannot create a new stream"));