Commit Graph

320 Commits

Author SHA1 Message Date
Daniel P. Berrange
cb7593bd19 Support memory ballooning in QEMU 2009-03-27 11:44:29 +00:00
Daniel P. Berrange
c86afc85ee Fix labelling of shared/readonly devices (Dan Walsh) 2009-03-17 11:35:40 +00:00
Cole Robinson
2068f2f5a3 Initialize security driver after config parsing 2009-03-16 17:16:04 +00:00
Daniel P. Berrange
b44af714d3 Support SASL auth for VNC server. 2009-03-16 13:54:26 +00:00
Daniel P. Berrange
8fa62166c4 Avoid deadlock setting vcpus in QEMU driver 2009-03-16 11:44:46 +00:00
Daniel P. Berrange
aad6873175 Don't try to close NULL virConnectPtr object 2009-03-16 10:30:04 +00:00
Daniel P. Berrange
61796bdb4b Explicitly track static declared vs dynamically generated security labels 2009-03-03 16:53:13 +00:00
Daniel P. Berrange
e4818895c1 Misc sVirt bug fixes 2009-03-03 15:18:24 +00:00
Daniel P. Berrange
d0aa10fdd6 QEMU security driver usage for sVirt support (James Morris, Dan Walsh, Daniel Berrange) 2009-03-03 12:03:44 +00:00
Daniel P. Berrange
b756b005ec Replace use of qemudLog with logging.h APIs/macros 2009-03-03 11:40:08 +00:00
Daniel P. Berrange
8d13558ae6 Internal driver API for sVirt support (James Morris & Dan Walsh) 2009-03-03 09:14:28 +00:00
Daniel P. Berrange
8f1912c58d Don't try to detach & reset PCI devices while running test suite for XML-> ARGV conversion. 2009-03-03 08:59:45 +00:00
Cole Robinson
4837725f37 Better error reporting from qemu AttachDevice 2009-03-02 17:39:43 +00:00
Cole Robinson
adecc8fc9e Remove redundant monitor watch variable (s/monitor_watch/monitorWatch/) 2009-03-02 17:33:39 +00:00
Daniel Veillard
34d23b0b01 * src/qemu_driver.c: add qemu dettach/reattach/reset implementation
patch by Mark McLoughlin.
Daniel
2009-03-02 16:32:52 +00:00
Daniel Veillard
737af2ea04 Adds the APIs for virNodeDeviceDettach , ReAttach and Reset
* include/libvirt/libvirt.h include/libvirt/libvirt.h.in
  src/driver.h src/libvirt.c src/libvirt_public.syms
  src/lxc_driver.c src/openvz_driver.c src/qemu_driver.c
  src/test.c src/uml_driver.c: add the public APIs for
  virNodeDeviceDettach virNodeDeviceReAttach and virNodeDeviceReset
  and extends the driver structure accordingly.
