• E
    qemu: simplify json parsing · 40783db3
    Eric Blake 提交于
    Rather than grabbing an arbitrary JSON value and then checking
    if it has the right type, we might as well request the correct
    type to begin with.
    
    * src/qemu/qemu_monitor_json.c (qemuMonitorJSONIOProcessEvent)
    (qemuMonitorJSONCommandWithFd, qemuMonitorJSONHandleGraphics)
    (qemuMonitorJSONGetStatus, qemuMonitorJSONExtractCPUInfo)
    (qemuMonitorJSONGetVirtType, qemuMonitorJSONGetBalloonInfo)
    (qemuMonitorJSONGetMemoryStats)
    (qemuMonitorJSONDevGetBlockExtent)
    (qemuMonitorJSONGetOneBlockStatsInfo)
    (qemuMonitorJSONGetAllBlockStatsInfo)
    (qemuMonitorJSONBlockStatsUpdateCapacityOne)
    (qemuMonitorJSONBlockStatsUpdateCapacity)
    (qemuMonitorJSONGetBlockExtent)
    (qemuMonitorJSONGetMigrationStatusReply)
    (qemuMonitorJSONGetDumpGuestMemoryCapability)
    (qemuMonitorJSONAddFd, qemuMonitorJSONQueryRxFilterParse)
    (qemuMonitorJSONExtractChardevInfo)
    (qemuMonitorJSONDiskNameLookupOne)
    (qemuMonitorJSONDiskNameLookup)
    (qemuMonitorJSONGetAllBlockJobInfo)
    (qemuMonitorJSONBlockIoThrottleInfo, qemuMonitorJSONGetVersion)
    (qemuMonitorJSONGetMachines, qemuMonitorJSONGetCPUDefinitions)
    (qemuMonitorJSONGetCommands, qemuMonitorJSONGetEvents)
    (qemuMonitorJSONGetKVMState, qemuMonitorJSONGetObjectTypes)
    (qemuMonitorJSONGetObjectListPaths)
    (qemuMonitorJSONGetObjectProps, qemuMonitorJSONGetTargetArch)
    (qemuMonitorJSONGetMigrationCapabilities)
    (qemuMonitorJSONGetStringArray, qemuMonitorJSONAttachCharDev)
    (qemuMonitorJSONGetCPUx86Data, qemuMonitorJSONGetIOThreads)
    (qemuMonitorJSONGetMemoryDeviceInfo): Use shorter idioms.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    40783db3
qemu_monitor_json.c 198.4 KB