diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 45bcad7a80..09b231bf98 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -817,11 +817,13 @@ class BaseConfig(object): | |||
817 | else: | 817 | else: |
818 | self.setup_tap() | 818 | self.setup_tap() |
819 | 819 | ||
820 | rootfs_format = self.fstype if self.fstype in ('vmdk', 'qcow2', 'vdi') else 'raw' | ||
821 | |||
820 | qb_rootfs_opt = self.get('QB_ROOTFS_OPT') | 822 | qb_rootfs_opt = self.get('QB_ROOTFS_OPT') |
821 | if qb_rootfs_opt: | 823 | if qb_rootfs_opt: |
822 | self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs) | 824 | self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs) |
823 | else: | 825 | else: |
824 | self.rootfs_options = '-drive file=%s,if=virtio,format=raw' % self.rootfs | 826 | self.rootfs_options = '-drive file=%s,if=virtio,format=%s' % (self.rootfs, rootfs_format) |
825 | 827 | ||
826 | if self.fstype in ('cpio.gz', 'cpio'): | 828 | if self.fstype in ('cpio.gz', 'cpio'): |
827 | self.kernel_cmdline = 'root=/dev/ram0 rw debugshell' | 829 | self.kernel_cmdline = 'root=/dev/ram0 rw debugshell' |
@@ -835,14 +837,15 @@ class BaseConfig(object): | |||
835 | cmd2 = "grep -q 'root=/dev/hd' %s" % self.rootfs | 837 | cmd2 = "grep -q 'root=/dev/hd' %s" % self.rootfs |
836 | if subprocess.call(cmd1, shell=True) == 0: | 838 | if subprocess.call(cmd1, shell=True) == 0: |
837 | logger.info('Using scsi drive') | 839 | logger.info('Using scsi drive') |
838 | vm_drive = '-drive if=none,id=hd,file=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' % self.rootfs | 840 | vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' \ |
841 | % (self.rootfs, rootfs_format) | ||
839 | elif subprocess.call(cmd2, shell=True) == 0: | 842 | elif subprocess.call(cmd2, shell=True) == 0: |
840 | logger.info('Using scsi drive') | 843 | logger.info('Using scsi drive') |
841 | vm_drive = self.rootfs | 844 | vm_drive = "%s,format=%s" % (self.rootfs, rootfs_format) |
842 | else: | 845 | else: |
843 | logger.warn("Can't detect drive type %s" % self.rootfs) | 846 | logger.warn("Can't detect drive type %s" % self.rootfs) |
844 | logger.warn('Tring to use virtio block drive') | 847 | logger.warn('Tring to use virtio block drive') |
845 | vm_drive = '-drive if=virtio,file=%s' % self.rootfs | 848 | vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format) |
846 | self.rootfs_options = '%s -no-reboot' % vm_drive | 849 | self.rootfs_options = '%s -no-reboot' % vm_drive |
847 | self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT')) | 850 | self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT')) |
848 | 851 | ||