]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
15 years agoAdd a rule to check for uses of readlink.
Chris Lalancette [Mon, 21 Dec 2009 19:14:46 +0000 (14:14 -0500)] 
Add a rule to check for uses of readlink.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoUse virFileResolveLink instead of readlink in AppArmor
Chris Lalancette [Wed, 20 Jan 2010 21:12:43 +0000 (16:12 -0500)] 
Use virFileResolveLink instead of readlink in AppArmor

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix a compile warning in parthelper.c
Chris Lalancette [Thu, 10 Dec 2009 16:53:55 +0000 (17:53 +0100)] 
Fix a compile warning in parthelper.c

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd virConnectGetVersion Python API
Taizo ITO [Fri, 22 Jan 2010 10:01:09 +0000 (11:01 +0100)] 
Add virConnectGetVersion Python API

adds a new python API call for retrieving the running
hypervisor version used by a connection: virConnectGetVersion

* python/generator.py: skip virConnectGetVersion from autogenerated
* python/libvirt-override-api.xml python/libvirt-override.c: define
  direct native bindings

15 years agoRemove AppArmor compile warnings
Jamie Strandboge [Fri, 22 Jan 2010 09:48:34 +0000 (10:48 +0100)] 
Remove AppArmor compile warnings

* src/security/security_apparmor.c: unused variable in
  AppArmorSetSecurityAllLabel and unused parameter in
  AppArmorReleaseSecurityLabel

15 years agoRemove unused PROC_MOUNT_BUF_LEN #define
Chris Lalancette [Fri, 22 Jan 2010 09:25:44 +0000 (10:25 +0100)] 
Remove unused PROC_MOUNT_BUF_LEN #define

15 years agoUpdate polish translation and regenerate localizations
Daniel Veillard [Fri, 22 Jan 2010 09:02:16 +0000 (10:02 +0100)] 
Update polish translation and regenerate localizations

15 years agoAdd docs about new mailing list
Daniel P. Berrange [Thu, 21 Jan 2010 15:48:11 +0000 (16:48 +0100)] 
Add docs about new mailing list

* docs/contact.html.in: Document new users mailing list

15 years agodomMemoryStats / qemu: Fix parsing of unknown stats
Adam Litke [Thu, 21 Jan 2010 15:26:35 +0000 (16:26 +0100)] 
domMemoryStats / qemu: Fix parsing of unknown stats

Fix a small problem with the qemu memory stats parsing algorithm.  If qemu
reports a stat that libvirt does not recognize, skip past it so parsing can
continue.  This corrects a potential infinite loop in the parsing code that can
only be triggered if new statistics are added to qemu.

* src/qemu/qemu_monitor_text.c: qemuMonitorParseExtraBalloonInfo add a
  skip for extra ','

15 years agoCorrected log level of WWN path message
David Allan [Thu, 21 Jan 2010 14:55:13 +0000 (15:55 +0100)] 
Corrected log level of WWN path message

* src/node_device/node_device_linux_sysfs.c: open_wwn_file() the
  VIR_ERROR resllay should be just a VIR_DEBUG

15 years agoFix an error when looking for devices in syspath
Daniel Veillard [Thu, 21 Jan 2010 14:45:44 +0000 (15:45 +0100)] 
Fix an error when looking for devices in syspath

* src/node_device/node_device_udev.c: udevSetupSystemDev() only print the
  error message if lookup failed in both DMI_DEVPATH and DMI_DEVPATH_FALLBACK

15 years agoAllow surrounding whitespace in uuid
Dan Kenigsberg [Thu, 21 Jan 2010 14:28:56 +0000 (15:28 +0100)] 
Allow surrounding whitespace in uuid

* src/util/uuid.c: extend virUUIDParse to allow leading and trailing
  spaces in UUIDs

15 years agofix "make distcheck" failure
Jim Meyering [Thu, 21 Jan 2010 14:24:15 +0000 (15:24 +0100)] 
fix "make distcheck" failure

* tests/Makefile.am (qemuhelpdata): Add qemu-0.12.1.

15 years agoavoid more format-related warnings
Jim Meyering [Thu, 21 Jan 2010 14:12:12 +0000 (15:12 +0100)] 
avoid more format-related warnings

* src/qemu/qemu_conf.c (qemuBuildDriveStr): Use "%s".
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetGuestPCIAddress):
(qemuMonitorJSONGetGuestDriveAddress): Likewise.

15 years agoavoid format-related warnings
Jim Meyering [Thu, 21 Jan 2010 13:39:42 +0000 (14:39 +0100)] 
avoid format-related warnings

* src/conf/domain_conf.c (virDomainDeviceInfoParseXML): Use "%s".

15 years agoFix off-by-1 in SCSI drive hotplug
Daniel P. Berrange [Wed, 20 Jan 2010 14:53:30 +0000 (14:53 +0000)] 
Fix off-by-1 in SCSI drive hotplug

The loop looking for the controller associated with a SCI drive had
an off by one, causing it to miss the last controller.

* src/qemu/qemu_driver.c: Fix off-by-1 in searching for SCSI
  drive hotplug

15 years agoFix leak in hotplug code in QEMU driver
Daniel P. Berrange [Mon, 18 Jan 2010 18:02:20 +0000 (18:02 +0000)] 
Fix leak in hotplug code in QEMU driver

