aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-10-18 10:02:14 -0700
committerAnthony Liguori <aliguori@amazon.com>2013-10-18 10:02:14 -0700
commit1da9772d83576cef463b88adb7c390f978ef4ea3 (patch)
tree37bfc90ec167e9d0aaf69f3a6db5b50a5466010a /hw
parent989644915c281ac83f06f65923d716272ede1ed8 (diff)
parentdbbcaa8d4358fdf3c42bf01e9e2d687300e84770 (diff)
Merge remote-tracking branch 'stefanha/block' into staging
# By Fam Zheng (3) and others # Via Stefan Hajnoczi * stefanha/block: vmdk: fix VMFS extent parsing vmdk: Only read cid from image file when opening virtio: Remove unneeded memcpy block/raw-win32: Always use -errno in hdev_open blockdev: fix cdrom read_only flag sd: Avoid access to NULL BlockDriverState hmp: drop bogus "[not inserted]" Message-id: 1382105915-27735-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/virtio-blk.c1
-rw-r--r--hw/sd/sd.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 49a23c33f7..13f6d8276e 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -703,7 +703,6 @@ static int virtio_blk_device_init(VirtIODevice *vdev)
s->bs = blk->conf.bs;
s->conf = &blk->conf;
- memcpy(&(s->blk), blk, sizeof(struct VirtIOBlkConf));
s->rq = NULL;
s->sector_mask = (s->conf->logical_block_size / BDRV_SECTOR_SIZE) - 1;
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 7380f063f7..4502ad143d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -494,7 +494,7 @@ SDState *sd_init(BlockDriverState *bs, bool is_spi)
{
SDState *sd;
- if (bdrv_is_read_only(bs)) {
+ if (bs && bdrv_is_read_only(bs)) {
fprintf(stderr, "sd_init: Cannot use read-only drive\n");
return NULL;
}