search for: device_sys

Displaying 4 results from an estimated 4 matches for "device_sys".

Did you mean: device_ops
2010 Mar 10
0
[PATCH node] Improve performance of multipath translations
...g-storage @@ -38,13 +38,12 @@ swap_min_size=5 get_sd_name() { local id=$1 local device_var=$2 - for device in $(ls /sys/block) - do - if [[ $id = $(cat /sys/block/$device/dev) ]]; then - eval $device_var=$device - return - fi - done + local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) + + if [ -n "$device_sys" ]; then + eval $device_var=$(basename $(dirname $device_sys)) + return + fi eval $device_var=1 } @@ -83,10 +82,17 @@ translate_multipath_device() { local dev=$1 local...
2010 Mar 17
1
[PATCH][node REPOST] Improve performance of multipath translations
...g-storage @@ -38,13 +38,12 @@ swap_min_size=5 get_sd_name() { local id=$1 local device_var=$2 - for device in $(ls /sys/block) - do - if [[ $id = $(cat /sys/block/$device/dev) ]]; then - eval $device_var=$device - return - fi - done + local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) + + if [ -n "$device_sys" ]; then + eval $device_var=$(basename $(dirname $device_sys)) + return + fi eval $device_var=1 } @@ -83,10 +82,23 @@ translate_multipath_device() { local dev=$1 local...
2010 Mar 31
1
[PATCH node] Handle space in storage wwid
...fee10e 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -36,12 +36,12 @@ swap_min_size=5 # return sd name for given #:# identifier get_sd_name() { - local id=$1 - local device_var=$2 + local id="$1" + local device_var="$2" local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) if [ -n "$device_sys" ]; then - eval $device_var=$(basename $(dirname $device_sys)) + eval $device_var=$(basename $(dirname "$device_sys")) return fi eval $device_var=1 @@ -49,23 +...
2010 Oct 22
0
[PATCH node] First draft of replacing some of the ovirt-config-* scripts with python equivalents.
...QEMU HARDDISK drive-scsi0-0-0p1 + os.system("partprobe ||:") + # partprobe fails on cdrom: + # Error: Invalid partition table - recursive partition on /dev/sr0. + else: + os.system("blockdev --rereadpt %s") % drive + + +def get_sd_name(id): + device_sys_cmd = "grep -H \"^%s$\" /sys/block/*/dev | cut -d: -f1" % id + device_sys = subprocess.Popen(device_sys_cmd, shell=True, stdout=PIPE, stderr=STDOUT) + device_sys_output = device_sys.stdout.read().strip() + if not device_sys_output is "": + device = os.p...