summaryrefslogtreecommitdiffstats
path: root/lua/examples/inspect_vm.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/examples/inspect_vm.lua')
-rw-r--r--lua/examples/inspect_vm.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/examples/inspect_vm.lua b/lua/examples/inspect_vm.lua
index 1bee10b3..e35b4631 100644
--- a/lua/examples/inspect_vm.lua
+++ b/lua/examples/inspect_vm.lua
@@ -1,6 +1,6 @@
-- Example showing how to inspect a virtual machine disk.
-require "guestfs"
+local G = require "guestfs"
if table.getn (arg) == 1 then
disk = arg[1]
@@ -8,7 +8,7 @@ else
error ("usage: inspect_vm disk.img")
end
-g = Guestfs.create ()
+local g = G.create ()
-- Attach the disk image read-only to libguestfs.
g:add_drive (disk, { -- format:"raw"
@@ -18,7 +18,7 @@ g:add_drive (disk, { -- format:"raw"
g:launch ()
-- Ask libguestfs to inspect for operating systems.
-roots = g:inspect_os ()
+local roots = g:inspect_os ()
if table.getn (roots) == 0 then
error ("inspect_vm: no operating systems found")
end