40783db qemu: simplify json parsing

Authored and Committed by ericb 8 years ago
    qemu: simplify json parsing
    
    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: Eric Blake <eblake@redhat.com>
    
        
file modified
+61 -105