1. 16 5月, 2013 13 次提交
    • O
      conf: Introduce <shareable> for hostdev · f2c1d9a8
      Osier Yang 提交于
      Unlike disk device, the scsi-generic always writethrough the data,
      so no need to introduce a "cache" tag, and set "cache=off".
      f2c1d9a8
    • D
      Don't mount selinux fs in LXC if selinux is disabled · 95c6cc34
      Daniel P. Berrange 提交于
      Before trying to mount the selinux filesystem in a container
      use is_selinux_enabled() to check if the machine actually
      has selinux support (eg not booted with selinux=0)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      95c6cc34
    • D
      Move VirtualBox driver into libvirtd · ba5f3c7c
      Daniel P. Berrange 提交于
      Change the build process & driver initialization so that the
      VirtualBox driver is built into libvirtd, instead of libvirt.so
      This change avoids the VirtualBox GPLv2-only license causing
      compatibility problems with libvirt.so which is under the
      GPLv2-or-later license.
      
      NB this change prevents use of the VirtualBox driver on the
      Windows platform, until such time as libvirtd can be made
      to work there.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ba5f3c7c
    • D
      Fix LXC startup when /var/run is an absolute symlink · d7d7581b
      Daniel P. Berrange 提交于
      During startup, the LXC driver uses paths such as
      
        /.oldroot/var/run/libvirt/lxc/...
      
      to access directories from the previous root filesystem
      after doing a pivot_root(). Unfortunately if /var/run
      is an absolute symlink to /run, instead of a relative
      symlink to ../run, these paths break.
      
      At least one Linux distro is known to use an absolute
      symlink for /var/run, so workaround this, by resolving
      all symlinks before doing the pivot_root().
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d7d7581b
    • O
      conf: Fix the bug of disk->copy_on_read formating · e3b40bec
      Osier Yang 提交于
      The reason for it's not exposed for such long time is that the
      enums for VirtioEventIdx and CopyOnReadType have same enum values
      and Correspondingstrings. This fixes the bug and adds test.
      e3b40bec
    • J
      datatypes: fix virGetStoragePool's comment · d3842cb4
      Ján Tomko 提交于
      d3842cb4
    • V
      qemu: Fix crash in migration of graphics-less guests. · 9684bb11
      Viktor Mihajlovski 提交于
      Commit 7f15ebc7 introduced a bug
      happening when guests without a <graphics> element are migrated.
      The initialization of listenAddress happens unconditionally
      from the cookie even if the cookie->graphics pointer was NULL.
      Moved the initialization to where it is safe.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      9684bb11
    • J
      build: Fix check-driverimpls in VPATH · e13e548f
      Jiri Denemark 提交于
      DRIVER_SOURCE_FILES mixes files with absolute path (inherited from
      REMOTE_DRIVER_GENERATED) with file paths that are relative to srcdir but
      check-driverimpls.pl needs full paths.
      e13e548f
    • J
      util: Fix build without devmapper · c431f065
      Jiri Denemark 提交于
      stdlib.h header file needed for getenv was only transitively included
      through libdevmapper.h.
      c431f065
    • O
      conf: Improve the coding style · a3f600f9
      Osier Yang 提交于
      Add spaces around "<<", and remove the useless blank-line.
      a3f600f9
    • S
      nwfilter: check for inverted ctdir · a6a04ea4
      Stefan Berger 提交于
      Linux netfilter at some point (Linux 2.6.39) inverted the meaning of the
      '--ctdir reply' and newer netfilter implementations now expect
      '--ctdir original' instead and vice-versa.
      We check for the kernel version and assume that all Linux kernels with version
      2.6.39 have the newer inverted logic.
      
      Any distro backporting the Linux kernel patch that inverts the --ctdir logic
      (Linux commit 96120d86f) must also backport this patch for Linux and
      adapt the kernel version being tested for.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      a6a04ea4
    • J
      Adjust improperly formatted <sysinfo> uuid · a2c37618
      John Ferlan 提交于
      If the <sysinfo> system table 'uuid' field is improperly formatted,
      then qemu will fail to start the guest with the error:
      
      virsh start dom
      error: Failed to start domain dom
      error: internal error process exited while connecting to monitor: Invalid SMBIOS UUID string
      
      This was because the parsing rules were lax with respect to allowing extraneous
      spaces and dashes in the provided UUID.  As long as there were 32 hexavalues
      that matched the UUID for the domain the string was accepted. However startup
      failed because the string format wasn't correct. This patch will adjust the
      string format so that when it's presented to the driver it's in the expected
      format.
      
      Added a test for uuid comparison within sysinfo.
      a2c37618
    • J
      Validate the bios_date format for <sysinfo> · 21540f5e
      John Ferlan 提交于
      Add incorrectly formatted bios_date validation test
      21540f5e
  2. 15 5月, 2013 14 次提交
  3. 14 5月, 2013 13 次提交
    • D
      Forbid use of ':' in RBD pool names · 2a2bc151
      Daniel P. Berrange 提交于
      The QEMU command line syntax for RBD disks is
      
         file=rbd:pool/image:opt1=val1:opt2=val2...
      
      There is no way to escape the ':' if it appears in the
      pool or image name. Thus it must be explicitly forbidden
      if it occurs in the libvirt XML. People are known to
      be abusing the lack of escaping in current libvirt to
      pass arbitrary args to QEMU.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2a2bc151
    • D
      Don't duplicate compiler warning flags when linking · 71b54636
      Daniel P. Berrange 提交于
      Automake already passes all CFLAGS to the linker too, so it
      is not necessary to set WARN_LDFLAGS in addition to the
      WARN_CFLAGS variable.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      71b54636
    • D
      Only pass -export-dynamic to linker, not compiler · 421846e4
      Daniel P. Berrange 提交于
      Clang does not like the -export-dynamic flag. The compiler does
      not need it in the first place, so we can avoid the problem by
      only setting it for the linker
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      421846e4
    • D
      Ignore cast alignment warnings in inotify code for Xen. · 7d73b114
      Daniel P. Berrange 提交于
      The inotify Xen code causes a cast alignment warning, but this
      is harmless since the kernel inotify interface will ensure
      sufficient alignment of the inotify structs in the buffer being
      read
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7d73b114
    • D
      Ensure consistent enablement of gcc 'diagnostic' pragma · c43b685a
      Daniel P. Berrange 提交于
      The virt-compile-warnings.m4 file would do an explicit
      check for whether the compile could use the 'diagnostic'
      pragma push/pop feature. The src/internal.h file would
      then only enable it for GCC >= 4.6
      
      This breaks with clang which supports the pragma but
      does not claim GCC 4.6 compat. Export a variable from
      the m4 check to the header file so they are consistent.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c43b685a
    • E
      qemu: fix bad free · 0b923ba3
      Eric Blake 提交于
      Commit bd56d0d8 could lead to freeing an uninitialized pointer:
      
      qemu/qemu_monitor_json.c: In function 'qemuMonitorJSONGetCommandLineOptionParameters':
      qemu/qemu_monitor_json.c:4284: warning: 'cmd' may be used uninitialized in this function
      
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONGetCommandLineOptionParameters): Initialize variable.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0b923ba3
    • E
      qemu: query command line options in QMP · bd56d0d8
      Eric Blake 提交于
      Ever since the conversion to using only QMP for probing features
      of qemu 1.2 and newer, we have been unable to detect features
      that are added only by additional command line options.  For
      example, we'd like to know if '-machine mem-merge=on' (added
      in qemu 1.5) is present.  To do this, we will take advantage
      of qemu 1.5's query-command-line-parameters QMP call [1].
      
      This patch wires up the framework for probing the command results;
      if the QMP command is missing, or if a particular command line
      option does not output any parameters (for example, -net uses
      a polymorphic parser, which showed up as no parameters as of qemu
      1.5), we silently treat that command as having no results.
      
      [1] https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05180.html
      
      * src/qemu/qemu_monitor.h (qemuMonitorGetOptions)
      (qemuMonitorSetOptions)
      (qemuMonitorGetCommandLineOptionParameters): New functions.
      * src/qemu/qemu_monitor_json.h
      (qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
      * src/qemu/qemu_monitor.c (_qemuMonitor): Add cache field.
      (qemuMonitorDispose): Clean it.
      (qemuMonitorGetCommandLineOptionParameters): Implement new function.
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
      (testQemuMonitorJSONGetCommandLineParameters): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bd56d0d8
    • E
      qemu: simplify string cleanup · 082274ea
      Eric Blake 提交于
      No need to open code a string list cleanup, if we are nice
      to the caller by guaranteeing a NULL-terminated result.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetCPUDefinitions)
      (qemuMonitorJSONGetCommands, qemuMonitorJSONGetEvents)
      (qemuMonitorJSONGetObjectTypes, qemuMonitorJSONGetObjectProps):
      Use simpler cleanup.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      082274ea
    • E
      qemu: use bool in monitor struct · 764bb5e5
      Eric Blake 提交于
      Follows on the heels of other bool cleanups, such as commit 93002b98.
      
      * src/qemu/qemu_monitor.h (qemuMonitorOpen, qemuMonitorOpenFD):
      Update json parameter type.
      * src/qemu/qemu_monitor.c (qemuMonitorOpen, qemuMonitorOpenFD):
      Likewise.
      (_qemuMonitor): Adjust field type.
      * src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLParse): Adjust
      client.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * tests/qemumonitortestutils.c (qemuMonitorTestNew): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      764bb5e5
    • E
      json: support removing a value from an object · 547a7c77
      Eric Blake 提交于
      In an upcoming patch, I need the way to safely transfer a nested
      virJSON object out of its parent container for independent use,
      even after the parent is freed.
      
      * src/util/virjson.h (virJSONValueObjectRemoveKey): New function.
      (_virJSONObject, _virJSONArray): Use correct type.
      * src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it.
      * src/libvirt_private.syms (virjson.h): Export it.
      * tests/jsontest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      547a7c77
    • G
      Support for static routes on a virtual bridge · ccff335f
      Gene Czarcinski 提交于
      network: static route support for <network>
      
      This patch adds the <route> subelement of <network> to define a static
      route.  the address and prefix (or netmask) attribute identify the
      destination network, and the gateway attribute specifies the next hop
      address (which must be directly reachable from the containing
      <network>) which is to receive the packets destined for
      "address/(prefix|netmask)".
      
      These attributes are translated into an "ip route add" command that is
      executed when the network is started. The command used is of the
      following form:
      
        ip route add <address>/<prefix> via <gateway> \
                     dev <virbr-bridge> proto static metric <metric>
      
      Tests are done to validate that the input data are correct.  For
      example, for a static route ip definition, the address must be a
      network address and not a host address.  Additional checks are added
      to ensure that the specified gateway is directly reachable via this
      network (i.e. that the gateway IP address is in the same subnet as one
      of the IP's defined for the network).
      
      prefix='0' is supported for both family='ipv4' address='0.0.0.0'
      netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::',
      prefix=0', although care should be taken to not override a desired
      system default route.
      
      Anytime an attempt is made to define a static route which *exactly*
      duplicates an existing static route (for example, address=::,
      prefix=0, metric=1), the following error message will be sent to
      syslog:
      
          RTNETLINK answers: File exists
      
      This can be overridden by decreasing the metric value for the route
      that should be preferred, or increasing the metric for the route that
      shouldn't be preferred (and is thus in place only in anticipation that
      the preferred route may be removed in the future).  Caution should be
      used when manipulating route metrics, especially for a default route.
      
      Note: The use of the command-line interface should be replaced by
      direct use of libnl so that error conditions can be handled better.  But,
      that is being left as an exercise for another day.
      Signed-off-by: NGene Czarcinski <gene@czarc.net>
      Signed-off-by: NLaine Stump <laine@laine.org>
      ccff335f
    • D
      Don't overwrite useful message when creating macvlan fails · 3407e3b3
      Daniel P. Berrange 提交于
      Currently we report a bogus error message when macvlan
      creation fails:
      
      error: Failed to start domain migtest
      error: operation failed: Unable to create macvlan device
      
      With this removed, we see the real error:
      
      error: Failed to start domain migtest
      error: Unable to get index for interface p31p1: No such device
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3407e3b3
    • D
      Remove & ban use of select() for waiting for I/O · 8845d8df
      Daniel P. Berrange 提交于
      Use of the select() system call is inherantly dangerous since
      applications will hit a buffer overrun if any FD number exceeds
      the size of the select set size (typically 1024). Replace the
      two uses of select() with poll() and use cfg.mk to ban any
      future use of select().
      
      NB: This changes the phyp driver so that it uses an infinite
      timeout, instead of busy-waiting for 1ms at a time.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8845d8df