1. 18 11月, 2013 1 次提交
  2. 12 11月, 2013 1 次提交
    • M
      qemuDomainObjStart: Warn on corrupted image · cfc28c66
      Michal Privoznik 提交于
      If the managedsave image is corrupted, e.g. the XML part is, we fail to
      parse it and throw an error, e.g.:
      
      error: Failed to start domain jms8
      error: XML error: missing security model when using multiple labels
      
      This is okay, as we can't really start the machine and avoid undefined
      qemu behaviour. On the other hand, the error message doesn't give a
      clue to users what should they do. The consensus here would be to thrown
      a warning to logs saying "Hey, you've got a corrupted file".
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cfc28c66
  3. 30 10月, 2013 1 次提交
    • D
      Fix race condition reconnecting to vms & loading configs · f26701f5
      Daniel P. Berrange 提交于
      The following sequence
      
       1. Define a persistent QMEU guest
       2. Start the QEMU guest
       3. Stop libvirtd
       4. Kill the QEMU process
       5. Start libvirtd
       6. List persistent guests
      
      At the last step, the previously running persistent guest
      will be missing. This is because of a race condition in the
      QEMU driver startup code. It does
      
       1. Load all VM state files
       2. Spawn thread to reconnect to each VM
       3. Load all VM config files
      
      Only at the end of step 3, does the 'virDomainObjPtr' get
      marked as "persistent". There is therefore a window where
      the thread reconnecting to the VM will remove the persistent
      VM from the list.
      
      The easy fix is to simply switch the order of steps 2 & 3.
      
      In addition to this though, we must only attempt to reconnect
      to a VM which had a non-zero PID loaded from its state file.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f26701f5
  4. 21 10月, 2013 1 次提交
  5. 18 10月, 2013 2 次提交
  6. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in qemu · 9a520a59
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/qemu.
      
      * src/qemu/qemu_bridge_filter.h (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Use intended type.
      * src/qemu/qemu_bridge_filter.c (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Likewise.
      * src/qemu/qemu_command.c (qemuBuildTPMBackendStr)
      (qemuBuildTPMDevStr, qemuBuildCpuArgStr)
      (qemuBuildObsoleteAccelArg, qemuBuildMachineArgStr)
      (qemuBuildSmpArgStr, qemuBuildNumaArgStr): Likewise.
      * src/qemu/qemu_conf.c (qemuSharedDeviceEntryCopy): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSaveImageStartVM): Likewise.
      * src/qemu/qemu_hostdev.c
      (qemuDomainHostdevNetConfigVirtPortProfile): Likewise.
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONAttachCharDevCommand): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a520a59
  7. 14 10月, 2013 2 次提交
  8. 11 10月, 2013 3 次提交
  9. 10 10月, 2013 2 次提交
  10. 07 10月, 2013 1 次提交
    • D
      Remove use of virConnectPtr from all remaining nwfilter code · 999d72fb
      Daniel P. Berrange 提交于
      The virConnectPtr is passed around loads of nwfilter code in
      order to provide it as a parameter to the callback registered
      by the virt drivers. None of the virt drivers use this param
      though, so it serves no purpose.
      
      Avoiding the need to pass a virConnectPtr means that the
      nwfilterStateReload method no longer needs to open a bogus
      QEMU driver connection. This addresses a race condition that
      can lead to a crash on startup.
      
      The nwfilter driver starts before the QEMU driver and registers
      some callbacks with DBus to detect firewalld reload. If the
      firewalld reload happens while the QEMU driver is still starting
      up though, the nwfilterStateReload method will open a connection
      to the partially initialized QEMU driver and cause a crash.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      999d72fb
  11. 04 10月, 2013 2 次提交
  12. 27 9月, 2013 1 次提交
  13. 26 9月, 2013 1 次提交
  14. 24 9月, 2013 1 次提交
  15. 18 9月, 2013 1 次提交
  16. 17 9月, 2013 5 次提交
  17. 16 9月, 2013 1 次提交
  18. 12 9月, 2013 1 次提交
  19. 10 9月, 2013 1 次提交
    • E
      qemu: endjob returns a bool · 6cd15482
      Eric Blake 提交于
      Osier Yang pointed out that ever since commit 31cb030a, the
      signature of qemuDomainObjEndJob was changed to return a bool.
      While comparison against 0 or > 0 still gives the right results,
      it looks fishy; we also had one place that was comparing < 0
      which is effectively dead code.
      
      * src/qemu/qemu_migration.c (qemuMigrationPrepareAny): Fix dead
      code bug.
      (qemuMigrationBegin): Use more canonical form of bool check.
      * src/qemu/qemu_driver.c (qemuAutostartDomain)
      (qemuDomainCreateXML, qemuDomainSuspend, qemuDomainResume)
      (qemuDomainShutdownFlags, qemuDomainReboot, qemuDomainReset)
      (qemuDomainDestroyFlags, qemuDomainSetMemoryFlags)
      (qemuDomainSetMemoryStatsPeriod, qemuDomainInjectNMI)
      (qemuDomainSendKey, qemuDomainGetInfo, qemuDomainScreenshot)
      (qemuDomainSetVcpusFlags, qemuDomainGetVcpusFlags)
      (qemuDomainRestoreFlags, qemuDomainGetXMLDesc)
      (qemuDomainCreateWithFlags, qemuDomainAttachDeviceFlags)
      (qemuDomainUpdateDeviceFlags, qemuDomainDetachDeviceFlags)
      (qemuDomainBlockResize, qemuDomainBlockStats)
      (qemuDomainBlockStatsFlags, qemuDomainMemoryStats)
      (qemuDomainMemoryPeek, qemuDomainGetBlockInfo)
      (qemuDomainAbortJob, qemuDomainMigrateSetMaxDowntime)
      (qemuDomainMigrateGetCompressionCache)
      (qemuDomainMigrateSetCompressionCache)
      (qemuDomainMigrateSetMaxSpeed)
      (qemuDomainSnapshotCreateActiveInternal)
      (qemuDomainRevertToSnapshot, qemuDomainSnapshotDelete)
      (qemuDomainQemuMonitorCommand, qemuDomainQemuAttach)
      (qemuDomainBlockJobImpl, qemuDomainBlockCopy)
      (qemuDomainBlockCommit, qemuDomainOpenGraphics)
      (qemuDomainGetBlockIoTune, qemuDomainGetDiskErrors)
      (qemuDomainPMSuspendForDuration, qemuDomainPMWakeup)
      (qemuDomainQemuAgentCommand, qemuDomainFSTrim): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6cd15482
  20. 09 9月, 2013 1 次提交
    • E
      qemu: don't leak vm on failure · d047b2d9
      Eric Blake 提交于
      Failure to attach to a domain during 'virsh qemu-attach' left
      the list of domains in an odd state:
      
      $ virsh qemu-attach 4176
      error: An error occurred, but the cause is unknown
      
      $ virsh list --all
       Id    Name                           State
      ----------------------------------------------------
       2     foo                            shut off
      
      $ virsh qemu-attach 4176
      error: Requested operation is not valid: domain is already active as 'foo'
      
      $ virsh undefine foo
      error: Failed to undefine domain foo
      error: Requested operation is not valid: cannot undefine transient domain
      
      $ virsh shutdown foo
      error: Failed to shutdown domain foo
      error: invalid argument: monitor must not be NULL
      
      It all stems from leaving the list of domains unmodified on
      the initial failure; we should follow the lead of createXML
      which removes vm on failure (the actual initial failure still
      needs to be fixed in a later patch, but at least this patch
      gets us to the point where we aren't getting stuck with an
      unremovable "shut off" transient domain).
      
      While investigating, I also found a leak in qemuDomainCreateXML;
      the two functions should behave similarly.  Note that there are
      still two unusual paths: if dom is not allocated, the user will
      see an OOM error even though the vm remains registered (but oom
      errors already indicate tricky cleanup); and if the vm starts
      and then quits again all before the job ends, it is possible
      to return a non-NULL dom even though the dom will no longer be
      useful for anything (but this at least lets the user know their
      short-lived vm ran).
      
      * src/qemu/qemu_driver.c (qemuDomainCreateXML): Don't leak vm on
      failure to obtain job.
      (qemuDomainQemuAttach): Match cleanup of qemuDomainCreateXML.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d047b2d9
  21. 05 9月, 2013 1 次提交
  22. 04 9月, 2013 1 次提交
  23. 26 8月, 2013 3 次提交
  24. 22 8月, 2013 2 次提交
  25. 17 8月, 2013 1 次提交
  26. 31 7月, 2013 1 次提交
  27. 26 7月, 2013 1 次提交