rng is only enabled if qemu guest agent is enabled

Bug #1851497 reported by sean mooney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Medium
sean mooney

Bug Description

In change https://github.com/openstack/nova/commit/be548a3396ee5f3a78b2b8b59321eb4c4530f7fb
the libvirt xml generation was refactored to reduce code complexity.

while this was inteded to have no fucntional change it unintentionally change when the random number generator woudl be enabled

the old code
https://github.com/openstack/nova/commit/be548a3396ee5f3a78b2b8b59321eb4c4530f7fb#diff-f4019782d93a196a0d026479e6aa61b1L4037-L4071

has a miss placed comment that the contence of the if block only applied to the qemu guest agent

 # Qemu guest agent only support 'qemu' and 'kvm' hypervisor
        if CONF.libvirt.virt_type in ('qemu', 'kvm'):
               ...

the if is instead gurading so that the block actully run only when qemu and kvm is used and the body
of the if has code for both the qemu guest agent and the random number generator
in the refactor the code to add the rng was added to the code for adding the qemu guest agent and as a result it would only be added if botht the rng and qemu guest agent are both enabled.

Tags: libvirt
Revision history for this message
sean mooney (sean-k-mooney) wrote :

i miss read the indentation
_add_rng_device was only called form _set_qemu_guest_agent

but it was called uncondtionally as was _set_qemu_guest_agent
so it actully was working just hard to follow

Changed in nova:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.