All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runqemu: support virtio drive type
@ 2017-04-13 20:32 Patrick Ohly
  0 siblings, 0 replies; only message in thread
From: Patrick Ohly @ 2017-04-13 20:32 UTC (permalink / raw)
  To: openembedded-core

Setting QB_DRIVE_TYPE=/dev/vd selects virtio without triggering any
warnings. Previously, that was only possible by setting an unknown
value and relying on the fallback to virtio, which caused some
warnings to be printed.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
---
 scripts/runqemu | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 5b5d56b9ef4..a536ff17c07 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -992,12 +992,15 @@ class BaseConfig(object):
                         logger.info('Using ide drive')
                         vm_drive = "%s,format=%s" % (self.rootfs, rootfs_format)
                     else:
-                        logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type)
-
-                if not vm_drive:
-                    logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE")
-                    logger.warn('Trying to use virtio block drive')
-                    vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format)
+                        # virtio might have been selected explicitly (just use it), or
+                        # is used as fallback (then warn about that).
+                        if not drive_type.startswith("/dev/vd"):
+                            logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type)
+                            logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE")
+                            logger.warn('Trying to use virtio block drive')
+                        vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format)
+
+                # All branches above set vm_drive.
                 self.rootfs_options = '%s -no-reboot' % vm_drive
             self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT'))
 
-- 
2.11.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-13 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13 20:32 [PATCH] runqemu: support virtio drive type Patrick Ohly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.