• E
    conf: prepare to track multiple host source files per <disk> · 4f202266
    Eric Blake 提交于
    It's finally time to start tracking disk backing chains in
    <domain> XML.  The first step is to start refactoring code
    so that we have an object more convenient for representing
    each host source resource in the context of a single guest
    <disk>.  Ultimately, I plan to move the new type into src/util
    where it can be reused by virStorageFile, but to make the
    transition easier to review, this patch just creates the
    new type then fixes everything until it compiles again.
    
    * src/conf/domain_conf.h (_virDomainDiskDef): Split...
    (_virDomainDiskSourceDef): ...to new struct.
    (virDomainDiskAuthClear): Use new type.
    * src/conf/domain_conf.c (virDomainDiskDefFree): Split...
    (virDomainDiskSourceDefClear): ...to new function.
    (virDomainDiskGetType, virDomainDiskSetType)
    (virDomainDiskGetSource, virDomainDiskSetSource)
    (virDomainDiskGetDriver, virDomainDiskSetDriver)
    (virDomainDiskGetFormat, virDomainDiskSetFormat)
    (virDomainDiskAuthClear, virDomainDiskGetActualType)
    (virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
    (virDomainDiskDefFormat, virDomainDiskDefForeachPath)
    (virDomainDiskDefGetSecurityLabelDef)
    (virDomainDiskSourceIsBlockType): Adjust all users.
    * src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
    Likewise.
    * src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
    Likewise.
    * src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
    (qemuParseDriveURIString, qemuParseGlusterString)
    (qemuParseISCSIString, qemuParseNBDString)
    (qemuDomainDiskGetSourceString, qemuBuildDriveStr)
    (qemuBuildCommandLine, qemuParseCommandLineDisk)
    (qemuParseCommandLine): Likewise.
    * src/qemu/qemu_conf.c (qemuCheckSharedDevice)
    (qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
    Likewise.
    * src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
    (qemuDomainPrepareDiskChainElement)
    (qemuDomainSnapshotCreateInactiveExternal)
    (qemuDomainSnapshotPrepareDiskExternalBackingInactive)
    (qemuDomainSnapshotPrepareDiskInternal)
    (qemuDomainSnapshotPrepare)
    (qemuDomainSnapshotCreateSingleDiskActive)
    (qemuDomainSnapshotUndoSingleDiskActive)
    (qemuDomainBlockPivot, qemuDomainBlockJobImpl)
    (qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
    * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
    * src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
    (qemuProcessInitPasswords): Likewise.
    * src/security/security_selinux.c
    (virSecuritySELinuxSetSecurityFileLabel): Likewise.
    * src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
    Likewise.
    * tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
    Likewise.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    4f202266
domain_conf.c 623.0 KB