resize_disk2.patch

Anton Todorov, 06/07/2017 08:49 PM

Download (1.68 KB)

View differences:

src/mad/sh/scripts_common.sh
626 626
# The variables set are as follows:
627 627
#
628 628
# * VMID
629
# * DISK_TARGET_PATH
629 630
# * DRIVER
630 631
# * TYPE
631 632
# * READONLY
......
669 670
    while IFS= read -r -d '' element; do
670 671
        XPATH_ELEMENTS[i++]="$element"
671 672
    done < <($CMD       /VMM_DRIVER_ACTION_DATA/VM/ID \
673
                        /VMM_DRIVER_ACTION_DATA/DISK_TARGET_PATH \
672 674
                        $DISK_XPATH/DRIVER \
673 675
                        $DISK_XPATH/TYPE \
674 676
                        $DISK_XPATH/READONLY \
......
690 692
                        $DISK_XPATH/TARGET)
691 693

  
692 694
    VMID="${XPATH_ELEMENTS[j++]}"
695
    DISK_TARGET_PATH="${XPATH_ELEMENTS[j++]}"
693 696
    DRIVER="${XPATH_ELEMENTS[j++]:-$DEFAULT_TYPE}"
694 697
    TYPE="${XPATH_ELEMENTS[j++]}"
695 698
    READONLY="${XPATH_ELEMENTS[j++]}"
src/vmm_mad/remotes/kvm/resize_disk
43 43

  
44 44
log_info "Resizing $DISK_TARGET to $DISK_SIZE"
45 45

  
46
virsh --connect $LIBVIRT_URI qemu-monitor-command $DOMAIN --hmp "block_resize $drive ${DISK_SIZE}M"
47

  
46
if [ -n "$USE_VIRSH_BLOCKRESIZE" ]; then
47
    virsh --connect $LIBVIRT_URI blockresize "$DOMAIN" --path "$DISK_TARGET_PATH" --size "${DISK_SIZE}M"
48
else
49
    virsh --connect $LIBVIRT_URI qemu-monitor-command $DOMAIN --hmp "block_resize $drive ${DISK_SIZE}M"
50
fi
48 51
) > /dev/null
49 52

  
50 53
if [ $? -ne 0 ]; then