dom0+vm/qvm-block: convert device size to bytes

This commit is contained in:
Marek Marczykowski 2011-10-01 02:55:51 +02:00
parent f0038d2ec7
commit 56f3d7ba75
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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)