block.c (81e5f78a9f4f13548ec1edddaf780d339f18e2d2) | block.c (d5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 3883 unchanged lines hidden (view full) --- 3892 if (!strcmp(node_name, bs->node_name)) { 3893 return bs; 3894 } 3895 } 3896 return NULL; 3897} 3898 3899/* Put this QMP function here so it can access the static graph_bdrv_states. */ | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 3883 unchanged lines hidden (view full) --- 3892 if (!strcmp(node_name, bs->node_name)) { 3893 return bs; 3894 } 3895 } 3896 return NULL; 3897} 3898 3899/* Put this QMP function here so it can access the static graph_bdrv_states. */ |
3900BlockDeviceInfoList *bdrv_named_nodes_list(void) | 3900BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp) |
3901{ 3902 BlockDeviceInfoList *list, *entry; 3903 BlockDriverState *bs; 3904 3905 list = NULL; 3906 QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { | 3901{ 3902 BlockDeviceInfoList *list, *entry; 3903 BlockDriverState *bs; 3904 3905 list = NULL; 3906 QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { |
3907 BlockDeviceInfo *info = bdrv_block_device_info(bs, errp); 3908 if (!info) { 3909 qapi_free_BlockDeviceInfoList(list); 3910 return NULL; 3911 } |
|
3907 entry = g_malloc0(sizeof(*entry)); | 3912 entry = g_malloc0(sizeof(*entry)); |
3908 entry->value = bdrv_block_device_info(bs); | 3913 entry->value = info; |
3909 entry->next = list; 3910 list = entry; 3911 } 3912 3913 return list; 3914} 3915 3916BlockDriverState *bdrv_lookup_bs(const char *device, --- 2376 unchanged lines hidden --- | 3914 entry->next = list; 3915 list = entry; 3916 } 3917 3918 return list; 3919} 3920 3921BlockDriverState *bdrv_lookup_bs(const char *device, --- 2376 unchanged lines hidden --- |