1. 20 9月, 2012 4 次提交
    • M
      qemu: Cleanup boot parameter building · 8c952908
      Martin Kletzander 提交于
      This patch cleans up building the "-boot" parameter and while on that
      fixes one inconsistency by modifying these things:
      
       - I completed the unfinished virDomainBootMenu enum by specifying
         LAST, declaring it and also declaring the TypeFromString and
         TypeToString parameters.
       - Previously mentioned TypeFromString and TypeToString are used when
         parsing the XML.
       - Last, but not least, visible change is that the "-boot" parameter
         is built and parsed properly:
          - The "order=" prefix is used only when additional parameters are
            used (menu, etc.).
          - It's rewritten in a way that other parameters can be added
            easily in the future (used in following patch).
          - The "order=" parameter is properly parsed regardless to where it
            is placed in the string (e.g. "menu=on,order=nc").
          - The "menu=" parameter (and others in the future) are created
            when they should be (i.e. even when bootindex is supported and
            used, but not when bootloader is selected).
      8c952908
    • M
      qemu: Transition domain to PAUSED after 'stop' command · a5e8beef
      Michal Privoznik 提交于
      Currently, we mark domain PAUSED (but not emit an event)
      just before we issue 'stop' on monitor; This command can
      take ages to finish, esp. when domain's doing a lot of
      IO - users can enforce qemu to open files with O_DIRECT
      which doesn't return from write() until data reaches the
      block device. Having said that, we report PAUSED even if
      domain is not paused yet.
      a5e8beef
    • L
      network: fix element size / length in memmove · db8760ff
      Laine Stump 提交于
      The memmove to move elements in the dhcp hosts array when inserting
      and deleting items was mistakenly basing the length of the copy on the
      size of a virNetworkDHCPHostDefPtr rather than virNetworkDHCPHostDef,
      with the expected disastrous results.
      
      The memmove to delete an entry commits two errors - along with the
      size of each element being wrong, it also omits some required
      parentheses.
      db8760ff
    • D
      virsh: Move daemon to misc since its not a network · 6a1b0e37
      Doug Goldstein 提交于
      Move the 'Daemon' entry to the Miscellaneous section since its not a
      networking driver or component.
      6a1b0e37
  2. 19 9月, 2012 9 次提交
    • L
      network: fix incorrect VIR_NETWORK_UPDATE_COMMAND_* values · 01ab6599
      Laine Stump 提交于
      These enums originally were put into the flags for virNetworkUpdate,
      and when they were moved into their own enum, the numbers weren't
      appropriately changed, causing the commands to start with value 2
      instead of 1. This causes problems for things like ENUM_IMPL, which
      wants a string for every value in the requested range, including those
      not used in the enum.
      01ab6599
    • D
      build: define WITH_INTERFACE for the driver · b95ad92e
      Doug Goldstein 提交于
      Based exclusively on work by Eric Blake in a patch posted with the same
      subject. However some modifications related to comments and my plans to
      add another backend.
      
      Added WITH_INTERFACE as the only automake variable deciding whether to
      build the driver and using WITH_NETCF to identify that we're wanting to
      use the netcf library as the backend.
      
      * configure.ac: Added with_interface
      * src/interface/netcf_driver.c: Renamed..
      * src/interface/interface_backend_netcf.c: ..to this to match storage.
      * src/interface/netcf_driver.h: Renamed..
      * src/interface/interface_driver.h: ..to this.
      * daemon/Makefile.am: Respect WITH_INTERFACE and WITH_NETCF.
      * libvirt.spec.in: Add RPM support for --with-interface
      b95ad92e
    • D
      virsh: Rename QEmu to QEMU to match upstream · c88a4f2a
      Doug Goldstein 提交于
      Match upstream's naming of QEMU. There was a notice on the ML that said
      the preferred spelling was QEMU a while back.
      c88a4f2a
    • P
      virsh: Fix resource leaks when editing files. · 1035c51f
      Peter Krempa 提交于
      The cleanup path in virsh-edit helper was never reached when the edit
      was successful leaking the document in memory as well as the temporary
      file.
      1035c51f
    • E
      util: don't print free'd dmidecode path · 03da89d1
      Eric Blake 提交于
      The path was freed before printing the error message, resulting in:
      error : virSysinfoRead:773 : internal error Failed to execute command
      (null)
      But virCommandRun already gives a better error message.
      
      * src/util/sysinfo.c (virSysinfoRead): Avoid overwriting error.
      03da89d1
    • E
      build: avoid unused symbol · 26cae4b4
      Eric Blake 提交于
      Commit f36309d6 added an export with no matching implementation;
      probably a misspelling of an earlier version of the final addition
      of virNetworkObjSetDefTransient.
      
      * src/libvirt_private.syms (network_conf.h): Drop bogus
      virNetworkSetDefTransient.
      26cae4b4
    • E
      build: fix nodeinfo build on non-Linux platforms · 35a03a66
      Eric Blake 提交于
      Commit aaa8ab3e added new static functions that are only used on Linux;
      but commit 22acfdc7 didn't go far enough to fix compiler issues.
      
      * src/nodeinfo.c (nodeSetMemoryParameterValue)
      (nodeGetMemoryParameterValue): Conditionally compile based on use.
      35a03a66
    • E
      bitmap: fix problems in previous commit · fd66ea66
      Eric Blake 提交于
      Commit ee3d3893 missed the fact that (unsigned char)<<(int)
      is truncated to int, and therefore failed for any bitmap data
      longer than four bytes.
      
      Also, I failed to run 'make syntax-check' on my commit 4bba6579;
      for whatever odd reason, ffs lives in a different header than ffsl.
      
      * src/util/bitmap.c (virBitmapNewData): Use correct shift type.
      (includes): Glibc (and therefore gnulib) decided ffs is in
      <strings.h>, but ffsl is in <string.h>.
      * tests/virbitmaptest.c (test5): Test it.
      fd66ea66
    • E
      build: avoid non-portable byte-swapping · 4bba6579
      Eric Blake 提交于
      Commit 0fc89098 used functions only available on glibc, completely
      botched 32-bit environments, and risked SIGBUS due to unaligned
      memory access on platforms that aren't as forgiving as x86_64.
      
      * bootstrap.conf (gnulib_modules): Import ffsl.
      * src/util/bitmap.c (includes): Use <strings.h> for ffsl.
      (virBitmapNewData, virBitmapToData): Avoid 64-bit assumptions and
      non-portable functions.
      4bba6579
  3. 18 9月, 2012 27 次提交
    • M
      Fix minor details not only in apic eoi · e6bd3ce0
      Martin Kletzander 提交于
      The introduction of APIC EOI patches had a few little details that
      could look better, so this patch fixes that and one more place in the
      file as well (same problem).
      e6bd3ce0
    • M
      secret: Fix error for private secrets · 54106114
      Martin Kletzander 提交于
      When trying to get the value of a private secret, the code used
      'operation denied' error. That error is specified as a error for
      read-only connections trying to perform denied operation. The
      following error seems more accurate.
      
      To compare the difference:
       - BEFORE
      error: operation secret is private forbidden for read only access
      
       - AFTER
      error: Invalid secret: secret is private
      54106114
    • M
      virNetDevBandwidthClear: Improve error handling · 2f678bb1
      Martin Kletzander 提交于
      Two changes are introduced in this patch:
      
       - The first change removes ATTRIBUTE_RETURN_CHECK from
         virNetDevBandwidthClear, because it was called with ignore_value
         always, anyway. The function is used even when it's not necessary
         to call it, just for cleanup purposes.
      
       - The second change is added ignoring of the command's exit status,
         since it may report an error even when run just as "to be sure we
         clean up" function. No libvirt errors are suppresed by this.
      2f678bb1
    • M
      syntax-check: fix run.in · 9ac287f8
      Martin Kletzander 提交于
      Two more problems in "run.in" made the syntax-check fail.
      9ac287f8
    • G
      Adhere to copyright_address check · 956ce7b4
      Guido Günther 提交于
      to fix "make syntax-check"
      
      Found by http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/
      956ce7b4
    • R
      Add a ./run script for running programs from the local directory. · 5090c576
      Richard W.M. Jones 提交于
      With this script you can run libvirt programs without needing to
      install them first.  You just have to do for example:
      
        ./run ./tools/virsh [args ...]
      
      If you are already in the tools/ subdirectory, then the following
      command will also work:
      
        ../run ./virsh [...]
      
      You can also run the C programs under valgrind like this:
      
        ./run valgrind [valgrind opts...] ./program
      
      or under gdb:
      
        ./run gdb --args ./program
      
      This also works with sudo (eg. if you need root access for libvirt):
      
        sudo ./run ./tools/virsh list --all
      
      Derived from libguestfs and simplified.  The ./run script in
      libguestfs is much more sophisticated:
      
      https://github.com/libguestfs/libguestfs/blob/master/run.in
      5090c576
    • P
      rpc: Fix name of member in remote_protocol-structs · 24f03aa8
      Peter Krempa 提交于
      Commit 7a99b0ab adds a new RPC struct
      but one of the members has different names in remote_protocol.x and
      remote_protocol-struct breaking make check.
      24f03aa8
    • J
      virBitmap: fix build without HAVE_NUMACTL · 2a72e54c
      Ján Tomko 提交于
      Commit 75b198b3 forgot to change
      arguments of dummy qemuProcessInitNumaMemoryPolicy from char* to
      virBitmapPtr.
      2a72e54c
    • J
      qemuhelptest: convert runaway tab to spaces · 587632ff
      Ján Tomko 提交于
      Make syntax-check happy and smiling again.
      587632ff
    • R
      daemon: Fix error message when libvirtd is missing. · 0e13136a
      Richard W.M. Jones 提交于
      Currently we search along the hard-coded names:
        SBINDIR "/libvirtd"
        SBINDIR "/libvirtd_dbg"
      but if the environment variable $LIBVIRTD_PATH is set to the
      name of the libvirtd binary, that is used instead.  Fix the
      error message so it accurately reflects current behaviour
      ($PATH is NOT searched).
      0e13136a
    • R
      gitignore: Ignore .gdb_history file. · 481dfbae
      Richard W.M. Jones 提交于
      481dfbae
    • D
      Fix the augea test for qemu libvirtd options · b1ba47ec
      Daniel Veillard 提交于
      Commit 1ccf2227 forgot to
      add the output to the augeas test
      b1ba47ec
    • L
      network: implement backend of virNetworkUpdate(IP_DHCP_HOST) · e3b6b2be
      Laine Stump 提交于
      This patch fills in the first implementation for one of the
      virNetworkUpdate sections. With this code, you can now add/delete/edit
      <host> entries in a network's <ip> address <dhcp> element (by
      specifying a section of VIR_NETWORK_SECTION_IP_DHCP_HOST).
      
      If you pass in a parentIndex of -1, the code will automatically find
      the one ip element that has a <dhcp> section and make the updates
      there. Otherwise, you can specify an index >= 0, and libvirt will look
      for that particular instance of <ip> in the network, and modify its
      <dhcp> element. (This currently isn't very useful, because libvirt
      only supports having dhcp information on a single IP address, but that
      could change in the future).
      
      When adding a new host entry
      (VIR_NETWORK_UPDATE_COMMAND_ADD_(FIRST|LAST)), the existing entries
      will be compared to the new entry, and if any non-empty attribute
      matches, the add will fail. When updating an existing entry
      (VIR_NETWORK_UPDATE_COMMAND_MODIFY), the mac address or name will be
      used to find the existing entry, and other fields will only be updated
      (note there is some potential for ambiguity here if you specify the
      mac address from one entry and the name from another).  When deleting
      an existing entry (VIR_NETWORK_UPDATE_COMMAND_DELETE), all non-empty
      attributes in the supplied xml arg will be compared - all of them must
      match before libvirt will delete the host.
      
      The xml should be a fully formed <host> element as it would appear in
      a network definition, e.g. "<host mac=00:11:22:33:44:55 ip=10.1.23.22
      name='testbox'/>" (when adding/updating, ip and one of mac|name is
      required; when deleting, you can specify any one, two, or all
      attributes, but they all must match the target element).
      
      As with the update of any other section, you can choose to affect the
      live config (with flag VIR_NETWORK_UPDATE_AFFECT_LIVE), the persistent
      config (VIR_NETWORK_UPDATE_AFFECT_CONFIG), or both. If you've chosen
      to affect the live config, those changes will take effect immediately,
      with no need to destroy/restart the network.
      
      An example of adding a host entry:
      
         virNetworkUpdate(net, VIR_NETWORK_UPDATE_COMMAND_ADD_LAST,
                           VIR_NETWORK_SECTION_IP_DHCP_HOST, -1,
                          "<host mac='00:11:22:33:44:55' ip='192.168.122.5'/>",
                          VIR_NETWORK_UPDATE_AFFECT_LIVE
                          | VIR_NETWORK_UPDATE_AFFECT_CONFIG);
      
      To delete that same entry:
      
         virNetworkUpdate(net, VIR_NETWORK_UPDATE_COMMAND_DELETE,
                          VIR_NETWORK_SECTION_IP_DHCP_HOST, -1,
                          "<host mac='00:11:22:33:44:55'/>",
                          VIR_NETWORK_UPDATE_AFFECT_LIVE
                          | VIR_NETWORK_UPDATE_AFFECT_CONFIG);
      
      (you could also delete it by replacing "mac='00:11:22:33:44:55'" with
      "ip='192.168.122.5'".)
      e3b6b2be
    • L
      network: restart radvd/dnsmasq if needed when libvirtd is restarted · 4cf974b6
      Laine Stump 提交于
      A user on IRC had accidentally killed all of his libvirt-started
      dnsmasq instances (due to a buggy dnsmasq service script in Fedora
      16), and had hoped that libvirtd would notice this on restart and
      reload all the dnsmasq daemons (as it does with iptables
      rules). Unfortunately this was not the case - as long as the network
      object had a pid registered for dnsmasq and/or radvd, it assumed that
      the processes were running.
      
      This patch takes advantage of the new utility functions in
      bridge_driver.c to do a "refresh" of all radvd and dnsmasq processes
      started by libvirt each time libvirtd is restarted - this function
      attempts to do a SIGHUP of each existing process, and if that fails,
      it restarts the process, rebuilding all the associated config files
      and commandline parameters in the process. This normally has no
      effect, but will be useful in solving the occasional "odd situation"
      without needing to take the drastic step of destroying/re-starting the
      network.
      4cf974b6
    • L
      network: implement virNetworkUpdate for test_driver · 6bdcef11
      Laine Stump 提交于
      The test driver does nothing outside of keeping track of each
      network's config/state in the in-memory database maintained by
      network_conf functions, so all we have to do is call the function that
      updates the network's entry in the in-memory database.
      6bdcef11
    • L
      network: implement virNetworkUpdate for bridge_driver · cd331650
      Laine Stump 提交于
      Call the network_conf function that modifies the live/persistent/both
      config, then refresh/restart dnsmasq/radvd if necessary, and finally
      save the config in the proper place(s).
      
      This patch also needed to uncomment a few utility functions that were
      added inside #if 0 in the previous commit (to avoid compiler errors
      due to unreferenced static functions).
      cd331650
    • L
      network: reorganize dnsmasq and radvd config file / startup · 1ce4922e
      Laine Stump 提交于
      This patch splits the starting of dnsmasq and radvd into multiple
      files, and adds new networkRefreshXX() and networkRestartXX()
      functions for each. These new functions are currently commented out
      because they won't be used until the next commit, and the compile options
      require all static functions to be used.
      
      networkRefreshXX() - rewrites any file-based config for dnsmasq/radvd,
      and sends SIGHUP to the process to make it reread its config. If the
      program isn't already running, it's just started.
      
      networkRestartXX() - kills the given program, waits for it to exit
      (see the comments in the function networkKillDaemon()), then calls
      networkStartXX().
      
      This commit is here mostly as a checkpoint to verify no change in
      functional behavior after refactoring networkStartXX() functions to
      fit in with these new functions.
      1ce4922e
    • L
      conf: implement NetworkObj backend of virNetworkUpdate API · d22f4bad
      Laine Stump 提交于
      virNetworkObjUpdate takes care of all virNetworkUpdate-related changes
      to the data stored in the in-memory virNetworkObj list. It should be
      called by network drivers that use this in-memory list.
      
      virNetworkObjUpdate *does not* take care of updating any disk-based
      copies of the config, nor does it perform any other operations
      necessary to have the new config data take effect (e.g. it won't
      re-write dnsmasq host files, nor will it send a SIGHUP to dnsmasq) -
      those things should all be taken care of in the network driver
      function that calls virNetworkObjUpdate (assuming that it returns
      success).
      d22f4bad
    • L
      network: utility functions for updating network config · f36309d6
      Laine Stump 提交于
      These new functions are highly inspired by those in domain_conf.c (but
      not identical), and are intended to make it simpler to update the
      various combinations of live/persistent network configs.
      
      The network driver wasn't previously as careful about the separation
      between the live "status" in network->def and the persistent "config"
      in network->newDef (or sometimes in network->def). This series
      attempts to remedy some of that, but probably doesn't go all the way
      (enough to get these functions working and enable continued work on
      virNetworkUpdate though).
      
      bridge_driver.c and test_driver.c were updated in a few places to take
      advantage of the new functions and/or account for changes in argument
      lists.
      f36309d6
    • L
      network: implement RPC calls for virNetworkUpdate · 7a99b0ab
      Laine Stump 提交于
      This is very short, because almost everything is autogenerated. All
      that's needed are:
      
      * src/remote/remote_driver.c: add pointer to autogenerated
          remoteNetworkUpdate to the function table for the remote
          network driver.
      
      * src/remote/remote_protocol.x: add the "args" struct and add one more
          item to the remote_procedure enum for this function.
      
      * src/remote_protocol-struct: update to match remote_protocol.x
      7a99b0ab
    • L
      network: define new API virNetworkUpdate · 574b9bc6
      Laine Stump 提交于
      This patch adds a new public API virNetworkUpdate that will permit
      updating an existing network configuration without requiring that the
      network be destroyed/restarted for the changes to take effect.
      574b9bc6
    • J
      tests: add qemu-1.2.0 help data · 76345dd4
      Ján Tomko 提交于
      Generated with:
      
      qemu-system-x86_64 -help >tests/qemuhelpdata/qemu-1.2.0
      qemu-system-x86_64 \
          -device ? \
          -device pci-assign,? \
          -device virtio-blk-pci,? \
          -device virtio-net-pci,? \
          -device scsi-disk,? 2>tests/qemuhelpdata/qemu-1.2.0-device
      76345dd4
    • J
      qemu: add -sandbox to command line if requested · 5f7861ca
      Ján Tomko 提交于
      5f7861ca
    • J
      qemu: conf: add seccomp_sandbox option · 1ccf2227
      Ján Tomko 提交于
      1ccf2227
    • J
      qemu: add capability flag for seccomp sandbox · ede22e58
      Ján Tomko 提交于
      This series adds support to run QEMU with seccomp sandbox enabled. It can be
      configured in qemu.conf to on, off, or the QEMU default, which is off in 1.2.
      Default value is the QEMU default.
      ede22e58
    • M
      qemu: Avoid deadlock on HandleAgentEOF · 1020a504
      Michal Privoznik 提交于
      On agent EOF the qemuProcessHandleAgentEOF() callback is called
      which locks virDomainObjPtr. Then qemuAgentClose() is called
      (with domain object locked) which eventually calls qemuAgentDispose()
      and qemuProcessHandleAgentDestroy(). This tries to lock the
      domain object again. Hence the deadlock.
      1020a504
    • O
      qemu: Use disk wwn in qemu command line · 6e73850b
      Osier Yang 提交于
      All of ide-drive, ide-hd, ide-cd, scsi-disk, scsi-hd, and scsi-cd
      supports wwn property. (NB, scsi-block doesn't support to set wwn).
      
      * src/qemu/qemu_command.c: Error out if underlying QEMU doesn't
      support wwn property for the device; Set wwn for the device otherwise.
      
      * tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args: New test
      * tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml: Likewise
      * tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args: Likewise
      * tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.xml: Likewise
      * tests/qemuxml2argvtest.c: Add the new tests.
      6e73850b