1. 25 4月, 2014 5 次提交
  2. 24 4月, 2014 2 次提交
  3. 22 4月, 2014 1 次提交
  4. 12 4月, 2014 2 次提交
  5. 11 4月, 2014 1 次提交
    • E
      conf: expose probe for non-local storage · 86f71e0a
      Eric Blake 提交于
      Deciding if a user string represents a local file instead of a
      network path is an operation worth exposing directly, particularly
      since the next patch will be removing a redundant variable that
      was caching the information.
      
      * src/util/virstoragefile.h (virStorageIsFile): New declaration.
      * src/util/virstoragefile.c (virBackingStoreIsFile): Rename...
      (virStorageIsFile): ...export, and allow NULL input.
      (virStorageFileGetMetadataInternal)
      (virStorageFileGetMetadataRecurse, virStorageFileGetMetadata):
      Update callers.
      * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Use it.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      * src/libvirt_private.syms (virstoragefile.h): Export function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      86f71e0a
  6. 09 4月, 2014 1 次提交
  7. 08 4月, 2014 1 次提交
  8. 07 4月, 2014 1 次提交
    • E
      hash: add common utility functions · 09567144
      Eric Blake 提交于
      I almost wrote a hash value free function that just called
      VIR_FREE, then realized I couldn't be the first person to
      do that.  Sure enough, it was worth factoring into a common
      helper routine.
      
      * src/util/virhash.h (virHashValueFree): New function.
      * src/util/virhash.c (virHashValueFree): Implement it.
      * src/util/virobject.h (virObjectFreeHashData): New function.
      * src/libvirt_private.syms (virhash.h, virobject.h): Export them.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
      common function.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
      * src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
      * src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      09567144
  9. 02 4月, 2014 8 次提交
    • E
      conf: move common disk source functions · 7a4fd22b
      Eric Blake 提交于
      Move some functions out of domain_conf for use in the next
      patch where snapshot starts to directly use structs in
      virstoragefile.
      
      * src/conf/domain_conf.c (virDomainDiskDefFree)
      (virDomainDiskSourcePoolDefParse): Adjust callers.
      (virDomainDiskSourceDefClear, virDomainDiskSourcePoolDefFree)
      (virDomainDiskAuthClear): Move...
      * src/util/virstoragefile.c (virStorageSourceClear)
      (virStorageSourcePoolDefFree, virStorageSourceAuthClear): ...and
      rename.
      * src/conf/domain_conf.h (virDomainDiskAuthClear): Drop
      declaration.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Adjust
      caller.
      * src/util/virstoragefile.h: Declare them.
      * src/libvirt_private.syms (virstoragefile.h): Export them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7a4fd22b
    • E
      util: move detection of shared filesystems · 5160ab79
      Eric Blake 提交于
      The code in virstoragefile.c is getting more complex as I
      consolidate backing chain handling code.  But for the setuid
      virt-login-shell, we don't need to crawl backing chains.  It's
      easier to audit things for setuid security if there are fewer
      files involved, so this patch moves the one function that
      virFileOpen() was actually relying on to also live in virfile.c.
      
      * src/util/virstoragefile.c (virStorageFileIsSharedFS)
      (virStorageFileIsSharedFSType): Move...
      * src/util/virfile.c (virFileIsSharedFS, virFileIsSharedFSType):
      ...to here, and rename.
      (virFileOpenAs): Update caller.
      * src/security/security_selinux.c
      (virSecuritySELinuxSetFileconHelper)
      (virSecuritySELinuxSetSecurityAllLabel)
      (virSecuritySELinuxRestoreSecurityImageLabelInt): Likewise.
      * src/security/security_dac.c
      (virSecurityDACRestoreSecurityImageLabelInt): Likewise.
      * src/qemu/qemu_driver.c (qemuOpenFileAs): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
      * src/util/virstoragefile.h: Adjust declarations.
      * src/util/virfile.h: Likewise.
      * src/libvirt_private.syms (virfile.h, virstoragefile.h): Move
      symbols as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5160ab79
    • E
      conf: move source pool type to util/ · b6edf2bf
      Eric Blake 提交于
      Another struct being moved to util.  This one doesn't have as
      much use yet, thankfully.
      
      * src/conf/domain_conf.h (virDomainDiskSourcePoolMode)
      (virDomainDiskSourcePoolDef): Move...
      * src/util/virstoragefile.h (virStorageSourcePoolMode)
      (virStorageSourcePoolDef): ...and rename.
      * src/conf/domain_conf.c (virDomainDiskSourcePoolDefFree)
      (virDomainDiskSourceDefClear, virDomainDiskSourcePoolDefParse)
      (virDomainDiskDefParseXML, virDomainDiskSourceDefParse)
      (virDomainDiskSourceDefFormatInternal)
      (virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType):
      Adjust clients.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b6edf2bf
    • E
      conf: move storage encryption type to util/ · 8fc32859
      Eric Blake 提交于
      Encryption keys can be associated with each source file in a
      backing chain; as such, this file belongs more in util/ where
      it can be used by virstoragefile.h.
      
      * src/conf/storage_encryption_conf.h: Rename...
      * src/util/virstorageencryption.h: ...to this.
      * src/conf/storage_encryption_conf.c: Rename...
      * src/util/virstorageencryption.c: ...to this.
      * src/Makefile.am (ENCRYPTION_CONF_SOURCES, CONF_SOURCES)
      (UTIL_SOURCES): Update to new file names.
      * src/libvirt_private.syms: Likewise.
      * src/conf/domain_conf.h: Update client.
      * src/conf/storage_conf.h: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8fc32859
    • E
      conf: move network disk protocol type to util/ · 4220f76a
      Eric Blake 提交于
      Another enum moved to util/, this time the fallout from renaming
      is not quite as large.
      
      * src/conf/domain_conf.h (virDomainDiskProtocol): Move...
      * src/util/virstoragefile.h (virStorageNetProtocol): ...and
      rename.
      * src/conf/domain_conf.c: Update clients.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/qemu/qemu_migration.c: Likewise.
      * src/storage/storage_backend.c: Likewise.
      * src/storage/storage_backend_gluster.c: Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4220f76a
    • E
      conf: move host disk type to util/ · 16ac4c9d
      Eric Blake 提交于
      A continuation of the migration of disk details to virstoragefile.
      This patch moves a single enum, but converting the name has quite
      a bit of fallout.
      
      * src/conf/domain_conf.h (virDomainDiskType): Move...
      * src/util/virstoragefile.h (virStorageType): ...and rename.
      * src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr)
      (virBhyveProcessBuildLoadCmd): Update clients.
      * src/conf/domain_conf.c (virDomainDiskSourceDefParse)
      (virDomainDiskDefParseXML, virDomainDiskSourceDefFormatInternal)
      (virDomainDiskDefFormat, virDomainDiskGetActualType)
      (virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType):
      Likewise.
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDiskDefFormat):
      Likewise.
      * src/esx/esx_driver.c (esxAutodetectSCSIControllerModel)
      (esxDomainDefineXML): Likewise.
      * src/locking/domain_lock.c (virDomainLockManagerAddDisk):
      Likewise.
      * src/lxc/lxc_controller.c
      (virLXCControllerSetupLoopDeviceDisk)
      (virLXCControllerSetupNBDDeviceDisk)
      (virLXCControllerSetupLoopDevices, virLXCControllerSetupDisk):
      Likewise.
      * src/parallels/parallels_driver.c (parallelsGetHddInfo):
      Likewise.
      * src/phyp/phyp_driver.c (phypDiskType): Likewise.
      * src/qemu/qemu_command.c (qemuGetDriveSourceString)
      (qemuDomainDiskGetSourceString, qemuBuildDriveStr)
      (qemuBuildCommandLine, qemuParseCommandLineDisk)
      (qemuParseCommandLine): Likewise.
      * src/qemu/qemu_conf.c (qemuCheckSharedDevice)
      (qemuTranslateDiskSourcePool)
      (qemuTranslateSnapshotDiskSourcePool): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
      (qemuDomainDetermineDiskChain): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotPrepareDiskExternalBackingInactive)
      (qemuDomainSnapshotPrepareDiskExternalBackingActive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayActive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayInactive)
      (qemuDomainSnapshotPrepareDiskInternal)
      (qemuDomainSnapshotPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
      Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
      * src/security/security_apparmor.c
      (AppArmorRestoreSecurityImageLabel)
      (AppArmorSetSecurityImageLabel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetSecurityImageLabel)
      (virSecurityDACRestoreSecurityImageLabelInt)
      (virSecurityDACSetSecurityAllLabel): Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxRestoreSecurityImageLabelInt)
      (virSecuritySELinuxSetSecurityImageLabel)
      (virSecuritySELinuxSetSecurityAllLabel): Likewise.
      * src/storage/storage_backend.c (virStorageFileBackendForType):
      Likewise.
      * src/storage/storage_backend_fs.c (virStorageFileBackendFile)
      (virStorageFileBackendBlock): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageFileBackendGluster): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives)
      (vboxDomainAttachDeviceImpl, vboxDomainDetachDevice): Likewise.
      * src/vmware/vmware_conf.c (vmwareVmxPath): Likewise.
      * src/vmx/vmx.c (virVMXParseDisk, virVMXFormatDisk)
      (virVMXFormatFloppy): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr)
      (xenFormatSxprDisk): Likewise.
      * src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise.
      * tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
      Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      16ac4c9d
    • E
      conf: split network host structs to util/ · 52fb5311
      Eric Blake 提交于
      Continuing the refactoring of host-side storage descriptions out
      of conf/domain_conf and into util/virstoragefile, this patch
      focuses on details about a host name/port/transport as used by
      a network storage volume.
      
      * src/conf/domain_conf.h (virDomainDiskProtocolTransport)
      (virDomainDiskHostDef, virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): Move...
      * src/util/virstoragefile.h (virStorageNetHostTransport)
      (virStorageNetHostDef, virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): ...here,
      with better names.
      * src/util/virstoragefile.c (virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): Moved from...
      * src/conf/domain_conf.c (virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): ...here.
      (virDomainDiskSourceDefClear, virDomainDiskSourceDefParse)
      (virDomainDiskSourceDefFormatInternal): Adjust callers.
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear):
      Likewise.
      * src/qemu/qemu_command.c (qemuAddRBDHost)
      (qemuParseDriveURIString, qemuParseNBDString)
      (qemuBuildNetworkDriveURI, qemuParseCommandLineDisk)
      (qemuParseCommandLine, qemuGetDriveSourceString): Likewise.
      * src/qemu/qemu_command.h: Likewise.
      * src/qemu/qemu_conf.c (qemuAddISCSIPoolSourceHost)
      (qemuTranslateDiskSourcePool): Likewise.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotUndoSingleDiskActive): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageFileBackendGlusterInit): Likewise.
      * src/storage/storage_driver.c (virStorageFileFree)
      (virStorageFileInitInternal): Likewise.
      * src/storage/storage_driver.h (_virStorageFile): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      52fb5311
    • E
      conf: split security label structs to util/ · 3e929386
      Eric Blake 提交于
      In order to reuse the newly-created host-side disk struct in
      the virstoragefile backing chain code, I first have to move
      it to util/.  This starts the process, by first moving the
      security label structures.
      
      * src/conf/domain_conf.h (virDomainDefGenSecurityLabelDef)
      (virDomainDiskDefGenSecurityLabelDef, virSecurityLabelDefFree)
      (virSecurityDeviceLabelDefFree, virSecurityLabelDef)
      (virSecurityDeviceLabelDef): Move...
      * src/util/virseclabel.h: ...to new file.
      (virSecurityLabelDefNew, virSecurityDeviceLabelDefNew): Rename the
      GenSecurity functions.
      * src/qemu/qemu_process.c (qemuProcessAttach): Adjust callers.
      * src/security/security_manager.c (virSecurityManagerGenLabel):
      Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxSetSecurityFileLabel): Likewise.
      * src/util/virseclabel.c: New file.
      * src/conf/domain_conf.c: Move security code, and fix fallout.
      * src/Makefile.am (UTIL_SOURCES): Build new file.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virseclabel.h): ...to new section.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3e929386
  10. 27 3月, 2014 1 次提交
  11. 25 3月, 2014 1 次提交
    • E
      conf: accessors for common source information · 1014c34e
      Eric Blake 提交于
      A future patch will split virDomainDiskDef, in order to track
      multiple host resources per guest <disk>.  To reduce the size
      of that patch, I've factored out the four most common accesses
      into functions, so that I can incrementally upgrade the code
      base to use the accessors, and so that code that doesn't care
      about the distinction of per-file details won't have to be
      changed when the struct changes.
      
      * src/conf/domain_conf.h (virDomainDiskGetType)
      (virDomainDiskSetType, virDomainDiskGetSource)
      (virDomainDiskSetSource, virDomainDiskGetDriver)
      (virDomainDiskSetDriver, virDomainDiskGetFormat)
      (virDomainDiskSetFormat): New prototypes.
      * src/conf/domain_conf.c (virDomainDiskGetType)
      (virDomainDiskSetType, virDomainDiskGetSource)
      (virDomainDiskSetSource, virDomainDiskGetDriver)
      (virDomainDiskSetDriver, virDomainDiskGetFormat)
      (virDomainDiskSetFormat): Implement them.
      * src/libvirt_private.syms (domain_conf.h): Export them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1014c34e
  12. 21 3月, 2014 7 次提交
    • R
      Introduce virFDStreamOpenPTY · 4dae396f
      Roman Bogorodskiy 提交于
      Add virFDStreamOpenPTY() function which is a wrapper around
      virFDStreamOpenFileInternal() with putting the device it opens into a
      raw mode.
      
      Make virChrdevOpen() use virFDStreamOpenPTY() for
      VIR_DOMAIN_CHR_TYPE_PTY devices.
      
      This fixes mangled console output when libvirt runs on FreeBSD as it
      requires device it opens to be placed into a raw mode explicitly.
      4dae396f
    • D
      Add DBus helper methods for creating reply messages · bd93dea3
      Daniel P. Berrange 提交于
      The test suites often have to create DBus method reply messages
      with payloads. Create two helpers for simplifying the process
      of creating replies with payloads.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bd93dea3
    • D
      Refactor dbus helper methods for method calls · 838d0b04
      Daniel P. Berrange 提交于
      Split the virDBusMethodCall method into a couple of new methods
      virDBusCall, virDBusCreateMethod and virDBusCreateMethodV.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      838d0b04
    • J
      conf: Introduce virDomainDeviceGetInfo API · 563a12b3
      Jiri Denemark 提交于
      The offset of virDomainDeviceInfo structure within a device definition
      varies with device type and some types do not contain the info structure
      at all. This new API makes it easier to access the info structure from a
      generic virDomainDeviceDef structure.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      563a12b3
    • E
      qemu: create object for qemu monitor events · 8059afca
      Eric Blake 提交于
      Create qemu monitor events as a distinct class to normal domain
      events, because they will be filtered differently.  For ease of
      review, the logic for filtering by event name is saved for a later
      patch.
      
      * src/conf/domain_event.c (virDomainQemuMonitorEventClass): New
      class.
      (virDomainEventsOnceInit): Register it.
      (virDomainQemuMonitorEventDispose, virDomainQemuMonitorEventNew)
      (virDomainQemuMonitorEventDispatchFunc)
      (virDomainQemuMonitorEventStateRegisterID): New functions.
      * src/conf/domain_event.h (virDomainQemuMonitorEventNew)
      (virDomainQemuMonitorEventStateRegisterID): New prototypes.
      * src/libvirt_private.syms (conf/domain_conf.h): Export them.
      8059afca
    • J
      Move functions using iscsiadm to viriscsi.c · 5e1d5dde
      Ján Tomko 提交于
      Remove the 'StorageBackend' from names of the functions and fix
      indentation.
      5e1d5dde
    • J
      Move virStorageBackendRun to vircommand · f2cc4286
      Ján Tomko 提交于
      The only storage-specific parameter is the pool object, which
      is only used for passing to the callback function.
      f2cc4286
  13. 18 3月, 2014 3 次提交
    • D
      Remove global log buffer feature entirely · c0c8c1d7
      Daniel P. Berrange 提交于
      A earlier commit changed the global log buffer so that it only
      records messages that are explicitly requested via the log
      filters setting. This removes the performance burden, and
      improves the signal/noise ratio for messages in the global
      buffer. At the same time though, it is somewhat pointless, since
      all the recorded log messages are already going to be sent to an
      explicit log output like syslog, stderr or the journal. The
      global log buffer is thus just duplicating this data on stderr
      upon crash.
      
      The log_buffer_size config parameter is left in the augeas
      lens to prevent breakage for users on upgrade. It is however
      completely ignored hereafter.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c0c8c1d7
    • D
      Add virLogSource variables to all source files · 2835c1e7
      Daniel P. Berrange 提交于
      Any source file which calls the logging APIs now needs
      to have a VIR_LOG_INIT("source.name") declaration at
      the start of the file. This provides a static variable
      of the virLogSource type.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2835c1e7
    • D
      Turn virLogSource into a struct instead of an enum · 098dd79e
      Daniel P. Berrange 提交于
      As part of the goal to get away from doing string matching on
      filenames when deciding whether to emit a log message, turn
      the virLogSource enum into a struct which contains a log
      "name". There will eventually be one virLogSource instance
      statically declared per source file. To minimise churn in this
      commit though, a single global instance is used.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      098dd79e
  14. 13 3月, 2014 6 次提交