Beispiel #1
0
    def reclampLV(self, oldpe, newpe):
        """ given an old and new pe value, set logical volume sizes accordingly

        newpe - (int) new value of PE, in KB
        """

        pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model())
        availSpaceMB = self.computeVGSize(pvlist, newpe)

        # see if total space is enough
        oldused = 0
        used = 0
        resize = 0
        for lv in self.logvolreqs:
            osize = lv.getActualSize(self.partitions,
                                     self.diskset,
                                     pesize=oldpe)
            oldused = oldused + osize
            nsize = lvm.clampLVSizeRequest(osize, newpe, roundup=1)
            if nsize != osize:
                resize = 1

            used = used + nsize

        if used > availSpaceMB:
            self.intf.messageWindow(_("Not enough space"),
                                    _("The physical extent size cannot be "
                                      "changed because otherwise the space "
                                      "required by the currently defined "
                                      "logical volumes will be increased "
                                      "to more than the available space."),
                                    custom_icon="error")
            return 0

        if resize:
            rc = self.intf.messageWindow(
                _("Confirm Physical Extent Change"),
                _("This change in the value of the "
                  "physical extent will require the "
                  "sizes of the current logical "
                  "volume requests to be rounded "
                  "up in size to an integer multiple "
                  "of the "
                  "physical extent.\n\nThis change "
                  "will take affect immediately."),
                type="custom",
                custom_icon="question",
                custom_buttons=["gtk-cancel", _("C_ontinue")])
            if not rc:
                return 0

        for lv in self.logvolreqs:
            osize = lv.getActualSize(self.partitions,
                                     self.diskset,
                                     pesize=oldpe)
            nsize = lvm.clampLVSizeRequest(osize, newpe, roundup=1)
            lv.setSize(nsize)

        return 1
    def reclampLV(self, oldpe, newpe):
        """ given an old and new pe value, set logical volume sizes accordingly

        newpe - (int) new value of PE, in KB
        """

        pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model())
        availSpaceMB = self.computeVGSize(pvlist, newpe)

	# see if total space is enough
        oldused = 0
        used = 0
	resize = 0
        for lv in self.logvolreqs:
            osize = lv.getActualSize(self.partitions, self.diskset, pesize=oldpe)
            oldused = oldused + osize
            nsize = lvm.clampLVSizeRequest(osize, newpe, roundup=1)
	    if nsize != osize:
		resize = 1
		
            used = used + nsize

        if used > availSpaceMB:
            self.intf.messageWindow(_("Not enough space"),
                                    _("The physical extent size cannot be "
                                      "changed because otherwise the space "
                                      "required by the currently defined "
                                      "logical volumes will be increased "
                                      "to more than the available space."),
				    custom_icon="error")
            return 0

	if resize:
	    rc = self.intf.messageWindow(_("Confirm Physical Extent Change"),
					 _("This change in the value of the "
					   "physical extent will require the "
					   "sizes of the current logical "
					   "volume requests to be rounded "
					   "up in size to an integer multiple "
					   "of the "
					   "physical extent.\n\nThis change "
					   "will take affect immediately."),
					 type="custom", custom_icon="question",
					 custom_buttons=["gtk-cancel", _("C_ontinue")])
	    if not rc:
		return 0
        
        for lv in self.logvolreqs:
            osize = lv.getActualSize(self.partitions, self.diskset, pesize=oldpe)
            nsize = lvm.clampLVSizeRequest(osize, newpe, roundup=1)
            lv.setSize(nsize)

        return 1
 def getActualSize(self, partitions, diskset):
     """Return the actual size allocated for the request in megabytes."""
     if self.percent:
         vgreq = partitions.getRequestByID(self.volumeGroup)
         vgsize = vgreq.getActualSize(partitions, diskset)
         lvsize = int(self.percent * 0.01 * vgsize)
         lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize)
         return lvsize
     else:
         return self.size