The hotplug code in QEMU was leaking memory because although the
inner device object was being moved into the main virDomainDefPtr
config object, the outer container virDomainDeviceDefPtr was not.

 * src/qemu/qemu_driver.c: Clarify code to show that the inner
   device object is owned by the main domain config upon
   successfull attach.

15 years agoAdd configuration option to turn off dynamic permissions management
Daniel P. Berrange [Wed, 13 Jan 2010 17:41:36 +0000 (17:41 +0000)] 
Add configuration option to turn off dynamic permissions management

Add the ability to turn off dynamic management of file permissions
for libvirt guests.

* qemu/libvirtd_qemu.aug: Support 'dynamic_ownership' flag
* qemu/qemu.conf: Document 'dynamic_ownership' flag.
* qemu/qemu_conf.c: Load 'dynamic_ownership' flag
* qemu/test_libvirtd_qemu.aug: Test 'dynamic_ownership' flag

15 years agoFix security driver calls in hotplug cleanup paths
Daniel P. Berrange [Wed, 13 Jan 2010 17:27:19 +0000 (17:27 +0000)] 
Fix security driver calls in hotplug cleanup paths

The hotplug code was not correctly invoking the security driver
in error paths. If a hotplug attempt failed, the device would
be left with VM permissions applied, rather than restored to the
original permissions. Also, a CDROM media that is ejected was
not restored to original permissions. Finally there was a bogus
call to set hostdev permissions in the hostdev unplug code

* qemu/qemu_driver.c: Fix security driver usage in hotplug/unplug

15 years agoAdd missing call to re-attach host devices if VM startup fails
Daniel P. Berrange [Wed, 13 Jan 2010 17:09:41 +0000 (17:09 +0000)] 
Add missing call to re-attach host devices if VM startup fails

If there is a problem with VM startup, PCI devices may be left
assigned to pci-stub / pci-back. Adding a call to reattach
host devices in the cleanup path is required.

* qemu/qemu_driver.c: qemuDomainReAttachHostDevices() when
  VM startup fails

15 years agoSwitch QEMU driver over to use the DAC security driver
Daniel P. Berrange [Wed, 13 Jan 2010 17:06:57 +0000 (17:06 +0000)] 
Switch QEMU driver over to use the DAC security driver

Remove all the QEMU driver calls for setting file ownership and
process uid/gid. Instead wire in the QEMU DAC security driver,
stacking it ontop of the primary SELinux/AppArmour driver.

* qemu/qemu_driver.c: Switch over to new DAC security driver

15 years agoIntroduce a new DAC security driver for QEMU
Daniel P. Berrange [Wed, 13 Jan 2010 16:43:29 +0000 (16:43 +0000)] 
Introduce a new DAC security driver for QEMU

This new security driver is responsible for managing UID/GID changes
to the QEMU process, and any files/disks/devices assigned to it.

* qemu/qemu_conf.h: Add flag for disabling automatic file permission
  changes
* qemu/qemu_security_dac.h, qemu/qemu_security_dac.c: New DAC driver
  for QEMU guests
* Makefile.am: Add new files

15 years agoIntroduce a stacked security driver impl for QEMU
Daniel P. Berrange [Wed, 13 Jan 2010 16:26:55 +0000 (16:26 +0000)] 
Introduce a stacked security driver impl for QEMU

* qemu/qemu_conf.h: Add securityPrimaryDriver and
  securitySecondaryDriver fields to 'struct qemud_driver'
* Makefile.am: Add new files
* qemu/qemu_security_stacked.c, qemu/qemu_security_stacked.h: A
  simple stacked security driver

15 years agoPull initial disk labelling out into libvirtd instead of exec hook
Daniel P. Berrange [Wed, 13 Jan 2010 16:28:31 +0000 (16:28 +0000)] 
Pull initial disk labelling out into libvirtd instead of exec hook

Pulling the disk labelling code out of the exec hook, and into
libvirtd will allow it to access shared state in the daemon. It
will also make debugging & error reporting easier / more reliable.

* qemu/qemu_driver.c: Move initial disk labelling calls up into
  libvirtd. Add cleanup of disk labels upon failure

15 years agoFix leak of allocated security label
Daniel P. Berrange [Wed, 13 Jan 2010 15:30:24 +0000 (15:30 +0000)] 
Fix leak of allocated security label

If a VM fails to start, we can't simply free the security label
strings, we must call the domainReleaseSecurityLabel() method
otherwise the reserved 'mcs' level will be leaked in SElinux

* src/qemu/qemu_driver.c: Invoke domainReleaseSecurityLabel()
  when domain fails to start

15 years agoRefactor setup & cleanup of security labels in security driver
Daniel P. Berrange [Mon, 11 Jan 2010 11:04:40 +0000 (11:04 +0000)] 
Refactor setup & cleanup of security labels in security driver

The current security driver architecture has the following
split of logic

 * domainGenSecurityLabel

    Allocate the unique label for the domain about to be started

 * domainGetSecurityLabel

    Retrieve the current live security label for a process

 * domainSetSecurityLabel

    Apply the previously allocated label to the current process
    Setup all disk image / device labelling

 * domainRestoreSecurityLabel

    Restore the original disk image / device labelling.
    Release the unique label for the domain

The 'domainSetSecurityLabel' method is special because it runs
in the context of the child process between the fork + exec.

This is require in order to set the process label. It is not
required in order to label disks/devices though. Having the
disk labelling code run in the child process limits what it
can do.

In particularly libvirtd would like to remember the current
disk image label, and only change shared image labels for the
first VM to start. This requires use & update of global state
in the libvirtd daemon, and thus cannot run in the child
process context.

