1. 15 11月, 2011 1 次提交
    • D
      Split src/util/network.{c,h} into 5 pieces · d3406045
      Daniel P. Berrange 提交于
      The src/util/network.c file is a dumping ground for many different
      APIs. Split it up into 5 pieces, along functional lines
      
       - src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
       - src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
       - src/util/virsocketaddr.c: virSocketAddr and APIs
       - src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
         for virNetDevBandwidth
       - src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
         for virNetDevVPortProfile
      
      * src/util/network.c, src/util/network.h: Split into 5 pieces
      * src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
        src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
        src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
        src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
        src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
      * daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
        src/conf/domain_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/conf/nwfilter_conf.h,
        src/esx/esx_util.h, src/network/bridge_driver.c,
        src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
        src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
        src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
        src/util/virnetdev.h, src/util/virnetdevtap.c,
        tools/virsh.c: Update include files
      d3406045
  2. 10 11月, 2011 1 次提交
    • D
      Santize naming of socket address APIs · 4c544e6c
      Daniel P. Berrange 提交于
      The socket address APIs in src/util/network.h either take the
      form  virSocketAddrXXX, virSocketXXX or virSocketXXXAddr.
      
      Sanitize this so everything is virSocketAddrXXXX, and ensure
      that the virSocketAddr parameter is always the first one.
      
      * src/util/network.c, src/util/network.h: Santize socket
        address API naming
      * src/conf/domain_conf.c, src/conf/network_conf.c,
        src/conf/nwfilter_conf.c, src/network/bridge_driver.c,
        src/nwfilter/nwfilter_ebiptables_driver.c,
        src/nwfilter/nwfilter_learnipaddr.c,
        src/qemu/qemu_command.c, src/rpc/virnetsocket.c,
        src/util/dnsmasq.c, src/util/iptables.c,
        src/util/virnetdev.c, src/vbox/vbox_tmpl.c: Update for
        API renaming
      4c544e6c
  3. 03 11月, 2011 4 次提交
    • D
      Fix default console type setting · 209c2880
      Daniel P. Berrange 提交于
      The default console type may vary based on the OS type. ie a Xen
      paravirt guests wants a 'xen' console, while a fullvirt guests
      wants a 'serial' console.
      
      A plain integer default console type in the capabilities does
      not suffice. Instead introduce a callback that is passed the
      OS type.
      
      * src/conf/capabilities.h: Use a callback for default console
        type
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
        for default console type. Add missing LXC/OpenVZ console types.
      * src/esx/esx_driver.c, src/libxl/libxl_conf.c,
        src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
        src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
        src/xenapi/xenapi_driver.c: Set default console type callback
      209c2880
    • D
      Allow multiple consoles per virtual guest · 0873b688
      Daniel P. Berrange 提交于
      While Xen only has a single paravirt console, UML, and
      QEMU both support multiple paravirt consoles. The LXC
      driver can also be trivially made to support multiple
      consoles. This patch extends the XML to allow multiple
      <console> elements in the XML. It also makes the UML
      and QEMU drivers support this config.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
        multiple <console> devices
      * src/lxc/lxc_driver.c, src/xen/xen_driver.c,
        src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
        internal API changes
      * src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Only label consoles that aren't a copy of the serial device
      * src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_process.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Support multiple console devices
      * tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
        tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
        for all console /channel tests
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
        for correct chardev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
        test file
      0873b688
    • D
      Remove translations in socket test case · b0a510ad
      Daniel P. Berrange 提交于
      The test case errors should not be translated since they're only
      targetted at developers, not users.
      
      * tests/virnetsockettest.c: Remove error reporting with translations
      b0a510ad
    • G
      virnetsockettest: Use a temporary directory in /tmp · 745c3e79
      Guido Günther 提交于
      to avoid exceeding UNIX_PATH_MAX
      745c3e79
  4. 27 10月, 2011 1 次提交
    • E
      qemu: simplify use of HAVE_YAJL · 6889f33e
      Eric Blake 提交于
      Rather than making all clients of monitor commands that are JSON-only
      check whether yajl support was compiled in, it is simpler to just
      avoid setting the capability bit up front if we can't use the capability.
      
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Only set
      capability bit if we also have yajl library to use it.
      * src/qemu/qemu_driver.c (qemuDomainReboot): Drop #ifdefs.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * tests/qemuhelptest.c (testHelpStrParsing): Pass test even
      without yajl.
      * tests/qemuxml2argvtest.c (mymain): Simplify use of json flag.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-*.args:
      Update expected results to match.
      6889f33e
  5. 25 10月, 2011 3 次提交
    • M
      qemu: Move device alias assigning before command line construction · b8fbe5d5
      Michal Privoznik 提交于
      This patch is rather cosmetic as it only moves device alias
      assignation from command line construction just before that.
      However, it is needed in connotation of previous and next patch.
      b8fbe5d5
    • M
      conf: Introduce optional startupPolicy attribute for cdrom and floppy · e5a84d74
      Michal Privoznik 提交于
      This attribute says what to do with cdrom (or floppy) if
      the source is missing. It accepts:
      - mandatory - fail if missing for any reason (the default)
      - requisite - fail if missing on boot up, drop if missing on
                    migrate/restore/revert
      - optional  - drop if missing at any start attempt.
      
      However, this patch introduces only XML part of this new
      functionality.
      e5a84d74
    • E
      waitpid: improve safety · 69d044c0
      Eric Blake 提交于
      Based on a report by Coverity.  waitpid() can leak resources if it
      fails with EINTR, so it should never be used without checking return
      status.  But we already have a helper function that does that, so
      use it in more places.
      
      * src/lxc/lxc_container.c (lxcContainerAvailable): Use safer
      virWaitPid.
      * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
      * tests/testutils.c (virtTestCaptureProgramOutput, virtTestMain):
      Likewise.
      * src/libvirt.c (virConnectAuthGainPolkit): Simplify with virCommand.
      69d044c0
  6. 21 10月, 2011 4 次提交
    • E
      snapshot: simplify indentation of cpu features · 4eedfd07
      Eric Blake 提交于
      Auto-indent makes life a bit easier; this patch also drops unused
      arguments and replaces a misspelled flag name with two entry points
      instead, so that callers don't have to worry about how much spacing
      is present when embedding cpu elements.
      
      * src/conf/cpu_conf.h (virCPUFormatFlags): Delete.
      (virCPUDefFormat): Drop unused argument.
      (virCPUDefFormatBuf): Alter signature.
      (virCPUDefFormatBufFull): New prototype.
      * src/conf/cpu_conf.c (virCPUDefFormatBuf): Split...
      (virCPUDefFormatBufFull): ...into new function.
      (virCPUDefFormat): Adjust caller.
      * src/conf/domain_conf.c (virDomainDefFormatInternal): Likewise.
      * src/conf/capabilities.c (virCapabilitiesFormatXML): Likewise.
      * src/cpu/cpu.c (cpuBaselineXML): Likewise.
      * tests/cputest.c (cpuTestCompareXML): Likewise.
      4eedfd07
    • E
      snapshot: test domainsnapshot indentation · 27b3b303
      Eric Blake 提交于
      Add a test for the simple parts of my indentation changes, and
      fix the fallout.
      
      * tests/domainsnapshotxml2xmltest.c: New test.
      * tests/Makefile.am (domainsnapshotxml2xmltest_SOURCES): Build it.
      * src/conf/domain_conf.c (virDomainSnapshotDefFormat): Avoid NULL
      deref, match documented order.
      * src/conf/domain_conf.h (virDomainSnapshotDefFormat): Add const.
      * tests/domainsnapshotxml2xmlout/all_parameters.xml: Tweak output.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Likewise.
      * tests/domainsnapshotxml2xmlout/full_domain.xml: Likewise.
      * .gitignore: Exempt new binary.
      27b3b303
    • E
      virbuf: add auto-indentation support · fd9c052e
      Eric Blake 提交于
      Rather than having to adjust all callers in a chain to deal with
      indentation, it is nicer to have virBuffer do auto-indentation.
      
      * src/util/buf.h (_virBuffer): Increase size.
      (virBufferAdjustIndent, virBufferGetIndent): New prototypes.
      * src/libvirt_private.syms (buf.h): Export new functions.
      * src/util/buf.c (virBufferAdjustIndent, virBufferGetIndent): New
      functions.
      (virBufferSetError, virBufferAdd, virBufferAddChar)
      (virBufferVasprintf, virBufferStrcat, virBufferURIEncodeString):
      Implement auto-indentation.
      * tests/virbuftest.c (testBufAutoIndent): Test it.
      (testBufInfiniteLoop): Don't rely on internals.
      Idea by Daniel P. Berrange.
      fd9c052e
    • E
      virbuf: improve testsuite reporting · ef696300
      Eric Blake 提交于
      I had some temporary test failures while working on virbuf
      improvements in later patches, with output that looked like:
      
      Expected [<]
      Actual [  <]
      
      which is pretty hard to figure out.  Adding an Offset designation
      made it much easier to find which particular '<' was at the
      wrong indentation, to fix the right part of the code.
      
      * tests/testutils.c (virtTestDifference): Make it easier to
      diagnose test failures.
      ef696300
  7. 19 10月, 2011 1 次提交
    • P
      qemu: Test name-space handling · aa84f966
      Philipp Hahn 提交于
      Add test cases for parsing the qemu-name-space.
      This is based on qemuxml2argv{test,data/}, but can not reside in
      qemuxml2argv{test,data/} because ...
      
      1. qemuxmlns-qemu-ns-domain.xml is not schema-valid and breaks
      domainschematest. The test is still important to detect xmlns:qemu
      bindings to a name-space other than
      http://libvirt.org/schemas/domain/qemu/1.0
      
      2. they break qemuxml2xml, because the xmlns:qemu binding is moved to
      the top-level <domain> element when converting from argv to xml.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      aa84f966
  8. 18 10月, 2011 1 次提交
    • J
      Add AHCI support to qemu driver · c1bc3d89
      Jim Fehlig 提交于
      Tested with multiple AHCI controllers and multiple disks attached
      to a controller. E.g.,
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk0.raw'/>
            <target dev='sda' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='0'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk1.raw'/>
            <target dev='sdb' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='1'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk2.raw'/>
            <target dev='sdc' bus='sata'/>
            <address type='drive' controller='1' bus='0' unit='0'/>
          </disk>
          <controller type='sata' index='0'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
          </controller>
          <controller type='sata' index='1'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
          </controller>
      c1bc3d89
  9. 14 10月, 2011 3 次提交
  10. 13 10月, 2011 2 次提交
  11. 12 10月, 2011 2 次提交
    • E
      build: fix 'make check' linkage with dtrace · b794d2a5
      Eric Blake 提交于
      Building on Linux with dtrace enabled was failing 'make check':
      
        CCLD   nodeinfotest
      ../src/.libs/libvirt_test.a(libvirt_net_rpc_client_la-virnetclient.o): In function `virNetClientNew':
      /home/remote/eblake/libvirt/src/rpc/virnetclient.c:162: undefined reference to `libvirt_rpc_client_new_semaphore'
      
      On looking further, I see some earlier warnings emitted from libtool:
      
      *** Warning: Linking the shared library libvirt.la against the non-libtool
      *** objects  probes.o is not portable!
      
      Since src/probes.o is only built on Linux, and even then, only when
      dtrace is enabled, this failure does not affect other platforms, and
      despite libtool warning that it is not generally portable, it is not
      a problem for our use-case in libvirt.la.  But it turns out that while
      libtool is willing to jam raw .o files into an installed shared
      library (libvirt.la becomes libvirt.so), it is NOT willing to jam
      the same .o file into the convenience library libvirt_test.la.
      Perhaps this is a bug in libtool, but even if we get libtool fixed,
      libvirt must continue to build on platforms with older libtool.  So,
      the fix is the same as we are already using for the libvirt_lxc
      executable - don't rely on the .o file being in the convenience
      library, but instead use LDADD to pull it in directly.
      
      * tests/Makefile.am (PROBES_O): New macro.
      (LDADDS): Use it to fix link errors.
      b794d2a5
    • J
      build: Fix VPATH build with new probes · 15d52307
      Jiri Denemark 提交于
      15d52307
  12. 11 10月, 2011 1 次提交
    • G
      xen_xs: Guard against set but empty kernel argument · dca1a6b4
      Guido Günther 提交于
      On xen 4.1 I observed configurations that look like:
      
      (image
          (hvm
              (kernel '')
              (loader '/foo/bar')
      ))
      
      The kernel element is there but unset. This leads to an empty <kernel/>
      element in the XML and even worse makes us skip the boot order parsing
      and therefore not emit a <boot device='$dev>'/> element which breaks CD
      booting.
      dca1a6b4
  13. 07 10月, 2011 3 次提交
    • L
      qemu: add separate rerror_policy for disk errors · 4bb4109f
      Laine Stump 提交于
      Previously libvirt's disk device XML only had a single attribute,
      error_policy, to control both read and write error policy, but qemu
      has separate options for controlling read and write. In one case
      (enospc) a policy is allowed for write errors but not read errors.
      
      This patch adds a separate attribute that sets only the read error
      policy. If just error_policy is set, it will apply to both read and
      write error policy (previous behavior), but if the new rerror_policy
      attribute is set, it will override error_policy for read errors only.
      Possible values for rerror_policy are "stop", "report", and "ignore"
      ("report" is the qemu-controlled default for rerror_policy when
      error_policy isn't specified).
      
      For consistency, the value "report" has been added to the possible
      values for error_policy as well.
      4bb4109f
    • L
      qemu: leave rerror policy at default when enospace is requested · 91195b43
      Laine Stump 提交于
      commit 12062abb set rerror=ignore when error_policy="enospace" was
      selected (since the rerror option in qemu doesn't accept "enospc", as
      the werror option does).
      
      After that patch was already pushed, Paolo Bonzini noticed it and
      commented that leaving rerror at the default ("report") would be a
      better choice. This patch corrects the problem - if error_policy =
      "enospace" is given, rerror is left off the qemu commandline,
      effectively setting it to "report". For other values, rerror is still
      set to match werror.
      
      Additionally, the parsing of error_policy was changed to no longer
      erroneously allow "default" as a choice - as with most other
      attributes, if you want the default setting, just don't specify an
      error_policy.
      
      Finally, two ommissions in the first patch were corrected - a
      long-dormant qemuxml2argv test for enospace was enabled, and fixed to
      pass, and the argv2xml parser in qemu_command.c was updated to
      recognize the different spelling on the qemu commandline.
      91195b43
    • E
      qemu: enable multifunction for older qemu · 8644a379
      Eric Blake 提交于
      Now that RHEL 6.2 Beta is out, it would be nice to test multifunction
      devices on that platform.  This changes things so that the multifunction
      cap bit can be set in two different ways: by version comparison (needed
      for qemu 0.13 which lacked a -device query), and by -device query
      (provided by qemu.git and backported to the RHEL beta build of
      qemu-kvm which still claims to be a modified 0.12, and therefore needed
      for RHEL).
      
      * src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Allow
      second method of setting multifunction cap bit.
      * tests/qemuhelptest.c (mymain): Test it.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device: Likewise.
      8644a379
  14. 01 10月, 2011 1 次提交
    • L
      qemu: make PCI multifunction support more manual · c329db71
      Laine Stump 提交于
      When support for was added for PCI multifunction cards (in commit
      9f8baf, first included in libvirt 0.9.3), it was done by always
      turning on the multifunction bit for all PCI devices. Since that time
      it has been realized that this is not an ideal solution, and that the
      multifunction bit must be selectively turned on. For example, see
      
        https://bugzilla.redhat.com/show_bug.cgi?id=728174
      
      and the discussion before and after
      
        https://www.redhat.com/archives/libvir-list/2011-September/msg01036.html
      
      This patch modifies multifunction support so that the multifunction=on
      option is only added to the qemu commandline for a device if its PCI
      <address> definition has the attribute "multifunction='on'", e.g.:
      
        <address type='pci' domain='0x0000' bus='0x00'
                 slot='0x04' function='0x0' multifunction='on'/>
      
      In practice, the multifunction bit should only be turned on if
      function='0' AND other functions will be used in the same slot - it
      usually isn't needed for functions 1-7 (although there are apparently
      some exceptions, e.g. the Intel X53 according to the QEMU source
      code), and should never be set if only function 0 will be used in the
      slot. The test cases have been changed accordingly to illustrate.
      
      With this patch in place, if a user attempts to assign multiple
      functions in a slot without setting the multifunction bit for function
      0, libvirt will issue an error when the domain is defined, and the
      define operation will fail. In the future, we may decide to detect
      this situation and automatically add multifunction=on to avoid the
      error; even then it will still be useful to have a manual method of
      turning on multifunction since, as stated above, there are some
      devices that excpect it to be turned on for all functions in a slot.
      
      A side effect of this patch is that attempts to use the same PCI
      address for two different devices will now log an error (previously
      this would cause the domain define operation to fail, but there would
      be no log message generated). Because the function doing this log was
      almost completely rewritten, I didn't think it worthwhile to make a
      separate patch for that fix (the entire patch would immediately be
      obsoleted).
      c329db71
  15. 29 9月, 2011 1 次提交
  16. 28 9月, 2011 1 次提交
    • J
      fix AppArmor driver for pipe character devices · 03d89991
      Jamie Strandboge 提交于
      The AppArmor security driver adds only the path specified in the domain
      XML for character devices of type 'pipe'. It should be using <path>.in
      and <path>.out. We do this by creating a new vah_add_file_chardev() and
      use it for char devices instead of vah_add_file(). Also adjust
      valid_path() to accept S_FIFO (since qemu chardevs of type 'pipe' use
      fifos). This is https://launchpad.net/bugs/832507
      03d89991
  17. 27 9月, 2011 1 次提交
    • L
      qemu: add ability to set PCI device "rombar" on or off · dc79852a
      Laine Stump 提交于
      This patch was made in response to:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=738095
      
      In short, qemu's default for the rombar setting (which makes the
      firmware ROM of a PCI device visible/not on the guest) was previously
      0 (not visible), but they recently changed the default to 1
      (visible). Unfortunately, there are some PCI devices that fail in the
      guest when rombar is 1, so the setting must be exposed in libvirt to
      prevent a regression in behavior (it will still require explicitly
      setting <rom bar='off'/> in the guest XML).
      
      rombar is forced on/off by adding:
      
        <rom bar='on|off'/>
      
      inside a <hostdev> element that defines a PCI device. It is currently
      ignored for all other types of devices.
      
      At the moment there is no clean method to determine whether or not the
      rombar option is supported by QEMU - this patch uses the advice of a
      QEMU developer to assume support for qemu-0.12+. There is currently a
      patch in the works to put this information in the output of "qemu-kvm
      -device pci-assign,?", but of course if we switch to keying off that,
      we would lose support for setting rombar on all the versions of qemu
      between 0.12 and whatever version gets that patch.
      dc79852a
  18. 23 9月, 2011 1 次提交
    • O
      Add unsafe cache mode support for disk driver · f887334d
      Oskari Saarenmaa 提交于
      QEMU 0.13 introduced cache=unsafe for -drive, this patch exposes
      it in the libvirt layer.
      
        * Introduced a new QEMU capability flag ($prefix_CACHE_UNSAFE),
          as even if $prefix_CACHE_V2 is set, we can't know if unsafe
          is supported.
      
        * Improved the reliability of qemu cache type detection.
      f887334d
  19. 22 9月, 2011 2 次提交
    • E
      virsh: fix regression in argv parsing · 466f9024
      Eric Blake 提交于
      Prior to commit 85d28108, we had an issue where:
      
      snapshot-create-as dom name --diskspec spec --diskspec spec
      
      failed to parse the second spec, because the first spec had marked
      that option as no longer requiring an argument.
      
      In commit 85d28108, I fixed it by making argv options no longer mark
      the option as seen.  But this in turn breaks mandatory argv options,
      which now complain that the argv option is missing.
      
      This patch reverts that part of 85d28108, and instead replaces it with
      fixes to no longer clear opts_need_arg of an argv argument.
      
      * tools/virsh.c (vshCmddefGetOption, vshCmddefGetData)
      (vshCommandParse): Fix option parsing for required argv option.
      (vshCmddefOptParse): Check that argv option is last.
      * tests/virsh-optparse: Enhance test.
      466f9024
    • O
      tests: improve test failure diagnosis · 42b23434
      Oskari Saarenmaa 提交于
        * qemuhelptest prints test case name on failure.
      42b23434
  20. 21 9月, 2011 1 次提交
    • J
      qemu: Fix shutdown regression with buggy qemu · f84aedad
      Jiri Denemark 提交于
      The commit that prevents disk corruption on domain shutdown
      (96fc4784) causes regression with QEMU
      0.14.* and 0.15.* because of a regression bug in QEMU that was fixed
      only recently in QEMU git. The affected versions of QEMU do not quit on
      SIGTERM if started with -no-shutdown, which we use to implement fake
      reboot. Since -no-shutdown tells QEMU not to quit automatically on guest
      shutdown, domains started using the affected QEMU cannot be shutdown
      properly and stay in a paused state.
      
      This patch disables fake reboot feature on such QEMU by not using
      -no-shutdown, which makes shutdown work as expected. However,
      virDomainReboot will not work in this case and it will report "Requested
      operation is not valid: Reboot is not supported with this QEMU binary".
      f84aedad
  21. 17 9月, 2011 1 次提交
    • D
      Prevent crash from dlclose() of libvirt.so · 8e44e559
      Daniel P. Berrange 提交于
      When libvirt calls virInitialize it creates a thread local
      for the virErrorPtr storage, and registers a callback to
      cleanup memory when a thread exits. When libvirt is dlclose()d
      or otherwise made non-resident, the callback function is
      removed from memory, but the thread local may still exist
      and if a thread later exists, it will invoke the callback
      and SEGV. There may also be other thread locals with callbacks
      pointing to libvirt code, so it is in general never safe to
      unload libvirt.so from memory once initialized.
      
      To allow dlclose() to succeed, but keep libvirt.so resident
      in memory, link with '-z nodelete'. This issue was first
      found with the libvirt CIM provider, but can potentially
      hit many of the dynamic language bindings which all ultimately
      involve dlopen() in some way, either on libvirt.so itself,
      or on the glue code for the binding which in turns links
      to libvirt
      
      * configure.ac, src/Makefile.am: Ensure libvirt.so is linked
        with -z nodelete
      * cfg.mk, .gitignore, tests/Makefile.am, tests/shunloadhelper.c,
        tests/shunloadtest.c: A test case to unload libvirt while
        a thread is still running.
      8e44e559
  22. 16 9月, 2011 1 次提交
    • E
      snapshot: tweak snapshot-create-as diskspec docs · 85d28108
      Eric Blake 提交于
      With this patch, it is hopefully a bit more obvious that for
      snapshot-create-as, a literal '--diskspec' is mandatory if name
      or description was omitted, but optional if all earlier options
      were provided.
      
      These all denote two diskspecs and a description:
      virsh snapshot-create-as dom name desc vda vdb
      virsh snapshot-create-as dom name desc --diskspec vda --diskspec vdb
      virsh snapshot-create-as dom name desc --diskspec vda vdb
      virsh snapshot-create-as dom name desc vda --diskspec vdb
      virsh snapshot-create-as dom --diskspec vda --diskspec vdb name desc
      
      This gives two diskspecs but no description:
      virsh snapshot-create-as dom name --diskspec vda --diskspec vdb
      
      And this treats 'vda' as the description, with only one diskspec:
      virsh snapshot-create-as dom name vda vdb
      
      The help output now shows:
          snapshot-create-as <domain> [<name>] [<description>] [--print-xml] [--no-metadata] [--halt] [--disk-only] [[--diskspec] <string>]...
      
      I also checked the help output for echo and send-key, which are two
      other variants of argv commands.
      
      * tools/virsh.pod (snapshot-create-as): Document when a literal
      --diskspec must preceed a diskspec argument.
      * tools/virsh.c (vshCmddefHelp): Update help output for argv when
      naming the option is useful.
      (vshCmddefGetData): Fix logic on when argv was seen.
      * tests/virsh-optparse: Add tests to avoid regressions.
      85d28108
  23. 08 9月, 2011 1 次提交
    • A
      tests: avoid memory leak on testTLSSessionInit · 3a89819d
      Alex Jia 提交于
      * tests/virnettlscontexttest: fix memory leak on virnettlscontext test case.
      
      * Detected in valgrind run:
      
      ==25667==
      ==25667== 86,651 (34,680 direct, 51,971 indirect) bytes in 10 blocks are
      definitely lost in loss record 350 of 351
      ==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
      ==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
      ==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
      ==25667==    by 0x804DD24: testTLSSessionInit (virnettlscontexttest.c:624)
      ==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
      ==25667==
      ==25667== 100,578 (38,148 direct, 62,430 indirect) bytes in 11 blocks are
      definitely lost in loss record 351 of 351
      ==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
      ==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
      ==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
      ==25667==    by 0x804DD3C: testTLSSessionInit (virnettlscontexttest.c:625)
      ==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
      
      * How to reproduce?
      % cd libvirt && ./configure && make && make -C tests valgrind
      or
      % valgrind -v --leak-check=full ./tests/virnettlscontexttest
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      3a89819d
  24. 06 9月, 2011 1 次提交
    • M
      redirdev: allows to specify device address · 2e0dbaad
      Marc-André Lureau 提交于
      It is important to be able to attach USB redirected devices to a
      particular controller (one that supports USB2 for instance).
      Without this patch, only the default bus was used.
      
           <redirdev bus='usb' type='spicevmc'>
             <address type='usb' bus='0' port='4'/>
           </redirdev>
      2e0dbaad
  25. 05 9月, 2011 1 次提交
    • E
      snapshot: wire up disk-only flag to snapshot-create · 35d52b56
      Eric Blake 提交于
      Expose the disk-only flag through virsh.  Additionally, make
      virsh snapshot-create-as take an arbitrary number of diskspecs,
      which can be used to build up the xml for <domainsnapshot>.
      
      * tools/virsh.c (cmdSnapshotCreate): Add --disk-only.
      (cmdSnapshotCreateAs): Likewise, and add argv diskspec.
      (vshParseSnapshotDiskspec): New helper function.
      (vshCmddefGetOption): Allow naming of argv field.
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Document
      them.
      * tests/virsh-optparse: Test snapshot-create-as parsing.
      35d52b56