1. 31 8月, 2011 5 次提交
    • D
      Remove bogus virSecurityManagerSetProcessFDLabel method · 18338388
      Daniel P. Berrange 提交于
      The virSecurityManagerSetProcessFDLabel method was introduced
      after a mis-understanding from a conversation about SELinux
      socket labelling. The virSecurityManagerSetSocketLabel method
      should have been used for all such scenarios.
      
      * src/security/security_apparmor.c, src/security/security_apparmor.c,
        src/security/security_driver.h, src/security/security_manager.c,
        src/security/security_manager.h, src/security/security_selinux.c,
        src/security/security_stack.c: Remove SetProcessFDLabel driver
      18338388
    • D
      Fix sanlock socket security labelling · 64bdec38
      Daniel P. Berrange 提交于
      It is not possible to change the label of a TCP socket once it
      has been opened. When creating a TCP socket care must be taken
      to ensure the socket creation label is set & then cleared.
      Remove the bogus call to virSecurityManagerSetProcessFDLabel
      from the lock driver guest setup code and instead make use of
      virSecurityManagerSetSocketLabel
      64bdec38
    • D
      Fix incorrect path length check in sanlock lockspace setup · 2223b1f7
      Daniel P. Berrange 提交于
      The code for creating a sanlock lockspace accidentally used
      SANLK_NAME_LEN instead of SANLK_PATH_LEN for a size check.
      This meant disk paths were limited to 48 bytes !
      
      * src/locking/lock_driver_sanlock.c: Fix disk path length
        check
      2223b1f7
    • E
      snapshot: forbid snapshot on autodestroy domain · 173015be
      Eric Blake 提交于
      There is no reason to forbid pausing an autodestroy domain
      (not to mention that 'virsh start --paused --autodestroy'
      succeeds in creating a paused autodestroy domain).
      
      Meanwhile, qemu was failing to enforce the API documentation that
      autodestroy domains cannot be saved.  And while the original
      documentation only mentioned save/restore, snapshots are another
      form of saving that are close enough in semantics as to make no
      sense on one-shot domains.
      
      * src/qemu/qemu_driver.c (qemudDomainSuspend): Drop bogus check.
      (qemuDomainSaveInternal, qemuDomainSnapshotCreateXML): Forbid
      saves of autodestroy domains.
      * src/libvirt.c (virDomainCreateWithFlags, virDomainCreateXML):
      Document snapshot interaction.
      173015be
    • P
      Fix error detection in device change · 4521ffab
      Philipp Hahn 提交于
      According to qemu-kvm/qerror.c all messages start with a capital
      "Device ", but the current code only scans for the lower case "device ".
      This results in "virDomainUpdateDeviceFlags()" to not detect locked
      CD-ROMs and reporting success even in the case of a failure:
      	# virsh qemu-monitor-command "$VM" change\ drive-ide0-0-0\ \"/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso\"
      	Device 'drive-ide0-0-0' is locked
      	# virsh update-device "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><driver name='qemu' type='raw'/><source file='/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso'/><target dev='hda' bus='ide'/><readonly/><alias name='ide0-0-0'/><address type='drive' controller='0' bus='0' unit='0'/></disk>"
      	Device updated successfully
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      4521ffab
  2. 30 8月, 2011 4 次提交
    • E
      start: allow discarding managed save · 27c85260
      Eric Blake 提交于
      There have been several instances of people having problems with
      a broken managed save file, and not aware that they could use
      'virsh managedsave-remove dom' to fix things.  Making it possible
      to do this as part of starting a domain makes the same functionality
      easier to find, and one less API call.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_START_FORCE_BOOT): New
      flag.
      * src/libvirt.c (virDomainCreateWithFlags): Document it.
      * src/qemu/qemu_driver.c (qemuDomainObjStart): Alter signature.
      (qemuAutostartDomain, qemuDomainStartWithFlags): Update callers.
      * tools/virsh.c (cmdStart): Expose it in virsh.
      * tools/virsh.pod (start): Document it.
      27c85260
    • E
      build: simplify use of verify · 71a0beaf
      Eric Blake 提交于
      Back in 2008 when this line of util.h was written, gnulib's verify
      module didn't allow the use of multiple verify() in one file
      in combination with our choice of gcc -W options.  But that has
      since been fixed in gnulib, and newer gnulib even maps verify()
      to the C1x feature of _Static_assert, which gives even nicer
      diagnostics with a new enough compiler, so we might as well go
      with the simpler verify().
      
      * src/util/util.h (VIR_ENUM_IMPL): Use simpler verify, now that
      gnulib module is smarter.
      71a0beaf
    • E
      qemu: properly label outgoing pipe for tunneled migration · e6b8bc81
      Eric Blake 提交于
      Commit 32617617 made it possible to use pipes instead of sockets
      for outgoing tunneled migration; however, it caused a regression
      because the pipe was never given a SELinux label.
      
      * src/qemu/qemu_migration.c (doTunnelMigrate): Label outgoing pipe.
      e6b8bc81
    • G
      rpc: fix a typo in debugging log in virNetServerProgramSendStreamData · bae460fc
      Guannan Ren 提交于
      The bufferOffset has been initialized to zero in virNetMessageEncodePayloadRaw(),
      so, we use bufferLength to represent the length of message which is going to be
      sent to client side.
      bae460fc
  3. 27 8月, 2011 2 次提交
  4. 26 8月, 2011 23 次提交
    • M
      hyperv: Add basic documentation · 2137cb19
      Matthias Bolte 提交于
      2137cb19
    • M
      hyperv: Add basic driver for Microsoft Hyper-V · 5e3b0f8b
      Matthias Bolte 提交于
      Domain listing, basic information retrieval and domain life cycle
      management is implemented. But currently the domain XML output
      lacks the complete devices section.
      
      The driver uses OpenWSMAN to directly communicate with a Hyper-V
      server over its WS-Management interface exposed via Microsoft WinRM.
      
      The driver is based on the work of Michael Sievers. This started in
      the same master program project group at the University of Paderborn
      as the ESX driver.
      
      See Michael's blog for details: http://hyperv4libvirt.wordpress.com/
      5e3b0f8b
    • M
      hyperv: Add OpenWSMAN based client for the Hyper-V WMI API · e224b6f8
      Matthias Bolte 提交于
      Add a generator script to generate the structs and serialization
      information for OpenWSMAN.
      
      openwsman.h collects workarounds for problems in OpenWSMAN <= 2.2.6.
      There are also disabled sections that would use ws_serializer_free_mem
      but can't because it's broken in OpenWSMAN <= 2.2.6. Patches to fix
      this have been posted upstream.
      e224b6f8
    • M
      hyperv: Add driver skeleton · 4d6e6f4a
      Matthias Bolte 提交于
      4d6e6f4a
    • M
      hyperv: Add configure check for OpenWSMAN · f2e70643
      Matthias Bolte 提交于
      f2e70643
    • T
      schedinfo: update man page about virsh schedinfo command · 5f57c485
      Taku Izumi 提交于
      This patch updates the man page about virsh schedinfo command.
      
       - fix typo: 1844674407370955 -> 18446744073709551
       - describe the value 0 of vcpu_period and vcpu_quota parameters
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      5f57c485
    • K
      Fix persistent migration config save · 709b4c50
      KAMEZAWA Hiroyuki 提交于
      When a user migrates a domain by command as
      
      libvirt saves vm's domain XML config in destination host after migration.
      But it saves vm->def. Then, the saved XML contains some garbage.
      
        <domain type='kvm' id='50'>
                           ^^^^^^^^
        ...
         <console type='pty' tty='/dev/pts/5'>
                             ^^^^^^^^^^^^^^^^^
      
      Avoid saving unnecessary things by saving persistent vm definition.
      709b4c50
    • J
      rpc: Don't close connection if program is unknown · 22d744d0
      Jiri Denemark 提交于
      In case we add a new program in the future (we did that in the past and
      we are going to do it again soon) current daemon will behave badly with
      new client that wants to use the new program. Before the RPC rewrite we
      used to just send an error reply to any request with unknown program.
      With the RPC rewrite in 0.9.3 the daemon just closes the connection
      through which such request was sent. This patch fixes this regression.
      22d744d0
    • M
      remote: Refuse connecting to remote socket · c4f91b14
      Michal Privoznik 提交于
      If users wants to connect to remote unix socket, e.g.
      'qemu+unix://<remote>/system' currently the <remote> part is ignored,
      ending up connecting to localhost. Connecting to remote socket is not
      supported and user should have used TLS/TCP/SSH instead.
      c4f91b14
    • M
      virterror: Fix error message for VIR_ERR_INVALID_ARG · 6c7299d4
      Michal Privoznik 提交于
      When a detail message is presented, nobody expects prefix 'invalid
      argument in' but something more general, like 'invalid argument:'.
      6c7299d4
    • D
      Detect errors from the 'sendkey' command · 6b434da6
      Daniel P. Berrange 提交于
      On success, the 'sendkey' command does not return any data, so
      any data in the reply should be considered to be an error
      message
      
      * src/qemu/qemu_monitor_text.c: Treat non-"" reply data as an
        error message for 'sendkey' command
      6b434da6
    • D
      Fix keymap used to talk with QEMU · ce93f64b
      Daniel P. Berrange 提交于
      The QEMU 'sendkey' command expects keys to be encoded in the same
      way as the RFB extended keycode set. Specifically it wants extended
      keys to have the high bit of the first byte set, while the Linux
      XT KBD driver codeset uses the low bit of the second byte. To deal
      with this we introduce a new keymap 'RFB' and use that in the QEMU
      driver
      
      * include/libvirt/libvirt.h.in: Add VIR_KEYCODE_SET_RFB
      * src/qemu/qemu_driver.c: Use RFB keycode set instead of XT KBD
      * src/util/virkeycode-mapgen.py: Auto-generate the RFB keycode
        set from the XT KBD set
      * src/util/virkeycode.c: Add RFB keycode entry to table. Add a
        verify check on cardinality of the codeOffset table
      ce93f64b
    • J
      virsh: Clarify documentation of -d option · 7ac78e32
      Jiri Denemark 提交于
      The default is 4, not 0.
      7ac78e32
    • J
      qemu: Correctly label migration TCP socket · 855f7689
      Jiri Denemark 提交于
      855f7689
    • J
      security: Introduce SetSocketLabel · 520d91f8
      Jiri Denemark 提交于
      This API labels all sockets created until ClearSocketLabel is called in
      a way that a vm can access them (i.e., they are labeled with svirt_t
      based label in SELinux).
      520d91f8
    • J
      security: Rename SetSocketLabel APIs to SetDaemonSocketLabel · 4c85d96f
      Jiri Denemark 提交于
      The APIs are designed to label a socket in a way that the libvirt daemon
      itself is able to access it (i.e., in SELinux the label is virtd_t based
      as opposed to svirt_* we use for labeling resources that need to be
      accessed by a vm). The new name reflects this.
      4c85d96f
    • J
      Ignore unused streams in virStreamAbort · b136266d
      Jiri Denemark 提交于
      When virStreamAbort is called on a stream that has not been used yet,
      quite confusing error is returned: "this function is not supported by
      the connection driver". Let's just ignore such streams as there's
      nothing to abort anyway.
      b136266d
    • J
      Do not try to cancel non-existent migration on source · 3398eeda
      Jiri Denemark 提交于
      If migration failed on source daemon, the migration is automatically
      canceled by the daemon itself. Thus we don't need to call
      virDomainMigrateConfirm3(cancelled=1). Calling it doesn't cause any harm
      but the resulting error message printed in logs may confuse people.
      3398eeda
    • E
      snapshot: track current snapshot across restarts · 6766ff10
      Eric Blake 提交于
      Audit all changes to the qemu vm->current_snapshot, and make them
      update the saved xml file for both the previous and the new
      snapshot, so that there is always at most one snapshot with
      <active>1</active> in the xml, and that snapshot is used as the
      current snapshot even across libvirtd restarts.
      
      This patch does not fix the case of virDomainSnapshotDelete(,CHILDREN)
      where one of the children is the current snapshot; that will be later.
      
      * src/conf/domain_conf.h (_virDomainSnapshotDef): Alter member
      type and name.
      * src/conf/domain_conf.c (virDomainSnapshotDefParseString)
      (virDomainSnapshotDefFormat): Update clients.
      * docs/schemas/domainsnapshot.rng: Tighten rng.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Reload current
      snapshot.
      (qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
      (qemuDomainSnapshotDiscard): Track current snapshot.
      6766ff10
    • E
      snapshot: only pass snapshot to qemu command line when reverting · 5e47785b
      Eric Blake 提交于
      Changing the current vm, and writing that change to the file
      system, all before a new qemu starts, is risky; it's hard to
      roll back if starting the new qemu fails for some reason.
      Instead of abusing vm->current_snapshot and making the command
      line generator decide whether the current snapshot warrants
      using -loadvm, it is better to just directly pass a snapshot all
      the way through the call chain if it is to be loaded.
      
      This frees up the last use of snapshot->def->active for qemu's
      use, so the next patch can repurpose that field for tracking
      which snapshot is current.
      
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Don't use active
      field of snapshot.
      * src/qemu/qemu_process.c (qemuProcessStart): Add a parameter.
      * src/qemu/qemu_process.h (qemuProcessStart): Update prototype.
      * src/qemu/qemu_migration.c (qemuMigrationPrepareAny): Update
      callers.
      * src/qemu/qemu_driver.c (qemudDomainCreate)
      (qemuDomainSaveImageStartVM, qemuDomainObjStart)
      (qemuDomainRevertToSnapshot): Likewise.
      (qemuDomainSnapshotSetCurrentActive)
      (qemuDomainSnapshotSetCurrentInactive): Delete unused functions.
      5e47785b
    • E
      snapshot: don't leak resources on qemu snapshot failure · 861dc84b
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=727709
      mentions that if qemu fails to create the snapshot (such as what
      happens on Fedora 15 qemu, which has qmp but where savevm is only
      in hmp, and where libvirt is old enough to not try the hmp fallback),
      then 'virsh snapshot-list dom' will show a garbage snapshot entry,
      and the libvirt internal directory for storing snapshot metadata
      will have a bogus file.
      
      This fixes the fallout bug of polluting the snapshot-list with
      garbage on failure (the root cause of the F15 bug of not having
      fallback to hmp has already been fixed in newer libvirt releases).
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Allocate
      memory before making snapshot, and cleanup on failure.  Don't
      dereference NULL if transient domain exited during snapshot creation.
      861dc84b
    • A
      libvirt: avoid dead store in virDomainMigrateVersion3 · 5495e45e
      Alex Jia 提交于
      * src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
        clang warning.
      
      Detected by ccc-analyzer:
      
      libvirt.c:4277:5: warning: Value stored to 'ret' is never read
          ret = domain->conn->driver->domainMigrateConfirm3
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      5495e45e
    • A
      qemu: avoid dead store in doPeer2PeerMigrate3 · d69d3210
      Alex Jia 提交于
      * src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
        clang warning.
      
      Detected by ccc-analyzer:
      
        CC     libvirt_driver_qemu_la-qemu_migration.lo
      qemu/qemu_migration.c:2046:5: warning: Value stored to 'ret' is never read
          ret = qemuMigrationConfirm(driver, sconn, vm,
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      d69d3210
  5. 25 8月, 2011 6 次提交