The solution is to split domainSetSecurityLabel into two parts,
one applies process label, and the other handles disk image
labelling. At the same time domainRestoreSecurityLabel is
similarly split, just so that it matches the style. Thus the
previous 4 methods are replaced by the following 6 new methods

 * domainGenSecurityLabel

    Allocate the unique label for the domain about to be started
    No actual change here.

 * domainReleaseSecurityLabel

   Release the unique label for the domain

 * domainGetSecurityProcessLabel

   Retrieve the current live security label for a process
   Merely renamed for clarity.

 * domainSetSecurityProcessLabel

   Apply the previously allocated label to the current process

 * domainRestoreSecurityAllLabel

    Restore the original disk image / device labelling.

 * domainSetSecurityAllLabel

    Setup all disk image / device labelling

The SELinux and AppArmour drivers are then updated to comply with
this new spec. Notice that the AppArmour driver was actually a
little different. It was creating its profile for the disk image
and device labels in the 'domainGenSecurityLabel' method, where as
the SELinux driver did it in 'domainSetSecurityLabel'. With the
new method split, we can have consistency, with both drivers doing
that in the domainSetSecurityAllLabel method.

NB, the AppArmour changes here haven't been compiled so may not
build.

15 years agoMake security drivers responsible for checking dynamic vs static labelling
Daniel P. Berrange [Wed, 13 Jan 2010 14:03:04 +0000 (14:03 +0000)] 
Make security drivers responsible for checking dynamic vs static labelling

The QEMU driver is doing 90% of the calls to check for static vs
dynamic labelling. Except it is forgetting todo so in many places,
in particular hotplug is mistakenly assigning disk labels. Move
all this logic into the security drivers themselves, so the HV
drivers don't have to think about it.

* src/security/security_driver.h: Add virDomainObjPtr parameter
  to virSecurityDomainRestoreHostdevLabel and to
  virSecurityDomainRestoreSavedStateLabel
* src/security/security_selinux.c, src/security/security_apparmor.c:
  Add explicit checks for VIR_DOMAIN_SECLABEL_STATIC and skip all
  chcon() code in those cases
* src/qemu/qemu_driver.c: Remove all checks for VIR_DOMAIN_SECLABEL_STATIC
  or VIR_DOMAIN_SECLABEL_DYNAMIC. Add missing checks for possibly NULL
  driver entry points.

15 years agoImplement support for multi IQN
David Allan [Thu, 21 Jan 2010 11:50:52 +0000 (12:50 +0100)] 
Implement support for multi IQN

Allows the initiator to use a variety of IQNs rather than just the
system IQN when creating iSCSI pools.
* docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
* src/conf/storage_conf.[ch]: read and stores the iqn name
* src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
  when detected

15 years agoLet make fail when XHTML validation fails
Jiri Denemark [Wed, 20 Jan 2010 13:14:43 +0000 (14:14 +0100)] 
Let make fail when XHTML validation fails

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoFix uses of virFileMakePath
Laine Stump [Wed, 20 Jan 2010 23:52:13 +0000 (00:52 +0100)] 
Fix uses of virFileMakePath

* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
  src/network/bridge_driver.c src/qemu/qemu_driver.c
  src/uml/uml_driver.c: virFileMakePath returns 0 for success, or the
  value of errno on failure, so error checking should be to test
  if non-zero, not if lower than 0

15 years agoCreate storage pool directories with proper uid/gid/mode
Laine Stump [Wed, 20 Jan 2010 23:46:32 +0000 (00:46 +0100)] 
Create storage pool directories with proper uid/gid/mode

Previously the uid/gid/mode in the xml was ignored when creating new
storage pool directories. This commit attempts to honor the requested
permissions, and spits out an error if it can't.

Note that when creating the directory, the rest of the path leading up
to the final element is created using current uid/gid/mode, and the
final element gets the settings from xml. It is NOT an error for the
directory to already exist; in this case, the perms for the existing
directory are just set (if necessary).

* src/storage/storage_backend_fs.c: update the virStorageBackendFileSystemBuild
  function to check the directory hierarchy separately then create the
  leaf directory with the right attributes

15 years agoCreate storage volumes directly with desired uid/gid
Laine Stump [Wed, 20 Jan 2010 23:41:52 +0000 (00:41 +0100)] 
Create storage volumes directly with desired uid/gid

In order to avoid problems trying to chown files that were created by
root on a root-squashing nfs server, fork a new process that setuid's
to the desired uid before creating the file. (It's only done this way
if the pool containing the new volume is of type 'netfs', otherwise
the old method of creating the file followed by chown() is used.)

This changes the semantics of the "create_func" slightly - previously
it was assumed that this function just created the file, then the
caller would chown it to the desired uid. Now, create_func does both
operations.

There are multiple functions that can take on the role of create_func:

createFileDir - previously called mkdir(), now calls virDirCreate().
virStorageBackendCreateRaw - previously called open(),
                             now calls virFileCreate().
virStorageBackendCreateQemuImg - use virRunWithHook() to setuid/gid.
virStorageBackendCreateQcowCreate - same.
virStorageBackendCreateBlockFrom - preserve old behavior (but attempt
                                   chown when necessary even if not root)

* src/storage/storage_backend.[ch] src/storage/storage_backend_disk.c
  src/storage/storage_backend_fs.c src/storage/storage_backend_logical.c
  src/storage/storage_driver.c: change the create_func implementations,
  also propagate the pool information to be able to detect NETFS ones.

15 years agoNew utility functions virFileCreate and virDirCreate
Laine Stump [Wed, 20 Jan 2010 23:33:43 +0000 (00:33 +0100)] 
New utility functions virFileCreate and virDirCreate

These functions create a new file or directory with the given
uid/gid. If the flag VIR_FILE_CREATE_AS_UID is given, they do this by
forking a new process, calling setuid/setgid in the new process, and
then creating the file. This is better than simply calling open then
fchown, because in the latter case, a root-squashing nfs server would
create the new file as user nobody, then refuse to allow fchown.

If VIR_FILE_CREATE_AS_UID is not specified, the simpler tactic of
creating the file/dir, then chowning is is used. This gives better
results in cases where the parent directory isn't on a root-squashing
NFS server, but doesn't give permission for the specified uid/gid to
create files. (Note that if the fork/setuid method fails to create the
file due to access privileges, the parent process will make a second
attempt using this simpler method.)

If the bit VIR_FILE_CREATE_ALLOW_EXIST is set in the flags, an
existing file/directory will not cause an error; in this case, the
function will simply set the permissions of the file/directory to
those requested. If VIR_FILE_CREATE_ALLOW_EXIST is not specified, an
existing file/directory is considered (and reported as) an error.

Return from both of these functions is 0 on success, or the value of
errno if there was a failure.

* src/util/util.[ch]: add the 2 new util functions

15 years agoAdd virRunWithHook util function
Laine Stump [Wed, 20 Jan 2010 23:30:36 +0000 (00:30 +0100)] 
Add virRunWithHook util function

* src/util/util.[ch]: similar to virExecWithHook, but waits for child to
  exit. Useful for doing things like setuid after the fork but before the
  exec.

15 years agoUnset copied environment variables in qemuxml2argvtest
Matthias Bolte [Mon, 28 Dec 2009 15:21:15 +0000 (16:21 +0100)] 
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

15 years agoqemu: Don't allocate zero bytes
Matthias Bolte [Tue, 19 Jan 2010 21:39:37 +0000 (22:39 +0100)] 
qemu: Don't allocate zero bytes

15 years agoclean-up: remove unnecessary closedir call
Jim Meyering [Wed, 20 Jan 2010 20:57:34 +0000 (21:57 +0100)] 
clean-up: remove unnecessary closedir call

* src/node_device/node_device_linux_sysfs.c (get_virtual_functions_linux):
Remove unnecessary closedir.  Spotted by Dave Allan.

15 years agonode_device_linux_sysfs.c: avoid opendir/fd leak on error path
Jim Meyering [Wed, 20 Jan 2010 16:49:35 +0000 (17:49 +0100)] 
node_device_linux_sysfs.c: avoid opendir/fd leak on error path

* src/node_device/node_device_linux_sysfs.c(get_virtual_functions_linux):
Don't leak a DIR buffer and file descriptor on error path.

15 years agodomain_conf.c: avoid a leak and the need for "cleanup:" block
Jim Meyering [Wed, 20 Jan 2010 18:27:43 +0000 (19:27 +0100)] 
domain_conf.c: avoid a leak and the need for "cleanup:" block

* src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on
an error path, and at the same time, eliminate the need for a
"cleanup:" block.  Before, the "return -1" after the switch
would leak an "addr" string.  Now, by reversing the port,addr-
getting blocks we can free "addr" immediately and skip the goto.

15 years agoMake all bitfields unsigned ints to avoid unexpected values in casts
Daniel P. Berrange [Tue, 19 Jan 2010 12:07:32 +0000 (12:07 +0000)] 
Make all bitfields unsigned ints to avoid unexpected values in casts

The 'int virInterfaceIsActive()' method was directly returning the
value of the 'int active:1' bitfield in virIntefaceDefPtr. A bitfield
with a signed integer, will hold the values 0 and -1, not 0 and +1
as might be expected. This meant that virInterfaceIsActive() was
always returning -1 when the interface was active, not +1 & thus all
callers thought an error had occurred. To protect against this kind
of mistake again, change all bitfields to be unsigned ints

* daemon/libvirtd.h, src/conf/domain_conf.h, src/conf/interface_conf.h,
  src/conf/network_conf.h: Change bitfields to unsigned int.

15 years agoFix QEMU driver custom domain status XML extensions
Daniel P. Berrange [Mon, 18 Jan 2010 16:24:25 +0000 (16:24 +0000)] 
Fix QEMU driver custom domain status XML extensions

Invoking the virConnectGetCapabilities() method causes the QEMU
driver to rebuild its internal capabilities object. Unfortunately
it was forgetting to register the custom domain status XML hooks
again.

To avoid this kind of error in the future, the code which builds
capabilities is refactored into one single method, which can be
called from all locations, ensuring reliable rebuilds.

* src/qemu/qemu_driver.c: Fix rebuilding of capabilities XML and
  guarentee it is always consistent

15 years agoDocument cpu-compare command in virsh man page
Jiri Denemark [Wed, 20 Jan 2010 14:16:29 +0000 (15:16 +0100)] 
Document cpu-compare command in virsh man page

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoDocument <cpu> elements in capabilities and domain XML
Jiri Denemark [Tue, 19 Jan 2010 17:22:45 +0000 (18:22 +0100)] 
Document <cpu> elements in capabilities and domain XML

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agodocs: Remove outdated information about remote limitations
Matthias Bolte [Tue, 19 Jan 2010 20:39:20 +0000 (21:39 +0100)] 
docs: Remove outdated information about remote limitations

15 years agologging: confirm that we want to ignore a write error
Jim Meyering [Mon, 18 Jan 2010 10:51:01 +0000 (11:51 +0100)] 
logging: confirm that we want to ignore a write error

* src/util/logging.c (virLogMessage): Include "ignore-value.h".
Use it to ignore the return value of safewrite.
Use STDERR_FILENO, rather than "2".
* bootstrap (modules): Add ignore-value.
* gnulib: Update to latest, for ignore-value that is now LGPLv2+.

15 years agoxen_driver: don't leak a parsed-config buffer
Jim Meyering [Mon, 18 Jan 2010 17:02:17 +0000 (18:02 +0100)] 
xen_driver: don't leak a parsed-config buffer

* src/xen/xen_driver.c (xenUnifiedDomainXMLFromNative): Also
free "conf" before returning.

15 years agoUpdate interface.rng and xml test files to match netcf 0.1.5
Laine Stump [Sat, 2 Jan 2010 01:40:26 +0000 (20:40 -0500)] 
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 ;-)

15 years agoSupport bond interfaces attached to bridges in interface xml.
Laine Stump [Sat, 2 Jan 2010 01:40:25 +0000 (20:40 -0500)] 
Support bond interfaces attached to bridges in interface xml.

This was accomplished in xml parsing by doing away with the
stripped-down virInterfaceBareDef object, and just always using
virInterfaceDef, but with restrictions in certain places (eg, the type
of subordinate interface allowed in parsing depends on the parent
interface).

xml formatting was similarly adjusted. In addition, the formatting
functions keep track of the level of interface nesting, and insert
extra leading spaces on each line accordingly (using %*s).

The only change in formatted xml from previous (aside frmo supporting
new combinations of interface types) is that the subordinate ethernet
interfaces take up 2 lines rather than one, eg:

   <interface type='ethernet' name='eth0'>
   </interface>

instead of:

   <interface type='ethernet' name='eth0'/>

15 years agoAllow empty bridges in interface xml.
Laine Stump [Sat, 2 Jan 2010 01:40:24 +0000 (20:40 -0500)] 
Allow empty bridges in interface xml.

15 years agoSupport delay property in interface bridge xml.
Laine Stump [Sat, 2 Jan 2010 01:40:23 +0000 (20:40 -0500)] 
Support delay property in interface bridge xml.

15 years agostorage_conf: plug a leak on OOM error path
Jim Meyering [Mon, 18 Jan 2010 17:40:13 +0000 (18:40 +0100)] 
storage_conf: plug a leak on OOM error path

* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
Free just-allocated "source" upon VIR_REALLOC_N failure.

15 years agoRemove superfluous new lines from messages
Jiri Denemark [Tue, 19 Jan 2010 13:17:20 +0000 (14:17 +0100)] 
Remove superfluous new lines from messages

I noticed some debug messages are printed with an empty lines after
them. This patch removes these empty lines from all invocations of the
following macros:
    VIR_DEBUG
    VIR_DEBUG0
    VIR_ERROR
    VIR_ERROR0
    VIR_INFO
    VIR_WARN
    VIR_WARN0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoUse pciDeviceIsAssignable in qemu driver
Jiri Denemark [Tue, 22 Dec 2009 17:21:16 +0000 (18:21 +0100)] 
Use pciDeviceIsAssignable in qemu driver

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoTests for ACS in PCIe switches
Jiri Denemark [Tue, 22 Dec 2009 17:21:15 +0000 (18:21 +0100)] 
Tests for ACS in PCIe switches

New pciDeviceIsAssignable() function for checking whether a given PCI
device can be assigned to a guest was added. Currently it only checks
for ACS being enabled on all PCIe switches between root and the PCI
device. In the future, it could be the right place to check whether a
device is unbound or bound to a stub driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoAdd Jiri Denemark <jdenemar@redhat.com> to commiters
Daniel Veillard [Tue, 19 Jan 2010 13:41:19 +0000 (14:41 +0100)] 
Add Jiri Denemark <jdenemar@redhat.com> to commiters

15 years agoAllow for CPU topology specification without model
Jiri Denemark [Tue, 12 Jan 2010 14:25:36 +0000 (15:25 +0100)] 
Allow for CPU topology specification without model

Currently CPU topology may only be specified together with CPU model:
    <cpu match='exact'>
        <model>name</model>
        <topology sockets='1' cores='2' threads='3'/>
    </cpu>

This patch allows for CPU topology specification without the need for
also specifying CPU model:
    <cpu>
        <topology sockets='1' cores='2' threads='3'/>
    </cpu>

'match' attribute and 'model' element are made optional with the
restriction that 'match' attribute has to be set when 'model' is
present.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoAdd debug messages for CPU incompatibility
Jiri Denemark [Tue, 12 Jan 2010 14:25:44 +0000 (15:25 +0100)] 
Add debug messages for CPU incompatibility

When comparing incompatible CPUs, the reason for this incompatibility is
logged as a debug message.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoTake disabled/forced CPU features into account
Jiri Denemark [Tue, 12 Jan 2010 14:25:50 +0000 (15:25 +0100)] 
Take disabled/forced CPU features into account

When comparing x86 CPUs, features with 'disabled' policy were mistakenly
required to be supported by the host CPU.

Likewise, features with 'force' policy which were supported by host CPU
would make CPUs incompatible if 'strict' match was used by guest CPU.

This patch fixes both issues.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoImplement CPU topology support for QEMU driver
Jiri Denemark [Mon, 18 Jan 2010 15:51:52 +0000 (16:51 +0100)] 
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>
15 years agoEnhance qemuParseCommandLineKeywords
Jiri Denemark [Wed, 13 Jan 2010 15:48:30 +0000 (16:48 +0100)] 
Enhance qemuParseCommandLineKeywords

Current version expects name=value,... list and when an incorrect string
such as "a,b,c=d" would be parsed as "a,b,c" keyword with "d" value
without reporting any error, which is probably not the expected
behavior.

This patch adds an extra argument called allowEmptyValue, which if
non-zero will permit keywords with no value; "a,b=c,,d=" will be parsed
as follows:
    keyword value
    "a"     NULL
    "b"     "c"
    ""      NULL
    "d"     ""

In case allowEmptyValue is zero, the string is required to contain
name=value pairs only; retvalues is guaranteed to contain non-NULL
pointers. Now, "a,b,c=d" will result in an error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoConvert VirtIO balloon over to -device syntax
Daniel P. Berrange [Fri, 8 Jan 2010 16:32:10 +0000 (16:32 +0000)] 
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

15 years agoAuto-assign PCI addresses
Daniel P. Berrange [Thu, 7 Jan 2010 19:25:41 +0000 (19:25 +0000)] 
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

15 years agoPass -vga none if no video card specified
Daniel P. Berrange [Mon, 21 Dec 2009 22:38:05 +0000 (22:38 +0000)] 
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

15 years agoAdd support for explicit -sdl flag to QEMU
Daniel P. Berrange [Mon, 21 Dec 2009 20:23:55 +0000 (20:23 +0000)] 
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

15 years agoConvert guestfwd to -device, and add -sdl explicit args
Daniel P. Berrange [Mon, 14 Dec 2009 19:47:47 +0000 (19:47 +0000)] 
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

15 years agoConvert PCI device assignment over to -device
Daniel P. Berrange [Mon, 14 Dec 2009 19:36:42 +0000 (19:36 +0000)] 
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

15 years agoConvert USB input devices to -device
Daniel P. Berrange [Wed, 6 Jan 2010 18:31:00 +0000 (18:31 +0000)] 
Convert USB input devices to -device

15 years agoConvert USB hostdevices over to -device
Daniel P. Berrange [Mon, 14 Dec 2009 19:32:32 +0000 (19:32 +0000)] 
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

15 years agoConvert USB disks over to -device
Daniel P. Berrange [Mon, 14 Dec 2009 19:15:05 +0000 (19:15 +0000)] 
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

15 years agoConvert NICs over to use -device & -netdev where possible
Daniel P. Berrange [Mon, 14 Dec 2009 19:09:40 +0000 (19:09 +0000)] 
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>

15 years agoConvert disk drive over to use -device where available
Daniel P. Berrange [Mon, 14 Dec 2009 18:30:09 +0000 (18:30 +0000)] 
Convert disk drive over to use -device where available

The current preferred syntax for disk drives uses

  -drive file=/vms/plain.qcow,if=virtio,index=0,boot=on,format=qcow

The new syntax splits this up into a pair of linked args

  -drive file=/vms/plain.qcow,if=none,id=drive-virtio-0,format=qcow2
  -device virtio-blk-pci,drive=drive-virtio-0,id=virtio-0,addr=<PCI SLOT>

SCSI/IDE devices also get a bus property linking them to the
controller

  -device scsi-disk,drive=drive-scsi0-0-0,id=scsi0-0-0,bus=scsi0.0,scsi-id=0
  -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bus=ide0,unit=0

15 years agoConvert audio devices over to -device syntax
Daniel P. Berrange [Mon, 14 Dec 2009 18:16:10 +0000 (18:16 +0000)] 
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

15 years agoConvert watchdog to -device
Daniel P. Berrange [Mon, 14 Dec 2009 18:06:23 +0000 (18:06 +0000)] 
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>

15 years agoConvert character devices over to use -device
Daniel P. Berrange [Mon, 14 Dec 2009 18:04:35 +0000 (18:04 +0000)] 
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

15 years agoAssign device aliases for all devices at startup
Daniel P. Berrange [Wed, 6 Jan 2010 12:11:26 +0000 (12:11 +0000)] 
Assign device aliases for all devices at startup

When starting a guest, give every device a unique alias. This will
be used for the 'id' parameter in -device args in later patches.
It can also be used to uniquely identify devices in the monitor

For old QEMU without -device, assign disk names based on QEMU's
historical naming scheme.

* src/qemu/qemu_conf.c: Assign unique device aliases
* src/qemu/qemu_driver.c: Remove obsolete qemudDiskDeviceName
  and use the device alias in eject & blockstats commands

15 years agostorage_backend_fs.c: do not ignore probe failure
Jim Meyering [Mon, 18 Jan 2010 09:34:53 +0000 (10:34 +0100)] 
storage_backend_fs.c: do not ignore probe failure

* src/storage/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
Correct parentheses.  The documented intent is to ignore non-regular
files, yet due to a parenthesization error all errors were handled
that way.

15 years agoProbe for -device and use -nodefaults
Daniel P. Berrange [Mon, 21 Dec 2009 20:36:32 +0000 (20:36 +0000)] 
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

15 years agoAdd device info to serial, parallel, channel, input & fs devices
Daniel P. Berrange [Wed, 6 Jan 2010 12:39:53 +0000 (12:39 +0000)] 
Add device info to serial, parallel, channel, input & fs devices

Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
  parsing / formatting device info for serial, parallel, channel
  input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
  devices, input & fs device

15 years agoIntroduce device aliases
Daniel P. Berrange [Fri, 8 Jan 2010 15:53:53 +0000 (15:53 +0000)] 
Introduce device aliases

This patch introduces the support for giving all devices a short,
unique name, henceforth known as a 'device alias'.  These aliases
are not set by the end user, instead being assigned by the hypervisor
if it decides it want to support this concept.

The QEMU driver sets them whenever using the -device arg syntax
and uses them for improved hotplug/hotunplug. it is the intent
that other APIs (block / interface stats & device hotplug) be
able to accept device alias names in the future.

The XML syntax is

   <alias name="video0"/>

This may appear in any type of device that supports device info.

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add a 'alias'
  field to virDomainDeviceInfo struct & parse/format it in XML
* src/libvirt_private.syms: Export virDomainDefClearDeviceAliases
* src/qemu/qemu_conf.c: Replace use of "nic_name" field with the
  standard device alias
* src/qemu/qemu_driver.c: Clear device aliases at shutdown

15 years agoClear assigned PCI devices at shutdown
Daniel P. Berrange [Wed, 6 Jan 2010 10:35:30 +0000 (10:35 +0000)] 
Clear assigned PCI devices at shutdown

The PCI device addresses are only valid while the VM is running,
since they are auto-assigned by QEMU. After shutdown they must
all be cleared. Future QEMU driver enhancement will allow for
persistent PCI address assignment

* src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms
  Add virDomainDefClearPCIAddresses() method for wiping out auto assigned
  PCI addresses
* src/qemu/qemu_driver.c: Clear PCI addresses at VM shutdown

15 years agoAuto-add disk controllers based on defined disks
Daniel P. Berrange [Tue, 5 Jan 2010 13:31:20 +0000 (13:31 +0000)] 
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

15 years agoAvoid free'ing a constant string in chardev lookup code
Daniel P. Berrange [Tue, 5 Jan 2010 11:51:04 +0000 (11:51 +0000)] 
Avoid free'ing a constant string in chardev lookup code

 * src/qemu/qemu_monitor_text.c: Don't free const string in
   qemuMonitorTextGetPtyPaths()

15 years agoRemove restriction on duplicated sound devices in parser
Daniel P. Berrange [Thu, 10 Dec 2009 19:06:54 +0000 (19:06 +0000)] 
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

15 years agoDetect PCI addresses at QEMU startup
Daniel P. Berrange [Wed, 9 Dec 2009 21:59:04 +0000 (21:59 +0000)] 
Detect PCI addresses at QEMU startup

Hotunplug of devices requires that we know their PCI address. Even
hotplug of SCSI drives, required that we know the PCI address of
the SCSI controller to attach the drive to. We can find this out
by running 'info pci' and then correlating the vendor/product IDs
with the devices we booted with.

Although this approach is somewhat fragile, it is the only viable
option with QEMU < 0.12, since there is no way for libvirto set
explicit PCI addresses when creating devices in the first place.
For QEMU > 0.12, this code will not be used.

* src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
  startup of QEMU VM, matching vendor/product IDs
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  API for fetching PCI device address mapping

15 years agoProperly support SCSI drive hotplug
Daniel P. Berrange [Wed, 9 Dec 2009 17:57:09 +0000 (17:57 +0000)] 
Properly support SCSI drive hotplug

The current SCSI hotplug support attaches a brand new SCSI controller
for every disk. This is broken because the semantics differ from those
used when starting the VM initially. In the latter case, each SCSI
controller is filled before a new one is added.

If the user specifies an high drive index (sdazz) then at initial
startup, many intermediate SCSI controllers may be added with no
drives.

This patch changes SCSI hotplug so that it exactly matches the
behaviour of initial startup. First the SCSI controller number is
determined for the drive to be hotplugged. If any controller upto
and including that controller number is not yet present, it is
attached. Then finally the drive is attached to the last controller.

NB, this breaks SCSI hotunplug, because there is no 'drive_del'
command in current QEMU. Previous SCSI hotunplug was broken in
any case because it was unplugging the entire controller, not
just the drive in question.

A future QEMU will allow proper SCSI hotunplug of a drive.

This patch is derived from work done by Wolfgang Mauerer on disk
controllers.

* src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
 the correct controller, instead of just attaching a new
  controller.
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  support for 'drive_add' command

15 years agoImplement SCSI controller hotplug/unplug for QEMU
Wolfgang Mauerer [Mon, 7 Dec 2009 19:28:05 +0000 (19:28 +0000)] 
Implement SCSI controller hotplug/unplug for QEMU

This patch allows for explicit hotplug/unplug of SCSI controllers.
Ordinarily this is not required, since QEMU/libvirt will attach
a new SCSI controller whenever one is required. Allowing explicit
hotplug of controllers though, enables the caller to specify a
static PCI address, instead of auto-assigning the next available
PCI slot. Or it will when we have static PCI addressing.

This patch is derived from Wolfgang Mauerer's disk controller
patch series.

* src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
  controllers
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  new API for attaching PCI SCSI controllers

15 years agovbox_tmpl.c: remove useless array-is-non-NULL comparisons
Jim Meyering [Mon, 18 Jan 2010 08:58:57 +0000 (09:58 +0100)] 
vbox_tmpl.c: remove useless array-is-non-NULL comparisons

* src/vbox/vbox_tmpl.c (vboxStorageVolDelete): Remove always-true
array-is-non-NULL test.  git grep 'key\[.*\];'|grep -F .h
src/datatypes.h:    char key[PATH_MAX];
(vboxStorageVolGetInfo): Likewise.
(vboxStorageVolGetXMLDesc): Likewise.
(vboxStorageVolGetPath): Likewise.
(vboxDomainDefineXML): Likewise. (but now with "mac[]")

15 years agolxc_driver: remove useless comparison
Jim Meyering [Mon, 18 Jan 2010 08:49:57 +0000 (09:49 +0100)] 
lxc_driver: remove useless comparison

* src/lxc/lxc_driver.c (lxcSetupInterfaces): Remove always-true
array-is-non-NULL test.  git grep 'mac\[.*\];'|grep -F .h
src/conf/domain_conf.h:    unsigned char mac[VIR_MAC_BUFLEN];

15 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 15 Jan 2010 09:23:22 +0000 (10:23 +0100)] 
build: update gnulib submodule to latest

15 years agognulib added a new syntax-check test: use $(VAR), not @VAR@
Jim Meyering [Fri, 15 Jan 2010 10:09:01 +0000 (11:09 +0100)] 
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.

15 years agostorage_backend.h: include required headers
Jim Meyering [Fri, 15 Jan 2010 09:38:36 +0000 (10:38 +0100)] 
storage_backend.h: include required headers

* src/storage/storage_backend.h: Include <stdint.h>.

15 years agoesx_vi_types.c: include required headers
Jim Meyering [Fri, 15 Jan 2010 09:37:03 +0000 (10:37 +0100)] 
esx_vi_types.c: include required headers

* src/esx/esx_vi_types.c: Include <stdint.h>.

15 years agovbox: include required headers
Jim Meyering [Fri, 15 Jan 2010 09:35:41 +0000 (10:35 +0100)] 
vbox: include required headers

* src/vbox/vbox_driver.c: Include <stdint.h> <unistd.h> <sys/types.h>.

15 years agocpu_x86_data.h: include required header
Jim Meyering [Fri, 15 Jan 2010 09:33:32 +0000 (10:33 +0100)] 
cpu_x86_data.h: include required header

* src/cpu/cpu_x86_data.h: Include <stdint.h>.

15 years agoutil.c: include required header, no longer masked by gnulib
Jim Meyering [Fri, 15 Jan 2010 09:31:23 +0000 (10:31 +0100)] 
util.c: include required header, no longer masked by gnulib

Until recently, some gnulib-generated replacement headers
included *other* headers that were not strictly necessary,
thus masking the need in this file for an explicit <stdlib.h>.
* src/util/util.c: Include <stdlib.h> for declarations of e.g.,
strtol, random_r, getenv, etc.

15 years agoUse closest CPU model when decoding from CPUID
Jiri Denemark [Fri, 15 Jan 2010 15:58:59 +0000 (16:58 +0100)] 
Use closest CPU model when decoding from CPUID

Current implementation of x86Decode() used for CPUID -> model+features
translation does not always select the closest CPU model. When walking
through all models from cpu_map.xml the function considers a new
candidate as a better choice than a previously selected candidate only
if the new one is a superset of the old one. In case the new candidate
is closer to host CPU but lacks some feature comparing to the old
candidate, the function does not choose well.

This patch changes the algorithm so that the closest model is always
selected. That is, the model which requires the lowest number of
additional features to describe host CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoChange detection of xen so that it's actually automatic rather than forced.
Diego Elio Pettenò [Sun, 17 Jan 2010 14:48:46 +0000 (15:48 +0100)] 
Change detection of xen so that it's actually automatic rather than forced.

This ensures that ./configure will work fine if xen development packages
are not around, rather than fail. When passing ./configure --with-xen, the
lack of xen development packages become fatal.

15 years agoStandardise ./configure --help options reporting.
Diego Elio Pettenò [Sun, 17 Jan 2010 14:48:45 +0000 (15:48 +0100)] 
Standardise ./configure --help options reporting.

Always use AC_HELP_STRING for the help text for options at ./configure,
so that the output is properly aligned.

Use proper quadrigraphs for outputting the brackets.

Always use autoconf-style [default=$foo] output to state the default, both
where it was stated before and where it wasn't.

This time, include Matthias Bolte notes regarding defaults, and removing
PFX specification from phyp.

15 years agoqemu: Use log output for pty assignment if 'info chardev' is unavailable
Matthias Bolte [Sat, 16 Jan 2010 17:32:56 +0000 (18:32 +0100)] 
qemu: Use log output for pty assignment if 'info chardev' is unavailable

qemudFindCharDevicePTYsMonitor reports an error if 'info chardev' didn't
provide information for a requested device, even if the log output parsing
had found the pty path for that device. This makes pty assignment fail for
older QEMU/KVM versions. For example KVM 72 on Debian doesn't support
'info chardev', so qemuMonitorTextGetPtyPaths cannot parse any useful
information and the hash for device-id-to-pty-path mapping stays empty.

Make qemudFindCharDevicePTYsMonitor report an error only if the log output
parsing and the 'info chardev' parsing failed to provide the pty path.

15 years agoesx: Add VNC support
Matthias Bolte [Sat, 16 Jan 2010 12:52:34 +0000 (13:52 +0100)] 
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