1. 27 9月, 2012 2 次提交
  2. 26 9月, 2012 1 次提交
  3. 25 9月, 2012 1 次提交
    • P
      qemu: Avoid holding the driver lock in trivial snapshot API's · 35fe4e7e
      Peter Krempa 提交于
      In most of the snapshot API's there's no need to hold the driver lock
      the whole time.
      
      This patch adds helper functions that get the domain object in functions
      that don't require the driver lock and simplifies call paths from
      snapshot-related API's.
      35fe4e7e
  4. 22 9月, 2012 1 次提交
  5. 21 9月, 2012 2 次提交
  6. 18 9月, 2012 6 次提交
  7. 17 9月, 2012 1 次提交
  8. 14 9月, 2012 1 次提交
    • G
      snapshot: fix rollback failure in transaction mode · ac89a611
      Guannan Ren 提交于
      BZ:https://bugzilla.redhat.com/show_bug.cgi?id=843372
      when qemu supports the 'transaction' monitor command,
      and libvirt's --reuse-ext flag was not specified, libvirt created
      a stub file with zero size in first place. After the failure of
      QEMU transaction command performing qcow2 snapshots on more than
      one drives, the stub file is left behind with non-empty
      by the QEMU transaction command.
      In order to unlink the file, the patch removes the file size checking.
      
      Steps to reproduce the issue:
      Steps:
       1, Create a qemu instance with two drive images of qcow2 type (root user)
          /usr/libexec/qemu-kvm -m 1024 -smp 1 -name "rhel6u1" \
            -drive file=/var/lib/libvirt/images/firstqcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
            -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
            -drive file=/var/lib/libvirt/images/secondqcow2,if=none,id=drive-virtio-disk1,format=qcow2,cache=none \
            -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk1,id=virtio-disk1 -qmp stdio
      
       2, Initialize qemu qmp
          {"execute":"qmp_capabilities"}
      
       3, Remove the second drive image file
          rm -f /var/lib/libvirt/images/secondqcow2
      
       4, Run 'transaction' command with snapshot qemu commands in.
          {"execute":"transaction","arguments":
            {"actions":
              [{"type":"blockdev-snapshot-sync","data":
                {"device":"drive-virtio-disk0","snapshot-file":"/var/lib/libvirt/images/firstqcow2-snapshot.img","format":"qcow2"}
               },
               {"type":"blockdev-snapshot-sync","data":
                {"device":"drive-virtio-disk1","snapshot-file":"/var/lib/libvirt/images/secondqcow2-snapshot.img","format":"qcow2"}
               }]
            },
         "id":"libvirt-6"}
      
       5, Got the error as follows:
          {"id": "libvirt-6",
            "error": {"class": "OpenFileFailed", "desc": "Could not open '/var/lib/libvirt/images/secondqcow2-snapshot.img'",
                      "data": {"filename": "/var/lib/libvirt/images/secondqcow2-snapshot.img"}
                     }
          }
      
       6, List first newly-created snapshot file:
          -rw-r--r--. 1 root root     262144 Sep 13 11:43 firstqcow2-snapshot.img
      ac89a611
  9. 13 9月, 2012 3 次提交
    • D
      Fix data types used for list sizes in QEMU capabilities · 9b5c5400
      Daniel P. Berrange 提交于
      The QEMU capabilities APIs used a misc of 'int' and
      'unsigned int' for variables relating to array sizes.
      Change all these to use 'size_t'
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      9b5c5400
    • D
      Turn QEMU capabilities object into a full virObjectPtr · beac09fd
      Daniel P. Berrange 提交于
      The current qemu capabilities are stored in a virBitmapPtr
      object, whose type is exposed to callers. We want to store
      more data besides just the flags, so we need to move to a
      struct type. This object will also need to be reference
      counted, since we'll be maintaining a cache of data per
      binary. This change introduces a 'qemuCapsPtr' virObject
      class. Most of the change is just renaming types and
      variables in all the callers
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      beac09fd
    • E
      maint: fix missing spaces in message · 2387aa26
      Eric Blake 提交于
      I got an off-list report about a bad diagnostic:
      Target network card mac 52:54:00:49:07:ccdoes not match source 52:54:00:49:07:b8
      
      True to form, I've added a syntax check rule to prevent it
      from recurring, and found several other offenders.
      
      * cfg.mk (sc_require_whitespace_in_translation): New rule.
      * src/conf/domain_conf.c (virDomainNetDefCheckABIStability): Add
      space.
      * src/esx/esx_util.c (esxUtil_ParseUri): Likewise.
      * src/qemu/qemu_command.c (qemuCollectPCIAddress): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSetMetadata)
      (qemuDomainGetMetadata): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainChangeNetBridge): Likewise.
      * src/rpc/virnettlscontext.c
      (virNetTLSContextCheckCertDNWhitelist): Likewise.
      * src/vmware/vmware_driver.c (vmwareDomainResume): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives):
      Avoid false negatives.
      * tools/virsh-domain.c (info_save_image_dumpxml): Reword.
      Based on a report by Luwen Su.
      2387aa26
  10. 07 9月, 2012 2 次提交
    • P
      qemu: Add range checking for scheduler tunables when changed by API · 972e914f
      Peter Krempa 提交于
      The quota and period tunables for cpu scheduler accept only a certain
      range of values. When changing the live configuration invalid values get
      rejected. This check is not performed when changing persistent config.
      
      This patch adds a separate range check, that improves error messages
      when changing live config and adds the check for persistent config.
      This check is done only when using the API. It is still possible to
      specify invalid values in the XML.
      972e914f
    • P
      qemu: clean up qemuSetSchedulerParametersFlags() · 3e250b36
      Peter Krempa 提交于
      This patch tries to clean the code up a little bit and shorten very long
      lines.
      
      The apparent semantic change from moving the condition before calling
      the setter function is a non-issue here as the setter function is a
      no-op when called with both arguments zero.
      3e250b36
  11. 03 9月, 2012 1 次提交
    • M
      qemu: Add support for S3/S4 state configuration · b8216ec9
      Martin Kletzander 提交于
      This patch adds support for running qemu guests with the required
      parameters to forcefully enable or disable BIOS advertising of S3 and
      S4 states.  The support for this is added to capabilities and there is
      also a qemu command parameter parsing implemented.
      b8216ec9
  12. 31 8月, 2012 2 次提交
  13. 30 8月, 2012 4 次提交
    • P
      vcpupin: Fix returning of arrays from virDomainVcpuPinAdd · 077e7bf5
      Peter Krempa 提交于
      virDomainVcpuPinAdd does a realloc on vcpupin_list if the new vcpu pin
      definition doesn't fit into the array. The list is an array of pointers
      but the function definition didn't support returning the changed pointer
      to the caller if it was realloced. This caused segfaults if realloc
      would change the base pointer.
      077e7bf5
    • P
      qemu: Clean up security driver initialisation and config file · 46514ff7
      Peter Krempa 提交于
      Commit d0c0e79a left behind some dead
      code (hasDAC can't be efectively set to true, because
      virSecurityManagerNew fails to load the "dac" driver).
      
      This patch also enhances the condition for adding the default
      auto-detected security manager if the manager array is allocated but
      empty.
      
      Also the configuration file for qemu driver still contains reference to
      the DAC driver that can't be enabled manualy.
      46514ff7
    • O
      qemu: Sort the numa params only when it affects the live config · 20b780ae
      Osier Yang 提交于
      As the next boot doesn't have to worry about the previous numa
      params setting (there is no).
      20b780ae
    • D
      Fix configuration of QEMU security drivers · d0c0e79a
      Daniel P. Berrange 提交于
      If no 'security_driver' config option was set, then the code
      just loaded the 'dac' security driver. This is a regression
      on previous behaviour, where we would probe for a possible
      security driver. ie default to SELinux if available.
      
      This changes things so that it 'security_driver' is not set,
      we once again do probing. For simplicity we also always
      create the stack driver, even if there is only one driver
      active.
      
      The desired semantics are:
      
       - security_driver not set
           -> probe for selinux/apparmour/nop
           -> auto-add DAC driver
       - security_driver set to a string
           -> add that one driver
           -> auto-add DAC driver
       - security_driver set to a list
           -> add all drivers in list
           -> auto-add DAC driver
      
      It is not allowed, or possible to specify 'dac' in the
      security_driver config param, since that is always
      enabled.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d0c0e79a
  14. 29 8月, 2012 2 次提交
    • P
      qemu: Refactor initialisation of security drivers. · eb8e9b60
      Peter Krempa 提交于
      The security driver loading code in qemu has a flaw that causes it to
      register the DAC security driver twice. This causes problems (machines
      unable to start) as the two DAC drivers clash together.
      
      This patch refactors the code to allow loading the DAC driver even if
      its specified in configuration (it can't be registered as a common
      security driver), and does not add the driver twice.
      eb8e9b60
    • O
      qemu: Set placement when setting numa parameters · 6fd1708f
      Osier Yang 提交于
      To keep the internal data structure consistent.
      6fd1708f
  15. 28 8月, 2012 2 次提交
    • M
      qemu: Fix define logic · 9eee40cc
      Michal Privoznik 提交于
      With current flow in qemudDomainDefine we might lose data
      when updating an existing domain. We parse given XML and
      overwrite the configuration.  Then we try to save the new
      config. However, this step may fail and we don't perform any
      roll back.  In fact, we remove the domain from the list of
      domains held up by qemu driver. This is okay as long as the
      domain was brand new one.
      9eee40cc
    • M
      Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code · aa3e8bd4
      Michal Privoznik 提交于
      Currently, when guest agent is configured but not responsive
      (e.g. due to appropriate service not running in the guest)
      we return VIR_ERR_INTERNAL_ERROR. Both are wrong. Therefore
      we need to introduce new error code to reflect this case.
      aa3e8bd4
  16. 27 8月, 2012 1 次提交
    • M
      qemu: Switch to unified func name · 661d7fb4
      Michal Privoznik 提交于
      With the latest patches libvirt supports qemu agent monitor
      passthrough. However, function in qemu driver is called
      qemuDrvDomainAgentCommand. s/Drv// as used in all other names.
      661d7fb4
  17. 24 8月, 2012 3 次提交
    • E
      snapshot: rename an enum · 1385c9cd
      Eric Blake 提交于
      The name 'virDomainDiskSnapshot' didn't fit in with our normal
      conventions of using a prefix hinting that it is related to a
      virDomainSnapshotPtr.  Also, a future patch will reuse the
      enum for declaring where the VM memory is stored.
      
      * src/conf/snapshot_conf.h (virDomainDiskSnapshot): Rename...
      (virDomainSnapshotLocation): ...to this.
      (_virDomainSnapshotDiskDef): Update clients.
      * src/conf/domain_conf.h (_virDomainDiskDef): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Likewise.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Likewise.
      * src/conf/snapshot_conf.c: (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDefFormat):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotCreateDiskActive, qemuDomainSnapshotCreateXML):
      Likewise.
      1385c9cd
    • E
      snapshot: make virDomainSnapshotObjList opaque · 3211deba
      Eric Blake 提交于
      We were failing to react to allocation failure when initializing
      a snapshot object list.  Changing things to store a pointer
      instead of a complete object adds one more possible point of
      allocation failure, but at the same time, will make it easier to
      react to failure now, as well as making it easier for a future
      patch to split all virDomainSnapshotPtr handling into a separate
      file, as I continue to add even more snapshot code.
      
      Luckily, there was only one client outside of domain_conf.c that
      was actually peeking inside the object, and a new wrapper function
      was easy.
      
      * src/conf/domain_conf.h (_virDomainObj): Use a pointer.
      (virDomainSnapshotObjListInit): Rename.
      (virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
      declarations.
      (_virDomainSnapshotObjList): Move definitions...
      * src/conf/domain_conf.c: ...here.
      (virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
      Rename...
      (virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
      these.
      (virDomainSnapshotForEach): New function.
      (virDomainObjDispose, virDomainListPopulate): Adjust callers.
      * src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
      (qemuDomainSnapshotDiscardAllMetadata): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
      (qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainListAllSnapshots)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren)
      (qemuDomainSnapshotListAllChildren)
      (qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
      (qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
      (qemuDomainSnapshotDelete): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      3211deba
    • E
      qemu-agent: available in 0.10.0 · 352cbae8
      Eric Blake 提交于
      The recent virDomainQemuAgentCommand addition is part of 0.10.0;
      also, grouping all libvirt-qemu.so callbacks together makes them
      easier to identify.
      
      * src/libvirt_qemu.syms: Fix release symbol.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/driver.h (_virDriver): Group qemu-specific callbacks.
      352cbae8
  18. 23 8月, 2012 2 次提交
  19. 22 8月, 2012 3 次提交
    • W
      qemu: support of emulator_period and emulator_quota's modification · 50659420
      Wen Congyang 提交于
      allow the user change/get emulator's period and quota when the vm is running.
      50659420
    • H
      limit cpu bandwidth only for vcpus · 1d4395eb
      Hu Tao 提交于
      This patch changes the behaviour of xml element cputune.period
      and cputune.quota to limit cpu bandwidth only for vcpus, and no
      longer limit cpu bandwidth for the whole guest.
      
      The reasons to do this are:
      
        - This matches docs of cputune.period and cputune.quota.
        - The other parts excepting vcpus are treated as "emulator",
          and there are separate period/quota settings for emulator
          in the subsequent patches
      1d4395eb
    • H
      qemu: support emulator pinning · 3dbf4838
      Hu Tao 提交于
      Introduce 2 APIs to support emulator threads pin in qemu driver.
      
          1) qemudDomainPinEmulator: setup emulator threads pin info.
          2) qemudDomainGetEmulatorPinInfo: get all emulator threads pin info.
      
      They are similar to qemudDomainPinVcpuFlags and qemudDomainGetVcpuPinInfo.
      And also, remoteDispatchDomainPinEmulatorFlags and remoteDispatchDomainGetEmulatorPinInfo
      functions are introduced.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      3dbf4838