Commit Graph

20 Commits

Author SHA1 Message Date
Jiri Denemark
8d8815ea2a Use common XML parsing functions 2010-03-23 15:40:10 +01:00
Jim Meyering
e977f471f1 virNodeDevCapScsiHostParseXML: avoid an unconditional leak
* src/conf/node_device_conf.c (virNodeDevCapScsiHostParseXML):
Free the "nodes" buffer allocated by virXPathNodeSet.
2010-02-16 17:49:05 +01:00
Daniel P. Berrange
99edc443e9 Remove virConnectPtr from all node device XML APIs
The virConnectPtr is no longer required for error reporting since
that is recorded in a thread local. Remove use of virConnectPtr
from all APIs in node_device_conf.{h,c} and update all callers to
match
2010-02-10 13:32:01 +00:00
Daniel Veillard
69cf62adac Escape strings serialized in XML
* src/conf/node_device_conf.c: string saved into XML should be escaped
  with the use of virBufferEscapeString()
2010-02-10 10:23:30 +01:00
Matthias Bolte
d5c6183def Remove conn parameter from virXPath* functions
It was used for error reporting only.
2010-02-09 01:04:54 +01:00
Matthias Bolte
8ce5e2c1ab Remove conn parameter from virReportOOMError 2010-02-09 01:04:54 +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
Dave Allan
a010165d27 expose SR IOV physical/virtual function relationships
exposes the relationships between physical
and virtual functions on SR IOV capable devices.
2009-12-14 14:44:12 +01:00
Matthias Bolte
1b9d074493 Add virBufferFreeAndReset() and replace free()
Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
Update documentation and replace all remaining calls to free() with
calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
and virReportOOMError() in OOM error cases.
2009-12-10 00:00:50 +01:00
Dave Allan
2cdb665b10 remove sysfs_path and parent_sysfs_path from XML
Erroneously included the sysfs_path and parent_sysfs_path elements in
the node device xml, they were not supposed to show up there

* src/conf/node_device_conf.c: remove the output of the 2 fields
2009-11-19 16:05:17 +01:00
Dave Allan
f2f656d426 Removing devicePath member from dev struct
I realized that I inadvertently added a member to the def struct to
contain each device's sysfs path when there was an existing member in the
dev struct for "OS specific path to device metadat, eg sysfs"  Since the
udev backend needs to record the sysfs path while it's in the process of
creating the device, before the dev struct gets allocated, I chose to
remove the member from the dev struct.

* src/conf/node_device_conf.c src/conf/node_device_conf.h
  src/node_device/node_device_driver.c src/node_device/node_device_hal.c
  src/node_device/node_device_udev.c: remove devicePath from the
  structure and use def->sysfs_path instead
2009-11-19 16:02:18 +01:00
David Allan
db19834a0a Add scsi_target device type
* src/conf/node_device_conf.h src/conf/node_device_conf.c: add specific
  support for SCSI target in node device capabilities
* src/node_device/node_device_udev.c: add some extra detection code
  when handling udev output
2009-11-12 23:03:47 +01:00
David Allan
3ad6dcf3dc Implement a node device backend using libudev
* configure.in: add new --with-udev, disabled by default, and requiring
  libudev > 145
* src/node_device/node_device_udev.c src/node_device/node_device_udev.h:
  the new node device backend
* src/node_device/node_device_linux_sysfs.c: moved node_device_hal_linux.c
  to a better file name
* src/conf/node_device_conf.c src/conf/node_device_conf.h: add a couple
  of fields in node device definitions, and an API to look them up,
  remove a couple of unused fields from previous patch.
* src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
  plug the new driver
* po/POTFILES.in src/Makefile.am src/libvirt_private.syms: add the new
  files and symbols
* src/util/util.h src/util/util.c: add a new convenience macro
  virBuildPath and virBuildPathInternal() function
2009-11-12 22:48:24 +01:00
David Allan
fe2af45bb2 Add several fields to node device capabilities
* src/conf/node_device_conf.h src/conf/node_device_conf.c: add the new
  fields in the structure as well as parsing and serialization
2009-11-12 22:39:40 +01:00
Matthias Bolte
790f0b3057 Add missing OOM error checks, reports and cleanups 2009-11-09 23:17:45 +01:00
Matthias Bolte
4ed2c3773e Fix potential false-positive OOM error reporting.
If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.

Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.

* src/conf/node_device_conf.c: only report an OOM error if there
  really is one
2009-10-22 15:25:45 +02:00
Cole Robinson
9e2fe24518 node device: Break out get_wwns and get_parent_node helpers
These will be used by the test driver, so move them to a shareable space.
2009-10-20 14:17:35 -04:00
Cole Robinson
7165bef132 node conf: Make parsing routines consistent with other drivers
Add virNodeDeviceParseFile, and make virNodeDeviceParseNode non-static. These
will be used by the test driver.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2009-10-05 14:07:16 -04:00
Cole Robinson
6e24ccb266 nodedev: Break out virNodeDeviceHasCap to node_conf
Will be used by test driver node device implementation.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2009-10-05 14:07:16 -04:00
Daniel P. Berrange
e0a48c99e4 Move all XML configuration handling to src/conf/
* src/capabilities.c, src/capabilities.h, src/domain_conf.c,
  src/domain_conf.h, src/domain_event.c, src/domain_event.h,
  src/interface_conf.c, src/interface_conf.h,
  src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
  src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
  src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
  src/storage_encryption_conf.h: Move to src/conf/
* src/Makefile.am: Add -Isrc/conf to the individual build targets
  which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
  and SELINUX_CFLAGS from global INCLUDES and only have them in build
  targets which actually need them.  Create a libvirt_conf.la
  convenience library for all config parsers
* src/hostusb.h: Remove bogus include of domain_conf.h
* tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
  since it never has any generated header files
* daemon/Makefile.am: Add -Isrc/conf
* proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
* src/hash.c: Remove bogus include of libxml/threads.h
2009-09-21 14:41:46 +01:00