dom0+vm/qvm-block: convert device size to bytes
This commit is contained in:
parent
f0038d2ec7
commit
56f3d7ba75
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
NAME=${DEVNAME#/dev/}
|
NAME=${DEVNAME#/dev/}
|
||||||
DESC="${ID_MODEL} (${ID_FS_LABEL})"
|
DESC="${ID_MODEL} (${ID_FS_LABEL})"
|
||||||
SIZE=$(cat /sys/$DEVPATH/size)
|
SIZE=$[ $(cat /sys/$DEVPATH/size) * 512 ]
|
||||||
MODE=w
|
MODE=w
|
||||||
XS_KEY="qubes-block-devices/$NAME"
|
XS_KEY="qubes-block-devices/$NAME"
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ def main():
|
|||||||
attached_to_str = ""
|
attached_to_str = ""
|
||||||
if attached_to:
|
if attached_to:
|
||||||
attached_to_str = " (attached to '%s' as '%s')" % (attached_to['vm'], attached_to['frontend'])
|
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)
|
print "%s\t%s %s%s" % (dev['name'], dev['desc'], size_str, attached_to_str)
|
||||||
exit (0)
|
exit (0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user