Daniel
2009-03-02 16:25:13 +00:00
Chris Lalancette
014bb5cf7e If there is a failure during Qemu offline migrate, make sure to resume the
guest.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-02-27 16:18:50 +00:00
Guido Günther
4cbe86fcb8 (s)size_t type cleanup 2009-02-19 08:18:31 +00:00
Cole Robinson
7e8ad2036a Remove the _actually_ incorrect ATTRIBUTE_UNUSED (Patch by Maximilian Wilhelm) 2009-02-18 01:37:47 +00:00
Cole Robinson
cf47347312 Remove incorrect ATTRIBUTE_UNUSED usage. 2009-02-17 14:38:22 +00:00
Guido Günther
6efe591e66 usleep to wait for domain logfile to fill up 2009-02-13 11:35:16 +00:00
Guido Günther
e9c920ba67 fix return status when domain didn't show up 2009-02-11 20:33:11 +00:00
Guido Günther
0437e75291 Don't ignore errors to save domain status 2009-02-07 21:36:06 +00:00
Jim Meyering
dcfa920aff use virReportOOMError rather than more verbose equivalent
* src/qemu_driver.c (qemudDomainSave, qemudDomainRestore)
(qemudDomainAttachPciDiskDevice)
(qemudDomainAttachUsbMassstorageDevice):
2009-02-05 16:27:40 +00:00
Jim Meyering
e60430be53 qemu_driver.c: s/strerror/virStrerror.../
Perform most changs automatically, with this:
perl -pi -e 's/\bstrerror *\((.+?)\)/virStrerror($1, ebuf, sizeof ebuf)/'
Then, declare ebuf, as needed
2009-02-05 16:27:28 +00:00
Jim Meyering
b0d49913d5 remove duplicate *SetCloseExec and *SetNonBlock functions
* src/qemu_driver.c: Use virSetCloseExec and virSetNonBlock,
rather than qemuSet* functions.  Suggested by Daniel P. Berrange.
* src/util.c (virSetCloseExec): Publicize.
* src/util.h (virSetCloseExec): Declare
* src/libvirt_private.syms: Add virSetCloseExec.
2009-02-05 16:27:17 +00:00
Jim Meyering
caea9c00e3 qemu_driver.c: use virReportSystemError in place of some qemudLog uses
...thus eliminating many uses of strerror.
(kvmGetMaxVCPUs): Rather than merely warning, diagnose an error
and return -1 upon failure to open KVM_DEVICE.  Suggested by
Daniel P. Berrange.
2009-02-05 16:11:25 +00:00
Jim Meyering
6778ad0f07 avoid a format-related warning
* src/qemu_driver.c (qemudStartVMDaemon): Use "%s".
2009-02-03 13:09:18 +00:00
Daniel P. Berrange
896761e5c7 Fix numerous bugs in QEMU domain startup 2009-01-30 17:07:29 +00:00
Daniel P. Berrange
3801794908 Support VNC password setting in QEMU driver 2009-01-29 17:50:00 +00:00
Daniel P. Berrange
4f4bfbc79e Fix save/restore migrate syntax for new KVM releases 2009-01-29 17:27:54 +00:00
Jim Meyering
bc18a91f91 error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead
* src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
* src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
* src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
* src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
* src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
* src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
Note: this loses config_filename:config_lineno diagnostics,
but that's ok.
* src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
* po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
2009-01-29 12:10:32 +00:00
Daniel P. Berrange
1b745219c7 Remove use of non-reentrant POSIX apis 2009-01-22 19:41:48 +00:00
Daniel P. Berrange
437ac354fc Make error reporting threadsafe by avoiding strerror 2009-01-20 17:13:33 +00:00
Daniel Veillard
25415eb104 * src/qemu_driver.c: remove a warning when printing a file offset
daniel
2009-01-20 16:39:35 +00:00
Daniel Veillard
6d004d3f8a * src/domain_conf.h src/qemu_driver.c: use monitor fd for QEmu/KVM
domain shutdown and read saved vm status on libvirtd startup,
  last 2 patches from Guido Günther finishing up the surviving the
  libvirt daemon restart
daniel
2009-01-20 15:52:11 +00:00
Guido Günther
8dfbfe3145 daemonize qemu processes 2009-01-19 21:55:54 +00:00
Daniel P. Berrange
4dac0a1105 Generic internal threads API 2009-01-15 19:56:05 +00:00
Guido Günther
8af87ea251 don't emulate snprintf 2009-01-11 11:21:29 +00:00
Guido Günther
4275be68fb split out opening of the qemu logfile 2009-01-11 11:18:31 +00:00
Guido Günther
46971d5ed7 pass flags argument to all virDomain*DefParse* functions 2009-01-08 13:54:20 +00:00
Daniel Veillard
fbba4423e9 * src/libvirt_private.syms src/qemu_driver.c src/test.c
src/uml_driver.c src/util.c src/util.h src/xen_unified.c:
  unify hostname lookup using virGetHostname convenience function,
  patch by David Lutterkort
daniel
2009-01-07 10:43:16 +00:00
Guido Günther
ffafc252dd trivial cleanups 2009-01-06 17:20:27 +00:00
Guido Günther
043d702f02 use virAsprintf instead of asprintf 2008-12-23 13:03:29 +00:00
Guido Günther
5614e868e1 save and remove kvm/qemu domain status 2008-12-20 13:17:49 +00:00
Guido Günther
ecd25f5262 fix device hotplug 2008-12-18 16:49:49 +00:00
Guido Günther
830ba76c3e let qemu/kvm instances write a pid file 2008-12-18 15:22:49 +00:00
Daniel P. Berrange
b5259e7e11 Fix domain events callback type (John Levon) 2008-12-17 21:48:20 +00:00
Daniel P. Berrange
7e58aaa7ae Remove use of anonymous unions for non-GCC (John Levon) 2008-12-17 18:12:07 +00:00
Cole Robinson
0e459cbdfb Sanitize qemu monitor reads. 2008-12-16 22:34:13 +00:00
Guido Günther
54f4ed6ba1 logrotate qemu monitor logs 2008-12-09 20:22:39 +00:00
Daniel P. Berrange
abb02bd18b Fix autostart of domains with virtual networks used 2008-12-08 11:18:47 +00:00
Daniel P. Berrange
491b4eab14 Remove unused driver arg from monitor APIs 2008-12-04 22:19:30 +00:00
Daniel P. Berrange
bc898df2c7 QEMU domain event thread safety 2008-12-04 21:09:20 +00:00
Daniel P. Berrange
3527f16a94 Add locking for (nearly complete) thread safety to QEMU driver 2008-12-04 21:06:41 +00:00
Daniel P. Berrange
ea960fb719 Merge all return paths from QEMU driver APIs 2008-12-04 21:04:30 +00:00
Cole Robinson
b9b9c8b020 Increase timeout for initial monitor poll, to prevent a guest from failing to start if it has to wait for a physical cdrom to spin up. 2008-12-04 14:47:12 +00:00
Guido Günther
38b402ce13 also look for /usb/bin/kvm 2008-12-04 10:45:31 +00:00
Daniel P. Berrange
d88d459d7b Allow remote://hostname/ style URIs for automatic driver probe. Fix virGetVersion impl 2008-11-28 12:03:20 +00:00
Daniel P. Berrange
c23ff311fc Fix libnuma use to build with v1 compatability code 2008-11-28 11:20:27 +00:00
Daniel P. Berrange
2c855c1c66 Optional dlopen support for drivers 2008-11-21 12:16:08 +00:00
Daniel P. Berrange
41f14d6ea5 Fix crash due to failure to unregister event callbacks in QEMU driver (David Lively) 2008-11-21 10:17:22 +00:00
Daniel P. Berrange
6d04effac7 Add a virFreeCallback to event loop APIs 2008-11-19 16:24:01 +00:00
Daniel P. Berrange
6d41cb87d3 Change public API for virEventAddHandle to allow multiple registrations per FD 2008-11-19 16:19:36 +00:00
Daniel P. Berrange
3d41e86534 Add a virFreeCallback to virDomainEventRegister (from David Lively) 2008-11-19 15:25:24 +00:00
Daniel P. Berrange
a5e72f9177 Add QEMU driver events for defined/undefined config files 2008-11-17 16:52:32 +00:00
Daniel P. Berrange
d3d54d2fc9 Add domain events detail information 2008-11-17 16:43:00 +00:00
Daniel P. Berrange
618276de19 Push URI probing logic down into individual drivers 2008-11-17 11:44:51 +00:00
Jim Meyering
94359e16d3 avoid format string warnings
* src/openvz_driver.c (ADD_ARG_LIT): Add "%s" arg before _(...).
* src/qemu_driver.c (PCI_ATTACH_OK_MSG): Likewise.
* src/util.c (virExec, virRun): Likewise.
2008-11-14 14:19:37 +00:00
Daniel Veillard
df285bdd8d KVM/QEmu migration support
* qemud/remote.c qemud/remote_dispatch_localvars.h
  qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h
  qemud/remote_protocol.c qemud/remote_protocol.h
  qemud/remote_protocol.x src/driver.h src/libvirt.c
  src/libvirt_internal.h src/libvirt_sym.version src/lxc_driver.c
  src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c
  src/remote_internal.c src/test.c src/virsh.c: large patch to
  add migration support for KVM/QEmu, based on the work of Rich Jones
  and Chris Lalancette. This introduce a new version of the prepare
  and finish steps of the migration, so changes the driver API and
  a lot of code.
Daniel
2008-11-14 08:42:47 +00:00
Daniel Veillard
df93e1ee24 add new logging module, and move existing definitions there
* src/logging.c src/logging.h proxy/Makefile.am proxy/libvirt_proxy.c
  src/Makefile.am src/cgroup.c src/datatypes.c src/domain_event.c
  src/internal.h src/libvirt.c src/lxc_container.c src/lxc_controller.c
  src/lxc_driver.c src/proxy_internal.c src/qemu_driver.c
  src/remote_internal.c src/storage_backend_disk.c src/util.c
  src/veth.c src/xen_internal.c src/xen_unified.c src/xend_internal.c:
  add new logging module, and move existing definitions there
Daniel
2008-11-06 16:36:07 +00:00
Jim Meyering
7271a92bec plug two leaks and fix a diagnostic
* src/qemu_conf.c (qemudLoadDriverConfig): Don't leak ->vncListen.
Fix an erroneous copy-and-pasted diagnostic.
* src/qemu_driver.c (qemudShutdown): Don't leak another ->vncListen.
2008-11-05 14:24:21 +00:00
Daniel P. Berrange
6ace5a39c3 Move some API declarations out of internal.h & hash.c into dedicated files 2008-11-04 23:22:06 +00:00
Daniel P. Berrange
d714b2afae Move internal error APIs into virterror_internal.h & drop leading __ prefix 2008-11-04 22:30:33 +00:00
Daniel P. Berrange
78439117bc Add support for -uuid and -domid args to QEMU 2008-11-04 22:15:30 +00:00
Daniel Veillard
c1a9be4c1b * src/qemu_driver.c: oops trailing blanks
Daniel
2008-11-03 15:52:55 +00:00
Daniel Veillard
4780a00b14 * src/domain_conf.h src/qemu_driver.c: patch adding hor removal of
scsi/virtio disks for KVM, patch by Guido Günther
daniel
2008-10-29 14:32:40 +00:00
Daniel P. Berrange
bdd50bc7f3 Centralize domain mac address handling in domain_conf.c/util.c 2008-10-24 11:20:08 +00:00
Daniel Veillard
1509b8027f Massive patch adding event APIs by Ben Guthro
* include/libvirt/libvirt.h include/libvirt/libvirt.h.in
  src/libvirt.c src/libvirt_sym.version: new libvirt event entry
  points, big patch provided by Ben Guthro
* Makefile.am configure.in src/driver.h src/event.c src/event.h
  src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c
  src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c
  src/remote_internal.c src/storage_backend_fs.c src/test.c
  qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c
  qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h
  qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h
  qemud/remote_protocol.c qemud/remote_protocol.h
  qemud/remote_protocol.x proxy/Makefile.am python/generator.py:
  Not much is left untouched by the patch adding the events support
* docs/libvirt-api.xml docs/libvirt-refs.xml
  docs/html/libvirt-libvirt.html: regenerated the docs
* examples/domain-events/events-c/Makefile.am
  examples/domain-events/events-c/event-test.c: a test example
* AUTHORS: added Ben Guthro
daniel
2008-10-23 13:18:18 +00:00
Chris Lalancette
c83c3e9e5c While doing on this patch series, I mistakenly added a bogus piece of
storage XML to libvirtd, which was saved in /etc/libvirt/storage.  On subsequent
stop/start of libvirtd, because of another bug , an
error wasn't being set properly in an error path, so libvirtd was SEGV'ing in
storage_conf.c:virStoragePoolObjLoad when trying to dereference the NULL err
returned from virGetLastError().  Make this more robust against errors by always
doing "err ? err->message : NULL" in the printf.  I looked around the tree and
found a couple of other places that weren't guarded, so this patch fixes them as
well.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-10-21 17:15:53 +00:00
Daniel Veillard
6d6fd6b305 * src/qemu_driver.c: cleanup patch for usb masstorage hotadd
by Guido Günther
daniel
2008-10-21 13:09:23 +00:00
Daniel Veillard
7b9344686a * src/qemu_driver.c: add scsi/virtio hotplug support for KVM
patch by Guido Günther
daniel
2008-10-17 12:36:39 +00:00
Daniel Veillard
8348610c5e qemudDomainBlockStats use qemudDiskDeviceName
* src/qemu_driver.c: use qemudDiskDeviceName to determine the block
  device name in qemudDomainBlockStats(), patch by Guido Günther
