From fa879d62eb51253d00b6920ce1d1d9d261370a49 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:07:40 +0200 Subject: block: Attach non-qdev devices as well For now, this just protects against programming errors like having the same drive back multiple non-qdev devices, or untimely bdrv_delete(). Later commits will add other interesting uses. While there, rename BlockDriverState member peer to dev, bdrv_attach() to bdrv_attach_dev(), bdrv_detach() to bdrv_detach_dev(), and bdrv_get_attached() to bdrv_get_attached_dev(). Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- hw/pflash_cfi02.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/pflash_cfi02.c') diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index ac5115e..919cfc4 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -643,6 +643,7 @@ pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off, g_free(pfl); return NULL; } + bdrv_attach_dev_nofail(pfl->bs, pfl); } #if 0 /* XXX: there should be a bit to set up read-only, * the same way the hardware does (with WP pin). -- cgit v1.1