1. 25 2月, 2011 3 次提交
    • E
      audit: add qemu hooks for auditing cgroup events · 6bb98d41
      Eric Blake 提交于
      * src/qemu/qemu_audit.h (qemuDomainCgroupAudit): New prototype.
      * src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Implement it.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Add audit.
      * src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
      (qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
      (qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.
      6bb98d41
    • E
      audit: prepare qemu for listing vm in cgroup audits · b4d3434f
      Eric Blake 提交于
      * src/qemu/qemu_cgroup.h (struct qemuCgroupData): New helper type.
      (qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
      (qemuTeardownDiskPathDeny): Drop unneeded prototypes.
      (qemuSetupDiskCgroup, qemuTeardownDiskCgroup): Adjust prototype.
      * src/qemu/qemu_cgroup.c
      (qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
      (qemuTeardownDiskPathDeny): Mark static and use new type.
      (qemuSetupHostUsbDeviceCgroup): Use new type.
      (qemuSetupDiskCgroup): Alter signature.
      (qemuSetupCgroup): Adjust caller.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
      (qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
      Likewise.
      * src/qemu/qemu_driver.c (qemudDomainAttachDevice)
      (qemuDomainUpdateDeviceFlags): Likewise.
      b4d3434f
    • E
      cgroup: determine when skipping non-devices · 06173876
      Eric Blake 提交于
      * src/util/cgroup.c (virCgroupAllowDevicePath)
      (virCgroupDenyDevicePath): Don't fail with EINVAL for
      non-devices.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update caller.
      * src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
      (qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
      (qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.
      06173876
  2. 24 2月, 2011 3 次提交
  3. 23 2月, 2011 1 次提交
    • E
      security: avoid memory leak · 009fce98
      Eric Blake 提交于
      Leak introduced in commit d6623003.
      
      * src/qemu/qemu_driver.c (qemuSecurityInit): Avoid leak on failure.
      * src/security/security_stack.c (virSecurityStackClose): Avoid
      leaking component drivers.
      009fce98
  4. 17 2月, 2011 3 次提交
    • D
      Move all the QEMU migration code to a new file · 766de435
      Daniel P. Berrange 提交于
      The introduction of the v3 migration protocol, along with
      support for migration cookies, will significantly expand
      the size of the migration code. Move it all to a separate
      file to make it more manageable
      
      The functions are not moved 100%. The API entry points
      remain in the main QEMU driver, but once the public
      virDomainPtr is resolved to the internal virDomainObjPtr,
      all following code is moved.
      
      This will allow the new v3 API entry points to call into the
      same shared internal migration functions
      
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
        qemuDomainFormatXML helper method
      * src/qemu/qemu_driver.c: Remove all migration code
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Add
        all migration code.
      766de435
    • D
      Split all QEMU process mangement code into separate file · 48c2d6c6
      Daniel P. Berrange 提交于
      Move the qemudStartVMDaemon and qemudShutdownVMDaemon
      methods into a separate file, renaming them to
      qemuProcessStart, qemuProcessStop. All helper methods
      called by these are also moved & renamed to match
      
      * src/Makefile.am: Add qemu_process.c/.h
      * src/qemu/qemu_command.c: Add qemuDomainAssignPCIAddresses
      * src/qemu/qemu_command.h: Add VNC port min/max
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
        domain event queue helpers
      * src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
        all QEMU process startup/shutdown functions
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add
        all QEMU process startup/shutdown functions
      48c2d6c6
    • O
      qemu: Error prompt when saving a shutoff domain · cd951ad2
      Osier Yang 提交于
      "qemudDomainSaveFlag" goto wrong label "endjob", which will cause
      error when security manager trying to restore label (regression).
      
      As it's more reasonable to check if vm is shutoff immediately, and
      return right away if it is, remove the checking in "qemudDomainSaveFlag",
      and add checking in "qemudDomainSave".
      
      * src/qemu/qemu_driver.c
      cd951ad2
  5. 16 2月, 2011 1 次提交
    • E
      qemu: avoid NULL derefs · abaa6560
      Eric Blake 提交于
      The processWatchdogEvent fix is real, although it can only trigger
      on OOM, since bad things happen if doCoreDump is called with a NULL
      pathname argument.  The other fixes silence clang, but aren't a real
      bug because virReportErrorHelper tolerates a NULL format string even
      though *printf does not.
      
      * src/qemu/qemu_driver.c (processWatchdogEvent): Exit on OOM.
      (qemuDomainIsActive, qemuDomainIsPersistent, qemuDomainIsUpdated):
      Provide valid message.
      abaa6560
  6. 15 2月, 2011 1 次提交
    • D
      Fix cleanup on VM state after failed QEMU startup · 41f551e2
      Daniel P. Berrange 提交于
      Commit 9962e406 introduced a
      problem where if the VM failed to startup, it would not be
      correctly cleaned up. Amongst other things the SELinux
      security label would not be removed, which prevents the VM
      from ever starting again.
      
      The virDomainIsActive() check at the start of qemudShutdownVMDaemon
      checks for vm->def->id not being -1. By moving the assignment of the
      VM id to the start of qemudStartVMDaemon, we can ensure cleanup will
      occur on failure
      
      * src/qemu/qemu_driver.c: Move initialization of 'vm->def->id'
        so that qemudShutdownVMDaemon() will process the shutdown
      41f551e2
  7. 12 2月, 2011 1 次提交
  8. 11 2月, 2011 1 次提交
    • W
      qemu: fix attach-interface regression · 6bf4788e
      Wen Congyang 提交于
      QEMUD_CMD_FLAG_PCI_MULTIBUS should be set in the function
      qemuCapsExtractVersionInfo()
      
      The flag QEMUD_CMD_FLAG_PCI_MULTIBUS is used in the function
      qemuBuildDeviceAddressStr(). All callers get qemuCmdFlags
      by the function qemuCapsExtractVersionInfo() except that
      testCompareXMLToArgvFiles() in qemuxml2argvtest.c.
      
      So we should set QEMUD_CMD_FLAG_PCI_MULTIBUS in the function
      qemuCapsExtractVersionInfo() instead of qemuBuildCommandLine()
      because the function qemuBuildCommandLine() does not be called
      when we attach a pci device.
      
      tests: set QEMUD_CMD_FLAG_PCI_MULTIBUS in testCompareXMLToArgvFiles()
      
      set QEMUD_CMD_FLAG_PCI_MULTIBUS before calling qemuBuildCommandLine()
      as the flags is not set by qemuCapsExtractVersionInfo().
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      6bf4788e
  9. 10 2月, 2011 1 次提交
    • D
      Reduce log level when cgroups aren't mounted · eacb3bb0
      Daniel P. Berrange 提交于
      Quite a few hosts don't have cgroups mounted and so see warnings
      from libvirt logged, which then cause bug reports, etc. Reduce
      the log level to INFO so they're not visible by default
      
      * src/qemu/qemu_driver.c: Reduce log level for cgroups
      eacb3bb0
  10. 09 2月, 2011 2 次提交
    • E
      sysinfo: implement qemu support · 5ec8fb56
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemuGetSysinfo): New function.
      (qemuDriver): Install it.
      5ec8fb56
    • E
      sysinfo: define internal driver API · dec13a5a
      Eric Blake 提交于
      * src/driver.h (virDrvGetSysinfo): New typedef.
      (_virDriver): New callback member.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/vmware/vmware_driver.c (vmwareDriver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dec13a5a
  11. 04 2月, 2011 2 次提交
    • J
      qemu: Add shortcut for HMP pass through · 2169472a
      Jiri Denemark 提交于
      Currently users who want to use virDomainQemuMonitorCommand() API or
      it's virsh equivalent has to use the same protocol as libvirt uses for
      communication to qemu. Since the protocol is QMP with current qemu and
      HMP much more usable for humans, one ends up typing something like the
      following:
      
          virsh qemu-monitor-command DOM \
      '{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'
      
      which is not a very convenient way of debugging qemu.
      
      This patch introduces --hmp option to qemu-monitor-command, which says
      that the provided command is in HMP. If libvirt uses QMP to talk with
      qemu, the command will automatically be converted into QMP. So the
      example above is simplified to just
      
          virsh qemu-monitor-command --hmp DOM "info kvm"
      
      Also the result is converted from
      
          {"return":"kvm support: enabled\r\n"}
      
      to just plain HMP:
      
          kvm support: enabled
      
      If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.
      2169472a
    • E
      qemu: avoid double shutdown · 9962e406
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemudShutdownVMDaemon): Check that vm is
      still active.
      Reported by Wen Congyang as follows:
      
      Steps to reproduce this bug:
      
      1. use gdb to debug libvirtd, and set breakpoint in the function
         qemuConnectMonitor()
      2. start a vm, and the libvirtd will be stopped in qemuConnectMonitor()
      3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
      4. continue to run libvirtd in gdb, and libvirtd will be blocked in the
         function qemuMonitorSetCapabilities()
      5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)
      
      Here is log of the qemu:
      =========
      LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin ...
      char device redirected to /dev/pts/3
      2011-01-27 09:38:48.101: shutting down
      2011-01-27 09:41:26.401: shutting down
      =========
      
      The vm is shut down twice. I do not know whether this behavior has
      side effect, but I think we should shutdown the vm only once.
      9962e406
  12. 31 1月, 2011 1 次提交
  13. 28 1月, 2011 4 次提交
    • D
      Remove bogus log warning lines when launching QEMU · 0095edaa
      Daniel P. Berrange 提交于
      The refactoring of QEMU command startup was comitted with
      a couple of VIR_WARN lines left in from debugging.
      
      * src/qemu/qemu_driver.c: Remove log warning lines
      0095edaa
    • D
      Remove double close of qemu monitor · e85247e7
      Daniel P. Berrange 提交于
      When qemuMonitorSetCapabilities() fails, there is no need to
      call qemuMonitorClose(), because the caller will already see
      the error code and tear down the entire VM. The extra call to
      qemuMonitorClose resulted in a double-free due to it removing
      a ref count prematurely.
      
      * src/qemu/qemu_driver.c: Remove premature close of monitor
      e85247e7
    • E
      qemu: fix error messages · b96b6f47
      Eric Blake 提交于
      Regression in commit caa805ea let a lot of bad messages slip in.
      
      * cfg.mk (msg_gen_function): Fix function name.
      * src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
      'make syntax-check'.
      * src/qemu/qemu_driver.c (qemudDomainGetInfo)
      (qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
      (qemudDomainSaveFlag, qemudDomainAttachDevice)
      (qemuDomainUpdateDeviceFlags): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
      (qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
      Likewise.
      b96b6f47
    • W
      avoid vm to be deleted if qemuConnectMonitor failed · d96431f9
      Wen Congyang 提交于
      Steps to reproduce this bug:
      1. service libvirtd start
      2. virsh start <domain>
      3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
      4. service libvirtd restart
      5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)
      
      Then libvirtd will core dump or be in deadlock state.
      
      Make sure that json is built into libvirt and the version
      of qemu is newer than 0.13.0.
      
      The reason of libvirtd cores dump is that:
      We add vm->refs when we alloc the memory, and decrease it
      in the function qemuHandleMonitorEOF() in other thread.
      
      We add vm->refs in the function qemuConnectMonitor() and
      decrease it when the vm is inactive.
      
      The libvirtd will block in the function qemuMonitorSetCapabilities()
      because the vm is stopped by signal SIGSTOP. Now the vm->refs is 2.
      
      Then we kill the vm by signal SIGKILL. The function
      qemuMonitorSetCapabilities() failed, and then we will decrease vm->refs
      in the function qemuMonitorClose().
      In another thread, mon->fd is broken and the function
      qemuHandleMonitorEOF() is called.
      
      If qemuHandleMonitorEOF() decreases vm->refs before qemuConnectMonitor()
      returns, vm->refs will be decrease to 0 and the memory is freed.
      
      We will call qemudShutdownVMDaemon() as qemuConnectMonitor() failed.
      The memory has been freed, so qemudShutdownVMDaemon() is too dangerous.
      
      We will reference NULL pointer in the function virDomainConfVMNWFilterTeardown():
      =============
      void
      virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
          int i;
      
          if (nwfilterDriver != NULL) {
              for (i = 0; i < vm->def->nnets; i++)
                  virDomainConfNWFilterTeardown(vm->def->nets[i]);
          }
      }
      ============
      vm->def->nnets is not 0 but vm->def->nets is NULL(We don't set vm->def->nnets
      to 0 when we free vm).
      
      We should add an extra reference of vm to avoid vm to be deleted if
      qemuConnectMonitor() failed.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      d96431f9
  14. 26 1月, 2011 3 次提交
    • L
      Manually kill gzip if restore fails before starting qemu · c9c794b5
      Laine Stump 提交于
      If a guest image is saved in compressed format, and the restore fails
      in some way after the intermediate process used to uncompress the
      image has been started, but before qemu has been started to hook up to
      the uncompressor, libvirt will endlessly wait for the uncompressor to
      finish, but it never will because it's still waiting to have something
      hooked up to drain its output.
      
      The solution is to close the pipes on both sides of the uncompressor,
      then send a SIGTERM before calling waitpid on it (only if the restore
      has failed, of course).
      c9c794b5
    • L
      Set SELinux context label of pipes used for qemu migration · 34a19dda
      Laine Stump 提交于
      This patch is a partial resolution to the following bug:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=667756
      
      (to complete the fix, an updated selinux-policy package is required,
      to add the policy that allows libvirt to set the context of a fifo,
      which was previously not allowed).
      
      Explanation : When an incoming migration is over a pipe (for example,
      if the image was compressed and is being fed through gzip, or was on a
      root-squash nfs server, so needed to be opened by a child process
      running as a different uid), qemu cannot read it unless the selinux
      context label for the pipe has been set properly.
      
      The solution is to check the fd used as the source of the migration
      just before passing it to qemu; if it's a fifo (implying that it's a
      pipe), we call the newly added virSecurityManagerSetFDLabel() function
      to set the context properly.
      34a19dda
    • O
      qemu: Error prompt when managed save a shutoff domain · dbd63c4d
      Osier Yang 提交于
      The problem was introduced by commit 4303c91c, which removed the checking
      of domain state, this patch is to fix it.
      
      Otherwise, improper error will be thrown, e.g.
      
      error: Failed to save domain rhel6 state
      error: cannot resolve symlink /var/lib/libvirt/qemu/save/rhel6.save: No such
      file or directory
      dbd63c4d
  15. 22 1月, 2011 3 次提交
    • C
      qemu: Allow serving VNC over a unix domain socket · 1d9c0a08
      Cole Robinson 提交于
      QEMU supports serving VNC over a unix domain socket rather than traditional
      TCP host/port. This is specified with:
      
      <graphics type='vnc' socket='/foo/bar/baz'/>
      
      This provides better security access control than VNC listening on
      127.0.0.1, but will cause issues with tools that rely on the lax security
      (virt-manager in fedora runs as regular user by default, and wouldn't be
      able to access a socket owned by 'qemu' or 'root').
      
      Also not currently supported by any clients, though I have patches for
      virt-manager, and virt-viewer should be simple to update.
      
      v2:
          schema: Make listen vs. socket a <choice>
      1d9c0a08
    • C
      qemu: Set domain def transient at beginning of startup process · cb4c2694
      Cole Robinson 提交于
      This will allow us to record transient runtime state in vm->def, like
      default VNC parameters. Accomplish this by adding an extra 'live' parameter
      to SetDefTransient, with similar semantics to the 'live' flag for
      AssignDef.
      cb4c2694
    • D
      Fix error reporting when machine type probe fails · f0bbf960
      Daniel P. Berrange 提交于
      Avoid overwriting the real error message with a generic
      OOM failure message, when machine type probe fails
      
      * src/qemu/qemu_driver.c: Don't overwrite error
      f0bbf960
  16. 21 1月, 2011 1 次提交
    • W
      qemu: Fix a possible deadlock in p2p migration · bda57661
      Wen Congyang 提交于
      The function virUnrefConnect() may call virReleaseConnect() to release
      the dest connection, and the function virReleaseConnect() will call
      conn->driver->close().
      
      So the function virUnrefConnect() should be surrounded by
      qemuDomainObjEnterRemoteWithDriver() and
      qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
      two communicating libvirt daemons.
      
      See commit f0c8e1cb for further details.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      bda57661
  17. 19 1月, 2011 3 次提交
    • J
      qemu: Avoid sending STOPPED event twice · 15e78658
      Jiri Denemark 提交于
      In some circumstances, libvirtd would issue two STOPPED events after it
      stopped a domain. This was because an EOF event can arrive after a qemu
      process is killed but before qemuMonitorClose() is called.
      
      qemuHandleMonitorEOF() should ignore EOF when the domain is not running.
      
      I wasn't able to reproduce this bug directly, only after adding an
      artificial sleep() into qemudShutdownVMDaemon().
      15e78658
    • M
      Use VIR_ERR_OPERATION_INVALID when appropriated · e065e1ea
      Matthias Bolte 提交于
      VIR_ERR_OPERATION_INVALID means that the operation is not valid
      for the current state of the involved object.
      e065e1ea
    • M
      Fix misuse of VIR_ERR_INVALID_* error code · 8c6d6116
      Matthias Bolte 提交于
      VIR_ERR_INVALID_* is meant for invalid pointers only.
      8c6d6116
  18. 18 1月, 2011 2 次提交
    • E
      qemu: use -incoming fd:n to avoid qemu holding fd indefinitely · 1859939a
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=620363
      
      When using -incoming stdio or -incoming exec:, qemu keeps the
      stdin fd open long after the migration is complete.  Not to
      mention that exec:cat is horribly inefficient, by doubling the
      I/O and going through a popen interface in qemu.
      
      The new -incoming fd: of qemu 0.12.0 closes the fd after using
      it, and allows us to bypass an intermediary cat process for
      less I/O.
      
      * src/qemu/qemu_command.h (qemuBuildCommandLine): Add parameter.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Support
      migration via fd: when possible.  Consolidate migration handling
      into one spot, now that it is more complex.
      * src/qemu/qemu_driver.c (qemudStartVMDaemon): Update caller.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args: New file.
      * tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.xml: Likewise.
      1859939a
    • J
      qemu: Support per-device boot ordering · 3d440358
      Jiri Denemark 提交于
      Support for this is included in qemu and seabios from upstream git.
      3d440358
  19. 15 1月, 2011 4 次提交
    • N
      memtune: Let virsh know the unlimited value for memory tunables · d94a14f8
      Nikunj A. Dadhania 提交于
      Display or set unlimited values for memory parameters. Unlimited is
      represented by INT64_MAX in memory cgroup.
      Signed-off-by: NNikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
      Reported-by: NJustin Clift <jclift@redhat.com>
      d94a14f8
    • M
      Use the new set_password monitor command to set password. · 9d73efdb
      Marc-André Lureau 提交于
      We try to use that command first when setting a VNC/SPICE password. If
      that doesn't work we fallback to the legacy VNC only password
      
      Allow an expiry time to be set, if that doesn't work, throw an error
      if they try to use SPICE.
      
      Change since v1:
      - moved qemuInitGraphicsPasswords to qemu_hotplug, renamed
        to qemuDomainChangeGraphicsPasswords.
      - updated what looks like a typo (that appears to work anyway) in
        initial patch from Daniel:
          - ret = qemuInitGraphicsPasswords(driver, vm,
          -                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
          -                                 &vm->def->graphics[0]->data.vnc.auth,
          -                                 driver->vncPassword);
          + ret = qemuInitGraphicsPasswords(driver, vm,
          +                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
          +                                 &vm->def->graphics[0]->data.spice.auth,
          +                                 driver->spicePassword);
      
      Based on patch by Daniel P. Berrange <berrange@redhat.com>.
      9d73efdb
    • E
      qemu: move monitor device out of domain_conf common code · 30b9e608
      Eric Blake 提交于
      * src/conf/domain_conf.h (virDomainChrDeviceType): Drop monitor.
      * src/conf/domain_conf.c (virDomainChrDevice)
      (virDomainChrDefParseTargetXML, virDomainChrDefFormat): Drop
      monitor support.
      * src/qemu/qemu_command.h (qemuBuildCommandLine): Alter signature.
      * src/qemu/qemu_monitor.h (qemuMonitorOpen): Likewise.
      * src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Change type of
      monConfig.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateFree)
      (qemuDomainObjPrivateXMLFormat, qemuDomainObjPrivateXMLParse):
      Adjust to type change.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemuPrepareMonitorChr)
      (qemudStartVMDaemon, qemuDomainXMLToNative, qemuConnectMonitor)
      (qemudShutdownVMDaemon): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorOpen): Likewise.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Likewise.
      30b9e608
    • E
      domain_conf: split source data out from ChrDef · 98334e7c
      Eric Blake 提交于
      This opens up the possibility of reusing the smaller ChrSourceDef
      for both qemu monitor and a passthrough smartcard device.
      
      * src/conf/domain_conf.h (_virDomainChrDef): Factor host
      details...
      (_virDomainChrSourceDef): ...into new struct.
      (virDomainChrSourceDefFree): New prototype.
      * src/conf/domain_conf.c (virDomainChrDefFree)
      (virDomainChrDefParseXML, virDomainChrDefFormat): Split...
      (virDomainChrSourceDefClear, virDomainChrSourceDefFree)
      (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
      ...into new functions.
      (virDomainChrDefParseTargetXML): Update clients to reflect type
      split.
      * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
      (virVMXFormatSerial, virVMXFormatParallel): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      * src/xen/xend_internal.c (xenDaemonParseSxprChar)
      (xenDaemonFormatSxprChr): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
      (vboxAttachParallel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetChardevLabel)
      (virSecurityDACSetChardevCallback)
      (virSecurityDACRestoreChardevLabel)
      (virSecurityDACRestoreChardevCallback): Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback)
      (SELinuxRestoreSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback): Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
      Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
      * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
      (umlDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineChr): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
      (qemuDomainObjPrivateXMLParse): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
      (qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
      (qemuPrepareMonitorChr, qemudShutdownVMDaemon)
      (qemuDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.h (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr): Delete, now that they are static.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): Update list.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
      tests.
      98334e7c