mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-08 05:57:43 +03:00
virt-xml: Fix --define
with stdin XML
And rework the `refresh-machine-type` testcase to trigger it Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
b83a1b0d0f
commit
de00ff7661
@ -1,17 +1,10 @@
|
|||||||
<domain type="kvm">
|
<currentMemory unit="KiB">2097152</currentMemory>
|
||||||
<name>test</name>
|
<vcpu placement="static">2</vcpu>
|
||||||
<uuid>6695eb01-f6a4-8304-79aa-97f2502e193f</uuid>
|
<os>
|
||||||
<memory unit="KiB">8388608</memory>
|
- <type arch="x86_64" machine="pc-q35-foobar">hvm</type>
|
||||||
<currentMemory unit="KiB">2097152</currentMemory>
|
+ <type arch="x86_64" machine="q35">hvm</type>
|
||||||
<vcpu placement="static">2</vcpu>
|
<boot dev="hd"/>
|
||||||
<os>
|
</os>
|
||||||
<type arch="x86_64" machine="q35">hvm</type>
|
<clock offset="utc"/>
|
||||||
<boot dev="hd"/>
|
|
||||||
</os>
|
Domain 'refresh-machine' defined successfully.
|
||||||
<clock offset="utc"/>
|
|
||||||
<on_poweroff>destroy</on_poweroff>
|
|
||||||
<on_reboot>restart</on_reboot>
|
|
||||||
<on_crash>destroy</on_crash>
|
|
||||||
<devices>
|
|
||||||
</devices>
|
|
||||||
</domain>
|
|
||||||
|
17
tests/data/cli/virtxml/virtxml-refresh-machine-in.xml
Normal file
17
tests/data/cli/virtxml/virtxml-refresh-machine-in.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<domain type='kvm'>
|
||||||
|
<name>refresh-machine</name>
|
||||||
|
<memory unit='KiB'>8388608</memory>
|
||||||
|
<currentMemory unit='KiB'>2097152</currentMemory>
|
||||||
|
<vcpu placement='static'>2</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='x86_64' machine="pc-q35-foobar">hvm</type>
|
||||||
|
<boot dev='hd'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
||||||
|
|
@ -1417,7 +1417,7 @@ c.add_invalid("test --add-device --xml ./@foo=bar", grep="--xml can only be used
|
|||||||
c.add_invalid("test-for-virtxml --edit --boot refresh-machine-type=yes", grep="Don't know how to refresh")
|
c.add_invalid("test-for-virtxml --edit --boot refresh-machine-type=yes", grep="Don't know how to refresh")
|
||||||
c.add_compare("test --print-xml --edit --vcpus 7", "print-xml") # test --print-xml
|
c.add_compare("test --print-xml --edit --vcpus 7", "print-xml") # test --print-xml
|
||||||
c.add_compare("--edit --cpu host-passthrough", "stdin-edit", input_file=(_VIRTXMLDIR + "virtxml-stdin-edit.xml")) # stdin test
|
c.add_compare("--edit --cpu host-passthrough", "stdin-edit", input_file=(_VIRTXMLDIR + "virtxml-stdin-edit.xml")) # stdin test
|
||||||
c.add_compare("--connect %(URI-KVM-X86)s --edit --boot refresh-machine-type=yes", "refresh-machine-type", input_file=(_VIRTXMLDIR + "virtxml-stdin-edit.xml")) # refresh-machine-type test. we need to use stdin XML since we can't get the libvirt testdriver to start with the machine XML we need
|
c.add_compare("--connect %(URI-KVM-X86)s --edit --print-diff --define --boot refresh-machine-type=yes", "refresh-machine-type", input_file=(_VIRTXMLDIR + "virtxml-refresh-machine-in.xml")) # refresh-machine-type test. we need to use stdin XML since we can't get the libvirt testdriver to start with the machine XML we need
|
||||||
c.add_compare("--build-xml --cpu pentium3,+x2apic", "build-cpu")
|
c.add_compare("--build-xml --cpu pentium3,+x2apic", "build-cpu")
|
||||||
c.add_compare("--build-xml --tpm path=/dev/tpm", "build-tpm")
|
c.add_compare("--build-xml --tpm path=/dev/tpm", "build-tpm")
|
||||||
c.add_compare("--build-xml --blkiotune weight=100,device0.path=/dev/sdf,device.weight=200,device0.read_bytes_sec=10000,device0.write_bytes_sec=10000,device0.read_iops_sec=20000,device0.write_iops_sec=20000", "build-blkiotune")
|
c.add_compare("--build-xml --blkiotune weight=100,device0.path=/dev/sdf,device.weight=200,device0.read_bytes_sec=10000,device0.write_bytes_sec=10000,device0.read_iops_sec=20000,device0.write_iops_sec=20000", "build-blkiotune")
|
||||||
|
@ -546,7 +546,7 @@ def main(conn=None):
|
|||||||
elif vm_is_running and not performed_update:
|
elif vm_is_running and not performed_update:
|
||||||
print_stdout(
|
print_stdout(
|
||||||
_("Changes will take effect after the domain is fully powered off."))
|
_("Changes will take effect after the domain is fully powered off."))
|
||||||
elif defined_xml_is_unchanged(conn, domain, original_xml):
|
elif defined_xml_is_unchanged(conn, dom, original_xml):
|
||||||
log.warning(_("XML did not change after domain define. You may "
|
log.warning(_("XML did not change after domain define. You may "
|
||||||
"have changed a value that libvirt is setting by default."))
|
"have changed a value that libvirt is setting by default."))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user