daniel
2008-10-17 09:29:29 +00:00
Daniel Veillard
f009e2aae2 * src/qemu_driver.c: fix qemudDiskDeviceName to handle disk devices
too, patch by Guido Günther
daniel
2008-10-17 09:24:07 +00:00
Chris Lalancette
164f786626 Compiling with -Werror showed a possible use before initialization
in src/qemu_driver.c.  Make sure to initialize the olddisk ptr to NULL.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-10-16 13:44:09 +00:00
Jim Meyering
fd52c6ff67 avoid many format string warnings
Building with --disable-nls exposed many new warnings like these:
virsh.c:4952: warning: format not a string literal and no format ...
util.c:163: warning: format not a string literal and no format arguments
All but one of the following changes add a "%s" argument before
the offending _(...) argument.

This was the only manual change:
* src/lxc_driver.c (lxcVersion): Use %s and strerror(errno)
rather than %m, to avoid a warning from gcc -Wformat-security.

Add "%s" before each warned about format-string-with-no-%-directive:
* src/domain_conf.c (virDomainHostdevSubsysUsbDefParseXML)
(virDomainDefParseString, virDomainDefParseFile):
* src/hash.c (virGetConnect, __virGetDomain, virReleaseDomain)
(__virGetNetwork, virReleaseNetwork, __virGetStoragePool)
(virReleaseStoragePool, __virGetStorageVol, virReleaseStorageVol):
* src/lxc_container.c (lxcContainerChild):
* src/lxc_driver.c (lxcDomainDefine, lxcDomainUndefine)
(lxcDomainGetInfo, lxcGetOSType, lxcDomainDumpXML)
(lxcSetupInterfaces, lxcDomainStart, lxcDomainCreateAndStart)
(lxcVersion, lxcGetSchedulerParameters):
* src/network_conf.c (virNetworkDefParseString)
(virNetworkDefParseFile):
* src/openvz_conf.c (openvzReadNetworkConf, openvzLoadDomains):
* src/openvz_driver.c (openvzDomainDefineCmd)
(openvzDomainGetInfo, openvzDomainDumpXML, openvzDomainShutdown)
(openvzDomainReboot, ADD_ARG_LIT, openvzDomainDefineXML)
(openvzDomainCreateXML, openvzDomainCreate, openvzDomainUndefine)
(openvzDomainSetAutostart, openvzDomainGetAutostart)
(openvzDomainSetVcpus):
* src/qemu_driver.c (qemudDomainBlockPeek, qemudDomainMemoryPeek):
* src/remote_internal.c (remoteDomainBlockPeek)
(remoteDomainMemoryPeek, remoteAuthPolkit):
* src/sexpr.c (sexpr_new, _string2sexpr):
* src/storage_backend_disk.c (virStorageBackendDiskMakeDataVol)
(virStorageBackendDiskCreateVol):
* src/storage_backend_fs.c
(virStorageBackendFileSystemNetFindPoolSources):
* src/storage_backend_logical.c (virStorageBackendLogicalFindLVs)
(virStorageBackendLogicalFindPoolSources):
* src/test.c (testOpenDefault, testOpenFromFile, testOpen)
(testGetDomainInfo, testDomainRestore)
(testNodeGetCellsFreeMemory):
* src/util.c (virExec):
* src/virsh.c (cmdAttachDevice, cmdDetachDevice)
(cmdAttachInterface, cmdDetachInterface, cmdAttachDisk)
(cmdDetachDisk, cmdEdit):
* src/xend_internal.c (do_connect, wr_sync, xend_op_ext)
(urlencode, xenDaemonDomainCreateXML)
(xenDaemonDomainLookupByName_ids, xenDaemonDomainLookupByID)
(xenDaemonParseSxprOS, xend_parse_sexp_desc_char)
(xenDaemonParseSxprChar, xenDaemonParseSxprDisks)
(xenDaemonParseSxpr, sexpr_to_xend_topology, sexpr_to_domain)
(xenDaemonDomainFetch, xenDaemonDomainGetAutostart)
(xenDaemonDomainSetAutostart, xenDaemonDomainMigratePerform)
(xenDaemonDomainDefineXML, xenDaemonGetSchedulerType)
(xenDaemonGetSchedulerParameters)
(xenDaemonSetSchedulerParameters, xenDaemonDomainBlockPeek)
(xenDaemonFormatSxprChr, virDomainXMLDevID):
* src/xm_internal.c (xenXMConfigCacheRefresh, xenXMDomainPinVcpu)
(xenXMDomainCreate, xenXMDomainDefineXML)
(xenXMDomainAttachDevice, xenXMDomainDetachDevice):
* src/xml.c (virXPathString, virXPathNumber, virXPathLong)
(virXPathULong, virXPathBoolean, virXPathNode, virXPathNodeSet):
* src/xs_internal.c (xenStoreOpen):
2008-10-13 16:46:28 +00:00
Daniel P. Berrange
7e0d3e62e9 Support SDL config with QEMU guests 2008-10-10 16:52:20 +00:00
Daniel P. Berrange
427f7a8b09 Switch domain device objects to array instead of linked list 2008-10-10 16:08:01 +00:00
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 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
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
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
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
Cole Robinson
a166cdbb6e Fix starting qemu VM with multiple pty char devices. 2008-10-02 14:10:20 +00:00
Daniel P. Berrange
0aac8c9447 Fix trailing whitespace & unmarked diagnostic warning 2008-09-18 08:54:23 +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
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
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
126d3ebeea Fix starting of xen domains without a PVFB console by removing default emulator 2008-09-05 11:52:12 +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
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
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
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 P. Berrange
3348a97bd3 Switch over fork/exec code to use virExec 2008-08-29 07:11:15 +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
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
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
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
Atsushi SAKAI
413c5dbf07 add _fd to stdin, stderr stdout in struct virDomainObj for compilation on MinGW 2008-08-12 08:38:22 +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
Daniel P. Berrange
ffc839fb20 Always set forward-delay on bridge, even if 0 2008-08-01 12:56:52 +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
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 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
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
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
Daniel P. Berrange
6385fe3ede Switch QEMU driver over to generic domain APIs 2008-07-11 19:34:11 +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
1d86fca433 Fix parsing of QEMU stdout looking for serial device PTY with Xenner 2008-07-11 09:48:51 +00:00
Atsushi SAKAI
fbb5d771a0 Compilation fixes for MinGW 2008-06-26 09:37:51 +00:00
Daniel P. Berrange
db162cb2b8 Fix saving of iptables rules 2008-06-12 13:47:38 +00:00
Daniel Veillard
5d14e4fcce * src/qemu_driver.c: patch from Kaitlin Rupert, changing vcpu or
memory of an active domain is a NO_SUPPORT not INTERNAL_ERROR
Daniel
2008-06-12 08:55:13 +00:00
Richard W.M. Jones
6bcf25017b virDomainMemoryPeek API
* include/libvirt/libvirt.h.in, src/libvirt.c, src/driver.h,
          src/libvirt_sym.version: New virDomainMemoryPeek API.
        * qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
          Support for remote.
        * src/qemu_driver.c: QEMU driver implementation of API.
        * src/test.c: Test driver (null) implementation of API.
        * docs/hvsupport.html.in: Document API.
        * libvirt.spec.in: New path /var/cache/libvirt for temporary
          storage of memory images.
        * qemud/libvirtd.init.in: Remove any old temp files in
          /var/cache/libvirt on restarts.
        * src/Makefile.am: make install creates /var/cache/libvirt.
        * configure.in: Detect mkdir -p.
