Commit Graph

398 Commits

Author SHA1 Message Date
Daniel P. Berrange
719c50caf8 Fix QEMU hotplug device alias assignment
To allow devices to be hot(un-)plugged it is neccessary to ensure
they all have a unique device aliases. This fixes the hotplug
methods to assign device aliases before invoking the monitor
commands which need them

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Expose methods
  for assigning device aliases for disks, host devices and
  controllers
* src/qemu/qemu_driver.c: Assign device aliases when hotplugging
  all types of device
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args:
  Update for changed hostdev naming scheme
2010-02-02 16:31:47 +00:00
Daniel P. Berrange
0943048ad0 Remove direct storage of hostnet_name & vlan
The current way of assigning names to the host network backend and
NIC device in QEMU was over complicated, by varying naming scheme
based on the NIC model and backend type. This simplifies the naming
to simply be 'net0' and 'hostnet0', allowing code to easily determine
the host network name and vlan based off the primary device alias
name 'net0'. This in turn allows removal of alot of QEMU specific
code from the XML parser, and makes it easier to assign new unique
names for NICs that are hotplugged

* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove hostnet_name
  and vlan fields from virNetworkDefPtr
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c:
  Use a single network alias naming scheme regardless of NIC type
  or backend type. Determine VLANs from the alias name.
* tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args: Update
  for new simpler naming scheme
2010-02-02 16:31:47 +00:00
Daniel P. Berrange
49a0f6cd99 Remove use of -netdev arg with QEMU
The QEMU 0.12.x tree has the -netdev command line argument, but not
corresponding monitor command. We can't enable the former, without
the latter since it will break hotplug/unplug.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage
  until 0.13 at earliest
* tests/qemuxml2argvtest.c: Add test for -netdev syntax
* tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test
  data files for -netdev syntax
2010-02-02 16:31:47 +00:00
Daniel P. Berrange
9258ec0a2e Rewrite way QEMU PCI addresses are allocated
The current QEMU code allocates PCI addresses incrementally starting
at 4. This is not satisfactory because the user may have given some
addresses in their XML config, which need to be skipped over when
allocating addresses to remaining devices.

It is thus neccessary to maintain a list of already allocated PCI
addresses and then only allocate ones that remain unused. This is
also required for domain device hotplug to work properly later.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add APIs for creating
  list of existing PCI addresses, and allocating new addresses.
  Refactor address assignment to use this code
* src/qemu/qemu_driver.c: Pull PCI address assignment up into the
  qemuStartVMDaemon() method, as a prelude to moving it into the
  'define' method. Update list of allocated addresses when connecting
  to a running VM at daemon startup.
* tests/qemuxml2argvtest.c, tests/qemuargv2xmltest.c,
  tests/qemuxml2xmltest.c: Remove USB product test since all
  passthrough is done based on address
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args,
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml: Kil
  unused data files
2010-02-02 16:31:47 +00:00
Matthias Bolte
854111f97e esx: Stop passing around virConnectPtr for error reporting 2010-01-26 01:19:23 +01:00
Jim Meyering
2c8eb68969 fix "make distcheck" failure
* tests/Makefile.am (qemuhelpdata): Add qemu-0.12.1.
2010-01-21 15:24:15 +01:00
Matthias Bolte
1671b64702 Unset copied environment variables in qemuxml2argvtest
The test expected all environment variables copied in qemudBuildCommandLine
to have known values. So all of them have to be either set to a known value
or be unset. SDL_VIDEODRIVER and QEMU_AUDIO_DRV are not handled at all but
should be handled. Unset both, otherwise the test will fail if they are set
in the testing environment.

* src/qemu/qemu_conf.c: add a comment about copied environment variables
  and qemuxml2argvtest
* tests/qemuxml2argvtest.c: unset SDL_VIDEODRIVER and QEMU_AUDIO_DRV
2010-01-20 23:22:15 +01:00
Laine Stump
77dd67087b Update interface.rng and xml test files to match netcf 0.1.5
The RNG now supports IPv6 and bonds attached to bridges, along with
some other minor tweaks. All test files from netcf have been copied to
the test directory and added to the xml2xml and schema tests (and they
all pass, of course ;-)
2010-01-19 21:13:03 +01:00
Jiri Denemark
5d462bd0b3 Implement CPU topology support for QEMU driver
QEMU's command line equivalent for the following domain XML fragment
    <vcpus>2</vcpus>
    <cpu ...>
        ...
        <topology sockets='1' cores='2', threads='1'/>
    </cpu>

is

    -smp 2,sockets=1,cores=2,threads=1

This syntax was introduced in QEMU-0.12.

Version 2 changes:
- -smp argument build split into a separate function
- always add ",sockets=S,cores=C,threads=T" to -smp if qemu supports it
- use qemuParseCommandLineKeywords for command line parsing

Version 3 changes:
- ADD_ARG_LIT => ADD_ARG and line reordering in qemudBuildCommandLine
- rebased

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2010-01-19 11:40:09 +01:00
Daniel P. Berrange
b66924148a Convert VirtIO balloon over to -device syntax
Replace

   -balloon virtio

With

   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

This allows it to get correct assigned PCI address as declared in
previous patch

 * src/qemu/qemu_conf.c: Convert Virtio ballon to -device and
   give it an explicit PCI address
 * tests/qemuxml2argvdata/qemuxml2argv-*args: Add in virtio balloon
   where appropriate
2010-01-18 13:55:57 +00:00
Daniel P. Berrange
a44d0dc26c Auto-assign PCI addresses
Instead of relying on QEMU to assign PCI addresses and then querying
them with 'info pci', manually assign all PCI addresses before starting
the guest.  These addresses are not stable across reboots. That will
come in a later patch

NB, the PIIX3 (IDE, FDC, ISA-Bridge) will always have slot 1 and
VGA will always have slot 2. We declare the Virtio Balloon gets
slot 3, and then all remaining slots are for configured devices.

* src/qemu/qemu_conf.c: If -device is supported, then assign all PCI
  addresses when building the command line
* src/qemu/qemu_driver.c: Don't query monitor for PCI addresses if
  they have already been assigned
* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-sound-device.args,
  tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args: Update
  to include PCI slot/bus information
2010-01-18 13:55:57 +00:00
Daniel P. Berrange
febc591683 Pass -vga none if no video card specified
QEMU always configures a VGA card. If no video card is included in
the libvirt XML, it is neccessary to explicitly turn off the default
using -vga none

* src/qemu/qemu_conf.c: Pass -vga none if no video card is configured
* tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Test for
  handling -vga none.
* tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args,
  tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml: Test
  data files
2010-01-18 13:55:57 +00:00
Daniel P. Berrange
4f6c999006 Add support for explicit -sdl flag to QEMU
Not all QEMU builds default to SDL graphics for their display.
Newer QEMU now has an explicit -sdl flag, which we can use to
explicitly request SDL intead of relying on the default. This
protects libvirt against unexpected changes in graphics default

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Probe for -sdl
  flag and use it if it is found
* tests/qemuhelptest.c: Add SDL flag to tests
2010-01-18 13:55:57 +00:00
Daniel P. Berrange
d86c876a66 Convert guestfwd to -device, and add -sdl explicit args
The old syntax was

   -chardev SOMECONFIG
   -nic user,guestfwd=tcp:IP:PORT-chardev:CHARDEV

The new syntax is

   -chardev SOMECONFIG
   -netdev user,guestfwd=tcp:IP:PORT,chardev=ID,id=user-ID
2010-01-18 13:55:57 +00:00
Daniel P. Berrange
16658da4e7 Convert PCI device assignment over to -device
The old syntax is

  -pcidevice host=BUS:SLOT:FUNCTION

The new syntax is

  -device pci-assign,host=BUS:SLOT:FUNCTION,addr=<PCI SLOT>,id=host0
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
42ce352c13 Convert USB hostdevices over to -device
The old syntax was

   -usbdevice host:PRODUCT:VENDOR

Or

   -usbdevice host:BUS.DEV

The new syntax is

   -device usb-host,product=PRODUCT,vendor=VENDOR

Or

   -device usb-host,hostbus=BUS,hostaddr=DEV
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
73370e9868 Convert USB disks over to -device
The previous syntax was severely limited in its options

  -usbdevice disk:/home/berrange/output.img

The new syntax is the same as for other disk types

  -drive file=/home/berrange/output.img,if=none,id=usb-1,index=1
  -device usb-storage,drive=usb-1

Again, the index= arg is wrong here, and will be removed in a
later merge
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
1dd6f855c3 Convert NICs over to use -device & -netdev where possible
The current syntax uses a pair of args

   -net nic,macaddr=52:54:00:56:6c:55,vlan=3,model=pcnet,name=pcnet.0
   -net user,vlan=3,name=user.0

The new syntax does not  need the vlan craziness anymore, and
so has a simplified pair of args

   -netdev user,id=user.0
   -device pcnet,netdev=user.0,id=pcnet.0,mac=52:54:00:56:6c:55,addr=<PCI SLOT>
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
4886cba76a Convert audio devices over to -device syntax
The current syntax for audio devices is a horrible multiplexed
arg

    -soundhw sb16,pcspk,ac97

The new syntax is

    -device sb16,id=sound0

or

    -device AC97,id=sound1,addr=<PCI SLOT>

NB, pcspk still uses the old -soundhw syntax
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
38a22fbfaa Convert watchdog to -device
The current syntax for watchdogs is

    -watchdog i6300esb

The new syntax will now be

    -device i6300esb,id=watchdogNN,addr=<PCI-SLOT>
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
7b2f8cdd7c Convert character devices over to use -device
The current character device syntax uses either

  -serial tty,path=/dev/ttyS2

Or

  -chardev tty,id=serial0,path=/dev/ttyS2 -serial chardev:serial0

With the new -device support, we now prefer

  -chardev file,id=serial0,path=/tmp/serial.log -device isa-serial,chardev=serial0

This patch changes the existing -chardev syntax to use this new
scheme, and fallbacks to the old plain -serial syntax for old
QEMU.

The monitor device changes to

  -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor

In addition, this patch adds --nodefaults, which kills off the
default serial, parallel, vga and nic devices. THis avoids the
need for us to explicitly turn each off
2010-01-18 13:55:56 +00:00
Daniel P. Berrange
1ed1bf3a38 Probe for -device and use -nodefaults
Probe for the new -device flag and if available set the -nodefaults
flag, instead of using -net none, -serial none or -parallel none.
Other device types will be converted to use -device in later patches.
The -nodefaults flag will help avoid unwelcome surprises from future
QEMU releases

* src/qemu/qemu_conf.c: Probe for -device. Add -nodefaults flag.
  Remove -net none, -serial none or -parallel none
* src/qemu/qemu_conf.h: Define QEMU_CMD_FLAG_DEVICE
* tests/qemuhelpdata/qemu-0.12.1: New data file for 0.12.1 QEMU
* tests/qemuhelptest.c: Test feature extraction from 0.12.1 QEMU
2010-01-18 13:39:14 +00:00
Daniel P. Berrange
b030084f07 Auto-add disk controllers based on defined disks
Existing applications using libvirt are not aware of the disk
controller concept. Thus, after parsing the <disk> definitions
in the XML, it is neccessary to create <controller> elements
to satisfy all requested disks, as per their defined drive
addresses

* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
  method for populating disk controllers, and call it after
  parsing disk definitions.
* src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
  when doing ARGV -> XML conversion
* tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
  data to all data files which don't have it already
2010-01-18 13:35:40 +00:00
Daniel P. Berrange
4359900ed1 Remove restriction on duplicated sound devices in parser
It is perfectly acceptable to have multiple sound devices of
same type in guest configuration. If the underlying hypervisor
does not like this, it is its job to complain, not the XML
parser's

* src/conf/domain_conf.c: Remove hack which deleted duplicated
  sound device models.
* tests/xml2sexprdata/xml2sexpr-fv-sound.xml: Remove duplicate
  models
2010-01-18 12:44:50 +00:00
Jim Meyering
eabb98b0a8 gnulib added a new syntax-check test: use $(VAR), not @VAR@
The latter is not officially "wrong", but *is* terribly anachronistic.
I think automake documentation or comments call that syntax obsolescent.
* cfg.mk (_makefile_at_at_check_exceptions): Exempt @SCHEMADIR@
and @SYSCONFDIR@ uses -- there are no Makefile variables for those.
* docs/Makefile.am: Use $(INSTALL), not @INSTALL@.
* examples/dominfo/Makefile.am: Similar.
* examples/domsuspend/Makefile.am: Similar.
* proxy/Makefile.am: Similar.
* python/Makefile.am: Similar.
* python/tests/Makefile.am: Similar.
* src/Makefile.am: Similar.
* tests/Makefile.am: Similar.
2010-01-18 09:50:08 +01:00
Matthias Bolte
c2c4d51b2f esx: Add VNC support
* src/conf/domain_conf.c: add defaults for the video device
* src/esx/esx_vmx.[ch]: add VNC support to the VMX handling
* tests/vmx2xmltest.c, tests/xml2vmxtest.c: add tests for the VNC support
2010-01-18 01:44:20 +01:00
Daniel P. Berrange
d78554d884 Specify bus/unit instead of index for disks with QEMU
The current code for using -drive simply sets the -drive 'index'
parameter. QEMU internally converts this to bus/unit depending
on the type of drive. This does not give us precise control over
the bus/unit assignment though. This change switches over to make
libvirt explicitly calculate the bus/unit number.

In addition bus/unit/index are actually irrelevant for VirtIO
disks, since each virtio disk is a separate PCI device. No disk
controller is involved.

Doing the conversion to bus/unit in libvirt allows us to correctly
attach SCSI controllers when required.

* src/qemu/qemu_conf.c: Specify bus/unit instead of index for
  disks
* tests/qemuxml2argvdata/qemuxml2argv-disk*.args: Switch over from
  using index=NNNN, to bus=NN, unit=NN for SCSI/IDE/Floppy disks
2010-01-15 17:55:59 +00:00
Daniel P. Berrange
776e37e1eb Set default disk controller/bus/unit props
When parsing the <disk> element specification, if no <address>
is provided for the disk, then automatically assign one based on
the <target dev='sdXX'/> device name. This provides for backwards
compatability with existing applications using libvirt, while also
allowing new apps to have complete fine grained control.

* src/conf/domain_conf.h, src/conf/domain_conf.c,
  src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
  for assigning a controller/bus/unit address based on disk target
* src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
  generating XML from ARGV
* tests/qemuxml2argvdata/*.xml: Add in drive address information
  to all XML files
2010-01-15 16:38:29 +00:00
Daniel P. Berrange
e8ac4a79f1 Make test suite output less verbose
Only print out '.' for each test case, full test output can be
re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX

Sample output now looks like

  TEST: statstest
        ........................................ 40
        ...................................      75  OK
  PASS: statstest
  TEST: qparamtest
        ................................         32  OK
  PASS: qparamtest
  TEST:
        ............                             12  OK
2010-01-15 16:28:05 +00:00
Jim Meyering
a4e9edbd77 avoid newly-introduced test failure
* tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Update
expected output to match, now that we use -mem-prealloc.
2010-01-09 09:25:04 +01:00
Jim Meyering
e6abf3d8f2 fix 7 "make check" test failures in non-srcdir build
* tests/capabilityschematest: Define and use $srcdir.
* tests/domainschematest: Likewise.
* tests/interfaceschematest: Likewise.
* tests/networkschematest: Likewise.
* tests/nodedevschematest: Likewise.
* tests/storagepoolschematest: Likewise.
* tests/storagevolschematest: Likewise.
2010-01-09 08:37:22 +01:00
Matthias Bolte
96ceb12443 esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses
The MAC addresses with 00:50:56 prefix are split into several ranges:

  00:50:56:00:00:00 - 00:50:56:3f:ff:ff  'static' range (manually assigned)
  00:50:56:80:00:00 - 00:50:56:bf:ff:ff  'vpx' range (assigned by a VI Client)

Erroneously the 'vpx' range was assumed to be larger and to occupy the
remaining addresses of the 00:50:56 prefix that are not part of the 'static'
range.

00:50:56 was used as prefix for generated MAC addresses, this is not possible
anymore, because there are gaps in the allowed ranges. Therefore, change the
prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway.

Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option
to false in case the MAC address doesn't fall into any predefined range.

* docs/drvesx.html.in: update website accordingly
* src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29
* src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC
  addresses
* tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests
2010-01-07 01:38:19 +01:00
Adam Litke
7a90f21655 qemu: Always enable the virtio balloon driver
The behavior for the qemu balloon device has changed.  Formerly, a virtio
balloon device was provided by default.  Now, '-balloon virtio' must be
specified on the command line to enable it.  This patch causes libvirt to
add '-balloon virtio' to the command line whenever the -balloon option is
available.
* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
  add "-baloon vitio" to qemu command when needed
* tests/qemuhelptest.c: add the new flag for detection
2010-01-06 18:01:51 +01:00
Matthias Bolte
20fa7cdb32 Distribute vmx2xml and xml2vmx test data files 2009-12-28 14:27:45 +01:00
Jim Meyering
2e5efc3d6e avoid calling exit with a constant; use EXIT_* instead
This appeases a new gnulib-provided "syntax-check".
* daemon/libvirtd.c (main): Use EXIT_FAILURE, not 1.
* proxy/libvirt_proxy.c (main): Likewise, and EXIT_SUCCESS, not 0.
* tests/conftest.c (main): Likewise.
* tests/reconnect.c (main): Likewise.
* tests/testutils.h (EXIT_AM_SKIP): Define.
* tests/nodeinfotest.c (mymain): Use EXIT_AM_SKIP, not 77.
* tests/qemuargv2xmltest.c: Likewise.
* tests/qemuxml2xmltest.c: Likewise.
* tests/virshtest.c (mymain): Likewise.
2009-12-15 17:46:04 +01:00
Cole Robinson
deae2bb57f nodedev: Add removable storage 'media_label' prop
Provides the CDROM label for current media. Only implemented for the
udev backend.
2009-12-14 14:58:23 +01:00
Jamie Strandboge
ad905a195e add AppArmor test and examples to dist
tests/virt-aa-helper-test and examples/apparmor are not included in
official tarballs, but should be. Attached is a patch to fix that
which works when apparmor is and is not available.
2009-12-14 13:40:42 +01:00
Matthew Booth
a8eb010ea2 Make QEMU driver use -chardev everywhere if available
Change -monitor, -serial and -parallel output to use -chardev if it is
available.
* src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where
  available.
* tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents
  for all current serial and parallel tests.
2009-12-14 10:38:44 +01:00
Daniel P. Berrange
3a4f172fdd Support for JSON mode monitor
Initial support for the new QEMU monitor protocol  using JSON
as the data encoding format instead of plain text

* po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
  mode. Replace with a version number check on >= 0.12 later
* src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
  impl of QMP protocol
* src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
2009-12-08 13:46:54 +00:00
Jiri Denemark
81ea6e4d9f Tests for interface type/model configuration
add a set of tests for Xen interface type and model configurations
2009-12-04 17:01:34 +01:00
Matthias Bolte
63166a4e0c Add virIndexToDiskName and fix mapping gap
esxVMX_IndexToDiskName handles indices up to 701. This limit comes
from a mapping gap in virDiskNameToIndex:

  sdzy -> 700
  sdzz -> 701
  sdaaa -> 728
  sdaab -> 729

This line in virDiskNameToIndex causes this gap:

  idx = (idx + i) * 26;

Fixing it by altering this line to:

  idx = (idx + (i < 1 ? 0 : 1)) * 26;

Also add a new version of virIndexToDiskName that handles the inverse
mapping for arbitrary indices.

* src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName
* src/util/util.[ch]: add virIndexToDiskName and fix mapping gap
* tests/esxutilstest.c: update test to verify that the gap is fixed
2009-12-03 18:07:49 +01:00
Daniel P. Berrange
7ed63c5312 Supress annoying libcap-ng errors from valgrind
* tests/.valgrind.supp: Ignore capng problems
2009-11-26 12:07:17 +00:00
Daniel P. Berrange
e7c78b0a94 Support QEMU's virtual FAT block device driver
Introduce a new type="dir"  mode for <disks> that allows use of
QEMU's  virtual FAT block device driver. eg

    <disk type='dir' device='floppy'>
      <source dir='/tmp/test'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>

gets turned into

  -drive file=fat:floppy:/tmp/test,if=floppy,index=0

Only read-only disks are supported with virtual FAT mode

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add type="dir"
* docs/schemas/domain.rng: Document new disk type
* src/xen/xend_internal.c, src/xen/xm_internal.c: Raise error for
  unsupported disk types
* tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Fix
  empty disk file handling
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.args,
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml,
  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args,
  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
  tests/qemuxml2argvtest.c: Test QEMU vitual FAT driver
* src/qemu/qemu_conf.c: Support generating fat:/some/dir type
  disk args
* src/security/security_selinux.c: Temporarily skip labelling
  of directory based disks
2009-11-23 12:17:16 +00:00
Steve Yarmie
b827338a72 qemu-kvm needs -enable-kvm flag for VT optimization
Recent qemu releases require command option '-enable-qemu' in order
for the kvm functionality be activated. Libvirt needs to pass this flag
to qemu when starting a domain. Note that without the option,
even if both the kernel and qemu support KVM, KVM will not be activated
and VMs will be very slow.

* src/qemu/qemu_conf.h src/qemu/qemu_conf.c: parse the extra command
  line option from help and add it when running kvm
* tests/qemuhelptest.c: this modified the flags output for qemu-0.10.5
  and qemu-kvm-0.11.0-rc2 regression tests
2009-11-20 15:41:05 +01:00
Matthias Bolte
645f4acafe esx: Fix MAC address formatting
VMware uses two MAC address prefixes: 00:0c:29 and 00:50:56. The 00:0c:29
prefix is used for ESX server generated addresses. The 00:50:56 prefix is
split into two parts. MAC addresses above 00:50:56:3f:ff:ff are generated
by a vCenter. The rest of the 00:50:56 prefix can be assigned manually.
Any MAC address within the 00:0c:29 and 00:50:56 prefix can be specified
in a domain XML config and the driver will handle the details internally.

* src/esx/esx_vmx.c: fix MAC address formatting
* tests/xml2vmxdata/*: update test files accordingly
2009-11-15 15:22:01 +01:00
Jamie Strandboge
308b85330a Fix virt-aa-helper when host and os.type arch differ
* src/security/virt-aa-helper.c: get_definition() now calls the new
  caps_mockup() function which will parse the XML for os.type,
  os.type.arch and then sets the wordsize.  These attributes are needed
  only to get a valid virCapsPtr for virDomainDefParseString(). The -H
  and -b options are now removed from virt-aa-helper (they weren't used
  yet anyway).
* tests/virt-aa-helper-test: extend and fixes tests, chmod'ed 755
2009-11-13 11:04:23 +01:00
Cole Robinson
e02f691a90 qemu: Break out function to check if we can create/define/restore
Use this function in the qemu, uml, lxc, and test drivers.
2009-11-06 10:12:32 -05:00
Daniel Veillard
bea92f968e Forgot test case on previous commit 2009-11-05 15:45:53 +01:00
Matthew Booth
af249ea468 Support for <channel> in domain and QEmu backend
allows the following to be specified in a domain:
<channel type='pipe'>
  <source path='/tmp/guestfwd'/>
  <target type='guestfwd' address='10.0.2.1' port='4600'/>
</channel>

* proxy/Makefile.am: add network.c as dep of domain_conf.c
* docs/schemas/domain.rng src/conf/domain_conf.[ch]: extend the domain
  schemas and the parsing/serialization side for the new construct

QEmu support will add the following on the qemu command line:
 -chardev pipe,id=channel0,path=/tmp/guestfwd
 -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0

* src/qemu/qemu_conf.c: Add argument output for channel
* tests/qemuxml2(argv|xml)test.c: Add test for <channel> domain syntax
2009-11-05 15:31:03 +01:00
Cole Robinson
4c44cdcce3 Various error reporting fixes
- Don't duplicate SystemError
- Use proper error code in domain_conf
- Fix a broken error call in qemu_conf
- Don't use VIR_ERR_ERROR in security driver (isn't a valid code in this case)
2009-11-03 16:46:54 -05:00