OSDN Git Service

virtfs: allow a device id to be specified in the -virtfs option
authorChris Webb <chris@arachsys.com>
Thu, 24 Nov 2011 17:05:18 +0000 (17:05 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 May 2017 07:19:23 +0000 (10:19 +0300)
commit3baa0a6a658e3a17a79d95440e5c949b2b13bb6e
tree5b9bb21960ebb1c30026825b04efa76b4e279289
parent6516367fc0803d079384e0ad370856ac328bef30
virtfs: allow a device id to be specified in the -virtfs option

When using a virtfs root filesystem, the mount_tag needs to be set to
/dev/root. This can be done long-hand as

  -fsdev local,id=root,path=/path/to/rootfs,...
  -device virtio-9p-pci,fsdev=root,mount_tag=/dev/root

but the -virtfs shortcut cannot be used as it hard-codes the device identifier
to match the mount_tag, and device identifiers may not contain '/':

  $ qemu-system-x86_64 -virtfs local,path=/foo,mount_tag=/dev/root,security_model=passthrough
  qemu-system-x86_64: -virtfs local,path=/foo,mount_tag=/dev/root,security_model=passthrough: duplicate fsdev id: /dev/root

To support this case using -virtfs, we allow the device identifier to be
specified explicitly when the mount_tag is not suitable:

  -virtfs local,id=root,path=/path/to/rootfs,mount_tag=/dev/root,...

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qemu-options.hx
vl.c