mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-03 01:49:20 -05:00
cli: Fix unsetting --disk path
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
--- Original XML
|
||||
+++ Altered XML
|
||||
@@ -55,7 +55,6 @@
|
||||
<devices>
|
||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
||||
<disk type="block" device="floppy">
|
||||
- <source dev="/dev/null"/>
|
||||
<target dev="fda" bus="fdc"/>
|
||||
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
|
||||
</disk>
|
||||
|
||||
Domain 'test-many-devices' defined successfully.
|
||||
Changes will take effect after the next domain shutdown.
|
||||
@@ -787,6 +787,7 @@ c.add_compare("--security label=foo,bar,baz,UNKNOWN=val,relabel=on", "virtxml-ed
|
||||
c.add_compare("--features eoi=on,hyperv_relaxed=off,acpi=", "virtxml-edit-simple-features")
|
||||
c.add_compare("--clock offset=localtime,hpet_present=yes,kvmclock_present=no,rtc_tickpolicy=merge", "virtxml-edit-simple-clock")
|
||||
c.add_compare("--disk /dev/zero,perms=ro,startup_policy=optional", "virtxml-edit-simple-disk")
|
||||
c.add_compare("--disk path=", "virtxml-edit-simple-disk-remove-path")
|
||||
c.add_compare("--network source=br0,type=bridge,model=virtio,mac=", "virtxml-edit-simple-network")
|
||||
c.add_compare("--graphics tlsport=5902,keymap=ja", "virtxml-edit-simple-graphics")
|
||||
c.add_compare("--controller index=2,model=lsilogic", "virtxml-edit-simple-controller")
|
||||
|
||||
+3
-2
@@ -1723,6 +1723,7 @@ class ParserDisk(VirtCLIParser):
|
||||
convert_perms(opts.get_opt_param("perms"))
|
||||
|
||||
path = opts.get_opt_param("path")
|
||||
had_path = path is not None
|
||||
backing_store = opts.get_opt_param("backing_store")
|
||||
pool = opts.get_opt_param("pool")
|
||||
vol = opts.get_opt_param("vol")
|
||||
@@ -1734,8 +1735,8 @@ class ParserDisk(VirtCLIParser):
|
||||
self.guest, path, pool, vol, size, fmt, sparse)
|
||||
|
||||
path = volobj and volobj.path() or abspath
|
||||
if path:
|
||||
opts.opts["path"] = path
|
||||
if had_path or path:
|
||||
opts.opts["path"] = path or ""
|
||||
|
||||
inst = VirtCLIParser._parse(self, opts, inst)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user