Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Slowroll:Build:2
virt-manager
virtinst-dont-create-storage-pool-for-dryrun.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File virtinst-dont-create-storage-pool-for-dryrun.patch of Package virt-manager
Reference: bsc#1228384 Don't create a storage pool for a dry run Index: virt-manager-4.1.0/virtinst/cli.py =================================================================== --- virt-manager-4.1.0.orig/virtinst/cli.py +++ virt-manager-4.1.0/virtinst/cli.py @@ -69,6 +69,14 @@ def _reset_global_state(): _globalstate = _GlobalState() +_dryrun = False + +def get_dryrun(): + return _dryrun +def set_dryrun(val): + global _dryrun + _dryrun = val + VIRT_PARSERS = [] @@ -646,6 +654,7 @@ def add_misc_options(grp, prompt=False, help=argparse.SUPPRESS) if dryrun: + set_dryrun(True) grp.add_argument("--dry-run", action="store_true", dest="dry", help=_("Run through install process, but do not " "create devices or define the guest.")) @@ -3615,7 +3624,7 @@ class ParserDisk(VirtCLIParser): ################### def set_path_cb(self, inst, val, virtarg): - inst.set_source_path(val) + inst.set_source_path(val, get_dryrun()) def path_lookup_cb(self, inst, val, virtarg): return inst.get_source_path() == val Index: virt-manager-4.1.0/virtinst/devices/disk.py =================================================================== --- virt-manager-4.1.0.orig/virtinst/devices/disk.py +++ virt-manager-4.1.0/virtinst/devices/disk.py @@ -635,7 +635,7 @@ class DeviceDisk(Device): self._resolve_storage_backend() return self._storage_backend.get_path() - def set_source_path(self, newpath): + def set_source_path(self, newpath, dryrun=False): if self._storage_backend.will_create_storage(): raise xmlutil.DevError( "Can't change disk path if storage creation info " @@ -644,7 +644,7 @@ class DeviceDisk(Device): # User explicitly changed 'path', so try to lookup its storage # object since we may need it (newpath, vol_object, parent_pool) = diskbackend.manage_path( - self.conn, newpath) + self.conn, newpath, dryrun) self._change_backend(newpath, vol_object, parent_pool) self._set_xmlpath(self.get_source_path()) Index: virt-manager-4.1.0/virtinst/diskbackend.py =================================================================== --- virt-manager-4.1.0.orig/virtinst/diskbackend.py +++ virt-manager-4.1.0/virtinst/diskbackend.py @@ -136,7 +136,7 @@ def _get_storage_search_path(path): return path -def manage_path(conn, path): +def manage_path(conn, path, dryrun=False): """ If path is not managed, try to create a storage pool to probe the path """ @@ -150,7 +150,7 @@ def manage_path(conn, path): searchpath = _get_storage_search_path(path) vol, pool = _check_if_path_managed(conn, searchpath) - if vol or pool or not _can_auto_manage(path): + if vol or pool or not _can_auto_manage(path) or dryrun is True: return path, vol, pool dirname = os.path.dirname(path)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor