1. 14 7月, 2011 25 次提交
    • E
      build: avoid ATTRIBUTE_UNUSED in headers · 088473b2
      Eric Blake 提交于
      The compiler might optimize based on our declaration that something
      is unused.  Putting that declaration in the header risks getting
      out of sync with the actual implementation, so it belongs better
      only in the .c files.  We were mostly compliant, and a new syntax
      check will help us in the future.
      
      * cfg.mk (sc_avoid_attribute_unused_in_header): New syntax check.
      * src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Delete
      attribute already present in .c file.
      * src/qemu/qemu_domain.h (qemuDomainEventFlush): Likewise.
      * src/util/virterror_internal.h (virReportErrorHelper): Parameters
      are actually used by .c file.
      * src/xenxs/xen_sxpr.h (xenFormatSxprDisk): Adjust prototype.
      * src/xenxs/xen_sxpr.c (xenFormatSxprDisk): Delete unused argument.
      (xenFormatSxpr): Adjust caller.
      * src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
      (xenDaemonUpdateDeviceFlags): Likewise.
      Suggested by Daniel Veillard.
      088473b2
    • E
      remote: prefer unsigned flags · 3349f2bb
      Eric Blake 提交于
      * src/remote/remote_driver.c (call, remoteOpenSecondaryDriver):
      Prefer unsigned flags.
      3349f2bb
    • E
      conf: delete unused flags arguments · 553115d3
      Eric Blake 提交于
      For static functions not used as callbacks, there's no need to
      keep an unused parameter.
      
      * src/conf/domain_conf.c (virDomainChrDefParseTargetXML)
      (virDomainTimerDefParseXML, virDomainHostdevSubsysUsbDefParseXML)
      (virDomainVcpuPinDefParseXML): Drop unused parameter.
      (virDomainChrDefParseXML, virDomainDefParseXML)
      (virDomainHostdevDefParseXML): Update callers.
      (virDomainNetDefParseXML): Mark flags used.
      553115d3
    • S
      virsh: Update virsh man page · c444721b
      Supriya Kannery 提交于
      Valid loglevel range for virsh  is 0-4. Update virsh man page
      accordingly. Also explain virsh ENV variables and values.
      Signed-off-by: NSupriya Kannery <supriyak@in.ibm.com>
      c444721b
    • J
      virsh: fix previous patch · f580a33f
      Jiri Denemark 提交于
      The last patch breaks make check for two reasons. First, it reverses the
      condition but leaves default level unchanged, so instead of not printing
      anything but errors before the patch it now prints all debug messages by
      default. Second, you forgot to change -d5 option passed to virsh in
      tests/virsh-optparse to -d0; the script wants to see all debug messages.
      f580a33f
    • S
      virsh: Make "DEBUG" loglevel the superset · c1710ca6
      Supriya Kannery 提交于
      Aligning loglevel values of virsh to that of libvirt.
      "DEBUG"=0 loglevel, when specified through commandline or
      env variable, should log all the messages. "ERROR=4"
      should log only error messages.
      Signed-off-by: NSupriya Kannery <supriyak@in.ibm.com>
      c1710ca6
    • S
      virsh: Avoid using magic numbers for logging · 2de8aa8f
      Supriya Kannery 提交于
      Replace magic numbers with loglevel variables.
      Signed-off-by: NSupriya Kannery <supriyak@in.ibm.com>
      2de8aa8f
    • J
      util: Avoid duplicating virFileOpenAsNoFork in virFileOpenAs · 3e75c5ec
      Jiri Denemark 提交于
      In 2f4d2496 I didn't notice that one
      part of virFileOpenAs doesn't actually call to virFileOpenAsNoFork but
      rather includes a copy of the code from there.
      3e75c5ec
    • E
      build: don't hand-roll cloexec code · ff98359d
      Eric Blake 提交于
      No need to repeat common code.
      
      * bootstrap.conf (gnulib_modules): Import calloc-posix.
      * src/util/bridge.c (brInit): Use virSetCloseExec.
      (brSetInterfaceUp): Adjust flags name.
      * src/uml/uml_driver.c (umlSetCloseExec): Delete.
      (umlStartVMDaemon): Use util version instead.
      ff98359d
    • E
      conf: prefer unsigned flags · e17d3e7f
      Eric Blake 提交于
      * src/conf/cpu_conf.h (virCPUDefFormat, virCPUDefFormatBuf):
      Change flags type.
      * src/conf/cpu_conf.c (virCPUDefFormat, virCPUDefFormatBuf):
      Likewise.
      * src/conf/storage_conf.c (_virStoragePoolOptions): Likewise.
      * src/datatypes.h (_virConnect, _virStream): Likewise.
      e17d3e7f
    • E
      python: prefer unsigned flags · 07d5d073
      Eric Blake 提交于
      * python/libvirt-override.c (libvirt_virConnectOpenAuth)
      (libvirt_virDomainSnapshotListNames)
      (libvirt_virDomainRevertToSnapshot): Change flags type.
      07d5d073
    • E
      node_device: avoid implicit int · 52a12382
      Eric Blake 提交于
      'unsigned a' and 'unsigned int a' are synonyms, but we generally
      always spell out the 'int' in that case.  Fixing this will avoid
      a false positive in the next syntax-check commit.
      
      * src/conf/node_device_conf.h (pci_config_address)
      (_virNodeDevCapsDef): Prefer 'unsigned int' over 'unsigned'.
      52a12382
    • E
      virsh, daemon: prefer unsigned flags · 0983905c
      Eric Blake 提交于
      * tools/virsh.c (vshCmdDef): Change flags type.
      * daemon/remote.c (remoteDispatchOpen): Likewise.
      0983905c
    • E
      xenapi: reject unknown flags · 4ba3faac
      Eric Blake 提交于
      * src/xenapi/xenapi_driver.c (xenapiOpen, xenapiDomainReboot):
      Reject unknown flags.
      (xenapiDomainGetXMLDesc): Likewise, and pass known flags through
      to XML generation.
      4ba3faac
    • E
      vmware: reject unknown flags · 8cf1b7fc
      Eric Blake 提交于
      * src/vmware/vmware_driver.c (vmwareOpen, vmwareDomainReboot)
      (vmwareDomainCreateXML, vmwareDomainCreateWithFlags): Reject
      unknown flags.
      8cf1b7fc
    • E
      vbox: reject unknown flags · 8d173c47
      Eric Blake 提交于
      * src/vbox/vbox_driver.c (vboxOpenDummy): Reject unknown flags.
      * src/vbox/vbox_tmpl.c (vboxOpen, vboxDomainReboot)
      (vboxNetworkOpen, vboxNetworkGetXMLDesc, vboxStorageOpen)
      (vboxStorageVolCreateXML, vboxStorageVolDelete)
      (vboxStorageVolGetXMLDesc, vboxDomainScreenshot): Likewise.
      8d173c47
    • E
      uml: reject unknown flags · 2bcad368
      Eric Blake 提交于
      * src/uml/uml_driver.c (umlOpen, umlDomainGetXMLDesc)
      (umlDomainBlockPeek): Reject unknown flags.
      2bcad368
    • E
      test: reject unknown flags · e8f03b8f
      Eric Blake 提交于
      * src/test/test_driver.c (testOpen, testDomainCoreDump)
      (testOpenNetwork, testNetworkGetXMLDesc, testOpenInterface)
      (testInterfaceChangeBegin, testInterfaceChangeCommit)
      (testInterfaceChangeRollback, testInterfaceGetXMLDesc)
      (testInterfaceDefineXML, testInterfaceCreate)
      (testInterfaceDestroy, testStorageOpen, testStoragePoolStart)
      (testStorageFindPoolSources, testStoragePoolCreate)
      (testStoragePoolDefine, testStoragePoolBuild)
      (testStoragePoolDelete, testStoragePoolRefresh)
      (testStoragePoolGetXMLDesc, testStorageVolumeCreateXML)
      (testStorageVolumeCreateXMLFrom, testStorageVolumeDelete)
      (testStorageVolumeGetXMLDesc, testDevMonOpen)
      (testNodeNumOfDevices, testNodeListDevices)
      (testNodeDeviceGetXMLDesc, testNodeDeviceCreateXML)
      (testSecretOpen, testNWFilterOpen): Reject unknown flags.
      e8f03b8f
    • E
      qemu: reject unknown flags · f548480b
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemudOpen, qemuDomainScreenshot)
      (qemuDomainXMLFromNative, qemuDomainXMLToNative)
      (qemudDomainBlockPeek, qemuCPUCompare, qemuCPUBaseline): Reject
      unknown flags.
      * src/qemu/qemu_migration.c (qemuMigrationConfirm): Likewise.
      (_qemuMigrationCookie, qemuMigrationCookieXMLParse)
      (qemuMigrationCookieXMLParseStr, qemuMigrationBakeCookie)
      (qemuMigrationEatCookie): Make flags unsigned.
      * src/qemu/qemu_domain.h: (qemuDomainDefFormatXML)
      (qemuDomainFormatXML): Prefer unsigned flags.
      * src/qemu/qemu_domain.c (qemuDomainDefFormatXML)
      (qemuDomainFormatXML): Likewise.
      (qemuDomainOpenLogHelper, qemuDomainCreateLog): Rename variable.
      f548480b
    • E
      phyp: reject unknown flags · 76f40fa5
      Eric Blake 提交于
      * src/phyp/phyp_driver.c (phypOpen, phypDomainReboot)
      (phypVIOSDriverOpen): Reject unknown flags.
      76f40fa5
    • E
      openvz: reject unknown flags · 8ef4fe14
      Eric Blake 提交于
      * src/openvz/openvz_driver.c (openvzDomainReboot, openvzOpen):
      Reject unknown flags.
      8ef4fe14
    • E
      lxc: reject unknown flags · 5037cea5
      Eric Blake 提交于
      * src/lxc/lxc_driver.c (lxcOpen, lxcDomainSetMemoryParameters)
      (lxcDomainGetMemoryParameters): Reject unknown flags.
      * src/lxc/lxc_container.c (lxcContainerStart): Rename flags to
      cflags to reflect that it is not tied to libvirt.
      5037cea5
    • E
      libxl: reject unknown flags · 9110941c
      Eric Blake 提交于
      * src/libxl/libxl_driver.c (libxlOpen, libxlDomainReboot)
      (libxlDomainXMLFromNative, libxlDomainXMLToNative)
      (libxlDomainCreateWithFlags): Reject unknown flags.
      9110941c
    • N
      virsh: fix missing prompt message for 'snapshot-delete' command · 23cbf1e0
      Nan Zhang 提交于
      Make the command 'virsh snapshot-delete' has the appropriate prompt
      message when executing sucessful or failed.
      23cbf1e0
    • P
      qemu: build failed due to unused variables · 36caaddd
      Peter Krempa 提交于
      While compiling on F15 build crashed (probably because of new GCC).
      36caaddd
  2. 13 7月, 2011 15 次提交
    • E
      storage: reject unknown flags · 64bd1b9d
      Eric Blake 提交于
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (virStorageBackendCreateQemuImg)
      (virStorageBackendCreateQcowCreate): Reject unknown flags.
      * src/storage/storage_backend_disk.c (virStorageBackendDiskBuildPool)
      (virStorageBackendDiskDeleteVol): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSources)
      (virStorageBackendFileSystemBuild)
      (virStorageBackendFileSystemDelete, createFileDir)
      (virStorageBackendFileSystemVolBuildFrom)
      (virStorageBackendFileSystemVolDelete): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalFindPoolSources)
      (virStorageBackendLogicalBuildPool)
      (virStorageBackendLogicalDeletePool)
      (virStorageBackendLogicalDeleteVol): Likewise.
      * src/storage/storage_driver.c (storageOpen, storagePoolCreate)
      (storagePoolDefine, storagePoolRefresh, storagePoolGetXMLDesc)
      (storageVolumeCreateXML, storageVolumeCreateXMLFrom)
      (storageVolumeGetXMLDesc): Likewise.
      64bd1b9d
    • E
      node_device: reject unknown flags · ba78d2cf
      Eric Blake 提交于
      * src/node_device/node_device_driver.c (nodeNumOfDevices)
      (nodeListDevices, nodeDeviceGetXMLDesc, nodeDeviceCreateXML):
      Reject unknown flags.
      * src/node_device/node_device_hal.c (halNodeDrvOpen): Likewise.
      * src/node_device/node_device_udev.c (udevNodeDrvOpen): Likewise.
      ba78d2cf
    • E
      util: reject unknown flags, and prefer unsigned flags · 833fe8ab
      Eric Blake 提交于
      Silently ignored flags get in the way of new features that
      use those flags.  Also, an upcoming syntax check will favor
      unsigned flags.
      
      * src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Drop
      unused attribute.
      * src/interface/netcf_driver.c (interfaceOpenInterface)
      (interfaceDefineXML, interfaceCreate, interfaceDestroy): Reject
      unknown flags.
      * src/network/bridge_driver.c (networkOpenNetwork)
      (networkGetXMLDesc): Likewise.
      * src/nwfilter/nwfilter_driver.c (nwfilterOpen): Likewise.
      * src/secret/secret_driver.c (secretOpen, secretDefineXML)
      (secretGetXMLDesc, secretSetValue): Likewise.
      * src/util/logging.c (virLogDefineFilter, virLogDefineOutput)
      (virLogMessage): Likewise; also use unsigned flags.
      * src/util/logging.h (virLogDefineFilter, virLogDefineOutput)
      (virLogMessage): Change signature.
      * src/util/command.c (virExecWithHook): Likewise.
      833fe8ab
    • E
      libvirt-qemu: use unsigned flags · 01ed9b56
      Eric Blake 提交于
      Like commit 1740c381, but for libvirt-qemu.
      
      * src/remote/qemu_protocol.x (qemu_monitor_command_args): Adjust
      type to match API.
      * src/qemu_protocol-structs: Update accordingly.
      01ed9b56
    • E
      maint: print flags in hex during debug · 06dbfa6d
      Eric Blake 提交于
      Continuation of commit 313ac7fd, and enforce things with a syntax
      check.
      
      Technically, virNetServerClientCalculateHandleMode is not printing
      a mode_t, but rather a collection of VIR_EVENT_HANDLE_* bits;
      however, these bits are < 8, so there is no different in the
      output, and that was the easiest way to silence the new syntax check.
      
      * cfg.mk (sc_flags_debug): New syntax check.
      (exclude_file_name_regexp--sc_flags_debug): Add exemptions.
      * src/fdstream.c (virFDStreamOpenFileInternal): Print flags in
      hex, mode_t in octal.
      * src/libvirt-qemu.c (virDomainQemuMonitorCommand)
      (virDomainQemuAttach): Likewise.
      * src/locking/lock_driver_nop.c (virLockManagerNopInit): Likewise.
      * src/locking/lock_driver_sanlock.c (virLockManagerSanlockInit):
      Likewise.
      * src/locking/lock_manager.c: Likewise.
      * src/qemu/qemu_migration.c: Likewise.
      * src/qemu/qemu_monitor.c: Likewise.
      * src/rpc/virnetserverclient.c
      (virNetServerClientCalculateHandleMode): Print mode with %o.
      06dbfa6d
    • E
      maint: exclude more files from syntax check · 017b8405
      Eric Blake 提交于
      * cfg.mk (VC_LIST_ALWAYS_EXCLUDE_REGEX): Exempt
      docs/api_extension/*.patch.
      (exclude_file_name_regexp--sc_prohibit_always_true_header_tests)
      (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF)
      (exclude_file_name_regexp--sc_prohibit_fork_wrappers)
      (exclude_file_name_regexp--sc_trailing_blank): Simplify.
      (exclude_file_name_regexp--sc_prohibit_gettext_noop): Delete.
      (exclude_file_name_regexp--sc_prohibit_close)
      (exclude_file_name_regexp--sc_prohibit_nonreentrant)
      (exclude_file_name_regexp--sc_prohibit_sprintf): Tighten.
      017b8405
    • E
      util: honor anchored names when searching for executables · 51fc5655
      Eric Blake 提交于
      I got bit in a debugging session on an uninstalled libvirtd; the
      code tried to call out to the installed $LIBEXECDIR/libvirt_iohelper
      instead of my just-built version.  So I set a breakpoint and altered
      the binary name to be "./src/libvirt_iohelper", and it still failed
      because I don't have "." on my PATH.
      
      According to POSIX, execvp only searches PATH if the name does
      not contain a slash.  Since we are trying to mimic that behavior,
      an anchored name should be relative to the current working dir.
      
      This tightens existing behavior, but most callers already pass
      an absolute name or a name with no slashes, so it probably won't
      be noticeable.
      
      * src/util/util.c (virFindFileInPath): Anchored relative names do
      not invoke a PATH search.
      51fc5655
    • D
      Ensure signal handler propagates fatal signals to default handler · 83d768fa
      Daniel P. Berrange 提交于
      When replacing the default SEGV/ABORT/BUS signal handlers you
      can't rely on the process being terminated after your custom
      handler runs. It is neccessary to manually restore the default
      handler and then re-raise the signal
      
      * src/rpc/virnetserver.c: Restore default handler and raise
        signal
      83d768fa
    • D
      Remove unused virNetServerProgramErrorHander typedef · 1a81687a
      Daniel P. Berrange 提交于
      * src/rpc/virnetserverprogram.h: Remove unused typedef for
        virNetServerProgramErrorHander function callback
      * daemon/remote.h: Remove decl for non-existant variables
      1a81687a
    • J
      qemu: Fix monitor unlocking in some error paths · a23476f0
      Jiri Denemark 提交于
      When monitor is entered with qemuDomainObjEnterMonitorWithDriver, the
      correct method for leaving and unlocking the monitor is
      qemuDomainObjExitMonitorWithDriver.
      a23476f0
    • J
      qemu: Consolidate qemuMigrationPrepare{Direct,Tunnel} · 307656b4
      Jiri Denemark 提交于
      Most of the code in these two functions is supposed to be identical but
      currently it isn't (which is natural since the code is duplicated).
      Let's move common parts of these functions into qemuMigrationPrepareAny.
      
      This also fixes qemuMigrationPrepareTunnel which didn't store received
      lockState in the domain object.
      307656b4
    • J
      qemu: Add support for job phase · 5b2d0bbc
      Jiri Denemark 提交于
      Asynchronous jobs may take long time to finish and may consist of
      several phases which we need to now about to help with recovery/rollback
      after libvirtd restarts.
      5b2d0bbc
    • J
      qemu: Recover from interrupted jobs · e6704af1
      Jiri Denemark 提交于
      Detect and react on situations when libvirtd was restarted or killed
      when a job was active.
      e6704af1
    • J
      qemu: Save job type in domain status XML · ff340a84
      Jiri Denemark 提交于
      If libvirtd is restarted when a job is running, the new libvirtd process
      needs to know about that to be able to recover and rollback the
      operation.
      ff340a84
    • J
      qemu: Allow all query commands to be run during long jobs · 36184288
      Jiri Denemark 提交于
      Query commands are safe to be called during long running jobs (such as
      migration). This patch makes them all work without the need to
      special-case every single one of them.
      
      The patch introduces new job.asyncCond condition and associated
      job.asyncJob which are dedicated to asynchronous (from qemu monitor
      point of view) jobs that can take arbitrarily long time to finish while
      qemu monitor is still usable for other commands.
      
      The existing job.active (and job.cond condition) is used all other
      synchronous jobs (including the commands run during async job).
      
      Locking schema is changed to use these two conditions. While asyncJob is
      active, only allowed set of synchronous jobs is allowed (the set can be
      different according to a particular asyncJob) so any method that
      communicates to qemu monitor needs to check if it is allowed to be
      executed during current asyncJob (if any). Once the check passes, the
      method needs to normally acquire job.cond to ensure no other command is
      running. Since domain object lock is released during that time, asyncJob
      could have been started in the meantime so the method needs to recheck
      the first condition. Then, normal jobs set job.active and asynchronous
      jobs set job.asyncJob and optionally change the list of allowed job
      groups.
      
      Since asynchronous jobs only set job.asyncJob, other allowed commands
      can still be run when domain object is unlocked (when communicating to
      remote libvirtd or sleeping). To protect its own internal synchronous
      commands, the asynchronous job needs to start a special nested job
      before entering qemu monitor. The nested job doesn't check asyncJob, it
      only acquires job.cond and sets job.active to block other jobs.
      36184288