qemu: fix failure to start with spice graphics and no tls
Commit eca3fdf7 inadvertantly caused a failure to start for any domain with the following in its config: <graphics type='spice' autoport='yes'/> The problem is that when tlsPort == 0 and defaultMode == "any" (which is the default for defaultMode), this would be flagged in the code as "needTLSPort", and if there was then no spice tls config, the new error+fail would happen. This patch checks for the case of defaultMode == "any", and in that case simply doesn't allocate a TLS port (since that's probably not what the user wanted, and it would have failed later anyway.). It does leave the error in place for cases when the user specifically asked to use tls in one way or another, though.
Showing
想要评论请 注册 或 登录