Restrict query to udev device properties in DMRaid::get_udev_dm_name()
Restricting the udev query from all types of device data to only properties slightly simplifies the output from udevadm info which has to be parsed. From this: $ udevadm info --query=all --name=/dev/dm-0 | grep DM_NAME E: DM_NAME=isw_cbaccqjiij_myarray to: $ udevadm info --query=property --name=/dev/dm-0 | grep DM_NAME DM_NAME=isw_cbaccqjiij_myarray
This commit is contained in:
parent
ad97634246
commit
c6ee5d8df5
|
@ -283,9 +283,9 @@ Glib::ustring DMRaid::get_udev_dm_name( const Glib::ustring & dev_path )
|
||||||
//Retrieve DM_NAME of device using udev information
|
//Retrieve DM_NAME of device using udev information
|
||||||
Glib::ustring output;
|
Glib::ustring output;
|
||||||
Glib::ustring error;
|
Glib::ustring error;
|
||||||
Utils::execute_command("udevadm info --query=all --name=" + Glib::shell_quote(dev_path),
|
Utils::execute_command("udevadm info --query=property --name=" + Glib::shell_quote(dev_path),
|
||||||
output, error, true);
|
output, error, true);
|
||||||
dm_name = Utils::regexp_label(output, "^E: DM_NAME=([^\n]*)$");
|
dm_name = Utils::regexp_label(output, "^DM_NAME=([^\n]*)$");
|
||||||
|
|
||||||
return dm_name ;
|
return dm_name ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue