aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-09-19 21:25:21 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-09-19 21:25:21 -0300
commit78f27075d219f0ad683066393978b1bbeb8ad940 (patch)
tree9f6cf3907073f2930adf4105057bf804f70ecd24
parentbbcd004a69f3798fa5426ba15b9ee238a04c6a16 (diff)
downloadkvmx-78f27075d219f0ad683066393978b1bbeb8ad940.tar.gz
kvmx-78f27075d219f0ad683066393978b1bbeb8ad940.tar.bz2
Fix: increase the maximum number of shared folders
-rwxr-xr-xkvmx13
1 files changed, 11 insertions, 2 deletions
diff --git a/kvmx b/kvmx
index ab599f5..8b5f666 100755
--- a/kvmx
+++ b/kvmx
@@ -411,9 +411,18 @@ function kvmx_up {
# See http://wiki.qemu-project.org/Documentation/9psetup
local shared="-fsdev local,id=shared,path=$shared_folder,security_model=none -device virtio-9p-pci,fsdev=shared,mount_tag=shared"
elif [ ! -z "$shared_folders" ]; then
+ # Add a PCI bus for shared filesystems
+ # See https://www.qemu.org/docs/master/system/device-emulation.html
+ # https://www.suse.com/support/kb/doc/?id=000019383
+ # https://unix.stackexchange.com/questions/588912/add-more-pci-slots-to-virtual-machine
+ #
+ # Perhaps could also be implemented with the PXB (PCI Expander Bridge):
+ # https://github.com/qemu/qemu/blob/master/docs/pci_expander_bridge.txt
+ local shared_bus="-device pci-bridge,bus=pci.0,addr=5,chassis_nr=1,id=shared.0"
+
local old_ifs="$IFS"
local shared_item
- local shared
+ local shared="$shared_bus"
IFS=","
for shared_item in $shared_folders; do
local id="`echo $shared_item | cut -d ':' -f 1`"
@@ -431,7 +440,7 @@ function kvmx_up {
mkdir -p $shared_folder
shared_folder="`cd $KVMX_PROJECT_FOLDER && cd $shared_folder &> /dev/null && pwd`"
- shared="$shared -fsdev local,id=$id,path=$shared_folder,security_model=none${shared_folder_mode} -device virtio-9p-pci,fsdev=$id,mount_tag=$id"
+ shared="$shared -fsdev local,id=$id,path=$shared_folder,security_model=none${shared_folder_mode} -device virtio-9p-pci,fsdev=$id,mount_tag=$id,bus=shared.0"
unset shared_folder
unset shared_folder_mountpoint