1. 01 5月, 2013 1 次提交
    • V
      S390: Do not generate a default USB controller · 3a82f628
      Viktor Mihajlovski 提交于
      For s390 we don't want to have a default USB device generated even
      if QEMU is silently tolerating -usb on the command line. This may change
      in the future.
      Another reason to avoid the USB controller is that it implies a PCI
      bus which might cause a regression at some later point in time.
      The following change will set the USB controller model to 'none'
      unless a model or address has been specified, which can be the case
      if a legacy definition is loaded or the XML writer knows what
      she/he's doing.
      Requiring the user to explicitly disable USB on systems not supporting
      it seems cumbersome.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      3a82f628
  2. 29 4月, 2013 1 次提交
  3. 27 4月, 2013 3 次提交
    • J
      qemu: don't always reserve PCI addresses for implicit controllers · 877bc089
      Ján Tomko 提交于
      In the past we automatically added a USB controller and assigned
      it a PCI address (0:0:1.2) even on machines without a PCI bus.
      This didn't break machines with no PCI bus  because the command
      line for it is just '-usb', with no mention of the PCI bus.
      
      The implicit IDE controller (reserved address 0:0:1.1) has
      no command line at all.
      
      Commit b33eb0dc removed the ability to reserve PCI addresses
      on machines without a PCI bus. This made them stop working,
      since there would always be the implicit USB controller.
      
      Skip the reservation of addresses for these controllers when
      there is no PCI bus, instead of failing.
      877bc089
    • L
      network: support <driver name='vfio'/> in network definitions · d64e114f
      Laine Stump 提交于
      I remembered to document this bit, but somehow forgot to implement it.
      
      This adds <driver name='kvm|vfio'/> as a subelement to the <forward>
      element of a network (this puts it parallel to the match between
      mode='hostdev' attribute in a network and type='hostdev' in an
      <interface>).
      
      Since it's already documented, only the parser, formatter, backend
      driver recognition (it just translates/moves the flag into the
      <interface> at the appropriate time), and a test case were needed.
      
      (I used a separate enum for the values both because the original is
      defined in domain_conf.h, which is unavailable from network_conf.h,
      and because in the future it's possible that we may want to support
      other non-hostdev oriented driver names in the network parser; this
      makes sure that one can be expanded without the other).
      d64e114f
    • J
      qemu: don't assign a PCI address to 'none' USB controller · a12475bd
      Ján Tomko 提交于
      Adjust the usb-none test, since it gives the memballoon a lower PCI slot now.
      Add a test for 'none' controller on s390, which doesn't have PCI buses.
      a12475bd
  4. 26 4月, 2013 5 次提交
    • D
      Do proper escaping of cgroup resource partitions · f3662737
      Daniel P. Berrange 提交于
      If a user cgroup name begins with "cgroup.", "_" or with any of
      the controllers from /proc/cgroups followed by a dot, then they
      need to be prefixed with a single underscore. eg if there is
      an object "cpu.service", then this would end up as "_cpu.service"
      in the cgroup filesystem tree, however, "waldo.service" would
      stay "waldo.service", at least as long as nobody comes up with
      a cgroup controller called "waldo".
      
      Since we require a '.XXXX' suffix on all partitions, there is
      no scope for clashing with the kernel 'tasks' and 'release_agent'
      files.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f3662737
    • D
      Ensure all cgroup partitions have a suffix of ".partition" · 9ddfe7ee
      Daniel P. Berrange 提交于
      If the partition named passed in the XML does not already have
      a suffix, ensure it gets a '.partition' added to each component.
      The exceptions are /machine, /user and /system which do not need
      to have a suffix, since they are fixed partitions at the top
      level.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      9ddfe7ee
    • D
      Change VM cgroup suffix from '{lxc,qemu}.libvirt' to 'libvirt-{lxc,qemu}' · 824e86e7
      Daniel P. Berrange 提交于
      Recently we changed to create VM cgroups with the naming pattern
      $VMNAME.$DRIVER.libvirt. Following discussions with the systemd
      community it was decided that only having a single '.' in the
      names is preferrable. So this changes the naming scheme to be
      $VMNAME.libvirt-$DRIVER. eg for LXC 'mycontainer.libvirt-lxc' or
      for KVM 'myvm.libvirt-qemu'.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      824e86e7
    • S
      test: Add JSON test for query-tpm-types · 7e77f252
      Stefan Berger 提交于
      Add a test case for query-tpm-models QMP command.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      7e77f252
    • L
      qemu: use vfio-pci on commandline when appropriate · 731b0f36
      Laine Stump 提交于
      The device option for vfio-pci is nearly identical to that for
      pci-assign - only the configfd parameter isn't supported (or needed).
      
      Checking for presence of the bootindex parameter is done separately
      from constructing the commandline, similar to how it is done for
      pci-assign.
      
      This patch contains tests to check for proper commandline
      construction. It also includes tests for parser-formatter-parser
      roundtrips (xml2xml), because those tests use the same data files, and
      would have failed had they been included before now.
      
      qemu: xml/args tests for VFIO hostdev and <interface type='hostdev'/>
      
      These should be squashed in with the patch that adds commandline
      handling of vfio (they would fail at any earlier time).
      731b0f36
  5. 25 4月, 2013 7 次提交
  6. 24 4月, 2013 7 次提交
  7. 20 4月, 2013 1 次提交
    • E
      docs: fix usage of 'onto' · 1bf25ba2
      Eric Blake 提交于
      http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
      (and several other sites) give hints that 'onto' is best used if
      you can also add 'up' just before it and still make sense. In many
      cases in the code base, we really want the two-word form, or even
      a simplification to just 'on' or 'to'.
      
      * docs/hacking.html.in: Use correct 'on to'.
      * python/libvirt-override.c: Likewise.
      * src/lxc/lxc_controller.c: Likewise.
      * src/util/virpci.c: Likewise.
      * daemon/THREADS.txt: Use simpler 'on'.
      * docs/formatdomain.html.in: Better usage.
      * docs/internals/rpc.html.in: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * tests/qemumonitortestutils.c: Likewise.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bf25ba2
  8. 19 4月, 2013 1 次提交
  9. 18 4月, 2013 1 次提交
  10. 17 4月, 2013 2 次提交
    • O
      qemu: Allow the disk wwn to have "0x" prefix · 09d2547f
      Osier Yang 提交于
      The recent qemu requires "0x" prefix for the disk wwn, this patch
      changes virValidateWWN to allow the prefix, and prepend "0x" if
      it's not specified. E.g.
      
      qemu-kvm: -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
      drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,wwn=6000c60016ea71ad:
      Property 'scsi-hd.wwn' doesn't take value '6000c60016ea71ad'
      
      Though it's a qemu regression, but it's nice to allow the prefix,
      and doesn't hurt for us to always output "0x".
      09d2547f
    • O
      cleanup: Only include testutils.h once · 2beae9c2
      Osier Yang 提交于
      No reason to include it in both "if" and "else" branches.
      2beae9c2
  11. 16 4月, 2013 9 次提交
    • J
      Resolve valgrind error · c3ad5a36
      John Ferlan 提交于
      Commit id '1acfc171' resulted in the following valgrind failure:
      
      ==25317== 136 (24 direct, 112 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
      ==25317==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
      ==25317==    by 0x4C6F851: virAlloc (viralloc.c:124)
      ==25317==    by 0x4C71493: virBitmapNew (virbitmap.c:74)
      ==25317==    by 0x4C71B79: virBitmapNewData (virbitmap.c:434)
      ==25317==    by 0x402EF2: test8 (virbitmaptest.c:436)
      ==25317==    by 0x40499F: virtTestRun (testutils.c:157)
      ==25317==    by 0x402E8D: mymain (virbitmaptest.c:474)
      ==25317==    by 0x404FDA: virtTestMain (testutils.c:719)
      ==25317==    by 0x39D0821A04: (below main) (in /usr/lib64/libc-2.16.so)
      c3ad5a36
    • D
      Track symlinks for co-mounted cgroup controllers · 83336118
      Daniel P. Berrange 提交于
      If a cgroup controller is co-mounted with another, eg
      
         /sys/fs/cgroup/cpu,cpuacct
      
      Then it is a requirement that there exist symlinks at
      
         /sys/fs/cgroup/cpu
         /sys/fs/cgroup/cpuacct
      
      pointing to the real mount point. Add support to virCgroupPtr
      to detect and track these symlinks
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      83336118
    • D
      Remove non-functional code for setting up non-root cgroups · 767596bd
      Daniel P. Berrange 提交于
      The virCgroupNewDriver method had a 'bool privileged' param.
      If a false value was ever passed in, it would simply not
      work, since non-root users don't have any privileges to create
      new cgroups. Just delete this broken code entirely and make
      the QEMU driver skip cgroup setup in non-privileged mode
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      767596bd
    • D
      Add XML config for resource partitions · 8d4adf3e
      Daniel P. Berrange 提交于
      Allow VMs to be placed into resource groups using the
      following syntax
      
        <resource>
          <partition>/virtualmachines/production</partition>
        </resource>
      
      A resource cgroup will be backed by some hypervisor specific
      functionality, such as cgroups with KVM/LXC.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8d4adf3e
    • D
      Add a new virCgroupNewPartition for setting up resource partitions · aa8604dd
      Daniel P. Berrange 提交于
      A resource partition is an absolute cgroup path, ignoring the
      current process placement. Expose a virCgroupNewPartition API
      for constructing such cgroups
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aa8604dd
    • D
      Refactor cgroups internal data structures · 8d1c141a
      Daniel P. Berrange 提交于
      Currently the virCgroupPtr struct contains 3 pieces of
      information
      
       - path - path of the cgroup, relative to current process'
         cgroup placement
       - placement - current process' placement in each controller
       - mounts - mount point of each controller
      
      When reading/writing cgroup settings, the path & placement
      strings are combined to form the file path. This approach
      only works if we assume all cgroups will be relative to
      the current process' cgroup placement.
      
      To allow support for managing cgroups at any place in the
      heirarchy a change is needed. The 'placement' data should
      reflect the absolute path to the cgroup, and the 'path'
      value should no longer be used to form the paths to the
      cgroup attribute files.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8d1c141a
    • D
      Add a test suite for cgroups functionality · d1452470
      Daniel P. Berrange 提交于
      Some aspects of the cgroups setup / detection code are quite subtle
      and easy to break. It would greatly benefit from unit testing, but
      this is difficult because the test suite won't have privileges to
      play around with cgroups. The solution is to use monkey patching
      via LD_PRELOAD to override the fopen, open, mkdir, access functions
      to redirect access of cgroups files to some magic stubs in the
      test suite.
      
      Using this we provide custom content for the /proc/cgroup and
      /proc/self/mounts files which report a fixed cgroup setup. We
      then override open/mkdir/access so that access to the cgroups
      filesystem gets redirected into files in a temporary directory
      tree in the test suite build dir.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d1452470
    • D
      Conditionally compile storagevolxml2argvtest · b7f1d218
      Daniel P. Berrange 提交于
      Only compile storagevolxml2argvtest if WITH_STORAGE is
      set, because it links to that driver
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b7f1d218
    • D
      Conditionalize use of symlink() function in test suite · c78a2b13
      Daniel P. Berrange 提交于
      On Win32 symlink() is not available, so virstoragetest.c
      must be conditionalized to avoid compile failures.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c78a2b13
  12. 13 4月, 2013 1 次提交
  13. 12 4月, 2013 1 次提交
    • L
      Add USB option capability · a6e37aed
      Li Zhang 提交于
      To avoid the collision for creating USB controllers in machine->init()
      and -device xx command line, it needs to set usb=off to avoid one USB
      controller created in machine->init(). So that libvirt can use -device
      or -usb to create USB controller sucessfully.
      So QEMU_CAPS_MACHINE_USB_OPT capability is added, and it is for QEMU
      v1.3.0 onwards which supports USB option.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      a6e37aed