[libvirt] [PATCH 0/2] virsh: allow to specify pci address with attach-interface

KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Wed Dec 14 03:23:28 UTC 2011


Now, at using attach-interface, pci address of the device is determined
automatically. This is nice. But in some situation, users may want to
specify pci address by hand. For example, when users want to use multifunction
pci device, he need to specify pci slot.

This patch allows to specify pci address with attach-interface.

Then, this kind of script can run to assign multiple nics in a slot.
==
#!/bin/bash -x

DOM=$1
SLOT=$2
NUM=$3

for i in `seq 0 $NUM`; do
        virsh attach-interface --domain $DOM --type='network'  --source=default\
        --persistent --model=virtio --address=pci:0000:00:$SLOT:0$i --multifunction;
done
==

Because I moved placement of some functions in virsh.c, diffstat seems big...

 virsh.c   |  948 ++++++++++++++++++++++++++++++++------------------------------
 virsh.pod |    4
 2 files changed, 495 insertions(+), 457 deletions(-)

Thanks,
-Kame




More information about the libvir-list mailing list