Revision 37764dfb

b/block/qcow2.c
1810 1810
    return 0;
1811 1811
}
1812 1812

  
1813
static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs)
1814
{
1815
    BDRVQcowState *s = bs->opaque;
1816
    ImageInfoSpecific *spec_info = g_new(ImageInfoSpecific, 1);
1817

  
1818
    *spec_info = (ImageInfoSpecific){
1819
        .kind  = IMAGE_INFO_SPECIFIC_KIND_QCOW2,
1820
        {
1821
            .qcow2 = g_new(ImageInfoSpecificQCow2, 1),
1822
        },
1823
    };
1824
    if (s->qcow_version == 2) {
1825
        *spec_info->qcow2 = (ImageInfoSpecificQCow2){
1826
            .compat = g_strdup("0.10"),
1827
        };
1828
    } else if (s->qcow_version == 3) {
1829
        *spec_info->qcow2 = (ImageInfoSpecificQCow2){
1830
            .compat             = g_strdup("1.1"),
1831
            .lazy_refcounts     = s->compatible_features &
1832
                                  QCOW2_COMPAT_LAZY_REFCOUNTS,
1833
            .has_lazy_refcounts = true,
1834
        };
1835
    }
1836

  
1837
    return spec_info;
1838
}
1839

  
1813 1840
#if 0
1814 1841
static void dump_refcounts(BlockDriverState *bs)
1815 1842
{
......
2130 2157
    .bdrv_snapshot_list     = qcow2_snapshot_list,
2131 2158
    .bdrv_snapshot_load_tmp     = qcow2_snapshot_load_tmp,
2132 2159
    .bdrv_get_info      = qcow2_get_info,
2160
    .bdrv_get_specific_info = qcow2_get_specific_info,
2133 2161

  
2134 2162
    .bdrv_save_vmstate    = qcow2_save_vmstate,
2135 2163
    .bdrv_load_vmstate    = qcow2_load_vmstate,
b/qapi-schema.json
210 210
            'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
211 211

  
212 212
##
213
# @ImageInfoSpecificQCow2:
214
#
215
# @compat: compatibility level
216
#
217
# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
218
#
219
# Since: 1.7
220
##
221
{ 'type': 'ImageInfoSpecificQCow2',
222
  'data': {
223
      'compat': 'str',
224
      '*lazy-refcounts': 'bool'
225
  } }
226

  
227
##
213 228
# @ImageInfoSpecific:
214 229
#
215 230
# A discriminated record of image format specific information structures.
......
219 234

  
220 235
{ 'union': 'ImageInfoSpecific',
221 236
  'data': {
237
      'qcow2': 'ImageInfoSpecificQCow2'
222 238
  } }
223 239

  
224 240
##

Also available in: Unified diff