Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 875677 Details for
Bug 1075671
Disk information not completely restored when actions are canceled
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that failed
0001-When-canceling-a-destroy-device-action-restore-state.patch (text/plain), 3.61 KB, created by
mulhern
on 2014-03-17 20:33:35 UTC
(
hide
)
Description:
Patch that failed
Filename:
MIME Type:
Creator:
mulhern
Created:
2014-03-17 20:33:35 UTC
Size:
3.61 KB
patch
obsolete
>From 02f9dacdd85ff969f1764098c5b7845da37af7e5 Mon Sep 17 00:00:00 2001 >From: mulhern <amulhern@redhat.com> >Date: Thu, 13 Mar 2014 12:28:22 -0400 >Subject: [PATCH] When canceling a destroy device action, restore state of > device (#1075671) > >Resolves: rhbz#1075671 > >When a device is removed due to the cancelation of a device creation action >info about some structure of the device is also removed. > >Now, when a device is added due to the cancelation of device destroy action >info about some structure of the device is added back. > >Signed-off-by: mulhern <amulhern@redhat.com> >--- > blivet/devicetree.py | 36 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 34 insertions(+), 2 deletions(-) > >diff --git a/blivet/devicetree.py b/blivet/devicetree.py >index 0eecbcb..07b7880 100644 >--- a/blivet/devicetree.py >+++ b/blivet/devicetree.py >@@ -262,11 +262,14 @@ class DeviceTree(object): > pdisk = partition.disk.format.partedDisk > partition.partedPartition = pdisk.getPartitionByPath(partition.path) > >- def _addDevice(self, newdev): >+ def _addDevice(self, newdev, moddisk=False): > """ Add a device to the tree. > > Raise ValueError if the device's identifier is already > in the list. >+ >+ If moddisk is True, restore connections that may have >+ been dismantled by _removeDevice. > """ > if newdev.uuid and newdev.uuid in [d.uuid for d in self._devices] and \ > not isinstance(newdev, NoDevice): >@@ -285,6 +288,35 @@ class DeviceTree(object): > newdev.type != "btrfs volume" and > newdev.name not in self.names): > self.names.append(newdev.name) >+ >+ if moddisk: >+ if isinstance(newdev, PartitionDevice) and newdev.disk is not None: >+ if newdev.partedPartition not in newdev.disk.format.partitions: >+ if newdev.partedPartition.type == parted.PARTITION_LOGICAL and \ >+ newdev.disk.format.extendedPartition is None: >+ raise ValueError("Cannot add logical partition %s. " >+ "No extended partition present." % newdev.name) >+ >+ newdev.disk.format.addPartition(newdev.partedPartition) >+ newdev.partedPartition = newdev.disk.format.partedDisk.getPartitionByPath(newdev.path) >+ >+ for device in self._devices: >+ if isinstance(device, PartitionDevice) and \ >+ device.disk == newdev.disk: >+ device.updateName() >+ elif hasattr(newdev, "pool"): >+ pool = newdev.pool >+ if newdev not in pool.lvs: >+ pool._addLogVol(newdev) >+ elif hasattr(newdev, "vg"): >+ vg = newdev.vg >+ if newdev not in vg.lvs: >+ vg._addLogVol(newdev) >+ elif hasattr(newdev, "volume"): >+ volume = newdev.volume >+ if newdev not in volume.subvolumes: >+ volume._addSubVolume(newdev.name) >+ > log.info("added %s %s (id %d) to device tree" % (newdev.type, > newdev.name, > newdev.id)) >@@ -390,7 +422,7 @@ class DeviceTree(object): > self._removeDevice(action.device) > elif action.isDestroy and action.isDevice: > # add the device back into the tree >- self._addDevice(action.device) >+ self._addDevice(action.device, moddisk=True) > > action.cancel() > self._actions.remove(action) >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1075671
:
873620
|
873621
|
873622
|
873623
|
873624
|
873625
|
873626
|
873627
|
873628
|
873629
|
873630
|
873631
|
875628
| 875677 |
875696
|
875697
|
875698
|
875699
|
875700
|
875701