-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for adding and replacing elements. (#3)
Co-authored-by: Oleg Neumyvakin <oleg.neumyvakin@webpros.com>
- Loading branch information
1 parent
755e4c0
commit 083785c
Showing
14 changed files
with
293 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= | ||
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= | ||
github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= | ||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | ||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= | ||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= | ||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= | ||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<diff> | ||
<add sel="domain/devices"> | ||
<interface type="added"> | ||
<mac address="mac3"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"/> | ||
<target dev="dev3"/> | ||
<model type="virtio"/> | ||
</interface> | ||
</add> | ||
</diff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="bridge"> | ||
<mac address="mac1"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid1"/> | ||
</virtualport> | ||
<target dev="dev1"/> | ||
<model type="virtio"/> | ||
<alias name="net1"/> | ||
<address type="pci" domain="0x0001" bus="0x01" slot="0x01" function="0x1"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="mac2"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid2"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net2"/> | ||
<address type="pci" domain="0x0002" bus="0x02" slot="0x02" function="0x2"/> | ||
</interface> | ||
<interface type="added"> | ||
<mac address="mac3"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"/> | ||
<target dev="dev3"/> | ||
<model type="virtio"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="bridge"> | ||
<mac address="mac1"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid1"/> | ||
</virtualport> | ||
<target dev="dev1"/> | ||
<model type="virtio"/> | ||
<alias name="net1"/> | ||
<address type="pci" domain="0x0001" bus="0x01" slot="0x01" function="0x1"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="mac2"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid2"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net2"/> | ||
<address type="pci" domain="0x0002" bus="0x02" slot="0x02" function="0x2"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<diff> | ||
<add sel="domain/devices" rejectsel="//interface/mac[@address='mac2']"> | ||
<interface type="added"> | ||
<mac address="mac2"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"/> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
</interface> | ||
</add> | ||
</diff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="bridge"> | ||
<mac address="mac1"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid1"/> | ||
</virtualport> | ||
<target dev="dev1"/> | ||
<model type="virtio"/> | ||
<alias name="net1"/> | ||
<address type="pci" domain="0x0001" bus="0x01" slot="0x01" function="0x1"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="mac2"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid2"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net2"/> | ||
<address type="pci" domain="0x0002" bus="0x02" slot="0x02" function="0x2"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="bridge"> | ||
<mac address="mac1"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid1"/> | ||
</virtualport> | ||
<target dev="dev1"/> | ||
<model type="virtio"/> | ||
<alias name="net1"/> | ||
<address type="pci" domain="0x0001" bus="0x01" slot="0x01" function="0x1"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="mac2"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="interfaceid2"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net2"/> | ||
<address type="pci" domain="0x0002" bus="0x02" slot="0x02" function="0x2"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<diff> | ||
<replace sel="//interface/mac[@address='52:54:00:31:3d:3e']/.."> | ||
<interface type="replaced"> | ||
<mac address="52:54:00:31:3d:3e"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch" /> | ||
<target dev="dev3"/> | ||
<model type="virtio"/> | ||
</interface> | ||
</replace> | ||
</diff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="replaced"> | ||
<mac address="52:54:00:31:3d:3e"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"/> | ||
<target dev="dev3"/> | ||
<model type="virtio"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="52:54:00:31:3d:3d"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="01fb70b1-6df4-4786-aa08-e5e9427662f0"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net0"/> | ||
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<domain type="kvm" id="98" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> | ||
<devices> | ||
<interface type="bridge"> | ||
<mac address="52:54:00:31:3d:3e"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="01fb70b1-6df4-4786-aa08-e5e9427662f0"/> | ||
</virtualport> | ||
<target dev="dev1"/> | ||
<model type="virtio"/> | ||
<alias name="net0"/> | ||
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> | ||
</interface> | ||
<interface type="bridge"> | ||
<mac address="52:54:00:31:3d:3d"/> | ||
<source bridge="br-int"/> | ||
<virtualport type="openvswitch"> | ||
<parameters interfaceid="01fb70b1-6df4-4786-aa08-e5e9427662f0"/> | ||
</virtualport> | ||
<target dev="dev2"/> | ||
<model type="virtio"/> | ||
<alias name="net0"/> | ||
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> | ||
</interface> | ||
</devices> | ||
</domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.