#!/bin/bash

DEVS=`/bin/ps -ef|grep qemu-system-x86_64|grep -v "grep"|awk -F"uuid=" '{print $2}'|awk '{print $1}'`
POSITION=1
echo "{"
echo " \"data\":["
for DEV in $DEVS
do
    if [ $POSITION -gt 1 ]
    then
        echo ","
    fi
    echo -n " { \"{#INSTANCE_UUID}\": \"$DEV\"}"
    POSITION=$[POSITION+1]
done
echo ""
echo " ]"
echo "}"
