[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/28] block: Code motion to get rid of stubs/blockde
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 09/28] block: Code motion to get rid of stubs/blockdev.c |
Date: |
Mon, 20 Oct 2014 15:35:35 +0200 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: BenoƮt Canet <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/block-backend.c | 13 +++++++++++++
blockdev.c | 11 -----------
include/sysemu/blockdev.h | 1 -
stubs/Makefile.objs | 1 -
stubs/blockdev.c | 12 ------------
5 files changed, 13 insertions(+), 25 deletions(-)
delete mode 100644 stubs/blockdev.c
diff --git a/block/block-backend.c b/block/block-backend.c
index edaf73c..d4bdd48 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -22,6 +22,8 @@ struct BlockBackend {
QTAILQ_ENTRY(BlockBackend) link; /* for blk_backends */
};
+static void drive_info_del(DriveInfo *dinfo);
+
/* All the BlockBackends (except for hidden ones) */
static QTAILQ_HEAD(, BlockBackend) blk_backends =
QTAILQ_HEAD_INITIALIZER(blk_backends);
@@ -93,6 +95,17 @@ static void blk_delete(BlockBackend *blk)
g_free(blk);
}
+static void drive_info_del(DriveInfo *dinfo)
+{
+ if (!dinfo) {
+ return;
+ }
+ qemu_opts_del(dinfo->opts);
+ g_free(dinfo->id);
+ g_free(dinfo->serial);
+ g_free(dinfo);
+}
+
/*
* Increment @blk's reference count.
* @blk must not be null.
diff --git a/blockdev.c b/blockdev.c
index 24d40f9..a00461d 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -284,17 +284,6 @@ void drive_del(DriveInfo *dinfo)
blk_unref(blk);
}
-void drive_info_del(DriveInfo *dinfo)
-{
- if (!dinfo) {
- return;
- }
- qemu_opts_del(dinfo->opts);
- g_free(dinfo->id);
- g_free(dinfo->serial);
- g_free(dinfo);
-}
-
typedef struct {
QEMUBH *bh;
BlockDriverState *bs;
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index c814a90..ccd4bf4 100644
--- a/include/sysemu/blockdev.h
+++ b/include/sysemu/blockdev.h
@@ -65,7 +65,6 @@ QemuOpts *drive_add(BlockInterfaceType type, int index, const
char *file,
const char *optstr);
DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type);
void drive_del(DriveInfo *dinfo);
-void drive_info_del(DriveInfo *dinfo);
/* device-hotplug */
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index c0b1f6a..5e347d0 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -1,6 +1,5 @@
stub-obj-y += arch-query-cpu-def.o
stub-obj-y += bdrv-commit-all.o
-stub-obj-y += blockdev.o
stub-obj-y += chr-baum-init.o
stub-obj-y += chr-msmouse.o
stub-obj-y += chr-testdev.o
diff --git a/stubs/blockdev.c b/stubs/blockdev.c
deleted file mode 100644
index 5d0a79c..0000000
--- a/stubs/blockdev.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <assert.h>
-#include "sysemu/blockdev.h"
-
-DriveInfo *drive_get_by_blockdev(BlockDriverState *bs)
-{
- return NULL;
-}
-
-void drive_info_del(DriveInfo *dinfo)
-{
- assert(!dinfo);
-}
--
1.8.3.1
- [Qemu-devel] [PULL 00/28] Block patches, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 02/28] block/raw-posix: Fix disk corruption in try_fiemap, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 03/28] block/raw-posix: use seek_hole ahead of fiemap, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 01/28] qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 05/28] block: Split bdrv_new_root() off bdrv_new(), Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 06/28] block: New BlockBackend, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 04/28] nbd: Fix filename generation, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 07/28] block: Connect BlockBackend to BlockDriverState, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 09/28] block: Code motion to get rid of stubs/blockdev.c,
Kevin Wolf <=
- [Qemu-devel] [PULL 08/28] block: Connect BlockBackend and DriveInfo, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 10/28] block: Make BlockBackend own its BlockDriverState, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 11/28] blockdev: Eliminate drive_del(), Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 12/28] block: Eliminate bdrv_iterate(), use bdrv_next(), Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 13/28] block: Eliminate BlockDriverState member device_name[], Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 15/28] block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo(), Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 14/28] block: Merge BlockBackend and BlockDriverState name spaces, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 16/28] block: Rename BlockDriverAIOCB* to BlockAIOCB*, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 17/28] block: Rename BlockDriverCompletionFunc to BlockCompletionFunc, Kevin Wolf, 2014/10/20
- [Qemu-devel] [PULL 19/28] virtio-blk: Rename VirtIOBlkConf variables to conf, Kevin Wolf, 2014/10/20