gparted/include/SWRaid.h
Curtis Gedak 1607d13a06 Added auto detection of Linux software RAID devices
Auto detection of Linux software RAID devices was lost in GParted
0.3.8.  This was because device scanning by the libparted device
call ped_device_probe_all() was replaced with custom code within
GParted to scan /proc/partitions for devices.

The reason the libparted call was replaced was due to a long
scanning problem with ped_device_probe_all(), a non-existent
physical floppy device, and a BIOS setting indicating a floppy
drive existed.  See bug #351753:
https://bugzilla.gnome.org/show_bug.cgi?id=351753
2009-11-03 13:30:44 -07:00

56 lines
1.6 KiB
C++

/* Copyright (C) 2009 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* READ THIS!
* This class was created in an effort to reduce the complexity of the
* GParted_Core class.
* This class provides support for Linux software RAID devices (mdadm).
* Static elements are used in order to reduce the disk accesses required to
* load the data structures upon each initialization of the class.
*/
#ifndef SWRAID_H_
#define SWRAID_H_
#include "../include/Utils.h"
#include <vector>
namespace GParted
{
class SWRaid
{
public:
SWRaid() ;
SWRaid( const bool & do_refresh ) ;
~SWRaid() ;
bool is_swraid_supported() ;
void get_devices( std::vector<Glib::ustring> & swraid_devices ) ;
private:
void load_swraid_cache() ;
void set_commands_found() ;
static bool swraid_cache_initialized ;
static bool mdadm_found ;
static std::vector<Glib::ustring> swraid_devices ;
};
}//GParted
#endif /* SWRAID_H_ */