)]}'
{
  "commit": "893a8f6220368a9ebff9a74bd48359928545cf6a",
  "tree": "7ef438d1504126ea408d9c29c84ac51224210405",
  "parents": [
    "0d51b4debee6fb322751a57097a1d675c7a7c38d"
  ],
  "author": {
    "name": "MORITA Kazutaka",
    "email": "morita.kazutaka@lab.ntt.co.jp",
    "time": "Tue Aug 06 09:53:40 2013 +0800"
  },
  "committer": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@redhat.com",
    "time": "Thu Aug 22 14:14:56 2013 +0200"
  },
  "message": "block: Produce zeros when protocols reading beyond end of file\n\nWhile Asias is debugging an issue creating qcow2 images on top of\nnon-file protocols.  It boils down to this example using NBD:\n\n$ qemu-io -c \u0027open -g nbd+unix:///?socket\u003d/tmp/nbd.sock\u0027 -c \u0027read -v 0 512\u0027\n\nNotice the open -g option to set bs-\u003egrowable.  This means you can\nread/write beyond end of file.  Reading beyond end of file is supposed\nto produce zeroes.\n\nWe rely on this behavior in qcow2_create2() during qcow2 image\ncreation.  We create a new file and then write the qcow2 header\nstructure using bdrv_pwrite().  Since QCowHeader is not a multiple of\nsector size, block.c first uses bdrv_read() on the empty file to fetch\nthe first sector (should be all zeroes).\n\nHere is the output from the qemu-io NBD example above:\n\n$ qemu-io -c \u0027open -g nbd+unix:///?socket\u003d/tmp/nbd.sock\u0027 -c \u0027read -v 0 512\u0027\n00000000:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................\n00000010:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................\n00000020:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................\n...\n\nWe are not zeroing the buffer!  As a result qcow2 image creation on top\nof protocols is not guaranteed to work even when file creation is\nsupported by the protocol.\n\n[Adapted this patch to use bs-\u003ezero_beyond_eof.\n-- Stefan]\n\nSigned-off-by: MORITA Kazutaka \u003cmorita.kazutaka@lab.ntt.co.jp\u003e\nSigned-off-by: Asias He \u003casias@redhat.com\u003e\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e655052c8b534ce29efb25de08b956e8ad0d9de4",
      "old_mode": 33188,
      "old_path": "block.c",
      "new_id": "1615d89f0adc148d711a473c5dccf5252952d097",
      "new_mode": 33188,
      "new_path": "block.c"
    }
  ]
}
