1. 09 10月, 2015 1 次提交
    • M
      virJSONValueArraySize: return ssize_t · 4f77c48c
      Michal Privoznik 提交于
      The internal representation of a JSON array counts the items in
      size_t. However, for some reason, when asking for the count it's
      reported as int. Firstly, we need the function to return a signed
      type as it's returning -1 on an error. But, not every system has
      integer the same size as size_t. Therefore, lets return ssize_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f77c48c
  2. 24 8月, 2015 1 次提交
    • E
      locking: Remove redundant 'srv' element from virLockDaemon · f08b1c58
      Erik Skultety 提交于
      Now that we have virNetDaemon object holding all the data and being
      capable of referencing multiple servers, having a duplicate reference to
      a single server stored in virLockDaemon isn't necessary anymore. This
      patch removes the above described element.
      f08b1c58
  3. 10 8月, 2015 1 次提交
    • M
      rpc: Remove keepalive_required option · a8743c39
      Martin Kletzander 提交于
      Since its introduction in 2011 (particularly in commit f4324e32),
      the option doesn't work.  It just effectively disables all incoming
      connections.  That's because the client private data that contain the
      'keepalive_supported' boolean, are initialized to zeroes so the bool is
      false and the only other place where the bool is used is when checking
      whether the client supports keepalive.  Thus, according to the server,
      no client supports keepalive.
      
      Removing this instead of fixing it is better because a) apparently
      nobody ever tried it since 2011 (4 years without one month) and b) we
      cannot know whether the client supports keepalive until we get a ping or
      pong keepalive packet.  And that won't happen until after we dispatched
      the ConnectOpen call.
      
      Another two reasons would be c) the keepalive_required was tracked on
      the server level, but keepalive_supported was in private data of the
      client as well as the check that was made in the remote layer, thus
      making all other instances of virNetServer miss this feature unless they
      all implemented it for themselves and d) we can always add it back in
      case there is a request and a use-case for it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a8743c39
  4. 16 6月, 2015 1 次提交
  5. 23 4月, 2015 1 次提交
    • J
      locking: relax PID requirement · ee3eddb3
      Jim Fehlig 提交于
      Some hypervisors like Xen do not have PIDs associated with domains.
      Relax the requirement for PID != 0 in the locking code so it can
      be used by hypervisors that do not represent domains as a process
      running on the host.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ee3eddb3
  6. 15 4月, 2015 1 次提交
  7. 02 4月, 2015 1 次提交
    • J
      Remove unused macros · a0482396
      Ján Tomko 提交于
      In the order of appearance:
      
      * MAX_LISTEN - never used
        added by 23ad665c (qemud) and addec57 (lock daemon)
      
      * NEXT_FREE_CLASS_ID - never used, added by 07d1b6b5
      
      * virLockError - never used, added by eb8268a4
      
      * OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
        unused since the removal of ADD_ARG_LIT in d8b31306
      
      * QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e7
      
      * QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7b
      
      * TEST_MODEL_WORDSIZE - unused since c25c18f7
      
      * TEMPDIR - never used, added by 714bef5b
      
      * NSIG - workaround around old headers
        added by commit 60ed1d2a
        unused since virExec was moved by commit 02e86910
      
      * DO_TEST_PARSE - never used, added by 9afa0060
      
      * DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb66
      a0482396
  8. 25 3月, 2015 1 次提交
  9. 09 3月, 2015 2 次提交
    • J
      sanlock: Don't spam logs with "target pid not found" · 54972be8
      Jiri Denemark 提交于
      Commit v1.2.4-52-gda879e59 fixed issues with domains started before
      sanlock driver was enabled by checking whether a running domain is
      registered with sanlock and if it's not, sanlock driver is basically
      ignored for the domain.
      
      However, it was checking this even for domain which has just been
      started and no sanlock_* API was called for them yet. This results in
      
          cmd 9 target pid 2135544 not found
      
      error messages to appear in sanlock.log whenever we start a new domain.
      
      This patch avoids this useless check for freshly started domains.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      54972be8
    • J
      locking: Fix flags in virLockManagerLockDaemonNew · 6beb75d9
      Jiri Denemark 提交于
      virLockManager*New APIs are never called with
      VIR_LOCK_MANAGER_USES_STATE. Moreover, lockd driver does not maintain
      any state that would need to be transferred during migration and thus it
      should not mention VIR_LOCK_MANAGER_USES_STATE at all.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      6beb75d9
  10. 19 2月, 2015 1 次提交
    • J
      Search for schemas and cpu_map.xml in source tree · bc6e2063
      Jiri Denemark 提交于
      Not all files we want to find using virFileFindResource{,Full} are
      generated when libvirt is built, some of them (such as RNG schemas) are
      distributed with sources. The current API was not able to find source
      files if libvirt was built in VPATH.
      
      Both RNG schemas and cpu_map.xml are distributed in source tarball.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      bc6e2063
  11. 09 1月, 2015 1 次提交
    • J
      safezero: fall back to writing zeroes even when resizing · 1390c268
      Ján Tomko 提交于
      Remove the resize flag and use the same code path for all callers.
      This flag was added by commit 18f03166 to allow virStorageFileResize
      use 'safezero' while preserving the behavior.
      
      Explicitly return -2 when a fallback to a different method should
      be done, to make the code path more obvious.
      
      Fail immediately when ftruncate fails in the mmap method,
      as we did before commit 18f03166.
      1390c268
  12. 17 12月, 2014 1 次提交
    • J
      virstoragefile: Have virStorageFileResize use safezero · 18f03166
      John Ferlan 提交于
      Currently virStorageFileResize() function uses build conditionals to
      choose either the posix_fallocate() or syscall(SYS_fallocate) with no
      fallback in order to preallocate the space in the newly resized file.
      
      Since the safezero code has a similar set of conditionals modify the
      resize and safezero code in order to allow the resize logic to make use
      of safezero to unify the look/feel of the code paths.
      
      Add a new boolean (resize) to safezero() to make the optional decision
      whether to try syscall(SYS_fallocate) if the posix_fallocate fails because
      HAVE_POSIX_FALLOCATE is not defined (eg, return -1 and errno == 0).
      
      Create a local safezero_sys_fallocate in order to handle the resize
      code paths that support that.  If not present, the set errno = ENOSYS
      in order to allow the caller to handle the failure scenarios.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      18f03166
  13. 15 12月, 2014 3 次提交
  14. 03 12月, 2014 1 次提交
    • J
      Replace virDomainFree with virObjectUnref · 8fb3aee2
      John Ferlan 提交于
      Since virDomainFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      8fb3aee2
  15. 15 11月, 2014 1 次提交
  16. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in helpers · ff99c791
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/conf/nwfilter_conf.c: Fix initialization.
      * src/cpu/cpu_x86.c: Likewise.
      * src/interface/interface_backend_netcf.c: Likewise.
      * src/locking/lock_daemon.c: Likewise.
      * src/locking/lock_driver_lockd.c: Likewise.
      * src/locking/lock_driver_sanlock.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/rpc/virnetserver.c: Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxGenSecurityLabel): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff99c791
  17. 15 9月, 2014 1 次提交
  18. 03 9月, 2014 1 次提交
  19. 22 8月, 2014 3 次提交
  20. 16 7月, 2014 1 次提交
    • M
      Fix const correctness · 607806f8
      Michal Privoznik 提交于
      In many places we define a variable as a 'const char *' when in fact
      we modify it just a few lines below. Or even free it. We should not do
      that.
      
      There's one exception though, in xenSessionFree() xenapi_utils.c. We
      are freeing the xen_session structure which is defined in
      xen/api/xen_common.h public header. The structure contains session_id
      which is type of 'const char *' when in fact it should have been just
      'char *'. So I'm leaving this unmodified, just noticing the fact in
      comment.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      607806f8
  21. 09 7月, 2014 1 次提交
  22. 08 7月, 2014 1 次提交
  23. 07 7月, 2014 1 次提交
  24. 03 7月, 2014 1 次提交
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
  25. 06 6月, 2014 1 次提交
  26. 13 5月, 2014 3 次提交
  27. 28 4月, 2014 2 次提交
  28. 25 4月, 2014 2 次提交
  29. 22 4月, 2014 1 次提交
  30. 02 4月, 2014 1 次提交
    • 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
  31. 25 3月, 2014 1 次提交