Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 18dd534

Browse files
committed
clone: Use virtinst Guest parsing
Simplifies the code a lot. xml file changes are trivial reformatting.
1 parent ea90415 commit 18dd534

13 files changed

Lines changed: 79 additions & 155 deletions

tests/cli-test-xml/compare/clone-auto1.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="test" id="3">
32
<name>test-for-clone1</name>
43
<uuid>00000000-1111-2222-3333-444444444444</uuid>

tests/cli-test-xml/compare/clone-auto2.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="test" id="2">
32
<name>newvm</name>
43
<uuid>00000000-1111-2222-3333-444444444444</uuid>
@@ -21,9 +20,9 @@
2120
<devices>
2221
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
2322
<disk type="file" device="disk">
24-
<source file="/default-pool/newvm.img"/>
2523
<target dev="hda" bus="ide"/>
2624
<address type="drive" controller="0" bus="0" unit="0"/>
25+
<source file="/default-pool/newvm.img"/>
2726
</disk>
2827
<controller type="ide" index="0"/>
2928
<interface type="user">

tests/clone-xml/cross-pool-out.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,12 +18,12 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="file" device="disk">
22-
<source file="/cross-pool/new1.img"/>
2321
<target dev="hda" bus="ide"/>
22+
<source file="/cross-pool/new1.img"/>
2423
</disk>
2524
<disk type="file" device="disk">
26-
<source file="/cross-pool/new2.img"/>
2725
<target dev="hdb" bus="ide"/>
26+
<source file="/cross-pool/new2.img"/>
2827
</disk>
2928
<interface type="network">
3029
<mac address="01:23:45:67:89:00"/>

tests/clone-xml/empty-disks-out.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,8 +18,8 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="block" device="disk">
22-
<source dev="/dev/loop0"/>
2321
<target dev="hda" bus="ide"/>
22+
<source dev="/dev/loop0"/>
2423
</disk>
2524
<disk type="file" device="floppy">
2625
<target dev="fdb" bus="fdc"/>
@@ -30,8 +29,8 @@
3029
<readonly/>
3130
</disk>
3231
<disk type="file" device="disk">
33-
<source file="/tmp/clone2.img"/>
3432
<target dev="sdb" bus="scsi"/>
33+
<source file="/tmp/clone2.img"/>
3534
</disk>
3635
<interface type="network">
3736
<mac address="01:23:45:67:89:00"/>

tests/clone-xml/force-out.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,19 +18,19 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="block" device="disk">
22-
<source dev="/dev/loop0"/>
2321
<target dev="hda" bus="ide"/>
22+
<source dev="/dev/loop0"/>
2423
</disk>
25-
<disk type="file" device="floppy">
24+
<disk type="block" device="floppy">
2625
<target dev="fdb" bus="fdc"/>
2726
</disk>
2827
<disk type="block" device="cdrom">
2928
<target dev="sda" bus="scsi"/>
3029
<readonly/>
3130
</disk>
3231
<disk type="file" device="disk">
33-
<source file="/tmp/clone2.img"/>
3432
<target dev="sdb" bus="scsi"/>
33+
<source file="/tmp/clone2.img"/>
3534
</disk>
3635
<interface type="network">
3736
<mac address="01:23:45:67:89:00"/>

tests/clone-xml/general-cfg-out.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,12 +18,12 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="block" device="disk">
22-
<source dev="/dev/loop0"/>
2321
<target dev="hda" bus="ide"/>
22+
<source dev="/dev/loop0"/>
2423
</disk>
2524
<disk type="file" device="disk">
26-
<source file="/tmp/clone2.img"/>
2725
<target dev="hdb" bus="ide"/>
26+
<source file="/tmp/clone2.img"/>
2827
</disk>
2928
<interface type="network">
3029
<mac address="01:23:45:67:89:00"/>

tests/clone-xml/managed-storage-out.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,8 +18,8 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="file" device="disk">
22-
<source file="/default-pool/new1.img"/>
2321
<target dev="hda" bus="ide"/>
22+
<source file="/default-pool/new1.img"/>
2423
</disk>
2524
<disk type="block" device="disk">
2625
<source dev="/disk-pool/new2.img"/>

tests/clone-xml/noclone-storage-out.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>

tests/clone-xml/nostorage-out.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="test">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>

tests/clone-xml/readonly-disks-out.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0"?>
21
<domain type="kvm">
32
<name>clone-new</name>
43
<uuid>12345678-1234-1234-1234-123456789012</uuid>
@@ -19,17 +18,17 @@
1918
<devices>
2019
<emulator>/usr/bin/qemu-kvm</emulator>
2120
<disk type="block" device="disk">
22-
<source dev="/dev/loop0"/>
2321
<target dev="hda" bus="ide"/>
22+
<source dev="/dev/loop0"/>
2423
</disk>
2524
<disk type="file" device="disk">
2625
<source file="/tmp/virtinst-test1.img"/>
2726
<target dev="hdb" bus="ide"/>
2827
<readonly/>
2928
</disk>
3029
<disk type="file" device="disk">
31-
<source file="/tmp/clone2.img"/>
3230
<target dev="sda" bus="scsi"/>
31+
<source file="/tmp/clone2.img"/>
3332
</disk>
3433
<disk type="block" device="cdrom">
3534
<target dev="sdb" bus="scsi"/>

0 commit comments

Comments
 (0)