Skip to content

Instantly share code, notes, and snippets.

def is_empty(device_path):
device_info = udev_db.get_device_info(device_path)
# This is probably too simplistic ...
# Check to see if a partition table exists
if 'ID_PART_TABLE_TYPE' in device_info:
return False
# Check if a usage is given, domain includes
Users want to be alerted by a mechanism of their choice when something is wrong with their storage (sms, email, tweet, desktop notification).
Users only want to configure how they want to be notified in one place regardless of the different storage technologies they utilize.
Users want to be able to track over time what device file a physical device has been or is currently associated with. Thus they can tell that errors that were occurring last month for device associated with /dev/sdk are the same errors occurring with device /dev/sdz today.
Users want to be notified that when a physical storage device is experiencing errors which file system(s) are effected.
@tasleson
tasleson / example_targetd.go
Created April 24, 2017 19:42
Example go code to talk to targetd
package main
import "fmt"
import "net/http"
import "log"
import "encoding/json"
import "bytes"
import "io/ioutil"
func main() {
@tasleson
tasleson / udisks_dupes.md
Last active March 28, 2017 17:24
Udisks duplicate code

Individual code duplications, each of which could be done as an individual task.

  • Migrate existing PR to master-libblockdev, this is specific to udiskslinuxpartition.c

Number of tasks = 260, individually listed below

  • Found 31 duplicate lines in the following files:
    • Between lines 454 and 498 in /home/tasleson/projects/udisks/modules/lvm2/udiskslinuxlogicalvolume.c
    • Between lines 820 and 866 in /home/tasleson/projects/udisks/modules/lvm2/udiskslinuxvolumegroup.c
454   g_clear_object (&object);
455   return TRUE;
@tasleson
tasleson / lvm_dbus_vgchange.md
Last active March 30, 2017 13:37
lvm dbus vgchange API

What do we want to add for vgchange to lvm dbus API

Currently we have:

  • Activate
  • Deactivate
  • AllocationPolicySet
  • MaxLvSet
  • MaxPvSet
@tasleson
tasleson / ci_lvm_dbus.md
Last active April 4, 2017 13:49
LVM dbus CI

Travis-ci

  • loop back devices do work
  • Need to specify a "c" project to get it to work
  • When you use C project it uses ubuntu 12.04.5 LTS

Sample project playing around with loop back and getting python3 dbus to work: https://github.com/tasleson/a_posse_ad_esse/pulls

For this to work easily we need dm and lvm userspace to be very current, so I believe we need to look into current fedora/rawhide based.