Commit Graph

53 Commits

Author SHA1 Message Date
Daniel P. Berrange
85d15b5143 Add support for setting disk drive serial numbers
* docs/schemas/domain.rng: Add <serial> element to disks
* src/domain_conf.h, src/domain_conf.c: XML parsing and
  formatting for disk serial numbers
* src/qemu_conf.c: Set serial number when launching guests
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
  serial number to XML test
2009-09-03 13:53:34 +01:00
Daniel P. Berrange
d823a05aef Support configuration of huge pages in guests
Add option to domain XML for

     <memoryBacking>
        <hugepages/>
     </memoryBacking>

* configure.in: Add check for mntent.h
* qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
  Add 'hugetlbfs_mount' config parameter
* src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
  and pass it when hugepages are requested.
  Load hugetlbfs_mount config parameter, search for mount if not given.
* src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
  Create directory for QEMU hugepage usage, chowning if required.
* docs/formatdomain.html.in: Document memoryBacking/hugepages elements
* docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
* src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
  helper API
* tests/qemuhelptest.c: Add -mem-path constants
* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
  handling
* tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
  tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
  hugepage tests
2009-09-03 13:51:55 +01:00
Mark McLoughlin
d4528d9ac2 Detect KVM's PCI device assignment support
PCI device assignment is only supported in KVM's fork of qemu, so we
should really detect its availability and give a nice error if its
not supported.

* src/qemu_conf.[ch]: introduce QEMUD_CMD_FLAG_PCIDEVICE indicating
  that the -pcidevice command line option is available

* tests/*: update the tests
2009-08-14 08:31:11 +01:00
Mark McLoughlin
c23dae4e5c Assign names to qemu NICs and network backends
We need these so that we can remove the devices via the monitor.

* src/domain_conf.h: add nic_name and hostnet_name to virDomainNetDef

* src/domain_conf.c: free nic_name and hostnet_name

* src/qemu_conf.c: add qemuAssignNetNames(), use it if qemu has
  support for the param and pass the names on the command line

* tests/qemuxml2argv*: add a test for this
2009-07-22 11:34:06 +01:00
Mark McLoughlin
62455ed872 Switch to using a unix socket for the qemu monitor
We keep support for the pty based monitor so that we can re-connect
to VMs started by older versions of libvirtd.

* src/domain_conf.c: handle formatting and parsing unix monitors

* src/qemu_driver.c: add qemudOpenMonitorUnix(), remove the monitor
  pty path searching from qemudFindCharDevicePTYs(), switch
  qemudStartVMDaemon() and qemuDomainXMLToNative() to using a unix
  monitor

* tests/qemuxml2argvtest.c: switch to using a unix monitor

* tests/qemuxml2argvdata/qemuxml2argv-*.args: update test data
2009-07-09 20:04:09 +01:00
Mark McLoughlin
05d377bdd2 Add the monitor type to the domain state XML
There are no functional changes in this patch apart from adding the
monitor type to the state XML.

The patch mostly consists of switching to use virDomainChrDef every
where to describe the monitor.

* src/domain_conf.h: replace monitorpath with monitor_chr

* src/domain_conf.c: handle parsing the monitor type and initializing
  monitor chr

* src/qemu_conf.[ch]: make qemudBuildCommandLine take a
  virDomainChrDefPtr and use that to build the -monitor parameter

* src/qemu_driver.c: split pty specific and common code from
  qemudOpenMonitor, have qemudStartVMDaemon() initialize monitor_chr

* tests/qemuxml2argvtest.c: update for qemudBuildCommandLine() change
2009-07-09 20:04:07 +01:00
Daniel P. Berrange
ad6d5acb42 Support <video> element for QEMU guests
* src/qemu_conf.c, src/qemu_conf.h: Use -vga or -std-vga
	when starting guests if video card is present
	* tests/qemuhelptest.c: Change to use constants instead
	of hardcoded hex numbers, and add VGA support
	* tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml,
	tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml: Add <video>
	element for testing graphics adapter
	* tests/qemuxml2argvtest.c: Add QEMUD_CMD_FLAG_VGA flag
	* tests/qemuxml2xmltest.c: Add missing graphics-vnc-sasl/tls tests
2009-07-08 13:40:32 +01:00
Cole Robinson
659bd66529 Check that '-drive format=' is supported before adding to qemu cmdline.
Qemu < 0.10.0 did not support it, and virt-* tools now try to add this by
default, so it's extra important we ensure the option exists.
2009-06-16 15:17:10 +00:00
Daniel P. Berrange
9a15c48d2d Switch to using virDomainDefPtr for building command line in QEMU driver 2009-04-19 14:50:01 +00:00
Daniel P. Berrange
b44af714d3 Support SASL auth for VNC server. 2009-03-16 13:54:26 +00:00
Jim Meyering
d26c3387df tests: diagnose more open failures
* tests/qemuxml2argvtest.c: Revert the change,
"tests: diagnose open failure" of 2009-01-30.
* tests/testutils.c (virtTestLoadFile): Diagnose failure here.
2009-02-02 20:35:14 +00:00
Jim Meyering
cf1b0f868b tests: diagnose open failure
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Diagnose
failure to open an input file.
2009-01-30 21:59:35 +00:00
Daniel P. Berrange
a6ef2e0055 Fix ifname= passing to QEMU for type=ethernet network config 2009-01-30 17:17:58 +00:00
Daniel P. Berrange
67e7416119 Support disk caching mode config 2009-01-30 17:15:39 +00:00
Daniel P. Berrange
4f4bfbc79e Fix save/restore migrate syntax for new KVM releases 2009-01-29 17:27:54 +00:00
Daniel P. Berrange
ad70b32414 Support QEMU disk format specification in XML 2009-01-23 16:22:20 +00:00
Daniel Veillard
c8ef64bdd7 Add tests and docs for the new PCI passthrough format
* docs/formatdomain.html.in docs/libvirt.rng docs/formatdomain.html:
  document the new PCI passthrough format
* tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml:
  and add a regression test for it.
Daniel
2009-01-12 15:09:19 +00:00
Guido Günther
830ba76c3e let qemu/kvm instances write a pid file 2008-12-18 15:22:49 +00:00
Daniel Veillard
a3d570c7b9 Adding support for SDL fullscreen option
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
  tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml:
  slightly modified patch for SDL fullscreen from Itamar Heim
* docs/formatdomain.html docs/formatdomain.html.in docs/libvirt.rng:
  update the schemas and docs about the sdl graphic element attributes
* AUTHORS: add Itamar Heim
Daniel
2008-12-11 11:44:30 +00:00
Guido Günther
1d7d2fae10 Differentiate between active and inactive configs by honoring the
VIR_DOMAIN_XML_INACTIVE flag.
2008-12-04 12:02:59 +00:00
Daniel P. Berrange
78439117bc Add support for -uuid and -domid args to QEMU 2008-11-04 22:15:30 +00:00
Daniel P. Berrange
7e0d3e62e9 Support SDL config with QEMU guests 2008-10-10 16:52:20 +00:00
Jim Meyering
efb8492b9d tests: append a newline to expected-output files lacking NL-at-EOF
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Adjust the
code that creates "actual" output, so that it too produces a
newline-terminated buffer.
* tests/qemuxml2argvdata/*.args: Append a newline to each, via:
for i in $(find|grep '\.args$'); do echo >> $i;done
2008-08-11 12:29:58 +00:00
Daniel P. Berrange
b3728d7d72 Fix const-correctness of virRUn and virExec 2008-08-08 15:43:38 +00:00
Daniel Veillard
5ba372306a llow to add a disk as an USB device (QEmu/KVM)
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
  src/qemu_driver.c: patch from Guido Günther allowing to add
  disk as USB devices
* docs/libvirt.rng: extend the schemas for the new value
* tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
  tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
  tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c: add a specific
  test to the regression suite
Daniel
2008-08-08 15:03:00 +00:00
Daniel Veillard
d1710d35ea Extend parser and add support for USB devices in QEmu/KVM
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
  src/qemu_driver.c: Patch from Guido Günther allowing to pass
  usb devices to qemu/kvm
* docs/libvirt.rng: add the new functionality to the grammar
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
  tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c: adding examples
  to the regression tests
* libvirt.spec.in: fix the licence tag
Daniel
2008-08-08 14:27:05 +00:00
Chris Lalancette
654c5714bf The new generic domain re-factor introduced a small regression into the drive
handling code.  In particular, if you had a section of XML like:

    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>

This used to work with older libvirt, but now fails.  This is because we are
actually passing the literal string (null) to the qemu command-line, which qemu
barfs on.  This patch fixes it up by making it blank, which allows qemu to
continue on it's merry way.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-07-29 12:09:21 +00:00
Daniel P. Berrange
6385fe3ede Switch QEMU driver over to generic domain APIs 2008-07-11 19:34:11 +00:00
Daniel P. Berrange
69582431a0 Fix booting QEMU off CDROM devices with -drive arg 2008-07-11 09:56:23 +00:00
Daniel P. Berrange
4b23495509 Convert test suites over to new test infrastructure 2008-05-29 15:31:49 +00:00
Daniel P. Berrange
40a82f3066 Make QEMU test suite independant of host OS capabilities 2008-05-16 16:51:30 +00:00
Daniel P. Berrange
763a59d84d Support Xenner bootloader 2008-05-15 16:21:11 +00:00
Daniel P. Berrange
0f1b6dd06a Pass -name arg to QEMU when available 2008-05-15 16:15:17 +00:00
Daniel P. Berrange
3a7b528d4b Add support for Xen input device in QEMU driver for xenner 2008-05-15 16:11:40 +00:00
Daniel P. Berrange
2c37f47985 Support paravirt disk configuration for xenner guests 2008-05-15 16:05:41 +00:00
Daniel P. Berrange
098ba1a433 Add support for -drive QEMU syntax, and virtio bus / disk type 2008-05-09 16:41:19 +00:00
Daniel Veillard
70f446631f Sound support for QEmu and Xen
* src/qemu_conf.c src/qemu_conf.h src/xend_internal.c
  src/xend_internal.h src/xm_internal.c src/xml.c src/xml.h:
  Patch from Cole Robinson adding sound support for QEmu and Xen
* tests/qemuxml2argvtest.c tests/sexpr2xmltest.c
  tests/xmconfigtest.c tests/xml2sexprtest.c:
  Associated regression tests
Daniel
2008-05-07 14:04:40 +00:00
Daniel P. Berrange
159cb2b97c Added support for network interface model setting 2008-04-30 12:30:55 +00:00
Daniel P. Berrange
49956f0469 Implement serial & parallel device support for QEMU driver 2008-04-25 20:46:13 +00:00
Jim Meyering
dc42a9d2de remove Vim and Emacs variable settings from C source files
Done with these commands:
git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,'

git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
2008-04-10 16:53:29 +00:00
Daniel P. Berrange
63bc5dd3e1 Add formal internal capabilities API and update drivers to use it 2008-02-27 04:35:08 +00:00
Jim Meyering
a378188194 Enable the <config.h>-requiring test; fix violations
Use <config.h>, not "config.h", per autoconf documentation.
* Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
* .x-sc_require_config_h: New file, to list exempted files.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
2008-01-29 18:15:54 +00:00
Jim Meyering
f510a6128b Clean up global name space in examples and tests.
* docs/examples/suspend.c: Declare global "conn" to be static.
* tests/qemuxml2argvtest.c: Declare global "driver" to be static.
* tests/qemuxml2xmltest.c: Likewise.


Author: Jim Meyering <meyering@redhat.com>
2008-01-14 14:04:33 +00:00
Jim Meyering
49230350fa Use a variable name as sizeof argument, not a type name.
Given code like: T *var = calloc (n, sizeof (T));
Convert to this: T *var = calloc (n, sizeof (*var));
This first-cut change adjusts all malloc, calloc, and
realloc statements.

The only binary differences are in remote_internal.c
(due to the bug fix) and in xmlrpc.c (due to factorization).

* python/libvir.c: As above.
* qemud/event.c: Likewise.
* qemud/mdns.c: Likewise.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.
* src/bridge.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/test.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/qemuxml2argvtest.c: Likewise.
* src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
* src/remote_internal.c (remoteAuthMakeCredentials): Use the right
type when allocating space for an array of cred _pointers_.
2007-12-11 21:57:29 +00:00
Richard W.M. Jones
4bfdb77aae Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
        qemud/remote.c, src/internal.h, src/openvz_conf.c,
        src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c,
        src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c,
        src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c,
        tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c,
        tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c,
        tests/xmconfigtest.c, tests/xml2sexprtest.c:
        Change #include <> to #include "" for local includes.
        Removed many includes from src/internal.h and put them in
        the C files which actually use them.
        Removed <ansidecl.h> - unused.
        Added a comment around __func__.
        Removed a clashing redefinition of VERSION symbol.
        All limits (PATH_MAX etc) now done in src/internal.h, so we
        don't need to include those headers in other files.
2007-12-05 13:56:22 +00:00
Richard W.M. Jones
b7641686a6 Mon Nov 26 12:03:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* tests/Makefile.am, tests/nodeinfotest.c, tests/qemuxml2argvtest.c,
	  tests/qemuxml2xmltest.c, tests/sexpr2xmltest.c, tests/virshtest.c,
	  tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
	  Miscellaneous fixes to the tests to compile under Cygwin.
2007-11-26 12:03:34 +00:00
Jim Meyering
5a6571eba9 Arrange for tests to pass in a non-srcdir build.
* tests/Makefile.am: Include the contents of the *data directories
in the make-dist-built tarball by adding each of that *data
directories to EXTRA_DIST.
Also add int-overflow (via $(test_scripts)) to EXTRA_DIST.
* tests/nodeinfotest.c: Prepend "$abs_top_srcdir/tests" to
each input file name.
* tests/qemuxml2argvtest.c: Likewise.
* tests/qemuxml2xmltest.c: Likewise.
* tests/sexpr2xmltest.c: Likewise.
* tests/test_conf.sh: Likewise.
* tests/virshtest.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
* tests/xml2sexprtest.c: Likewise.


Author: Jim Meyering <meyering@redhat.com>
2007-11-14 10:35:58 +00:00
Daniel Veillard
69b9fcf297 * src/conf.c: documentation cleanups from Jim Meyering
* tests/conftest.c: Use fwrite, not printf, since the
  result buffer is not NUL-terminatedi, from Jim Meyering.
* tests/qemuxml2argvtest.c: Initialize vm.migrateFrom[0],
  to avoid "read-uninitialized" error from within
  qemudBuildCommandLinei, from Jim Meyering.
Daniel
2007-10-19 08:29:13 +00:00
Daniel P. Berrange
136ebc6e3c Detect QEMU flags per VM instead of once for driver as a whole 2007-09-21 21:20:32 +00:00
Daniel P. Berrange
63dc047468 Fixed PXE network boot config 2007-09-13 22:06:54 +00:00