File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/vmm_mad/remotes/lib/kvm Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,10 @@ def interface_xml
438438 model = env ( 'DEFAULT_ATTACH_NIC_MODEL' ) if model . empty?
439439 model . encode! ( :xml => :attr ) unless model . empty?
440440
441+ virtio_queues = @xml [ "#{ @xpath_prefix } VIRTIO_QUEUES" ]
442+ virtio_queues = @xml [ 'TEMPLATE/VCPU' ] || '1' if virtio_queues == 'auto'
443+ virtio_queues . encode! ( :xml => :attr ) unless virtio_queues . empty?
444+
441445 filter = @xml [ "#{ @xpath_prefix } FILTER" ]
442446 filter = env ( 'DEFAULT_ATTACH_NIC_FILTER' ) if filter . empty?
443447 filter . encode! ( :xml => :attr ) unless filter . empty?
@@ -461,9 +465,8 @@ def interface_xml
461465 dev << xputs ( '<boot order=%s/>' , 'ORDER' )
462466 dev << "<model type=#{ model } />" unless model . empty?
463467
464- if model == 'virtio'
465- dev << xputs ( '<driver name="vhost" queues=%s/>' ,
466- 'VIRTIO_QUEUES' )
468+ if model == '"virtio"' && !virtio_queues . empty?
469+ dev << "<driver name='vhost' queues=#{ virtio_queues } />"
467470 end
468471
469472 if exist? ( 'IP' ) && !filter . empty?
You can’t perform that action at this time.
0 commit comments