Commit Graph

1213 Commits

Author SHA1 Message Date
Daniel P. Berrange
4789154063 Switch domain objects to array instead of linked list 2008-10-10 14:20:37 +00:00
Daniel P. Berrange
1564711a27 Split network driver out into separate files 2008-10-10 13:57:13 +00:00
Daniel P. Berrange
0107578c5e Fix two format string warnings on 32bit hosts 2008-10-10 12:54:10 +00:00
Daniel Veillard
f6803c960f virDomainDefineXML, and a few additional cleanups
* include/libvirt/libvirt.h[.in] include/libvirt/virterror.h
  qemud/remote* src/driver.h src/libvirt.c src/libvirt_sym.version
  src/lxc_driver.c src/openvz_driver.c src/proxy_internal.c
  src/qemu_driver.c src/remote_internal.c src/test.c src/virsh.c
  src/xen_internal.c src/xen_unified.c src/xen_unified.h
  src/xend_internal.c src/xend_internal.h src/xm_internal.c
  src/xs_internal.c docs/*: cleanup virDomainCreateLinux into
  virDomainDefineXML, and a few additional cleanups
Daniel
2008-10-10 09:32:27 +00:00
Daniel Veillard
3d038d101f fix index creation for disks
* src/domain_conf.c src/util.c: fix index creation for disks >
  {sd,hd,xvd,vd}z (Sanjay Rao and Chris Wright)
Daniel
2008-10-10 08:37:35 +00:00
Cole Robinson
02fc93d624 Centralize majority of error reporting logic. 2008-10-09 15:38:31 +00:00
Daniel P. Berrange
218334d1b2 Fix two compile warnings 2008-10-09 14:50:25 +00:00
Dan Smith
6c504d6a7c Add LXC scheduling parameters and support in virsh schedinfo 2008-10-08 16:28:48 +00:00
Daniel Veillard
6d670a1fc1 use safewrite() and plug a leak
* src/cgroup.c: use safewrite()
* src/qemu_driver.c: missing VIR_FREE pojnted out by Eduardo Habkost
Daniel
2008-10-08 13:44:40 +00:00
Jim Meyering
3ca608b5d6 avoid "make syntax-check" failure
* src/cgroup.c (virCgroupSetValueStr): Use safe_write, not write.
2008-10-08 09:31:13 +00:00
Daniel Veillard
f9dbe46b44 * src/qemu_driver.c: another OOM handling cleanup (Guido Günther)
daniel
2008-10-07 16:39:32 +00:00
Daniel Veillard
9f4c047935 * src/qemu_driver.c: don't print and extra OOM error on top of getpwuid error
(Guido Günther)
Daniel
2008-10-07 16:01:23 +00:00
Cole Robinson
e2a43cdb87 Move DEBUG macros to central location. 2008-10-06 19:53:06 +00:00
Cole Robinson
8206b421d6 Fix segfault if starting qemu VM with an inactive virtual network. 2008-10-06 19:36:46 +00:00
Daniel Veillard
72c40b0622 use C99 initializers for virState
* src/lxc_driver.c src/qemu_driver.c src/remote_internal.c
  src/storage_driver.c: use C99 initializers for virState (Guido
  Gunther)
Daniel
2008-10-06 15:40:37 +00:00
Dan Smith
dd062d4209 Add forgotten cgroup.{c,h} and ChangeLog 2008-10-03 17:58:02 +00:00
Dan Smith
4461568ab4 Add cgroup manipulation and LXC driver 2008-10-03 16:46:01 +00:00
Cole Robinson
a166cdbb6e Fix starting qemu VM with multiple pty char devices. 2008-10-02 14:10:20 +00:00
Daniel Veillard
3bc324139e Xen interface order and fix python parallel build
* src/xend_internal.c: fix ordering when parsing multiple Xen
  interfaces, patch by Jim Fehlig
* python/Makefile.am: fix parallel build
Daniel
2008-10-01 15:31:02 +00:00
Daniel Veillard
321c9a7f51 * configure.in libvirt.spec.in NEWS docs/*: release of libvirt-0.4.6
* src/storage_backend_logical.c: re-add the -f flag to vgremove
* po/*: rebuilt
Daniel
2008-09-23 20:48:49 +00:00
Daniel Veillard
ad5723e792 cleanup and removal for pools in logical backend
* src/storage_backend_logical.c: enable stop pool in logical backend
  improve portability when deleting a pool and also call pvremove
  patch by Chris Lalancette
Daniel
2008-09-22 20:22:35 +00:00
Daniel Veillard
4f84e631ed * src/storage_conf.c: fixes parsing to allow no sources for a pool
fix by Dan and Chris Lalancette
Daniel
2008-09-22 19:57:47 +00:00
Daniel Veillard
0958489ca5 * src/remote_internal.c src/storage_driver.c: structure init cleanup
by Chris Lalancette
Daniel
2008-09-22 19:53:42 +00:00
Daniel Veillard
7e0ff3aab0 read network config in OpenVZ driver
* src/openvz_conf.c: patch from Evgeniy Sokolov to read
  network config in OpenVZ driver.
Daniel
2008-09-22 15:21:44 +00:00
Daniel P. Berrange
0aac8c9447 Fix trailing whitespace & unmarked diagnostic warning 2008-09-18 08:54:23 +00:00
Richard W.M. Jones
a0208e6635 src/openvz_driver.c: Fix segfault in OpenVZ driver
(Evgeniy Sokolov).
2008-09-17 16:07:03 +00:00
Richard W.M. Jones
4f1e6e7ef2 src/storage_backend_disk.c: Missing include file. 2008-09-17 14:29:47 +00:00
Richard W.M. Jones
dd57b821e4 Remove some deadcode (Nguyen Anh Quynh). 2008-09-17 14:21:27 +00:00
Richard W.M. Jones
3b7c7d888a Change name of "blocked" state to "idle" (John Levon). 2008-09-17 14:18:15 +00:00
Richard W.M. Jones
a744ddad59 include/libvirt/libvirt.h.in, src/libvirt.c: Fix comments
which incorrectly referred to non-existent 'virDomainFlags'
type (Anton Protopopov).
2008-09-17 14:15:20 +00:00
Richard W.M. Jones
7076981f50 src/conf.c: Improved error messages in XM conf module. 2008-09-17 14:11:21 +00:00
Richard W.M. Jones
04e9e1b2a6 configure.in, src/qemu_driver.h, src/qemu_driver.c: KVM
can determine max VCPUs at runtime (Guido Günther).
2008-09-17 14:07:49 +00:00
Cole Robinson
bf26cd8ecb Implement disk volume deleting. 2008-09-16 16:46:08 +00:00
Cole Robinson
a82bd0784b Fix reading vncdisplay from xend, add several test cases for xen vnc corner case
s.
2008-09-09 13:53:58 +00:00
Cole Robinson
bf3e2132a7 Fix a segfault if defining a qemu domain without an emulator. 2008-09-09 13:44:42 +00:00
Daniel Veillard
58686c3dd8 add domain name in network configurations suport and on OpenVZ config bugfix
* src/network_conf.c src/network_conf.h src/qemu_driver.c: add
  support for a domain name in network configurations, patch by
  JJ Reynolds with bugfix raised by Dan
* src/openvz_conf.c: fix to small bug in openvzReadConfigParam
  by Evgeniy Sokolov
Daniel
2008-09-08 12:45:29 +00:00
Daniel P. Berrange
3aa7c4639d Fix potential NULL deref in openvz driver 2008-09-08 12:15:33 +00:00
Daniel Veillard
914e1c61de finish applying initialization patch for logical storage backend
* src/storage_backend_logical.c: finish applying initialization
  from Jim Fehlig patch for logical storage backend
Daniel
2008-09-08 08:03:54 +00:00
Daniel P. Berrange
a8936295ce Fix trailing whitespace mistakes 2008-09-05 15:00:14 +00:00
Daniel P. Berrange
1cc9f9b3d8 Convert openvz driver to generic domain XML APIs 2008-09-05 14:10:58 +00:00
Daniel P. Berrange
542039fab0 Fully support mingw builds 2008-09-05 12:03:45 +00:00
Daniel P. Berrange
126d3ebeea Fix starting of xen domains without a PVFB console by removing default emulator 2008-09-05 11:52:12 +00:00
Daniel P. Berrange
f193e19536 Fix xen capabilities data creation 2008-09-05 11:35:43 +00:00
Daniel Veillard
e88295804a * src/storage_backend_fs.c: fix a signed/unsigned issue breaking
virStorageBackendProbeFile(), patch by Cole Robinson
Daniel
2008-09-04 13:34:42 +00:00
Daniel Veillard
a8d0600762 * src/qemu_driver.c: fix an error message, patch by Nguyen Anh Quynh
Daniel
2008-09-04 13:20:28 +00:00
Daniel Veillard
c37031ebf3 fix a miscalculation of command line size for vgcreate
* src/storage_backend_logical.c: fix a miscalculation of command line
  size for vgcreate, patch from Jim Fehlig
Daniel
2008-09-04 13:13:32 +00:00
Daniel Veillard
18626bd225 when dumping code don't keep Xen domain live
* src/xend_internal.c: patch from John Levon shutting down a live
  domain is just more hazardous
Daniel
2008-09-04 09:11:37 +00:00
Daniel Veillard
584ff19452 * src/xend_internal.c src/xs_internal.c: use poweroff instead of halt
when shutting down a xen domain, patch by John Levon
Daniel
2008-09-04 09:07:42 +00:00
Daniel Veillard
821dcf0ff7 * src/qemu_driver.c: switch flags to unsigned by James Morris
* AUTHORS: add James Morris
Daniel
2008-09-04 08:15:05 +00:00
Dan Smith
df01e14bd7 Add LXC version implementation
This patch adds an implementation of the version function to the LXC driver.
The providers use the hypervisor version in a field of one of the instances,
so we need to have something meaningful here.  AFAICT, the only real option
we have (considering the limitations of the libvirt version information) is
to use the kernel version.
2008-09-03 17:21:27 +00:00
Cole Robinson
e0b4fcc280 Fix qemu media connect/eject to work with latest syntax. Add support for ejecting floppy devices and scsi cdroms. 2008-09-03 16:05:25 +00:00
Cole Robinson
fe7bb57a8b Update domain xml after usb device hotplug. 2008-09-03 15:05:31 +00:00
Cole Robinson
f4af06d812 Scrap media eject output to try and determine success/fail. 2008-09-03 14:43:34 +00:00
Cole Robinson
34b1a03402 Fix disk ordering and add target duplication checking when parsing domain xml. 2008-09-03 14:30:24 +00:00
Daniel Veillard
53738f83a5 avoid a segfault on CD eject in KVM/QEmu
* src/qemu_driver.c: patch from Cole Robinson to avoid a segfault
  on KVM CD eject
Daniel
2008-09-03 12:52:27 +00:00
Daniel Veillard
54a4f8d44d add output on attach and detach success
* src/virsh.c: patch from Cole Robinson to add output on attach
  and detach success
daniel
2008-09-03 12:38:28 +00:00
Daniel Veillard
b419ebc7e9 * src/storage_conf.c: add one missing check in virStoragePoolDefParseDoc
Daniel
2008-09-03 07:12:37 +00:00
Daniel Veillard
10ccfc92f3 * src/domain_conf.c: fix a parsing error for input devices
patch by Cole Robinson
daniel
2008-09-02 15:33:39 +00:00
Daniel Veillard
b8f2610280 check availbility of emulators before reporting them in capabilities
* src/qemu_conf.c: patch from Cole Robinson to report in the
  capabilities only the ones where the emulators is actually found
* po/libvirt.pot: regenerated
* src/libvirt.c: small typo fix
Daniel
2008-09-02 15:00:09 +00:00
Daniel Veillard
41ce15a586 Adds storage source element for pools
* src/storage_backend.h src/storage_backend_logical.c
src/storage_conf.c src/storage_conf.h src/virsh.c:
Applied patches from David Lively to add storage source
elements needed for storage pool
* docs/formatstorage.html docs/formatstorage.html.in: associated
documentation
Daniel
2008-09-02 14:15:42 +00:00
Jim Meyering
81cb09f9fe qemu_conf.c: use new function, virFileReadLimFD
* src/qemu_conf.c (qemudExtractVersionInfo): Use virFileReadLimFD
and VIR_FREE in place of an open-coded loop and a static buffer.
2008-09-02 10:30:40 +00:00
Jim Meyering
d2ac46f2b0 util.c: add a file-descriptor-based wrapper for fread_file_lim
* src/util.c (virFileReadLimFP): New function.
(__virFileReadLimFD): New function.
* src/util.h (__virFileReadLimFD): Declare.
(virFileReadLimFD): Define.
(virFileReadAll): Rewrite to use virFileReadLimFP.
2008-09-02 10:29:51 +00:00
Daniel P. Berrange
3348a97bd3 Switch over fork/exec code to use virExec 2008-08-29 07:11:15 +00:00
Daniel P. Berrange
afac1439aa Allow for private root filessytem in containers using pivot_root 2008-08-28 22:40:50 +00:00
Daniel P. Berrange
8f762e34f3 Fix lookup of xen VM after define (Cole Robinson) 2008-08-28 11:59:07 +00:00
Daniel P. Berrange
39c9354c5c Add storage pool source discovery support (patch from David Lively) 2008-08-27 20:05:58 +00:00
Daniel P. Berrange
da1963381b Fix QEMU domain creation by allowing virExec to preserve certain FDs 2008-08-27 11:42:52 +00:00
Daniel P. Berrange
2875ed81bd Fix EOF handling when reading openvz domain list 2008-08-27 11:21:01 +00:00
Daniel P. Berrange
d81b038cc2 Remove use of virState apis from openvz driver 2008-08-27 11:19:45 +00:00
Dan Smith
5fb17bcc1e [LXC] Cleanup devices on container shutdown 2008-08-22 15:35:37 +00:00
Daniel P. Berrange
9472d3e2f3 Improve error reporting from remote driver 2008-08-21 10:14:54 +00:00
Daniel P. Berrange
11a2e2972a Propagate virConnectOpen errors to global error object 2008-08-21 10:12:32 +00:00
Daniel P. Berrange
c2bbf99e48 Remove unused lx_controller.h file 2008-08-21 10:07:21 +00:00
Daniel P. Berrange
5f134f0197 Ignore libvirt_lxc binary 2008-08-21 09:14:39 +00:00
Daniel P. Berrange
177c74b1fa Create lxc_controller standalone binary 2008-08-20 20:55:32 +00:00
Daniel P. Berrange
bb16f4a25d Do conditional driver config in Makefile.am, not source files 2008-08-20 20:48:35 +00:00
Daniel P. Berrange
6334cd16df Remove configFile/autostartLink vars from virDomainObj struct 2008-08-20 19:42:36 +00:00
Daniel Veillard
b1e5880740 add cpu management functionality to OpenVZ driver
* src/openvz_conf.c src/openvz_driver.c: patch from Evgeniy Sokolov
  to limit the number of CPUs used by OpenVZ domains.
Daniel
2008-08-20 13:44:03 +00:00
Daniel Veillard
ce9439358c Fix creating and cleaning up logical volumes if a target path is specified
* src/storage_backend_logical.c: Patch from Cole Robinson, fix
  creating and cleaning up logical volumes if a target path is
  specified.
Daniel
2008-08-20 13:33:01 +00:00
Daniel Veillard
ace1b6bf98 Fix size reporting for disks without partitions.
* src/parthelper.c: Patch from Cole Robinson, fix size reporting for
  disks without partitions.
Daniel
2008-08-20 13:20:01 +00:00
Daniel Veillard
b73d495754 * src/network_conf.c src/network_conf.h src/qemu_driver.c: allow to
add static host definition for dnsmasq
Daniel
2008-08-20 12:50:29 +00:00
Daniel P. Berrange
1b4bb7d4ab Allow non-blocking/daemon mode to be specified via virExec flags 2008-08-20 09:24:14 +00:00
Daniel P. Berrange
6bc99a7775 Allow a pre-opened FD to be be pass to virExec for stdout/err 2008-08-20 09:08:17 +00:00
Daniel P. Berrange
60ed1d2a7a Avoid signal race in virExec 2008-08-20 08:53:49 +00:00
Daniel P. Berrange
f2172946e5 Improve virExec error reporting 2008-08-20 08:30:04 +00:00
Daniel P. Berrange
5cd1d3c53c Remove duplicated call to virInitialize 2008-08-18 09:24:46 +00:00
Mark McLoughlin
7c3ccd6f14 Fri Aug 15 11:00:38 IST 2008 Mark McLoughlin <markmc@redhat.com>
* src/qemu_conf.c: fix serial/telnet to use "server" option
        rather than "listen"

        * tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args:
        fix the test case too
2008-08-15 10:02:33 +00:00
Atsushi SAKAI
6fd4c30285 fix typos src/virsh.c from John Levon,
and 3 more files(src/domain_conf.c src/openvz_driver.c src/qemu_driver.c)
2008-08-15 01:41:49 +00:00
Daniel P. Berrange
2e7a373646 Switch LXC driver over to generic domain XML processing APIs 2008-08-13 12:50:55 +00:00
Daniel P. Berrange
763dacda97 Make LXC I/O controller process a parent of the container process 2008-08-13 10:52:15 +00:00
Daniel P. Berrange
518c2144e5 Re-arrange code between LXC driver files 2008-08-13 10:25:34 +00:00
Daniel P. Berrange
e82c913680 Refactor LXC driver to pass tty/socket state directly 2008-08-13 10:14:47 +00:00
Daniel Veillard
415b92101f * docs/storage.html[.in] src/storage_backend_disk.c: revert previous
msdos patch and apply new one from Cole Robinson
daniel
2008-08-13 09:45:10 +00:00
Jim Meyering
4ee755d641 rewrite virFileLinkPointsTo
* src/util.c (SAME_INODE): Define.
(virFileLinkPointsTo): Rewrite to be more portable and more efficient.
2008-08-12 17:38:08 +00:00
Daniel Veillard
8fdb2cffa5 make sure parted doesn't ask for confirmation
* src/storage_backend_disk.c: make sure parted doesn't ask
  confirmation,  patch by Cole Robinson
Daniel
2008-08-12 11:29:49 +00:00
Daniel Veillard
ef7fec1168 rename the disk type from 'dos' to 'msdos'
* docs/storage.html[.in] src/storage_backend_disk.c: patch from
  Cole Robinson to rename the disk type from 'dos' to 'msdos'
Daniel
2008-08-12 11:26:00 +00:00
Atsushi SAKAI
413c5dbf07 add _fd to stdin, stderr stdout in struct virDomainObj for compilation on MinGW 2008-08-12 08:38:22 +00:00
Atsushi SAKAI
43c7f972aa fix compilation for MinGW 2008-08-12 08:25:48 +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
Dan Smith
e94c12451b Fix device name clash in src/veth.c 2008-08-07 13:34:17 +00:00
Daniel Veillard
2194f1c983 * src/bridge.c: fix a build failure on RHEL4
Daniel
2008-08-07 10:22:52 +00:00
Jim Meyering
3fb53d1181 fix failing "make syntax-check"
* src/stats_linux.c: Don't include <c-ctype.h> no longer used.
2008-08-06 13:07:55 +00:00
Jim Meyering
783158511a work around MinGW build failure due to its lack of inet_aton
Use inet_pton instead; pull in gnulib's module by the same name.
* src/network_conf.c (virNetworkDefParseXML): Use inet_pton,
rather than inet_aton.
* bootstrap (modules): Add inet_pton.
* gnulib/lib/inet_pton.c: New file, from gnulib.
2008-08-06 12:08:49 +00:00
Chris Lalancette
b8fb68be37 DanB pointed out that my sexpr xend_internal patch from yesterday broke one of
the regression tests.  The problem is that the xenDaemonFormatSxpr{Disk,Net}
functions are shared between domain creation time and attaching disk time.
Unfortunately, though, Xend expects something different during these two times.
 During domain creation time, it wants the "(device" in front of the sexpr,
while during attach time it does not.  To remedy this situation, I added a flag
to these two functions to differentiate between these two modes.  With this
patch in place, all of the regression tests pass.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-08-06 11:26:47 +00:00
Chris Lalancette
6335c2a0cc With the recent refactoring of the domain code, plus the changes with the Xend
code, a couple of bugs were introduced into the attach-disk and attach-interface
functionality.  This patch fixes 3 bugs:

1)  In xenDaemonAttachDevice(), there is a switch statement to determine which
of the xenDaemonFormatSxpr{Disk,Net} functions to call.  Unfortunately, the case
statements are all missing the corresponding "break", so we always fall-through
to the default error case.  This patch just adds the appropriate break statements.

2)  (minor) In xenDaemonDomainDefineXML (that's a mouthful!), there is a stray
"fprintf".  This is now converted to a proper virXendError().

3)  xenDaemonFormatSxpr{Disk,Net} were adding an extra (device to the front of
the sexpr expressions that xend did not expect (this is Xend on RHEL 5.2).
Because of this, the attaches would fail.  The patch fixes this by removing the
(device from the front, which makes attach-disk and attach-interface work again.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-08-05 16:45:07 +00:00
Chris Lalancette
8c30002862 Recently upstream Xen added support for having xvd devices > 16. For the most
part, this doesn't really concern libvirt, since for things like attach and
detach we just pass it through and let xend worry about whether it is supported
or not.  The one place this breaks down is in the stats collecting code, where
we need to figure out the device number so we can go digging in /sys for the
statistics.

To remedy this, I've re-written xenLinuxDomainDeviceID() to use regular
expressions to figure out the device number from the name.  The major advantage
is that now xenLinuxDomainDeviceID() looks fairly identical to
tools/python/xen/util/blkif.py (in the Xen sources), so that adding additional
devices in the future should be much easier.  It also reduces the size of the
code, and, in my opinion, the code complexity.

With this patch in place, I was able to get block statistics both on older style
devices (/dev/xvda) and on the new, expanded devices (/dev/xvdaa).

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-08-05 16:38:49 +00:00
Daniel Veillard
063679580d saving UUID of new OpenVZ domains
* src/openvz_conf.c src/openvz_conf.h src/openvz_driver.c: patch
  from Evgeniy Sokolov saving the UUID when creating or defining
  a domain.
Daniel
2008-08-05 10:53:05 +00:00
Jim Meyering
6d72e14178 make distclean: remove generated source files
* src/Makefile.am (DISTCLEANFILES): Define to $(BUILT_SOURCES)
so "make distcheck" passes.
2008-08-05 08:43:03 +00:00
Atsushi SAKAI
adc1d93f97 fix syntax-check error (replace TAB to space) 2008-08-04 06:33:25 +00:00
Jim Meyering
deefaf1891 src/xend_internal.c (xenDaemonParseSxpr): Add const to "root" parameter.
This piece was mistakenly omitted from the previous patch.
2008-08-01 15:32:28 +00:00
Jim Meyering
07f8a8b34a xend_internal.c, sexpr.c: const-correctness fixes 2008-08-01 14:43:12 +00:00
Richard W.M. Jones
969fa847c1 'virsh edit' and related commands
* src/virsh.c: Implement 'virsh edit', 'virsh net-edit' and
	  'virsh pool-edit' commands.  These edit the XML for domains,
	  networks and storage pools respectively, and are the
	  equivalent of doing 'virsh dumpxml; vi foo.xml; virsh define'
	* src/Makefile.am, src/.cvsignore: Auto-generate the net-edit
	  and pool-edit commands.
	* docs/virsh.pod: Updated the documentation.
2008-08-01 14:30:41 +00:00
Daniel P. Berrange
0dee7feb74 Fix initial VM state 2008-08-01 14:19:06 +00:00
Jim Meyering
66f9bb5b95 virsh.c: more const-correctness fixes 2008-08-01 13:51:18 +00:00
Daniel P. Berrange
a7600746fb Support for container related domain XML extensions 2008-08-01 13:31:37 +00:00
Daniel P. Berrange
ffc839fb20 Always set forward-delay on bridge, even if 0 2008-08-01 12:56:52 +00:00
Richard W.M. Jones
3f3345aa85 Const-correctness fixes in virsh.c
* src/virsh.c: Const-correctness.
2008-08-01 12:19:56 +00:00
Daniel Veillard
c810c6cc23 * src/qemu_driver.c: patch from Chris Lalancette adding missing
carriage returns to logs
Daniel
2008-08-01 11:24:04 +00:00
Richard W.M. Jones
cf11bb2249 Improve error messages when XML is not well-formed.
* src/domain_conf.c, src/network_conf.c, src/storage_conf.c:
	  Improve error messages from commands such as 'virsh define'
	  when the XML is not well-formed by passing libxml2 errors
	  back out through virterror.
2008-08-01 09:39:44 +00:00
Daniel Veillard
eba65e1c6d * docs/formatdomain.html docs/formatdomain.html.in docs/libvirt-api.xml
docs/libvirt-refs.xml docs/html/libvirt-libvirt.html src/libvirt.c:
  fixed somedocs and API entry point descriptions as suggested by
  Charles Duffy and regenerated the API descriptions.
Daniel
2008-08-01 06:42:45 +00:00
Daniel Veillard
7711e6858c * src/qemu_driver.c: apply patch from Charles Duffy fixing erro
messages when trying to crate a domain already defined.
Daniel
2008-08-01 06:23:31 +00:00
Daniel P. Berrange
42e559a324 Fix autoport when domain is inactive 2008-07-31 14:39:30 +00:00
Chris Lalancette
6f17fb2851 From Charles Duffy:
Per subject; if autoport is in use for a host, the current
virDomainGraphicsDefFormat code always emits "port=-1", even if a port
is assigned to the host; this leaves no way for a client to find the VNC
port assigned to the host in question.

This patches fixes it by putting the vncport in place if there is one, and
only putting "-1" if we fail that test.
2008-07-31 12:30:34 +00:00
Daniel Veillard
55e1221686 * src/qemu_driver.c: patch from Guido Günther, interface stats should
not crash on interfaces without an ifname.
Daniel
2008-07-30 09:20:19 +00:00
Daniel Veillard
c05cf3f3e1 * src/storage_backend_logical.c: patch from David Lively fixing
small differences of behaviour for 'lvs' and 'vgs' on SLES
Daniel
2008-07-30 08:52:44 +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 Veillard
4779e0bcb2 build OpenVZ and LXC support by default, fix OpenVZ build
* src/openvz_conf.c: fix compilation with new XPath interface
  signatures
* configure.in: build OpenVZ and LXC support by default
Daniel
2008-07-29 08:42:56 +00:00
Daniel Veillard
996933bbcd OpenVZ xml refactoring
* src/domain_conf.[ch] src/openvz_conf.[ch] src/openvz_driver.c:
  patch from Evgeniy Sokolov doing the OpenVZ xml refactoring,
  still needs to be ported to the new XML parsing code but
  implements the new format.
Daniel
2008-07-28 14:06:54 +00:00
Daniel Veillard
387e06421f * src/qemu_driver.c: patch from Guido Günther to make sure create
doesn't override an existing domain definition or UUID
Daniel
2008-07-28 12:52:37 +00:00
Daniel P. Berrange
c5ecc66658 Fix misc typos in domain XML handling 2008-07-25 16:25:11 +00:00
Daniel P. Berrange
e8a84817d4 Remove unused c-ctype.h include 2008-07-25 16:19:00 +00:00
Daniel P. Berrange
9351cb0ab0 Fix reporting of errors against virConnect object in XML apis 2008-07-25 14:27:25 +00:00
Daniel P. Berrange
cb29913fb1 Switch XM config file driver to use new domain APIs for XML to config conversion 2008-07-25 14:10:49 +00:00
Daniel P. Berrange
547bd71a4a Switch XM config file driver to use new domain APIs for XML generation 2008-07-25 13:50:08 +00:00
Daniel P. Berrange
225fb3e93c Prepare xm_internal driver for new domain XML apis 2008-07-25 13:39:02 +00:00
Daniel P. Berrange
73d021c5c1 Fix test driver inactive domains and domain ID allocation 2008-07-25 13:27:12 +00:00
Daniel P. Berrange
8c6f5a546b Convert XenD XML->SEXPR conversion to new domain XML APIs 2008-07-25 13:17:27 +00:00
Daniel P. Berrange
31ac8125b8 Convert XenD SEXPR->XML convesion to new domain XML APIs 2008-07-25 10:49:33 +00:00
Daniel P. Berrange
d9383fe158 Remove unused/no-op Xen driver code 2008-07-25 09:51:23 +00:00
Daniel P. Berrange
3de646a51d Misc bug fixes 2008-07-25 09:31:24 +00:00
Daniel Veillard
c1e6cc1969 * src/qemu_driver.c: some uuid to string conversion were missing
patch from Guido Günther
Daniel
2008-07-25 09:01:25 +00:00
Daniel Veillard
6fae611381 wrong open() failure detection
* src/qemu_driver.c: Guido Trotter pointed out a wrong open() failure
  detection
Daniel
2008-07-25 08:42:05 +00:00
Daniel Veillard
27efc8bd0d Check for already running QEmu domain on create
* src/qemu_driver.c: another patch from Guido Günther checking
  for an already running domain on create
Daniel
2008-07-24 07:29:50 +00:00
Daniel Veillard
d3bb1e4367 * src/qemu_driver.c: patch from Guido Günther checking for
unsupported migrate command
Daniel
2008-07-24 07:09:45 +00:00
Jim Meyering
2eb8ab2057 better diagnostic when failing to undefine a running domain via ID
* src/virsh.c (cmdUndefine): Tell user to shutdown and then use name or UUID.
* tests/undefine: New test.  Exercise virsh's undefine command.
* tests/Makefile.am (test_scripts): Add undefine.
2008-07-22 16:12:01 +00:00
Daniel Veillard
fa6177aafe fix a warning when no proxy is configured in, Daniel 2008-07-22 09:52:31 +00:00
Daniel Veillard
7e73b8b61a cleaning up integer string parsing
* src/openvz_conf.c src/openvz_driver.c: patch from Evgeniy Sokolov
  cleaning up integer string parsing.
Daniel
2008-07-21 13:34:19 +00:00
Daniel Veillard
f92e0898d3 Fix compile , Daniel 2008-07-21 12:06:16 +00:00
Daniel Veillard
403a5163c9 * src/xen_unified.c: fix a leak in xenUnifiedOpen
Daniel
2008-07-21 09:48:01 +00:00
Daniel Veillard
7b4f67acea OpenVZ domain cpu time
* src/openvz_driver.c: patch from Evgeniy Sokolov to get OpenVZ
  domain cpu time consumption.
Daniel
2008-07-21 08:08:25 +00:00
Daniel Veillard
cb3e65e922 * src/openvz_driver.c: patch from Evgeniy Sokolov avoiding domain
lookups based on ID as this doesn't work for a stopped domain.
Daniel
2008-07-21 07:31:14 +00:00
Jim Meyering
3ff5480d7b remove unnecessary "V = NULL;" stmts after VIR_FREE(V)
* src/domain_conf.c (virDomainChrDefParseXML)
(virDomainNetDefParseXML): Likewise.
* src/iptables.c (iptRuleFree): Likewise.
* src/storage_backend.c (virStorageBackendRunProgRegex): Likewise.
* src/test.c (testOpenFromFile): Likewise.
* src/xmlrpc.c (xmlRpcCallRaw): Likewise.
2008-07-19 07:42:34 +00:00
Jim Meyering
cff27e9f40 enable format-safety checks for virDomainReportError
* src/domain_conf.c (virDomainReportError): Declare using
ATTRIBUTE_FORMAT(printf, 3, 4).
* Makefile.maint (msg_gen_function): Add virDomainReportError.
2008-07-18 11:02:18 +00:00
Daniel Veillard
dfccabe1e7 fix pool-create for netfs format 'auto'
* src/storage_backend_fs.c: patch from Cole Robinson fixing
  pool-create for netfs format 'auto'
Daniel
2008-07-17 15:20:28 +00:00
Daniel Veillard
16b8942966 undefine command can't take an ID
* src/virsh.c: patch from Evgeniy Sokolov for the undefine command
  which can't take an id
Daniel
2008-07-17 11:49:15 +00:00
Daniel Veillard
edbbb3aa12 ID domain lookup fixup
* src/libvirt.c src/openvz_driver.c: fix the description of the ID
  domain lookup and fix the OpenVZ routine
Daniel
2008-07-16 20:42:38 +00:00
Daniel Veillard
07601749e8 lookup by ID function and error report fix for OpenVZ
* src/openvz_driver.c: fix the lookup by ID function and error
  reporting in OpenVZ, fix by Evgeniy Sokolov
Daniel
2008-07-16 15:27:00 +00:00
Daniel Veillard
5553b0cd16 cleaning up the exec calls to OpenVZ binaries
* src/openvz_driver.c: another cleanup patch from Evgeniy Sokolov
  cleaning up the exec calls to OpenVZ binaries
Daniel
2008-07-16 14:45:55 +00:00
Daniel P. Berrange
276bffd907 Remove unneccessary include 2008-07-12 13:53:50 +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
774354e3ef Set initial domain state to SHUTOFF 2008-07-11 19:31:26 +00:00
Daniel P. Berrange
a1b49bcdea Use full path when loading XML files 2008-07-11 17:59:27 +00:00
Daniel P. Berrange
381fa1fc46 Switch QEMU driver over to generic network APIs 2008-07-11 17:33:45 +00:00
Daniel P. Berrange
d78c0a6800 Convert test driver to new domain XML apis 2008-07-11 16:41:27 +00:00
Daniel P. Berrange
c422fd1240 Convert test driver to new network XML apis 2008-07-11 16:39:08 +00:00
Daniel P. Berrange
d1304583d6 Added generic domain XML APIs 2008-07-11 16:23:36 +00:00
Daniel Veillard
d678a6e88c fix OpenVZ probe function
* src/openvz_driver.c: fix from Evgeniy Sokolov to the probe function
Daniel
2008-07-11 11:09:44 +00:00
Daniel P. Berrange
747fad6654 Generic APIs for network XML configuration 2008-07-11 10:48:34 +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
1d86fca433 Fix parsing of QEMU stdout looking for serial device PTY with Xenner 2008-07-11 09:48:51 +00:00
Daniel Veillard
915b86d29b cleanup OpenVZ config file accesses
* src/openvz_conf.c: cleanup OpenVZ config file accesses, patch
  from Evgeniy Sokolov
Daniel
2008-07-11 08:56:16 +00:00
Daniel Veillard
fc2076033b bug in do_open()
* src/libvirt.c: Evgeniy Sokolov found a driver open bug
  in do_open()
Daniel
2008-07-10 15:29:39 +00:00
Daniel Veillard
5215d88be2 cleanup OpenVZ error function
* src/openvz_conf.c src/openvz_conf.h src/openvz_driver.c
  Makefile.maint: patch from Evgeniy Sokolov cleaning up the
  error function used and format check based on Jim's fedback.
Daniel
2008-07-10 12:21:09 +00:00
Daniel Veillard
47010f352c * src/openvz_conf.c src/openvz_conf.h src/openvz_driver.c: new
patch from Evgeniy Sokolov adding OpenVZ autostart get and set support
Daniel
2008-07-10 07:52:14 +00:00
Jim Meyering
a626719f0c remove trailing blanks 2008-07-09 16:59:28 +00:00
Daniel Veillard
db9bcc9bd4 diagnostic fixes on OpenVZ failures
* src/openvz_conf.c src/openvz_conf.h src/openvz_driver.c: applied
patch from Evgeniy Sokolov fixing error diagnostic when exec'ing
OpenVZ commands.
Daniel
2008-07-09 11:55:27 +00:00
Daniel P. Berrange
b897973f2e Preserve context node when doing XPath queries to allow relative XPath expressions 2008-07-09 08:35:09 +00:00
Jim Meyering
fb2eca4cfd give a more useful diagnostic for tap-add failure w/ENOTSUP
* src/qemu_conf.c (qemudNetworkIfaceConnect):
Suggestion from Daniel P. Berrange.
2008-07-09 05:24:08 +00:00
Daniel P. Berrange
a211db1b8f Fix typo in domain state constant 2008-07-08 17:49:26 +00:00
Daniel P. Berrange
95675d4d76 Fix openvz build on x86_64 2008-07-07 11:48:40 +00:00
Daniel P. Berrange
bf79e90f3a Fix memory leak in OOM cleanup 2008-07-07 09:52:26 +00:00
Atsushi SAKAI
fa97486070 Compilation fix for MinGW(w/ LXC) 2008-06-30 05:11:13 +00:00
Dan Smith
0d2c36fda9 [LXC] Remove unused variable and fix uninitialized variable
Also remove a stale comment in the area.  This makes libvirt compile when
passed --with-lxc and --enable-compiler-warnings=error
2008-06-27 15:05:31 +00:00
Dan Smith
0240fe9d58 [LXC] Add setup/cleanup of container network interfaces 2008-06-26 16:09:48 +00:00
Dan Smith
97e1fc3734 [LXC] Add XML parsing of container network interfaces. 2008-06-26 16:08:59 +00:00
Dan Smith
e59eb52fad [LXC] Add functions to manage veth device pairs
This gives us the ability to create a veth pair so that we can move one
into the network namespace of an LXC container.
2008-06-26 16:07:48 +00:00
Dan Smith
99ded85f45 [LXC] Detect support for NETNS in lxc driver initialization
Allow check for containers support to be done without CLONE_NEWNET, and then
determine support on the fly by checking for iproute2 support and a
successful clone(CLONE_NEWNET).  This lets us set a flag for later, as well
as not completely disable LXC support on a system without NETNS support.
2008-06-26 16:05:02 +00:00
Atsushi SAKAI
f3c3550771 Fix make syntax-check 2008-06-26 10:56:19 +00:00
Atsushi SAKAI
fbb5d771a0 Compilation fixes for MinGW 2008-06-26 09:37:51 +00:00
Daniel Veillard
93db3c61c0 * configure.in NEWS libvirt.spec* doc/* po/*: making libvirt-0.4.4
release
* src/xm_internal.c: fix xm driver serialization escapes
* tests/xmconfigtest.c tests/xmconfigdata/test-escape-paths.cfg
  tests/xmconfigdata/test-escape-paths.xml: add test for previous
  problem
Daniel
2008-06-25 08:59:37 +00:00
Daniel P. Berrange
47605e1dfa Added helpers for dealing with enumerations 2008-06-24 15:00:15 +00:00
Daniel P. Berrange
313f1a7c0d Fix const-ness of virStorageBackendRunProgRegex() 2008-06-24 14:30:25 +00:00
Daniel Veillard
1ec7cccbd3 fix a couple of List functions for max = 0 issues
* src/xen_internal.c src/xend_internal.c: fix a couple of issues
  for List functions where max given is 0
Daniel
2008-06-19 14:39:49 +00:00
Jim Meyering
e09fab39a8 virsh fails to read files larger than BUFSIZ bytes
* src/util.c (fread_file_lim): Use VIR_REALLOC_N, not VIR_ALLOC_N.
Bug introduced in 895d0fdf5b.
* tests/Makefile.am (test_scripts): Add read-bufsiz.
* tests/read-bufsiz: New test for the above.
2008-06-19 14:30:52 +00:00
Chris Lalancette
0aa6eedddd For 0.4.3, danpb's new memory management scheme went into libvirt. This is
fine, except that is subtly alters the semantics of malloc(), calloc(), and
realloc().  In particular, if you say:

foo = malloc(0);

glibc will happily return a non-NULL pointer to you.  However, with the new
memory management stuff, if you say:

foo = VIR_ALLOC(0);

you will actually get a NULL pointer back.  Personally, I think this is a
dangerous deviation from malloc() semantics that everyone is used to, and is
indeed causing problems with the remote driver.  The short of it is that the
remote driver allocates memory on behalf of the remote side using VIR_ALLOC_N,
and this call is returning NULL so that the NULL checks elsewhere in the code
fire and return failure.

The attached patch fixes this situation by removing the 0 checks from the memory
allocation paths, and just lets them fall through to the normal malloc(),
calloc(), or realloc() routines, restoring old semantics.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-19 11:58:49 +00:00
Chris Lalancette
a24b1d9eda When doing the conversion to danpb's new memory API, a small bug was
introduced into the qemudNetworkIfaceConnect() function.  In particular, there
is a call:

    if (VIR_ALLOC_N(vm->tapfds, vm->ntapfds+2) < 0)
        goto no_memory;

However, the tapfds structure is used to track *all* of the tap fds, and is
called once for each network that is being attached to the domain.  VIR_ALLOC_N
maps to calloc().  So the first network would work just fine, but if you had
more than one network, subsequent calls to this function would blow away the
stored fd's that were already there and fill them all in with zeros.  This
causes multiple problems, from the qemu domains not starting properly to
improper cleanup on shutdown.  The attached patch just changes the VIR_ALLOC_N()
to a VIR_REALLOC_N(), and everything is happy again.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-19 10:38:36 +00:00
Jim Meyering
21ea9cb7af remove trailing white space 2008-06-17 15:55:03 +00:00
Chris Lalancette
0de4f35ebc This rather large patch rewrites the virStorageBackendISCSIFindLUNs() function
to only rely on sysfs for finding LUNs, given a session number.  Along the way,
it also fixes the bug where we wouldn't find LUNs for older kernels (with the
block:sda format), and also fixes a race condition where we could try
to find the LUN before udev has finished connecting it.

This patch fixes a few different bugs:
1) We weren't finding LUNs on pre 2.6.24 kernels
2) libvirtd sysfs scanning was racing with udev, so we didn't always see LUNs
3) We weren't showing the 0'th LUN, although that can be a valid LUN

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:49:37 +00:00