[sheepdog] Call to sd_truncate()

Liu Yuan namei.unix at gmail.com
Fri Dec 13 17:20:00 CET 2013


On Sat, Dec 14, 2013 at 12:10:37AM +0800, Liu Yuan wrote:
> On Fri, Dec 13, 2013 at 05:01:42PM +0100, Hadrien KOHL wrote:
> > Here we go:
> > 
> > # qemu-img create -f qcow2 sheepdog:test 10G
> > Formatting 'sheepdog:test', fmt=qcow2 size=10737418240 encryption=off
> > cluster_size=65536 lazy_refcounts=off
> > 
> > # qemu-system-x86_64 -machine accel=kvm:tcg -drive
> > file=sheepdog:127.0.0.1:7000:test,if=none,id=virtio-disk0,format=qcow2,cache=writeback
> > -cdrom /vm/iso/install-amd64-minimal-20131010.iso -device
> > virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=virtio-disk0,id=virtio-disk0,bootindex=1
> > -boot cd -m 1024 -name test -vnc 172.16.0.11:0 -bios
> > /usr/local/share/qemu/bios.bin
> > 65798144, 73555968
> > qemu-system-x86_64: shrinking is not supported
> > 371130368, 379322368
> > qemu-system-x86_64: shrinking is not supported
> > 455671808, 472121344
> > qemu-system-x86_64: shrinking is not supported
> > 666042368, 674234368
> > qemu-system-x86_64: shrinking is not supported
> > 776339456, 791805952
> > qemu-system-x86_64: shrinking is not supported
> > 796459008, 796471296
> > qemu-system-x86_64: shrinking is not supported
> 
> Can you try following patch
> 
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index b4ae50f..9fb3c78 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -1774,6 +1774,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset)
>      unsigned int datalen;
>  
>      if (offset < s->inode.vdi_size) {
> +        printf("%ld, %ld, %lld\n", offset, s->inode.vdi_size, bs->total_sectors * BDRV_SECTOR_SIZE);
>          error_report("shrinking is not supported");
>          return -EINVAL;
>      } else if (offset > SD_MAX_VDI_SIZE) {
> @@ -1783,6 +1784,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset)
>  
>      fd = connect_to_sdog(s);
>      if (fd < 0) {
> +        error_report("failed to connected to sheep");
>          return fd;
>      }
> 

I finally reproduced the same error with centos6.3 guest. I'll look at this issue.

Thanks
Yuan



More information about the sheepdog mailing list