mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
vir-qemu-sev-validate: Use string() method in xpath
For the xpath "/domain/cpu/@mode", it will return a list type not a
string. Use string() method in the xpath for the string result.
Fixes: 6b95437c17
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
fa14b4a1a6
commit
6beeca77be
@ -1054,7 +1054,7 @@ class LibvirtConfidentialVM(ConfidentialVM):
|
|||||||
raise InsecureUsageException(
|
raise InsecureUsageException(
|
||||||
"Using CPU SKU from capabilities is not secure")
|
"Using CPU SKU from capabilities is not secure")
|
||||||
|
|
||||||
mode = doc.xpath("/domain/cpu/@mode")
|
mode = doc.xpath("string(/domain/cpu/@mode)")
|
||||||
if mode != "host-passthrough":
|
if mode != "host-passthrough":
|
||||||
raise UnsupportedUsageException(
|
raise UnsupportedUsageException(
|
||||||
"Using CPU family/model/stepping from host not possible unless 'host-passthrough' is used")
|
"Using CPU family/model/stepping from host not possible unless 'host-passthrough' is used")
|
||||||
|
Loading…
Reference in New Issue
Block a user