2008-06-10 10:43:28 +00:00
Richard W.M. Jones
a73a88a19f virDomainBlockPeek QEMU and remote support
* qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
	  Remote support.
	* qemud/remote_dispatch_localvars.h,
	  qemud/remote_dispatch_proc_switch.h,
	  qemud/remote_dispatch_prototypes.h,
	  qemud/remote_protocol.c,
	  qemud/remote_protocol.h:
	  Generated files for remote support.
	* src/xen_unified.c, src/driver.h, src/libvirt.c: Small fix -
	  pass flags around internally.
	* src/qemu_driver.c: Support for QEMU.
	* src/xend_internal.c: Remove redundant fstat call from Xen.
2008-06-05 21:12:26 +00:00
Richard W.M. Jones
8354895e68 virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
	* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
	* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
	src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
	* src/qemu_driver.c, src/test.c: Null versions of this call.
	* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
	src/xm_internal.c, src/xm_internal.h: Xen implementation.
	* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
	tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
	has been reordered slightly in the Xen driver, but should be
	functionally the same.
2008-06-05 13:17:45 +00:00
Daniel P. Berrange
895d0fdf5b Convert to use new memory allocation APIs 2008-05-29 19:20:22 +00:00
Richard W.M. Jones
1d8d4f86b6 Standardize use of header files, making internal.h primary.
* qemud/internal.h, qemud/qemud.h: Rename this file so it
	doesn't conflict with src/internal.h.
	* HACKING: Document how header files should be used.
	* qemud/Makefile.am: Add src/ directory to includes.
	* qemud/event.c, qemud/mdns.c, qemud/qemud.c, qemud/remote.c,
	qemud/remote_protocol.c, qemud/remote_protocol.h,
	qemud/remote_protocol.x, src/buf.c, src/libvirt.c,
	src/nodeinfo.c, src/qemu_conf.c, src/qemu_driver.c,
	src/stats_linux.c, src/storage_backend.c, src/storage_backend_fs.c,
	src/storage_backend_iscsi.c, src/storage_backend_logical.c,
	src/storage_conf.c, src/storage_driver.c, src/util.c,
	src/util.h, src/virsh.c, src/virterror.c, src/xend_internal.c,
	src/xml.c, tests/reconnect.c, tests/xmlrpctest.c,
	tests/qparamtest.c: Standardize	use of header files.
	* docs/*, po/*: Rebuild docs.
2008-05-23 08:24:41 +00:00
Daniel P. Berrange
e193b5ddea Apply CPU pinning at startup for QEMU guests 2008-05-22 16:27:20 +00:00
Daniel P. Berrange
6d372bd468 Add support for VCPU pinning in QEMU driver 2008-05-22 16:20:31 +00:00
Daniel P. Berrange
42aec3d000 Fix removal of iptable forwarding rules 2008-05-22 15:49:50 +00:00
Daniel P. Berrange
508c4226e1 Implement NUMA info/apis in QEMU driver 2008-05-22 15:29:50 +00:00
Daniel P. Berrange
40a82f3066 Make QEMU test suite independant of host OS capabilities 2008-05-16 16:51:30 +00:00
Jim Meyering
c1ee35af3b start using c-ctype functions
Up to now, we've been avoiding ctype functions like isspace, isdigit,
etc.  because they are locale-dependent.  Now that we have the c-ctype
functions, we can start using *them*, to make the code more readable
with changes like these:

-        /* This may not work on EBCDIC. */
-        if ((*p >= 'a' && *p <= 'z') ||
-            (*p >= 'A' && *p <= 'Z') ||
-            (*p >= '0' && *p <= '9'))
+        if (c_isalnum(*p))

-    while ((*cur >= '0') && (*cur <= '9')) {
+    while (c_isdigit(*cur)) {

Also, some macros in conf.c used names that conflicted with
standard meaning of "BLANK" and "SPACE", so I've adjusted them
to be in line with the definition of e.g., isblank.
In addition, I've wrapped those statement macros with do {...} while (0),
so that we can't forget the ";" after a use.  There was one like that
already (fixed below).  The missing semicolon would mess up automatic
indenting.
* src/buf.c (virBufferURIEncodeString):
* src/conf.c (IS_EOL, SKIP_BLANKS_AND_EOL, SKIP_BLANKS)
(virConfParseLong, virConfParseValue, virConfParseName)
(virConfParseSeparator, virConfParseStatement, IS_BLANK, IS_CHAR)
(IS_DIGIT, IS_SPACE, SKIP_SPACES):
* src/nodeinfo.c:
* src/qemu_conf.c (qemudParseInterfaceXML):
* src/qemu_driver.c (qemudDomainBlockStats):
* src/sexpr.c:
* src/stats_linux.c:
* src/util.c (virParseNumber, virDiskNameToIndex):
* src/uuid.c (hextobin, virUUIDParse):
* src/virsh.c:
* src/xml.c (parseCpuNumber, virParseCpuSet):
2008-05-16 09:37:44 +00:00
Daniel P. Berrange
3a7b528d4b Add support for Xen input device in QEMU driver for xenner 2008-05-15 16:11:40 +00:00
Jim Meyering
6049594045 avoid using STREQLEN with a literal; use STRPREFIX instead
Likewise for STRNEQLEN -> !STRPREFIX.
* src/nodeinfo.c (linuxNodeInfoCPUPopulate):
* src/qemu_conf.c (qemudNetworkIfaceConnect):
(qemudParseInterfaceXML):
* src/qemu_driver.c (qemudDomainBlockStats):
* src/remote_internal.c (call):
* src/stats_linux.c (xenLinuxDomainDeviceID):
* src/xend_internal.c (xend_parse_sexp_desc):
(xend_get, sexpr_to_xend_topology):
* src/xm_internal.c (xenXMConfigCacheRefresh)
(xenXMDomainFormatXML):
2008-05-15 14:21:34 +00:00
David L. Leskovec
94311de539 Enable libvirtd drivers to handle signals, in lxc, sigchld triggers vm cleanup
Mon May 12 23:32:21 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>

	* qemud/qemud.c: get siginfo with signals, distribute to drivers that
    register a handler
	* src/driver.h: add sighandler function to state driver table
	* src/internal.h: define virStateSigDispatcher functions
	* src/libvirt.c: add __virStateSigDispatcher function
	* src/libvirt_sym.version: add __virStateSigDispatcher
	* src/lxc_driver.c: add sig handler function, cleanup vm when sigchld
    received from container process
	* src/qemu_driver.c: NULL for sig handler (no handler) in state driver
	* src/remote_internal.c: NULL for sig handler (no handler) in state driver
	* src/storage_driver.c: NULL for sig handler (no handler) in state driver
2008-05-13 06:30:58 +00:00
Jim Meyering
25534052bc Use gnulib's c-ctype.h, not <ctype.h>.
# Convert uses of isspace to c_isspace, isdigit to c_isdigit, etc.
re=$(man isspace|grep is.....,.is|sed 's/ -.*//' \
  |tr -s ', \n' \||sed 's/^|//;s/|$//')
git grep -l -E "$re"|grep -Ev 'Chan|gnulib' \
  |xargs perl -pi -e 's/\b('"$re"')\b/c_$1/g'
# Remove all uses of to_uchar
git grep -l to_uchar|xargs perl -pi -e 's/to_uchar\((.*?)\)/$1/g'
* src/util.h (to_uchar): Remove definition.
(TOLOWER): Remove definition.
(__virMacAddrCompare): Use c_tolower, not TOLOWER.
Globally:
  Where needed, change <ctype.h> to <c-ctype.h>.
  Remove unnecessary inclusion of <ctype.h>.
Ensure the global changes are never needed again:
* Makefile.maint (sc_avoid_ctype_macros): Prohibit use of ctype
macros.   Recommend c-ctype.h instead.
(sc_prohibit_c_ctype_without_use): New rule.
(sc_prohibit_ctype_h): New rule.  Disallow use of <ctype.h>.
2008-05-09 13:50:14 +00:00