Beispiel #4
0
    def getActualSize(self, partitions, diskset, pesize=None):
        """Return the actual size allocated for the request in megabytes."""
        retval = 0
        vgreq = partitions.getRequestByID(self.volumeGroup)

        if not pesize:
            pesize = vgreq.pesize

        if self.percent:
            vgsize = vgreq.getActualSize(partitions, diskset)
            lvsize = int(self.percent * 0.01 * vgsize)
            #lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize)
            retval = lvsize
        else:
            retval = self.size

        # lvm tools round up lvolums using the volume group pv size.
        # If the logical volume is preexisting do NOT touch it.
        if not self.preexist:
            retval = lvm.clampLVSizeRequest(retval, pesize)

        return retval
    def getActualSize(self, partitions, diskset, pesize=None):
        """Return the actual size allocated for the request in megabytes."""
        retval = 0
        vgreq = partitions.getRequestByID(self.volumeGroup)

        if not pesize:
            pesize = vgreq.pesize

        if self.percent:
	    vgsize = vgreq.getActualSize(partitions, diskset)
	    lvsize = int(self.percent * 0.01 * vgsize)
	    #lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize)
            retval = lvsize
        else:
            retval = self.size

        # lvm tools round up lvolums using the volume group pv size.
        # If the logical volume is preexisting do NOT touch it.
        if not self.preexist:
            retval = lvm.clampLVSizeRequest(retval, pesize)

        return retval
