diff --git a/common/block_add_change b/common/block_add_change index b4bd0f03..e76235ec 100755 --- a/common/block_add_change +++ b/common/block_add_change @@ -2,7 +2,7 @@ NAME=${DEVNAME#/dev/} DESC="${ID_MODEL} (${ID_FS_LABEL})" -SIZE=$(cat /sys/$DEVPATH/size) +SIZE=$[ $(cat /sys/$DEVPATH/size) * 512 ] MODE=w XS_KEY="qubes-block-devices/$NAME" diff --git a/dom0/qvm-tools/qvm-block b/dom0/qvm-tools/qvm-block index c16c6905..66f416f2 100755 --- a/dom0/qvm-tools/qvm-block +++ b/dom0/qvm-tools/qvm-block @@ -107,7 +107,7 @@ def main(): attached_to_str = "" if attached_to: attached_to_str = " (attached to '%s' as '%s')" % (attached_to['vm'], attached_to['frontend']) - size_str = kbytes_to_kmg(dev['size']) + size_str = bytes_to_kmg(dev['size']) print "%s\t%s %s%s" % (dev['name'], dev['desc'], size_str, attached_to_str) exit (0)