Revision history [back]

It looks like libvirt.xml is generated from the code in nova/virt/libvirt/driver.py

_get_guest_xml calls _get_guest_config , which calls a ton of things to get all the necessary item to generate the file for each instance.

So, you're looking at modifying that python script, probably inside the _get_guest_config method to add something that adds in the password. Since you're modifying the graphics area, you're probably looking at changing:

           graphics = vconfig.LibvirtConfigGuestGraphics()
            graphics.type = "vnc"
            graphics.keymap = CONF.vnc.keymap
            graphics.listen = CONF.vnc.vncserver_listen
            guest.add_device(graphics)
            add_video_driver = True

I'm going to guess there'll be something like graphics.passwd that you can set.

Anyway, you probably shouldn't have to add the code to do this, so it might be worth filing a bug.