You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/10/05 01:20:48 UTC

[GitHub] rhtyd commented on a change in pull request #2878: Fixed Issue 2868, libvirt resize notify failure

rhtyd commented on a change in pull request #2878: Fixed Issue 2868, libvirt resize notify failure
URL: https://github.com/apache/cloudstack/pull/2878#discussion_r222870615
 
 

 ##########
 File path: scripts/storage/qcow2/resizevolume.sh
 ##########
 @@ -92,7 +92,8 @@ notifyqemu() {
     if `virsh domstate $vmname >/dev/null 2>&1`
     then
       sizeinkb=$(($newsize/1024))
-      virsh blockresize --domain $vmname --path $path --size $sizeinkb >/dev/null 2>&1
+      devicepath=$(virsh domblklist $vmname|grep $path|tr -s ' ' | cut -d' ' -f1)
 
 Review comment:
   @kiwiflyer Instead of tr and cut, can you improve string processing (maybe use more predictable sed/awk like simply do this `grep $path | awk '{print $1}'`  if you only want the target device, like vda, vdb etc.)? I'm concerned if different versions of libvirt or different distributions may give a different kind of output.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services