1. 03 4月, 2014 10 次提交
    • S
      libxl: Set disk format for empty cdrom device · 7a1452f5
      Stefan Bader 提交于
      The XML config for a CDROM device can be without a source path,
      indicating that there is no media present. Without this change
      the libxl driver fails to start a guest in that case because
      the libxl library checks for the LIBXL_DISK_FORMAT_EMPTY format
      type and tries to stat the NULL pointer that gets passed on.
      
      > libxl: error: libxl_device.c:265:libxl__device_disk_set_backend:
      > Disk vdev=hdc failed to stat: (null): Bad address
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      7a1452f5
    • S
      libxl: Use id from virDomainObj inside the driver · 0e0c1a74
      Stefan Bader 提交于
      There is a domain id in the virDomain structure as well as in the
      virDomainObj structure. While the former can become stale the latter
      is kept up to date. So it is safer to always (virDomainObjPtr)->def->id
      internally.
      
      This will fix issues seen when managing Xen guests through libvirt from
      virt-manager (not being able to get domain info after define or reboot).
      This was caused both though libxlDomainGetInfo() only but there were
      a lot of places that might potentially cause issues, too.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      0e0c1a74
    • J
      Add redirdevs to ABI stability check · c9123fbe
      Ján Tomko 提交于
      Check the bus, type of the source device (tcp vs. spicevmc)
      and the device address visible in the guest.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1035128
      c9123fbe
    • J
      Use the force flag for mkfs -t xfs · 904e6e90
      Ján Tomko 提交于
      Without this, building an XFS pool on a formatted partition
      fails with --overwrite.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=927172
      904e6e90
    • L
      virsh: Make 'exit' action same as 'quit' · cc7e1503
      Li Yang 提交于
      For now 'virsh quit' action like this:
      --------------------------------
      [root@localhost /]# virsh quit
      [root@localhost /]#
      --------------------------------
      And 'virsh exit' action:
      --------------------------------
      [root@localhost /]# virsh exit
      
      [root@localhost /]#
      --------------------------------
      There is a small difference('/n') between them.
      According to manual said:
             quit, exit
                 quit this interactive terminal
      
      And in the code they all called cmdQuit func,
      They should get same actions.
      Signed-off-by: NLi Yang <liyang.fnst@cn.fujitsu.com>
      cc7e1503
    • M
      qemu: make sure agent returns error when required data are missing · 736e017e
      Martin Kletzander 提交于
      Commit 5b3492fa aimed to fix this and caught one error but exposed
      another one.  When agent command is being executed and the thread
      waiting for the reply is woken up by an event (e.g. EOF in case of
      shutdown), the command finishes with no data (rxObject == NULL), but
      no error is reported, since this might be desired by the caller
      (e.g. suspend through agent).  However, in other situations, when the
      data are required (e.g. getting vCPUs), we proceed to getting desired
      data out of the reply, but none of the virJSON*() functions works well
      with NULLs.  I chose the way of a new parameter for qemuAgentCommand()
      function that specifies whether reply is required and behaves
      according to that.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      736e017e
    • J
      Include PCI address in the error in virDomainNetFindIdx · 246317d3
      Ján Tomko 提交于
      When looking up a net device by a MAC and PCI address, it is possible
      that we've got a match on the MAC address but failed to match the
      PCI address.
      
      In that case, outputting just the MAC address can be confusing.
      
      Partially resolves:
      https://bugzilla.redhat.com/show_bug.cgi?id=872028
      246317d3
    • J
      Move error reporting into virDomainNetFindIdx · 2fbae1b2
      Ján Tomko 提交于
      Every caller checked the return value and logged an error
      - one if no device with the specified MAC was found,
      other if there were multiple devices matching the MAC address
      (except for qemuDomainUpdateDeviceConfig which logged the same
       message in both cases).
      
      Move the error reporting into virDomainNetFindIdx, since in both cases,
      we couldn't find one single match - it's just the error messages that
      differ.
      2fbae1b2
    • E
      tests: simplify storage test cleanup · 8feec44a
      Eric Blake 提交于
      No need to spawn a child 'rm' process when we can do it ourselves.
      
      * tests/virstoragetest.c (testCleanupImages): Use dedicated
      helper.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8feec44a
    • C
      storage: Report error from VolOpen by default · 138e65c3
      Cole Robinson 提交于
      Currently VolOpen notifies the user of a potentially non-fatal failure by
      returning -2 and logging a VIR_WARN or VIR_INFO. Unfortunately most
      callers treat -2 as fatal but don't actually report any message with
      the error APIs.
      
      Rename the VOL_OPEN_ERROR flag to VOL_OPEN_NOERROR. If NOERROR is specified,
      we preserve the current behavior of returning -2 (there's only one caller
      that wants this).
      
      However in the default case, only return -1, and actually use the error
      APIs. Fix up a couple callers as a result.
      138e65c3
  2. 02 4月, 2014 26 次提交
    • J
      Fix coverity-reported leak in virSecurityManagerGenLabel · 66050f0f
      Ján Tomko 提交于
      Coverity complains about a possible leak of seclabel if
      !sec_managers[i]->drv->domainGenSecurityLabel is true
      and the seclabel might be overwritten by the next iteration
      of the loop.
      
      This leak should never happen, because every security driver
      has domainGenSecurityLabel defined.
      66050f0f
    • E
      conf: modify tracking of encrypted images · 2279d560
      Eric Blake 提交于
      A future patch will merge virStorageFileMetadata and virStorageSource,
      but I found it easier to do if both structs use the same information
      for tracking whether a source file needs encryption keys.
      
      * src/util/virstoragefile.h (_virStorageFileMetadata): Prepare
      full encryption struct instead of just a bool.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Use transfer semantics.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal):
      Populate struct.
      (virStorageFileFreeMetadata): Adjust clients.
      * tests/virstoragetest.c (testStorageChain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2279d560
    • E
      conf: drop redundant parameters during probe · ac9a0963
      Eric Blake 提交于
      Now that each virStorageSource can track allocation information,
      and given that we already have the information without extra
      syscalls, it's easier to just always populate the information
      directly into the struct than it is to sometimes pass the address
      of the struct members down the call chain.
      
      * src/storage/storage_backend.h (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Update signature.
      * src/storage/storage_backend.c (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Always populate struct
      members instead.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol): Update client.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac9a0963
    • E
      conf: track sizes directly in source struct · cce2410a
      Eric Blake 提交于
      One of the features of qcow2 is that a wrapper file can have
      more capacity than its backing file from the guest's perspective;
      what's more, sparse files make tracking allocation of both
      the active and backing file worthwhile.  As such, it makes
      more sense to show allocation numbers for each file in a chain,
      and not just the top-level file.  This sets up the fields for
      the tracking, although it does not modify XML to display any
      new information.
      
      * src/util/virstoragefile.h (_virStorageSource): Add fields.
      * src/conf/storage_conf.h (_virStorageVolDef): Drop redundant
      fields.
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (createRawFile, virStorageBackendCreateQemuImgCmd)
      (virStorageBackendCreateQcowCreate): Update clients.
      * src/storage/storage_driver.c (storageVolDelete)
      (storageVolCreateXML, storageVolCreateXMLFrom, storageVolResize)
      (storageVolWipeInternal, storageVolGetInfo): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolResize)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol)
      (virStorageBackendLogicalCreateVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_rbd.c
      (volStorageBackendRBDRefreshVolInfo)
      (virStorageBackendRBDCreateImage): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskCreateVol): Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogBuildVol)
      (virStorageBackendSheepdogParseVdiList): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/conf/storage_conf.c (virStorageVolDefFormat)
      (virStorageVolDefParseXML): Likewise.
      * src/test/test_driver.c (testOpenVolumesForPool)
      (testStorageVolCreateXML, testStorageVolCreateXMLFrom)
      (testStorageVolDelete, testStorageVolGetInfo): Likewise.
      * src/esx/esx_storage_backend_iscsi.c (esxStorageVolGetXMLDesc):
      Likewise.
      * src/esx/esx_storage_backend_vmfs.c (esxStorageVolGetXMLDesc)
      (esxStorageVolCreateXML): Likewise.
      * src/parallels/parallels_driver.c (parallelsAddHddByVolume):
      Likewise.
      * src/parallels/parallels_storage.c (parallelsDiskDescParseNode)
      (parallelsStorageVolDefineXML, parallelsStorageVolCreateXMLFrom)
      (parallelsStorageVolDefRemove, parallelsStorageVolGetInfo):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML)
      (vboxStorageVolGetXMLDesc): Likewise.
      * tests/storagebackendsheepdogtest.c (test_vdi_list_parser):
      Likewise.
      * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Likewise.
      cce2410a
    • E
      conf: use common struct in storage volumes · df176115
      Eric Blake 提交于
      A fairly smooth transition.  And now that domain disks and
      storage volumes share a common struct, it opens the doors for
      a future patch to expose more details in the XML for both
      objects.
      
      * src/conf/storage_conf.h (_virStorageVolTarget): Delete.
      (_virStorageVolDef): Use common type.
      * src/conf/storage_conf.c (virStorageVolDefFree)
      (virStorageVolTargetDefFormat): Update clients.
      * src/storage/storage_backend.h: Likewise.
      * src/storage/storage_backend.c
      (virStorageBackendDetectBlockVolFormatFD)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      df176115
    • E
      conf: move volume structs to util/ · 2a4fd228
      Eric Blake 提交于
      Another step towards unification of structures.  While we might
      not expose everything in XML via domain disk as we do for
      storage volume pointer, both places want to deal with (at least
      part of) the backing chain; therefore, moving towards a single
      struct usable from both contexts will make the backing chain
      code more reusable.
      
      * src/conf/storage_conf.h (_virStoragePerms)
      (virStorageTimestamps): Move...
      * src/util/virstoragefile.h: ...here.
      (_virStorageSource): Add more fields.
      * src/util/virstoragefile.c (virStorageSourceClear): Clean
      additional fields.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2a4fd228
    • E
      conf: tweak volume target struct details · dae1568c
      Eric Blake 提交于
      Some preparatory work before consolidating storage volume
      structs with the rest of virstoragefile.  Making these
      changes allows a volume target to be much closer to (a
      subset of) the virStorageSource struct.
      
      Making perms be a pointer allows it to be optional if we
      have a storage pool that doesn't expose permissions in a
      way we can access.  It also allows future patches to
      optionally expose permissions details learned about a disk
      image via domain <disk> listings, rather than just
      limiting it to storage volume listings.
      
      Disk partition types was only used by internal code to
      control what type of partition to create when carving up
      an MS-DOS partition table storage pool (and is not used
      for GPT partition tables or other storage pools).  It was
      not exposed in volume XML, and as it is more closely
      related to extent information of the overall block device
      than it is to the <target> information describing the host
      file.  Besides, if we ever decide to expose it in XML down
      the road, we can move it back as needed.
      
      * src/conf/storage_conf.h (_virStorageVolTarget): Change perms to
      pointer, enhance comments.  Move partition type...
      (_virStorageVolSource): ...here.
      * src/conf/storage_conf.c (virStorageVolDefFree)
      (virStorageVolDefParseXML, virStorageVolTargetDefFormat): Update
      clients.
      * src/storage/storage_backend_fs.c (createFileDir): Likewise.
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (virStorageBackendCreateRaw, virStorageBackendCreateExecCommand)
      (virStorageBackendUpdateVolTargetInfoFD): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalCreateVol): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskPartTypeToCreate): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      dae1568c
    • E
      conf: manage disk source by struct instead of pieces · c99efbcd
      Eric Blake 提交于
      Now that we have a dedicated type for representing a disk source,
      we might as well parse and format directly into that type instead
      of piecemeal into pointers to members of the type.
      
      * src/conf/domain_conf.h (virDomainDiskSourceDefFormatInternal)
      (virDomainDiskSourceDefParse): Rename...
      (virDomainDiskSourceFormat, virDomainDiskSourceParse): ...and
      compress signatures.
      * src/conf/domain_conf.c (virDomainDiskSourceParse)
      (virDomainDiskSourceFormat): Rewrite to use common struct.
      (virDomainDiskSourceDefFormat): Delete.
      (virDomainDiskDefParseXML, virDomainDiskDefFormat): Update
      callers.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotDiskDefFormat): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c99efbcd
    • E
      phyp: fix logic error on volume creation · 93d4585e
      Eric Blake 提交于
      The phyp code claims that it wants a non-zero value, but actually
      enforces a capacity of zero.  It has been this way since commit
      ebc46fea in June 2010.  Bummer that it has my name as the committer
      - I guess I should have been much more stubborn about not blindly
      taking someone else's 1600-line patch.
      
      * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Use correct
      logic.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      93d4585e
    • M
      qemu: remove unneeded forward declaration · e9d09fe1
      Martin Kletzander 提交于
      by moving qemuAgentCommand() after qemuAgentCheckError().
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      e9d09fe1
    • S
      34a43163
    • M
      qemu: cleanup error checking on agent replies · 5b3492fa
      Martin Kletzander 提交于
      On all the places where qemuAgentComand() was called, we did a check
      for errors in the reply.  Unfortunately, some of the places called
      qemuAgentCheckError() without checking for non-null reply which might
      have resulted in a crash.
      
      So this patch makes the error-checking part of qemuAgentCommand()
      itself, which:
      
       a) makes it look better,
      
       b) makes the check mandatory and, most importantly,
      
       c) checks for the errors if and only if it is appropriate.
      
      This actually fixes a potential crashers when qemuAgentComand()
      returned 0, but reply was NULL.  Having said that, it *should* fix the
      following bug:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      5b3492fa
    • E
      maint: fix spelling errors in disk pools · 17f82636
      Eric Blake 提交于
      Noticed during my work on storage struct cleanups.
      
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskPartBoundaries): Fix spelling errors.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      17f82636
    • E
      conf: let snapshots share disk source struct · ca1ee0fd
      Eric Blake 提交于
      Now that we have a common struct, it's time to start using it!
      Since external snapshots make a longer backing chain, it is
      only natural to use the same struct for the file created by
      the snapshot as what we use for <domain> disks.
      
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Use common
      struct instead of open-coded duplicate fields.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear)
      (virDomainSnapshotDiskDefParseXML, virDomainSnapshotAlignDisks)
      (virDomainSnapshotDiskDefFormat)
      (virDomainSnapshotDiskGetActualType): Adjust clients.
      * src/qemu/qemu_conf.c (qemuTranslateSnapshotDiskSourcePool):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskGetSourceString)
      (qemuDomainSnapshotCreateInactiveExternal)
      (qemuDomainSnapshotPrepareDiskExternalOverlayActive)
      (qemuDomainSnapshotPrepareDiskExternal)
      (qemuDomainSnapshotPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
      * src/storage/storage_driver.c
      (virStorageFileInitFromSnapshotDef): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ca1ee0fd
    • 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: don't support loopback and nbd when setuid · 885ac290
      Eric Blake 提交于
      The only remaining reason that virt-login-shell was trying to
      link against virstoragefile was because of a call to
      virStorageFileFormatTypeToString when spawning a qemu-nbd
      process - but setuid processes shouldn't be spawning qemu-nbd.
      
      * src/util/virfile.c (virFileLoopDeviceAssociate)
      (virFileNBDDeviceAssociate): Cripple in setuid builds.
      * src/Makefile.am (libvirt_setuid_rpc_client_la_SOURCES):
      Drop virstoragefile from the list.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      885ac290
    • 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 storage source type to util/ · 8a20e227
      Eric Blake 提交于
      With this patch, all information related to a host resource in
      a storage file backing chain now lives in util/virstoragefile.h.
      The next step will be to consolidate various places that have
      been tracking backing chain details to all use a common struct.
      
      The changes to tools/Makefile.am were made necessary by the
      fact that virstorageencryption includes uses of libxml, and is
      now pulled in by inclusion from virstoragefile.h.  No
      additional libraries are linked into the final image, and in
      comparison, the build of the setuid library in src/Makefile.am
      already was using LIBXML_CFLAGS via AM_CFLAGS.
      
      * src/conf/domain_conf.h (virDomainDiskSourceDef): Move...
      * src/util/virstoragefile.h (virStorageSource): ...and rename.
      * src/conf/domain_conf.c (virDomainDiskSourceDefClear)
      (virDomainDiskAuthClear): Adjust clients.
      * tools/Makefile.am (virt_login_shell_CFLAGS)
      (virt_host_validate_CFLAGS): Add libxml headers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8a20e227
    • E
      conf: move storage secret type to util/ · c05d9dca
      Eric Blake 提交于
      This one is a relatively easy move.  We don't ever convert the
      enum to or from strings (it is inferred from other elements in
      the xml, rather than directly represented).
      
      * src/conf/domain_conf.h (virDomainDiskSecretType): Move...
      * src/util/virstoragefile.h (virStorageSecreteType): ...and
      rename.
      * src/conf/domain_conf.c (virDomainDiskSecretType): Drop unused
      enum conversion.
      (virDomainDiskAuthClear, virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Adjust clients.
      * src/qemu/qemu_command.c (qemuGetSecretString): Likewise.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePoolAuth):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c05d9dca
    • 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
    • E
      maint: ensure src/ directory includes are clean · cbfd9a61
      Eric Blake 提交于
      In 'make syntax-check', we have a rule that prevents layering
      violations between the various files in src.  However, we
      forgot to treat conf/ and the more recently-added access/ as
      lower-level directories, and were not detecting cases where
      they might have used a driver file.  Also, it's not nice that
      qemu can use storage/ but none of the other drivers could do so.
      
      * cfg.mk (sc_prohibit_cross_inclusion): Tighten rules for conf/
      and access/, let all other drivers use storage/.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cbfd9a61
  3. 01 4月, 2014 4 次提交