Merge "Install libguestfs for nova-compute on Ubuntu"
diff --git a/files/apts/n-cpu b/files/apts/n-cpu
index 29e3760..b287107 100644
--- a/files/apts/n-cpu
+++ b/files/apts/n-cpu
@@ -1,8 +1,8 @@
 # Stuff for diablo volumes
-nbd-client
 lvm2
 open-iscsi
 open-iscsi-utils # Deprecated since quantal dist:precise
 genisoimage
 sysfsutils
 sg3-utils
+python-guestfs
diff --git a/lib/nova b/lib/nova
index 9db19ed..d5f7514 100644
--- a/lib/nova
+++ b/lib/nova
@@ -240,8 +240,10 @@
         sudo sysctl -w net.ipv4.ip_forward=1
 
         if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
-            # Attempt to load modules: network block device - used to manage qcow images
-            sudo modprobe nbd || true
+            # When libguestfs is available for file injection, enable using
+            # libguestfs to inspect the image and figure out the proper
+            # partition to inject into.
+            iniset $NOVA_CONF libvirt inject_partition '-1'
 
             # Check for kvm (hardware based virtualization).  If unable to initialize
             # kvm, we drop back to the slower emulation mode (qemu).  Note: many systems