• E
    xml: use better types for memory values · 4888f0fb
    Eric Blake 提交于
    Using 'unsigned long' for memory values is risky on 32-bit platforms,
    as a PAE guest can have more than 4GiB memory.  Our API is
    (unfortunately) locked at 'unsigned long' and a scale of 1024, but
    the rest of our system should consistently use 64-bit values,
    especially since the previous patch centralized overflow checking.
    
    * src/conf/domain_conf.h (_virDomainDef): Always use 64-bit values
    for memory.  Change hugepage_backed to a bool.
    * src/conf/domain_conf.c (virDomainDefParseXML)
    (virDomainDefCheckABIStability, virDomainDefFormatInternal): Fix
    clients.
    * src/vmx/vmx.c (virVMXFormatConfig): Likewise.
    * src/xenxs/xen_sxpr.c (xenParseSxpr, xenFormatSxpr): Likewise.
    * src/xenxs/xen_xm.c (xenXMConfigGetULongLong): New function.
    (xenXMConfigGetULong, xenXMConfigSetInt): Avoid truncation.
    (xenParseXM, xenFormatXM): Fix clients.
    * src/phyp/phyp_driver.c (phypBuildLpar): Likewise.
    * src/openvz/openvz_driver.c (openvzDomainSetMemoryInternal):
    Likewise.
    * src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Likewise.
    * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
    * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
    * src/qemu/qemu_monitor.h (qemuMonitorGetBalloonInfo): Likewise.
    * src/qemu/qemu_monitor_text.h (qemuMonitorTextGetBalloonInfo):
    Likewise.
    * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBalloonInfo):
    Likewise.
    * src/qemu/qemu_monitor_json.h (qemuMonitorJSONGetBalloonInfo):
    Likewise.
    * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBalloonInfo):
    Likewise.
    * src/qemu/qemu_driver.c (qemudDomainGetInfo)
    (qemuDomainGetXMLDesc): Likewise.
    * src/uml/uml_conf.c (umlBuildCommandLine): Likewise.
    4888f0fb
domain_conf.c 460.3 KB