1. 16 7月, 2011 2 次提交
    • E
      maint: fix typos · 37754a74
      Eric Blake 提交于
      Our XML prefers "shareable" over "sharable".
      
      * docs/internals/locking.html.in: s/sharable/shareable/
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockAddResource): Likewise.
      37754a74
    • H
      add --cache, --serial, --shareable and --address to attach-disk · e962a579
      Hu Tao 提交于
      This adds four options for virsh command attach-disk.
      
      --cache option allows user to specify cache mode of disk device
      from virsh command line when attaching a disk device.
      
      --serial option allows user to specify serial string of disk device
      from virsh command line when attaching a disk device.
      
      --shareable option allows user to specify whether the disk device is
      shareable between domains when attaching a disk device from virsh
      command line.
      
      --address option allows user to specify address of disk device when
      attaching a disk device.
      e962a579
  2. 15 7月, 2011 12 次提交
    • D
      Fix error message for missing TLS write function · c8771867
      Daniel P. Berrange 提交于
      * src/rpc/virnettlscontext.c: s/read/write/
      c8771867
    • D
      Fix reporting of cert validation failures · f2845177
      Daniel P. Berrange 提交于
      If the server succesfully validates the client cert, it will send
      back a single byte, under TLS. If it fails, it will close the
      connection. In this case, we were just reporting the standard
      I/O error. The original RPC code had a special case hack for the
      GNUTLS_E_UNEXPECTED_PACKET_LENGTH error code to make us report
      a more useful error message
      
      * src/rpc/virnetclient.c: Return ENOMSG if we get
        GNUTLS_E_UNEXPECTED_PACKET_LENGTH
      * src/rpc/virnettlscontext.c: Report cert failure if we
        see ENOMSG
      f2845177
    • D
      Fix error code for storage operations · 618b5522
      Dave Allan 提交于
      Many volume operations will fail if the volume in question is being
      allocated.  These operations were returning VIR_ERR_INTERNAL_ERROR
      when they should be returning VIR_ERR_OPERATION_INVALID.
      618b5522
    • T
      setvcpus: add "--current" option to "virsh setvcpus" · 3807d552
      Taku Izumi 提交于
      This patch adds the --current option to "virsh setvcpus"
      command. Currently "virsh setvcpus" command supports
      "--live" and "--config" , but "--current" option.
      From view of consistency, it's reasonable to support
      "--current" option too.
      
      When --current is specified, it affects a "current"
      domain.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      3807d552
    • T
      setvcpus: extend qemuDomainSetVcpusFlags() to support current flag · c147b937
      Taku Izumi 提交于
      This patch extends qemudDomainSetVcpusFlags() function to support
      VIR_DOMAIN_AFFECT_CURRENT flag.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      c147b937
    • T
      setvcpus: extend virDomainSetVcpusFlags API to support current flag · ceb0ed5d
      Taku Izumi 提交于
      This patch extends virDomainSetVcpusFlags API to support
      VIR_DOMAIN_AFFECT_CURRENT flag.
      
      Now because most APIs accept VIR_DOMAIN_AFFECT_CURRENT flags,
      virDomainSetVcpusFlags API should also do.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      ceb0ed5d
    • D
      Add domain events support to UML driver · cf81318c
      Daniel P. Berrange 提交于
      * src/uml_conf.h: Add queue for dispatch of domain events
      * src/uml_driver.c: Trigger domain events upon important lifecycle transitions
      cf81318c
    • E
      docs: mention EMOTIVE as a libvirt-using app · 71d30260
      Eric Blake 提交于
      * docs/apps.html.in: Add EMOTIVE.
      Reported by Alex Vaqué Brull <memfis@gmail.com>.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      71d30260
    • E
      virnetsocket: use new API for uniform child cleanup · a59a99f2
      Eric Blake 提交于
      Rather than trying to clean up the ssh child ourselves, and risk
      subtle differences from the socket creation error path, we can
      just use the new APIs.
      
      * src/rpc/virnetsocket.c (virNetSocketFree): Use new function.
      a59a99f2
    • E
      fdstream: avoid child process leak on error · 3cbf5d5f
      Eric Blake 提交于
      By requesting the pid in virCommandRunAsync, fdstream was claiming
      that it would manually wait for the process.  But on the failure
      path, the child process was being leaked.
      
      * src/fdstream.c (virFDStreamOpenFileInternal): Auto-reap child.
      3cbf5d5f
    • E
      command: introduce virPidWait, virPidAbort · e208c38b
      Eric Blake 提交于
      When using virCommandRunAsync and saving the pid for later, it
      is useful to be able to reap that pid in the same way that it
      would have been auto-reaped by virCommand if we had passed
      NULL for the pid argument in the first place.
      
      * src/util/command.c (virPidWait, virPidAbort): New functions,
      created from...
      (virCommandWait, virCommandAbort): ...bodies of these.
      (includes): Drop duplicate <stdlib.h>.  Ensure that our pid_t
      assumptions hold.
      (virCommandRunAsync): Improve documentation.
      * src/util/command.h (virPidWait, virPidAbort): New prototypes.
      * src/libvirt_private.syms: Export them.
      * docs/internals/command.html.in: Document them.
      e208c38b
    • J
      update apparmor security driver for new udev paths · 3d732040
      Jamie Strandboge 提交于
      In the Ubuntu development release we recently got a new udev that
      moves /var/run to /run, /var/lock to /run/lock and /dev/shm to /run/shm.
      This change in udev requires updating the apparmor security driver in
      libvirt[1].
      
      Attached is a patch that:
       * adjusts src/security/virt-aa-helper.c to allow both
      LOCALSTATEDIR/run/libvirt/**/%s.pid and /run/libvirt/**/%s.pid. While
      the profile is not as precise, LOCALSTATEDIR/run/ is typically a symlink
      to /run/ anyway, so there is no additional access (remember that
      apparmor resolves symlinks, which is why this is still required even
      if /var/run points to /run).
       * adjusts example/apparmor/libvirt-qemu paths for /dev/shm
      
      [1]https://launchpad.net/bugs/810270
      
      --
      Jamie Strandboge             | http://www.canonical.com
      3d732040
  3. 14 7月, 2011 26 次提交
    • M
      xenapi: Improve error reporting in xenapiOpen · 2682731d
      Matthias Bolte 提交于
      Use better suited error code and avoid NULL in error messsage
      as *privP->session->error_description can be NULL.
      2682731d
    • E
      build: fix VPATH build of todo · b8f36e74
      Eric Blake 提交于
      Without this patch, the make rule in a VPATH build was trying to
      invoke ../../docs/../../docs/todo.pl, which didn't exist.
      
      * docs/Makefile.am (todo.html.in): Using $< already implies
      $(srcdir) in GNU make VPATH situations.
      b8f36e74
    • E
      build: check for virnetprotocol on-the-wire stability · 3fbc7615
      Eric Blake 提交于
      Similar to the recent qemu_protocol-structs addition.
      
      * src/virnetprotocol-structs: New file.
      * src/Makefile.am (%_protocol-structs): Factor body...
      (PDWTAGS): ...into new helper macro.
      (virnetprotocol-structs): New rule.
      (PROTOCOL_STRUCTS): Add virnetprotocol-structs.
      3fbc7615
    • W
      build: disable some drivers when building without libvirt daemon · f2093339
      Wen Congyang 提交于
      We disable some drivers when building without libvirtd in configure,
      but we do not do the same thing in libvirt.spec. It may break rpm
      building without libvirtd.
      f2093339
    • M
      storage: Avoid memory leak on metadata fetching · 85aa40e2
      Michal Privoznik 提交于
      Getting metadata on storage allocates a memory (path) which need to
      be freed after use otherwise it gets leaked. This means after use of
      virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one
      must call virStorageFileFreeMetadata to free it. This function frees
      structure internals and structure itself.
      85aa40e2
    • J
      qemu: Don't overwrite errors by closefd in error paths · c3fd09f7
      Jiri Denemark 提交于
      When qemuMonitorCloseFileHandle is called in error path, we need to
      preserve the original error since a possible further error when running
      closefd monitor command is not very useful to users.
      c3fd09f7
    • J
      qemu: Save domain status ASAP after creating qemu process · 5169e5ea
      Jiri Denemark 提交于
      When creating new qemu process we saved domain status XML only after the
      process was fully setup and running. In case libvirtd was killed before
      the whole process finished, once libvirtd started again it didn't know
      anything about the new process and we end up with an orphaned qemu
      process. Let's save the domain status XML as soon as we know the PID so
      that libvirtd can kill the process on restart.
      5169e5ea
    • 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