Beispiel #6
0
    def editLogicalVolume(self, logrequest, isNew=0):
        if isNew:
            tstr = _("Make Logical Volume")
        else:
            try:
                tstr = _("Edit Logical Volume: %s") % (
                    logrequest.logicalVolumeName, )
            except:
                tstr = _("Edit Logical Volume")

        dialog = gtk.Dialog(tstr, self.parent)
        gui.addFrame(dialog)
        dialog.add_button('gtk-cancel', 2)
        dialog.add_button('gtk-ok', 1)
        dialog.set_position(gtk.WIN_POS_CENTER)

        maintable = gtk.Table()
        maintable.set_row_spacings(5)
        maintable.set_col_spacings(5)
        row = 0

        lbl = createAlignedLabel(_("_Mount Point:"))
        maintable.attach(lbl, 0, 1, row, row + 1)
        mountCombo = createMountPointCombo(logrequest,
                                           excludeMountPoints=["/boot"])
        lbl.set_mnemonic_widget(mountCombo.entry)
        maintable.attach(mountCombo, 1, 2, row, row + 1)
        row = row + 1

        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_File System Type:"))
            maintable.attach(lbl, 0, 1, row, row + 1)
            (newfstype,
             newfstypeMenu) = createFSTypeMenu(logrequest.fstype,
                                               fstypechangeCB,
                                               mountCombo,
                                               ignorefs=[
                                                   "software RAID",
                                                   "physical volume (LVM)",
                                                   "vfat", "PPC PReP Boot"
                                               ])
            lbl.set_mnemonic_widget(newfstype)
        else:
            maintable.attach(
                createAlignedLabel(_("Original File System Type:")), 0, 1, row,
                row + 1)
            if logrequest.origfstype and logrequest.origfstype.getName():
                newfstype = gtk.Label(logrequest.origfstype.getName())
            else:
                newfstype = gtk.Label(_("Unknown"))
        maintable.attach(newfstype, 1, 2, row, row + 1)
        row = row + 1

        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_Logical Volume Name:"))
            lvnameEntry = gtk.Entry(16)
            lbl.set_mnemonic_widget(lvnameEntry)
            if logrequest and logrequest.logicalVolumeName:
                lvnameEntry.set_text(logrequest.logicalVolumeName)
            else:
                lvnameEntry.set_text(lvm.createSuggestedLVName(
                    self.logvolreqs))
        else:
            lbl = createAlignedLabel(_("Logical Volume Name:"))
            lvnameEntry = gtk.Label(logrequest.logicalVolumeName)

        maintable.attach(lbl, 0, 1, row, row + 1)
        maintable.attach(lvnameEntry, 1, 2, row, row + 1)
        row = row + 1

        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_Size (MB):"))
            sizeEntry = gtk.Entry(16)
            lbl.set_mnemonic_widget(sizeEntry)
            if logrequest:
                sizeEntry.set_text("%g" % (logrequest.getActualSize(
                    self.partitions, self.diskset), ))
        else:
            lbl = createAlignedLabel(_("Size (MB):"))
            sizeEntry = gtk.Label(str(logrequest.size))

        maintable.attach(lbl, 0, 1, row, row + 1)
        maintable.attach(sizeEntry, 1, 2, row, row + 1)
        row = row + 1

        if not logrequest or not logrequest.getPreExisting():
            pesize = self.peOptionMenu.get_active().get_data("value")
            (tspace, uspace, fspace) = self.computeSpaceValues(usepe=pesize)
            maxlv = min(lvm.getMaxLVSize(pesize), fspace)

            # add in size of current logical volume if it has a size
            if logrequest and not isNew:
                maxlv = maxlv + logrequest.getActualSize(
                    self.partitions, self.diskset)
            maxlabel = createAlignedLabel(_("(Max size is %s MB)") % (maxlv, ))
            maintable.attach(maxlabel, 1, 2, row, row + 1)

        self.fsoptionsDict = {}
        if logrequest.getPreExisting():
            (row, self.fsoptionsDict) = createPreExistFSOptionSection(
                logrequest,
                maintable,
                row,
                mountCombo,
                showbadblocks=0,
                ignorefs=["software RAID", "physical volume (LVM)", "vfat"])

        dialog.vbox.pack_start(maintable)
        dialog.show_all()

        while 1:
            rc = dialog.run()
            if rc == 2:
                dialog.destroy()
                return

            if not logrequest or not logrequest.getPreExisting():
                fsystem = newfstypeMenu.get_active().get_data("type")
                format = 1
                migrate = 0
            else:
                if self.fsoptionsDict.has_key("formatrb"):
                    formatrb = self.fsoptionsDict["formatrb"]
                else:
                    formatrb = None

                if formatrb:
                    format = formatrb.get_active()
                    if format:
                        fsystem = self.fsoptionsDict["fstypeMenu"].get_active(
                        ).get_data("type")
                else:
                    format = 0

                if self.fsoptionsDict.has_key("migraterb"):
                    migraterb = self.fsoptionsDict["migraterb"]
                else:
                    migraterb = None

                if migraterb:
                    migrate = migraterb.get_active()
                    if migrate:
                        fsystem = self.fsoptionsDict[
                            "migfstypeMenu"].get_active().get_data("type")
                else:
                    migrate = 0

    # set back if we are not formatting or migrating
                origfstype = logrequest.origfstype
                if not format and not migrate:
                    fsystem = origfstype

            mntpt = string.strip(mountCombo.entry.get_text())

            if not logrequest or not logrequest.getPreExisting():
                # check size specification
                badsize = 0
                try:
                    size = long(sizeEntry.get_text())
                except:
                    badsize = 1

                if badsize or size <= 0:
                    self.intf.messageWindow(
                        _("Illegal size"),
                        _("The requested size as entered is "
                          "not a valid number greater "
                          "than 0."),
                        custom_icon="error")
                    continue
            else:
                size = logrequest.size

            # is this an existing logical volume or one we're editting
            if logrequest:
                preexist = logrequest.getPreExisting()
            else:
                preexist = 0

            # test mount point
            # check in pending logical volume requests
            # these may not have been put in master list of requests
            # yet if we have not hit 'OK' for the volume group creation
            if fsystem.isMountable():
                used = 0
                if logrequest:
                    curmntpt = logrequest.mountpoint
                else:
                    curmntpt = None

                for lv in self.logvolreqs:
                    if curmntpt and lv.mountpoint == curmntpt:
                        continue

                    if lv.mountpoint == mntpt:
                        used = 1
                        break

                if used:
                    self.intf.messageWindow(_("Mount point in use"),
                                            _("The mount point \"%s\" is in "
                                              "use, please pick another.") %
                                            (mntpt, ),
                                            custom_icon="error")
                    continue

            # check out logical volumne name
            lvname = string.strip(lvnameEntry.get_text())

            if not logrequest or not logrequest.getPreExisting():
                err = sanityCheckLogicalVolumeName(lvname)
                if err:
                    self.intf.messageWindow(_("Illegal Logical Volume Name"),
                                            err,
                                            custom_icon="error")
                    continue

            # is it in use?
            used = 0
            if logrequest:
                origlvname = logrequest.logicalVolumeName
            else:
                origlvname = None

            for lv in self.logvolreqs:
                if origlvname and lv.logicalVolumeName == origlvname:
                    continue

                if lv.logicalVolumeName == lvname:
                    used = 1
                    break

            if used:
                self.intf.messageWindow(_("Illegal logical volume name"),
                                        _("The logical volume name \"%s\" is "
                                          "already in use. Please pick "
                                          "another.") % (lvname, ),
                                        custom_icon="error")
                continue

            # create potential request
            request = copy.copy(logrequest)
            pesize = self.peOptionMenu.get_active().get_data("value")
            size = lvm.clampLVSizeRequest(size, pesize, roundup=1)

            # do some final tests
            maxlv = lvm.getMaxLVSize(pesize)
            if size > maxlv:
                self.intf.messageWindow(_("Not enough space"),
                                        _("The current requested size "
                                          "(%10.2f MB) is larger than maximum "
                                          "logical volume size (%10.2f MB). "
                                          "To increase this limit you can "
                                          "increase the Physical Extent size "
                                          "for this Volume Group."),
                                        custom_icon="error")
                continue

            request.fstype = fsystem

            if request.fstype.isMountable():
                request.mountpoint = mntpt
            else:
                request.mountpoint = None

            request.preexist = preexist
            request.logicalVolumeName = lvname
            request.size = size
            request.format = format
            request.migrate = migrate
            request.badblock = None

            # this is needed to clear out any cached info about the device
            # only a workaround - need to change way this is handled in
            # partRequest.py really.
            request.dev = None

            # make list of original logvol requests so we can skip them
            # in tests below. We check for mount point name conflicts
            # above within the current volume group, so it is not
            # necessary to do now.
            err = request.sanityCheckRequest(self.partitions,
                                             skipMntPtExistCheck=1)
            if err is None:
                skiplist = []
                for lv in self.origvolreqs:
                    skiplist.append(lv.uniqueID)

                err = request.isMountPointInUse(self.partitions,
                                                requestSkipList=skiplist)

            if err:
                self.intf.messageWindow(_("Error With Request"),
                                        "%s" % (err),
                                        custom_icon="error")
                continue

            if (not request.format and request.mountpoint
                    and request.formatByDefault()):
                if not queryNoFormatPreExisting(self.intf):
                    continue

            # see if there is room for request
            (availSpaceMB, neededSpaceMB,
             fspace) = self.computeSpaceValues(usepe=pesize)

            tmplogreqs = []
            for l in self.logvolreqs:
                if origlvname and l.logicalVolumeName == origlvname:
                    continue

                tmplogreqs.append(l)

            tmplogreqs.append(request)
            neededSpaceMB = self.computeLVSpaceNeeded(tmplogreqs)

            if neededSpaceMB > availSpaceMB:
                self.intf.messageWindow(
                    _("Not enough space"),
                    _("The logical volumes you have "
                      "configured require %g MB, but the "
                      "volume group only has %g MB.  Please "
                      "either make the volume group larger "
                      "or make the logical volume(s) smaller.") %
                    (neededSpaceMB, availSpaceMB),
                    custom_icon="error")
                del tmplogreqs
                continue

            # everything ok
            break

        # now remove the previous request, insert request created above
        if not isNew:
            self.logvolreqs.remove(logrequest)
            iter = self.getCurrentLogicalVolume()
            self.logvolstore.remove(iter)

        self.logvolreqs.append(request)

        iter = self.logvolstore.append()
        self.logvolstore.set_value(iter, 0, lvname)
        if request.fstype and request.fstype.isMountable():
            self.logvolstore.set_value(iter, 1, mntpt)
        else:
            self.logvolstore.set_value(iter, 1, "N/A")

        self.logvolstore.set_value(iter, 2, "%g" % (size, ))

        self.updateVGSpaceLabels()
        dialog.destroy()
    def editLogicalVolume(self, logrequest, isNew = 0):
	if isNew:
	    tstr = _("Make Logical Volume")
	else:
	    try:
		tstr = _("Edit Logical Volume: %s") % (logrequest.logicalVolumeName,)
	    except:
		tstr = _("Edit Logical Volume")
	    
        dialog = gtk.Dialog(tstr, self.parent)
        gui.addFrame(dialog)
        dialog.add_button('gtk-cancel', 2)
        dialog.add_button('gtk-ok', 1)
        dialog.set_position(gtk.WIN_POS_CENTER)

        maintable = gtk.Table()
        maintable.set_row_spacings(5)
        maintable.set_col_spacings(5)
        row = 0

        lbl = createAlignedLabel(_("_Mount Point:"))
	maintable.attach(lbl, 0, 1, row,row+1)
        mountCombo = createMountPointCombo(logrequest, excludeMountPoints=["/boot"])
        lbl.set_mnemonic_widget(mountCombo)
        maintable.attach(mountCombo, 1, 2, row, row + 1)
        row += 1

        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_File System Type:"))
            maintable.attach(lbl, 0, 1, row, row + 1)
            newfstypeCombo = createFSTypeMenu(logrequest.fstype,
                                              fstypechangeCB,
                                              mountCombo,
                                              ignorefs = ["software RAID", "physical volume (LVM)", "vfat", "PPC PReP Boot", "Apple Bootstrap"])
            lbl.set_mnemonic_widget(newfstypeCombo)
            maintable.attach(newfstypeCombo, 1, 2, row, row + 1)
            row += 1
        else:
            maintable.attach(createAlignedLabel(_("Original File System Type:")),
                             0, 1, row, row + 1)
            if logrequest.origfstype and logrequest.origfstype.getName():
                newfstypeCombo = gtk.Label(logrequest.origfstype.getName())
            else:
                newfstypeCombo = gtk.Label(_("Unknown"))

            maintable.attach(newfstypeCombo, 1, 2, row, row + 1)
            row += 1

            if logrequest.fslabel:
                maintable.attach(createAlignedLabel(_("Original File System "
                                                      "Label:")),
                                 0, 1, row, row + 1)
                maintable.attach(gtk.Label(logrequest.fslabel), 1, 2, row,
                                 row + 1)
                row += 1


        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_Logical Volume Name:"))
            lvnameEntry = gtk.Entry(32)
            lbl.set_mnemonic_widget(lvnameEntry)
            if logrequest and logrequest.logicalVolumeName:
                lvnameEntry.set_text(logrequest.logicalVolumeName)
            else:
                lvnameEntry.set_text(lvm.createSuggestedLVName(self.logvolreqs))
        else:
            lbl = createAlignedLabel(_("Logical Volume Name:"))
            lvnameEntry = gtk.Label(logrequest.logicalVolumeName)
            
        maintable.attach(lbl, 0, 1, row, row + 1)
        maintable.attach(lvnameEntry, 1, 2, row, row + 1)
        row += 1

        if not logrequest or not logrequest.getPreExisting():
            lbl = createAlignedLabel(_("_Size (MB):"))
            sizeEntry = gtk.Entry(16)
            lbl.set_mnemonic_widget(sizeEntry)
            if logrequest:
                pesize = int(self.peCombo.get_active_value())
                sizeEntry.set_text("%Ld" % (logrequest.getActualSize(self.partitions, self.diskset, pesize=pesize),))
        else:
            lbl = createAlignedLabel(_("Size (MB):"))
            sizeEntry = gtk.Label(str(logrequest.size))
            
        maintable.attach(lbl, 0, 1, row, row+1)
        maintable.attach(sizeEntry, 1, 2, row, row + 1)
        row += 1

        if not logrequest or not logrequest.getPreExisting():
            pesize = int(self.peCombo.get_active_value())
            (tspace, uspace, fspace) = self.computeSpaceValues(usepe=pesize)
            maxlv = min(lvm.getMaxLVSize(pesize), fspace)

            # add in size of current logical volume if it has a size
            if logrequest and not isNew:
                maxlv = maxlv + logrequest.getActualSize(self.partitions, self.diskset, pesize=pesize)
            maxlabel = createAlignedLabel(_("(Max size is %s MB)") % (maxlv,))
            maintable.attach(maxlabel, 1, 2, row, row + 1)

	self.fsoptionsDict = {}
	if logrequest.getPreExisting():
	    (row, self.fsoptionsDict) = createPreExistFSOptionSection(logrequest, maintable, row, mountCombo, showbadblocks=0, ignorefs = ["software RAID", "physical volume (LVM)", "vfat"])

        # checkbutton for encryption using dm-crypt/LUKS
        if not logrequest.getPreExisting():
            self.lukscb = gtk.CheckButton(_("_Encrypt"))
            if logrequest.format or logrequest.type == REQUEST_NEW:
                self.lukscb.set_data("formatstate", 1)
            else:
                self.lukscb.set_data("formatstate", 0)

            if logrequest.encryption:
                self.lukscb.set_active(1)
            else:
                self.lukscb.set_active(0)
            maintable.attach(self.lukscb, 0, 2, row, row + 1)
            row = row + 1
        else:
            self.lukscb = self.fsoptionsDict.get("lukscb")

        dialog.vbox.pack_start(maintable)
        dialog.show_all()

	while 1:
	    rc = dialog.run()
	    if rc == 2:
		dialog.destroy()
		return

            if not logrequest or not logrequest.getPreExisting():
                fsystem = newfstypeCombo.get_active_value()
                format = 1
                migrate = 0
            else:
		if self.fsoptionsDict.has_key("formatrb"):
		    formatrb = self.fsoptionsDict["formatrb"]
		else:
		    formatrb = None

		if formatrb:
                    format = formatrb.get_active()
                    if format:
                        fsystem = self.fsoptionsDict["fstypeCombo"].get_active_value()
                else:
                    format = 0

		if self.fsoptionsDict.has_key("migraterb"):
		    migraterb = self.fsoptionsDict["migraterb"]
		else:
		    migraterb = None
		    
		if migraterb:
                    migrate = migraterb.get_active()
                    if migrate:
                        fsystem = self.fsoptionsDict["migfstypeCombo"].get_active_value()
                else:
                    migrate = 0

                # set back if we are not formatting or migrating
		origfstype = logrequest.origfstype
                if not format and not migrate:
                    fsystem = origfstype

            mntpt = string.strip(mountCombo.get_children()[0].get_text())

            if not logrequest or not logrequest.getPreExisting():
                # check size specification
                badsize = 0
                try:
                    size = long(sizeEntry.get_text())
                except:
                    badsize = 1

                if badsize or size <= 0:
                    self.intf.messageWindow(_("Illegal size"),
                                            _("The requested size as entered is "
                                              "not a valid number greater "
                                              "than 0."), custom_icon="error")
                    continue
            else:
                size = logrequest.size

	    # is this an existing logical volume or one we're editting
            if logrequest:
                preexist = logrequest.getPreExisting()
            else:
                preexist = 0

	    # test mount point
            # check in pending logical volume requests
	    # these may not have been put in master list of requests
	    # yet if we have not hit 'OK' for the volume group creation
	    if fsystem.isMountable():
		used = 0
		if logrequest:
		    curmntpt = logrequest.mountpoint
		else:
		    curmntpt = None
		    
		for lv in self.logvolreqs:
		    if curmntpt and lv.mountpoint == curmntpt:
			continue

		    if lv.mountpoint == mntpt:
			used = 1
			break

		if used:
		    self.intf.messageWindow(_("Mount point in use"),
					    _("The mount point \"%s\" is in "
					      "use, please pick another.") %
					    (mntpt,), custom_icon="error")
		    continue

	    # check out logical volumne name
	    lvname = string.strip(lvnameEntry.get_text())

            if not logrequest or not logrequest.getPreExisting():
                err = sanityCheckLogicalVolumeName(lvname)
                if err:
                    self.intf.messageWindow(_("Illegal Logical Volume Name"),err, custom_icon="error")
                    continue

	    # is it in use?
	    used = 0
	    if logrequest:
		origlvname = logrequest.logicalVolumeName
	    else:
		origlvname = None

	    for lv in self.logvolreqs:
		if origlvname and lv.logicalVolumeName == origlvname:
		    continue

		if lv.logicalVolumeName == lvname:
		    used = 1
		    break

	    if used:
		self.intf.messageWindow(_("Illegal logical volume name"),
					_("The logical volume name \"%s\" is "
					  "already in use. Please pick "
					  "another.") % (lvname,), custom_icon="error")
		continue

	    # create potential request
	    request = copy.copy(logrequest)
            request.encryption = copy.deepcopy(logrequest.encryption)
	    pesize = int(self.peCombo.get_active_value())
	    size = lvm.clampLVSizeRequest(size, pesize, roundup=1)

	    # do some final tests
	    maxlv = lvm.getMaxLVSize(pesize)
	    if size > maxlv:
		self.intf.messageWindow(_("Not enough space"),
					_("The current requested size "
					  "(%10.2f MB) is larger than maximum "
					  "logical volume size (%10.2f MB). "
					  "To increase this limit you can "
					  "create more Physical Volumes from "
                                          "unpartitioned disk space and "
                                          "add them to this Volume Group.")
					  %(size, maxlv),
                                        custom_icon="error")
		continue

 	    request.fstype = fsystem

 	    if request.fstype.isMountable():
 		request.mountpoint = mntpt
 	    else:
 		request.mountpoint = None

            request.preexist = preexist
	    request.logicalVolumeName = lvname
	    request.size = size
            request.format = format
            request.migrate = migrate
	    request.badblock = None
            request.grow = 0

	    # this is needed to clear out any cached info about the device
	    # only a workaround - need to change way this is handled in
	    # partRequest.py really.
	    request.dev = None
	    
            if self.lukscb and self.lukscb.get_active():
                if not request.encryption:
                    request.encryption = LUKSDevice(passphrase=self.partitions.encryptionPassphrase, format=1)
            else:
                request.encryption = None

	    # make list of original logvol requests so we can skip them
	    # in tests below. We check for mount point name conflicts
	    # above within the current volume group, so it is not
	    # necessary to do now.
 	    err = request.sanityCheckRequest(self.partitions, skipMntPtExistCheck=1, pesize=pesize)
	    if err is None:
		skiplist = []
		for lv in self.origvolreqs:
		    skiplist.append(lv.uniqueID)
		    
		err = request.isMountPointInUse(self.partitions, requestSkipList=skiplist)

 	    if err:
 		self.intf.messageWindow(_("Error With Request"),
 					"%s" % (err), custom_icon="error")
 		continue

	    if (not request.format and
		request.mountpoint and request.formatByDefault()):
		if not queryNoFormatPreExisting(self.intf):
		    continue

	    # see if there is room for request
	    (availSpaceMB, neededSpaceMB, fspace) = self.computeSpaceValues(usepe=pesize)

	    tmplogreqs = []
	    for l in self.logvolreqs:
		if origlvname and l.logicalVolumeName == origlvname:
		    continue
		
		tmplogreqs.append(l)

	    tmplogreqs.append(request)
	    neededSpaceMB = self.computeLVSpaceNeeded(tmplogreqs, pesize)

	    if neededSpaceMB > availSpaceMB:
		self.intf.messageWindow(_("Not enough space"),
					_("The logical volumes you have "
					  "configured require %g MB, but the "
					  "volume group only has %g MB.  Please "
					  "either make the volume group larger "
					  "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error")
		del tmplogreqs
		continue

	    # everything ok
	    break

	# now remove the previous request, insert request created above
	if not isNew:
	    self.logvolreqs.remove(logrequest)
	    iter = self.getCurrentLogicalVolume()
	    self.logvolstore.remove(iter)
	    
        self.logvolreqs.append(request)

	iter = self.logvolstore.append()
	self.logvolstore.set_value(iter, 0, lvname)
	if request.fstype and request.fstype.isMountable():
	    self.logvolstore.set_value(iter, 1, mntpt)
	else:
	    self.logvolstore.set_value(iter, 1, "N/A")
	    
	self.logvolstore.set_value(iter, 2, "%Ld" % (size,))

	self.updateVGSpaceLabels()
        dialog.destroy()