Commit Graph

2316 Commits

Author SHA1 Message Date
Mark McLoughlin
d06f261cb1 Remove the network backend if NIC hotplug fails
If we fail to pci_add a NIC, we should remove the network backend and
leave things the way we found them. To do that, we pre-allocate a
host_net_remove monitor command and issue that if the pci_add fails.
If the remove fails, we just log a warning.

We can only do this if we have a name for the network backend and
we know the vlan number its associated with.

* src/qemu_driver.c: host_net_remove the network backend if the
  pci_add fails
2009-07-22 11:34:07 +01:00
Mark McLoughlin
35153940e3 Basic qemu NIC hotplug support
Implement basic NIC hotplug support using the 'host_net_add' and
'pci_add' qemu monitor commands.

For now, we don't support 'bridge' or 'network' types.

Also, if pci_add fails, we currently fail to remove the backend
which we added.

Finally, NIC hot-unplug support is missing.

* src/qemu_driver.c: add qemudDomainAttachNetDevice()

* src/qemu_conf.[ch]: export qemuBuildNicStr(), qemuBuildHostNetStr()
  and qemuAssignNames()

* src/libvirt_private.syms: export virDomainNetTypeToString()
2009-07-22 11:34:06 +01:00
Mark McLoughlin
423af1977f Make qemuCmdFlags available in qemudDomainAttachDevice()
qemudDomainChangeEjectableMedia() currently extracts the qemu command
line flags, but other device attaching code might need it, so move
the qemudExtractVersionInfo() call up a frame.

* src/qemu_driver.c: move the qemudExtractVersionInfo() call from
  qemudDomainChangeEjectableMedia() to qemudDomainAttachDevice()
2009-07-22 11:34:06 +01:00
Mark McLoughlin
30605477f2 Store the interface vlan number in the domain state
Currently, an interface's vlan number corresponds to its index in
the table of network interfaces. That is no longer true when we
allow devices to be removed.

To fix this, we store the vlan number in the domain's state XML
so that it survives libvirtd restarts.

* src/domain_conf.h: add vlan number to virDomainNetDef

* src/domain_conf.c: store it in XML as <state vlan='N'/>, defaulting
  to -1 if this is state saved by a previous version of libvirt

* src/qemu_conf.c: assign vlan numbers before starting qemu
2009-07-22 11:34:06 +01:00
Mark McLoughlin
36c820e6c8 Add NIC and hostnet names to domain state XML
The qemu driver needs to assign and keep track of identifiers for
network devices so that it can remove them. We need to keep this state
across libvirtd restarts, but it's not configuration that needs to
be kept across guest restarts.

* src/domain_conf.c: parse and format <state nic="foo" hostnet="bar"/>
2009-07-22 11:34:06 +01:00
Mark McLoughlin
c23dae4e5c Assign names to qemu NICs and network backends
We need these so that we can remove the devices via the monitor.

* src/domain_conf.h: add nic_name and hostnet_name to virDomainNetDef

* src/domain_conf.c: free nic_name and hostnet_name

* src/qemu_conf.c: add qemuAssignNetNames(), use it if qemu has
  support for the param and pass the names on the command line

* tests/qemuxml2argv*: add a test for this
2009-07-22 11:34:06 +01:00
Mark McLoughlin
948897687e Add checks for some NIC hotplug related features added in qemu-0.10.0
Add QEMUD_CMD_FLAG_NET_NAME to indicate that '-net ...,name=foo' is
supported and QEMUD_CMD_FLAG_HOST_NET_ADD to indicate that the
'host_net_add' monitor command is available.

Set both these flags if the qemu version is greater than 0.10.0.
Checking via the '-help' output would not work for the monitor command
and even for the command line arg, it would be quite fragile.

* src/qemu_conf.h: add new flags as aliases of QEMUD_CMD_FLAG_0_10

* src/qemu_conf.c: set QEMUD_CMD_FLAG_0_10 for versions >= 0.10.0

* tests/qemuhelptest.c: set QEMUD_CMD_FLAG_0_10 for the appropriate
  qemu versions
2009-07-22 11:34:06 +01:00
Mark McLoughlin
63e67ee013 Factor qemuBuildHostNetStr() out from qemuBuildCommandLine()
Re-factor this code so that it can be used for NIC hotplug
too. The awkward prefix and type_sep arguments are needed to
allow us to do "host_net_add tap vlan=..."

* src/qemu_conf.c: factor the net backend string formatting
  code into its own function
2009-07-22 11:34:06 +01:00
Mark McLoughlin
ce2e300a4f Factor qemuBuildNicStr() out from qemuBuildCommandLine()
Re-factor this code so that it can be used for NIC hotplug
too. The awkward arguments are needed to allow use to do
"pci_add auto nic macaddr=..."

* src/qemu_conf.c: factor the nic string formatting code into
  its own function
2009-07-22 11:34:06 +01:00
Mark McLoughlin
0165410712 Retain disk PCI address across libvirtd restarts
When we hot-plug a disk device into a qemu guest, we need to retain its
PCI address so that it can be removed again later. Currently, we do
retain the slot number, but not across libvirtd restarts.

Add <state devaddr="xxxx:xx:xx"/> to the disk device XML config when the
VIR_DOMAIN_XML_INTERNAL_STATUS flag is used. We still don't parse the
domain and bus number, but the format allows us to do that in future.

* src/domain_conf.h: replace slotnum with pci_addr struct, add helper
  for testing whether the address is valid

* src/domain_conf.c: handle formatting and parsing the address

* src/qemu_driver.c: store the parsed slot number as a full PCI address,
  and use this address with the pci_del monitor command

* src/vbox/vbox_tmpl.c: we're debug printing slotnum here even though
  it can never be set, just delete it
2009-07-22 11:34:05 +01:00
Mark McLoughlin
aa98871c77 Add internal XML parsing/formatting flag
We need to store things like device names and PCI slot numbers in the
qemu domain state file so that we don't lose that information on
libvirtd restart. Add a flag to indicate that this information should
be parsed or formatted.

Make bit 16 and above of the flags bitmask for internal use only and
consume the first bit for this new status flag.

* include/libvirt/libvirt.h: add VIR_DOMAIN_XML_FLAGS_MASK

* src/libvirt.c: reject private flags in virDomainGetXMLDesc()

* src/domain_conf.h: add VIR_DOMAIN_XML_INTERNAL_STATUS

* src/domain_conf.c: pass the flag from virDomainObjParseXML() and
  virDomainSaveStatus
2009-07-22 11:34:05 +01:00
Laine Stump
1499e1d5f4 Rename variable for compilation in Mingw32
* src/virsh.c: rename interface into iface
2009-07-22 10:32:03 +02:00
Thomas Treutner
683241de5a Fix documentation of virStoragePoolUndefine return
* src/libvirt.c: the documented return was wrong
2009-07-22 08:41:40 +02:00
Daniel P. Berrange
6c3f7d7fd6 Fix typo in check for glusterfs format pools
* src/storage_backend_fs.c: Replace = with == for comparison
2009-07-21 12:49:44 -04:00
Harshavardhana
44948f5b69 Set specific flags for glusterfs fs mounts
* src/storage_backend_fs.c: due to Fuse O_DIRECT problem one need
  to mount glusterfs with direct-IO mode, until fixed
2009-07-21 17:49:20 +02:00
Pritesh Kothari
e1506cb4eb Fix reconnect bug for VBox
* src/vbox/vbox_tmpl.c: reconnecting to vbox:///session was failing
2009-07-21 16:44:50 +02:00
Daniel Veillard
909d647aab Activate the interface drivers, and cleanups
* src/libvirt.c: activate the interface drivers
* po/POTFILES.in: add the netcf driver as a source of localization strings
* src/interface_driver.c: NETCF_ENOMEM -> VIR_ERR_NO_MEMORY mapping was
  breaking syntax checking
2009-07-21 16:15:39 +02:00
Laine Stump
da4f146f83 Netcf based interface driver implementation
* src/interface_driver.c src/interface_driver.h: the new driver
* src/Makefile.am qemud/Makefile.am qemud/qemud.c: hook the new driver
  in the build system and get ti activated by the daemon
* src/libvirt_private.syms: export needed symbols internally
2009-07-21 16:02:16 +02:00
Laine Stump
3edbc2c4a9 Add a test interface driver
* test.c: includes an interface driver to the test framework
2009-07-21 15:45:55 +02:00
Daniel Veillard
d6fa6f3e92 Remove trailing blank lines 2009-07-21 15:43:11 +02:00
Laine Stump
846f694908 Add interface object list manipulation functions
* interface_conf.c interface_conf.h: utilities function usful for
  interface driver like the test interface driver
2009-07-21 15:40:55 +02:00
Laine Stump
9734c81f3a virGetinterface matching of MAC and interface name
MAC address of a particular interface may change over time, and the
reduced virInterface object (which contains just name and mac) needs
to reflect these changes. Since we can't modify the mac address of an
existing virInterface (some other thread may currently be using it) we
just create a new virInterface, and let the old one die a dignified
death when its refct goes to 0.
* src/datatypes.c: fix the matching and lifetime of virInterface object
  accordingly
2009-07-21 15:37:20 +02:00
Laine Stump
6eeca586d4 Add an error code for conflicting mac addresses
* include/libvirt/virterror.h src/virterror.c: if a driver's
  virInterfaceLookupByMACString() function finds more than one interface
  with the desired MAC Address, this new error is raised.
2009-07-21 15:13:32 +02:00
Jun Koi
b2fd033cd5 Fix an uninitialized variable in Unix socket open
* src/qemu_driver.c: qemudOpenMonitorUnix() had an uninitialized loop
  counter
2009-07-21 11:57:54 +02:00
Daniel Veillard
86941f55d5 Remove some unused variables and cut long lines
* src/virsh.c: a bit of cleanup on previous commit
2009-07-16 22:04:24 +02:00
Laine Stump
6b56ac24df Add virsh commands for network interface management
* src/virsh.c: add a number of interface related commands:
  iface-list, iface-name, iface-mac, iface-dumpxml, iface-define,
  iface-undefine, iface-edit, iface-start and iface-destroy
2009-07-16 21:44:10 +02:00
Cole Robinson
3b5417687d qemu: Try multiple times to open unix monitor socket
Unlike the pty monitor (which we know exists since we scrape its path from
stdout), we have no way of knowing that the unix monitor socket should exist/
be initialized. As a result, some of my KVM guests randomly fail to start on
F10 host.

Try to open the unix socket in a 3 second timeout loop. Ignore EACCES (path
does not exist if a first time run) and ECONNREFUSED (leftover socket from
a previous run hasn't been removed yet). Fixes things for me.
2009-07-16 12:52:53 -04:00
Cole Robinson
fd06fd1442 storage: Implement CreateVolFrom for logical and disk backend.
With the previous refactoring, this is a simple process, since the global
'CreateBlockFrom' in storage_backend does all the work.
2009-07-16 12:52:52 -04:00
Cole Robinson
f23814e0cd storage: Don't try sparse detection if writing to block device.
We don't gain any space savings, so skip the detection to speed up
the cloning operation.
2009-07-16 12:52:52 -04:00
Cole Robinson
7471357081 storage: Implement 'CreateBlockFrom' helper.
Add a 'CreateBlockFrom' in the global storage_backend, which sets up the
destination block device: CopyFromFD does the rest of the cloning.
2009-07-16 12:52:52 -04:00
Cole Robinson
a256fccfe1 storage: Break out actual raw cloning to separate function.
The CreateRaw function has some 'file' only assumptions, so break the agnostic
cloning bits to a separate function.
2009-07-16 12:52:52 -04:00
Cole Robinson
16e4833492 storage: cleanup: do away with 'createFile'
Have storage building functions be definitions of
virStorageBackendBuildVolFrom: we will need to do this in the future anyways
if we ever support the flags attribute.
2009-07-16 12:52:52 -04:00
Cole Robinson
6d7d465a04 storage: Move most of the FS creation functions to common backend.
These will be used by other pool cloning implementations.
2009-07-16 12:52:52 -04:00
Cole Robinson
1b16bf4ec7 storage: Refactor FS backend 'create' function choosing.
Break out separate functions for

- Determining the supported '*-img' tool,
- The tool's associated create function,
- Desired function for cloning (CreateXMLFrom).

This will be eventually used to unify cloning across all backends.
2009-07-16 12:52:52 -04:00
Cole Robinson
045176bf35 storage: Fix deadlock when cloning across pools.
We need to unlock the first pool before looking up the second, since the
search locks every pool it checks.
2009-07-16 12:52:52 -04:00
Cole Robinson
a500d73ac0 storage: disk: Use capacity, not allocation, when creating volume.
There isn't any way to dictate allocation when creating disk volumes, so
capacity is the only relevant value.
2009-07-16 12:52:52 -04:00
Cole Robinson
bd70595c9d storage: disk: Default to 'ext2' for new volumes.
Currently, if no format is specified for a new disk volume, we pass the
invalid value "none" as the FS type to 'parted mkpart'.

There doesn't seem to be a way to have parted not format the drive, so
just default to using 'ext2' in this case: this shouldn't cause any harm,
since we are creating a new partition in the first place.
2009-07-16 12:52:52 -04:00
Cole Robinson
12a6278135 storage: disk: Fix segfault creating volume without target path
Remove unneeded target path duplication, which could carelessly dereference
NULL. Make it clear where 'key' is actually filled in.
2009-07-16 12:52:51 -04:00
Cole Robinson
a3711708f7 storage: disk: Fix parthelper '-g' option handling.
Typo was breaking 'parthelper -g', preventing disk pool definition.
2009-07-16 12:52:51 -04:00
Daniel P. Berrange
0714b2ba4c Run QEMU guests as an unprivileged user
* configure.in: Add --with-qemu-user and --with-qemu-group args
* libvirt.spec.in: use 'qemu' for user/group for Fedora >= 12
* qemud/libvirtd_qemu.arg, qemud/test_libvirtd_qemu.aug,
  src/qemu.conf: Add 'user' and 'group' args for configuration
* src/Makefile.am: Create %localstatedir/cache/libvirt/qemu
* src/qemu_conf.c, src/qemu_conf.h: Load user/group from config
* src/qemu_driver.c: Change user ID/group ID when launching QEMU
  guests. Change user/group ownership on disks/usb/pci devs.
  Put memory dumps in %localstatedir/cache/libvirt/qemu
* src/util.c, src/util.h: Add convenient APIs for converting
  username/groupname to user ID / group ID
2009-07-16 17:06:55 +01:00
Laine Stump
d4ad29be2a Implement the new virinterface functions
* src/driver.h: add new driver functions virDrvNumOfDefinedInterfaces
  and virDrvListDefinedInterfaces
* src/libvirt.c: implements the entry points, calling new driver
  functions
* qemud/remote.c qemud/remote_dispatch_args.h qemud/remote_protocol.[chx]
  qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_ret.h
  qemud/remote_dispatch_table.h src/remote_internal.c: implement the
  client/server side of the RPC
2009-07-16 17:58:15 +02:00
Laine Stump
043c954e9f Public API for new virInterface functions
* include/libvirt/libvirt.h[.in]: adds signatures for the new exported
  functions virConnectNumOfDefinedInterfaces and
  virConnectListDefinedInterfaces
* src/libvirt_public.syms: export the new symbols
2009-07-16 17:49:50 +02:00
Daniel P. Berrange
5dd21f2a75 Rename a bunch of internal methods to clarify their meaning
This renames a lot of the methods in the remote driver client
to more accurately reflect their responsibility of IO handling
vs message handling.
2009-07-16 16:09:48 +01:00
Daniel P. Berrange
d65707a5b4 Simplify remote driver error reporting
Remove redundant error reporting functions which obscured the
filename/line number reporting. Removed code which created a
virDomain/virNetwork object, since those are silently dropped
in error reporting functions now

* src/remote_internal.c: Remove error() and errorf() in favour of
 macros, and remove server_error in favour of direct call
2009-07-16 16:09:48 +01:00
Daniel P. Berrange
9c9ed0f3f6 Refactor message sending to allow code reuse for data streams
Splits up the 'call' method moving generic IO code out into
separate method to allow it to be easily reused for sending
data streams

* src/remote_internal.c: Split 'call' into two methods, the first
  with same name serializes a set of method arguments into a
  message, the second 'remoteIO' takes a pre-serialized messages,
  sends it and awaits a reply
2009-07-16 16:09:48 +01:00
Daniel P. Berrange
7a61c13834 Refactor incoming message handling to prepare for data stream support
* src/remote_internal.c: Rename processCallRecvMsg to
  processCallDispatch, and move code specific to method replies
  into processCallDispatchReply, and rename processCallAsyncEvent
  to processCallDispatchMessage
2009-07-16 16:09:48 +01:00
Daniel P. Berrange
27944fac9c Rename 'direction' to 'type' in remote_message_header
The 'remote_message_header' struct has a mis-leadingly named
field 'direction'. It is really a reflection of the type of
message, and some types can be sent in either direction. Thus
the field is more accurately named 'type'. No function change.

* qemud/remote_protocol.x: Rename 'direction' to 'type' in
  'remote_message_header. Write better docs describing the
  message header field semantics & usage
* qemud/remote_protocol.c, qemud/remote_protocol.h: Regenerate
* qemud/remote.c, qemud/dispatch.c, src/remote_internal.c
  Update to reflect rename of 'direction' to 'type'
2009-07-16 16:09:48 +01:00
Daniel P. Berrange
aa23d432cd Change code generator to give async event messages their own postfix
The naming convention for structs used in the RPC layer is for
incoming requests to be called XXXX_args, and the associated
outgoing reply to be called XXXX_ret.  Asynchronously emitted
messages (eg events) are re-using the XXXX_ret naming scheme.
This patch changes that such that async messages are XXXX_msg,
and stops adding entries for them in the dispatch table, avoiding
the need for a dummy no-op implementation.

* qemud/remote.c: Remove dummy remoteDispatchDomainEvent, no
  longer required. Update to replace remote_domain_event_ret
  with xdr_remote_domain_event_msg
* qemud/remote_protocol.x: Rename remote_domain_event_ret to
  remote_domain_event_msg
* qemud/remote_generate_stubs.pl: Adding handling for new
  XXX_msg structs.
* src/remote_internal.c: Rename remote_domain_event_ret to
  remote_domain_event_msg
* qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h,
  qemud/remote_dispatch_table.h, qemud/remote_protocol.h,
  qemud/remote_protocol.c: auto-regenerate
2009-07-16 16:09:47 +01:00
Paolo Bonzini
e1abc44814 Implement qemu dump capabilities
* src/qemu_driver.c (qemudDomainCoreDump): New
  (qemuDriver): Add core dump function. The behaviour is similar
  as the current Xen dump
2009-07-16 16:50:23 +02:00
Paolo Bonzini
c4951f11b7 add cd and pwd commands to virsh
* src/virsh.c: adds cd and pwd commands to virsh useful for save and
  restore commands
* docs/virsh.pod virsh.1: update the documentation
* AUTHORS: add Paolo Bonzini
2009-07-16 16:40:08 +02:00
Jim Meyering
07613d2020 remove all trailing blank lines
by running this command:
git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/'
This is in preparation for a more strict make syntax-check
rule that will detect trailing blank lines.
2009-07-16 15:06:42 +02:00
Daniel P. Berrange
4a7acedd3c Fix free of unitialized data upon PCI open fail 2009-07-16 13:57:44 +01:00
Daniel P. Berrange
1795bfe4a1 Fix SELinux denial during hotplug
* src/qemu_driver.c: Relabel disk images *before* running QEMU
hotplug monitor commands
2009-07-16 11:32:09 +01:00
Daniel P. Berrange
326ecb7814 Fix PCI device hotplug/unplug with newer QEMU
* src/qemu_driver.c: Try new monitor syntax for hotplug first. If
  that fails fallback to old KVM specific syntax
2009-07-16 11:32:09 +01:00
Daniel P. Berrange
2d1f2e706c Fix problem with QEMU monitor welcome prompt confusing libvirt
after a libvirtd daemon restart with active guests

* src/qemu_driver: Read and dicard pending monitor data
  before issuing new monitor commands.
2009-07-16 11:32:03 +01:00
Daniel P. Berrange
bf5343d233 Ensure spawned children have a stderr/out set to /dev/null if requested 2009-07-16 10:53:21 +01:00
Daniel P. Berrange
89c5ce4dcd Allow autostart of libvirtd to be disabled with LIBVIRT_AUTOSTART=0
* src/remote_internal.c: Disable libvirtd autostart if the
  LIBVIRT_AUTOSTART=0 env variable is set
* src/libvirt.c: Document environment variables can impact
  the virConnectOpen API
2009-07-16 10:53:16 +01:00
Daniel Veillard
2f5fb5e09d add support for netcf XML import and export
* src/interface_conf.c src/interface_conf.h: the import and export
  routines and the internal APIs
* src/Makefile.am: hook the new file in the makefiles
* src/libvirt_private.syms: export a few private symbols internally
* po/POTFILES.in: the new file contains translatable strings
2009-07-15 20:16:26 +02:00
Daniel P. Berrange
8c9b8431ee Ensure test:/// URIs get routed to the non-privileged libvirtd
* src/remote_internal.c: Ensure that all test:/// URIs are dealt
  with by the auto-started, per-user unprivileged libvirtd instances
2009-07-15 12:29:35 +01:00
Daniel P. Berrange
845659340e Fix error reporting for security driver over remote protocol
* qemud/remote.c: Send back the actual libvirt connection error
  rather than formatting a generic error for security driver
  methods
* src/libvirt.c: Fix virDomainGetSecurityLabel, and
  virNodeGetSecurityModel to correctly set the error on
  the virConnectPtr object, and raise a full error rather
  than warning when not supported
2009-07-15 12:27:42 +01:00
Cole Robinson
ad664f54ff Fix docs and code disagreements for character devices.
The 'pipe' character type wasn't documented.
TCP uses a <protocol> element, not <wire>
We weren't doing strict validation for protocol and source mode values.
2009-07-10 19:29:31 -04:00
Cole Robinson
fe7cb869a8 qemu: Check driver is initialized up front, to avoid segfault.
If the qemu_driver was not initialized (possibly due to an error on driver
startup), we can segfault if attempting to connect to the URI.
2009-07-10 19:29:31 -04:00
Mark McLoughlin
13709bdbf8 Use virDomainChrTypeFromString() instead of open coding
* src/domain_conf.c: replace open coded chr type parsing with
  virDomainChrTypeFromString(), retaining the existing semantics
  where unknown types are silently mapped to the "null" type and
  "pty" is used if none is specified
2009-07-10 09:33:34 +01:00
Mark McLoughlin
62455ed872 Switch to using a unix socket for the qemu monitor
We keep support for the pty based monitor so that we can re-connect
to VMs started by older versions of libvirtd.

* src/domain_conf.c: handle formatting and parsing unix monitors

* src/qemu_driver.c: add qemudOpenMonitorUnix(), remove the monitor
  pty path searching from qemudFindCharDevicePTYs(), switch
  qemudStartVMDaemon() and qemuDomainXMLToNative() to using a unix
  monitor

* tests/qemuxml2argvtest.c: switch to using a unix monitor

* tests/qemuxml2argvdata/qemuxml2argv-*.args: update test data
2009-07-09 20:04:09 +01:00
Mark McLoughlin
05d377bdd2 Add the monitor type to the domain state XML
There are no functional changes in this patch apart from adding the
monitor type to the state XML.

The patch mostly consists of switching to use virDomainChrDef every
where to describe the monitor.

* src/domain_conf.h: replace monitorpath with monitor_chr

* src/domain_conf.c: handle parsing the monitor type and initializing
  monitor chr

* src/qemu_conf.[ch]: make qemudBuildCommandLine take a
  virDomainChrDefPtr and use that to build the -monitor parameter

* src/qemu_driver.c: split pty specific and common code from
  qemudOpenMonitor, have qemudStartVMDaemon() initialize monitor_chr

* tests/qemuxml2argvtest.c: update for qemudBuildCommandLine() change
2009-07-09 20:04:07 +01:00
Mark McLoughlin
1f4ec305f0 Minor qemu monitor coding style fixes
* src/qemu_driver.c: use a consistent coding style for function
  definitions
2009-07-09 19:31:01 +01:00
Mark McLoughlin
8a52daa2d4 Don't leak vm->monitorpath on re-connect
* src/qemu_driver.c: vm->monitorpath is already initialized in the case
  of re-connect, so move the initialization for the normal startup case
  out of the common code
2009-07-09 19:31:01 +01:00
Jim Meyering
fb98f4b10d remove all .cvsignore files 2009-07-08 16:17:51 +02:00
Daniel P. Berrange
ad6d5acb42 Support <video> element for QEMU guests
* src/qemu_conf.c, src/qemu_conf.h: Use -vga or -std-vga
	when starting guests if video card is present
	* tests/qemuhelptest.c: Change to use constants instead
	of hardcoded hex numbers, and add VGA support
	* tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml,
	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml,
	tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml: Add <video>
	element for testing graphics adapter
	* tests/qemuxml2argvtest.c: Add QEMUD_CMD_FLAG_VGA flag
	* tests/qemuxml2xmltest.c: Add missing graphics-vnc-sasl/tls tests
2009-07-08 13:40:32 +01:00
Daniel P. Berrange
6b4d18c7b3 Support <video> tag for defining VGA card properties
* docs/schemas/domain.rng: Define <video> element schema
 * src/domain_conf.c, src/domain_conf.h, src/libvirt_private.syms:
   Add parsing and formatting for <video> element
2009-07-08 13:40:32 +01:00
Daniel Veillard
c6cd55d38e Report the object name on lookup error
* src/network_driver.c src/node_device.c src/storage_driver.c:
  many places in the code reported 'No xxx with matching name" after
  a Lookup error without reporting the name used by the failed lookup
2009-07-08 12:01:35 +02:00
Harshavardhana
2562303a45 Add new net filesystem glusterfs
* src/storage_conf.c src/storage_conf.h: adds glusterfs to the list
  of network storage
* libvirt.spec.in: adds the dependency on glusterfs-client
2009-07-08 11:46:25 +02:00
Paolo Bonzini
b0e48bfdfe Avoid raising an internal error
* src/qemu_conf.c: when connecting an interface if it reference
  an undefined network, then we used to raise an internal error.
2009-07-07 16:54:55 +02:00
Daniel Veillard
d81275974a Add support for arm emulation if qemu-system-arm is present
* src/qemu_conf.c: patch from C.J. Adams-Collier adding support
  for arm emulation if qemu-system-arm is present
daniel
2009-07-03 13:15:55 +00:00
Mark McLoughlin
67d0c6eb94 Skip labelling if no src path present
Fixes startup of guest's with sourceless cdrom devices.

Patch from Cole Robinson originally posted here:

  https://bugzilla.redhat.com/499569

but never sent upstream.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-07-03 10:29:09 +00:00
Mark McLoughlin
add254feea Don't unnecessarily try to change a file context
As pointed out by Tim Waugh here:

  https://bugzilla.redhat.com/507555

We shouldn't bother trying to set the context of a file if it already
matches what we want.

(Fixed to use STREQ() and not use tabs, as pointed out by danpb)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-07-03 10:27:46 +00:00
Mark McLoughlin
547147084d Re-label shared and readonly images
This patch was posted ages ago here:

  https://bugzilla.redhat.com/493692

But was never posted upstream AFAICT.

Patch from Dan Berrange

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-07-03 10:26:37 +00:00
Daniel Veillard
1e4434d652 Fix some missing parts in network code and schemas
* docs/schemas/network.rng: fix the network schemas to match
  new accepted elements, patch by Satoru SATOH
* src/network_conf.c: fix network driver to save the domain name
  in XML if present, patch by Satoru SATOH
* AUTHORS: adding Satoru SATOH
Daniel
2009-07-02 14:02:18 +00:00
Daniel Veillard
bc429a0e54 fix an endless loop in node device XML dump
* src/node_device.c: fix an endless loop in node device XML dump,
  patch by Cole Robinson
Daniel
2009-07-01 21:30:41 +00:00
Daniel Veillard
88b4cc5fe9 Regenerated the documentation and localization files
* src/libvirt.c src/virterror.c: fix some missing comments in public
  modules.
* docs/libvirt-api.xml docs/libvirt-refs.xml
  docs/devhelp/libvirt-libvirt.html docs/html/libvirt-libvirt.html:
  regenerated documentation
* po/*: updated the polish localization and regenerated
Daniel
2009-07-01 13:08:17 +00:00
Daniel Veillard
2a004db6c7 Various logging cleanups in code and doc
* docs/logging.html[.in] qemud/libvirtd.conf qemud/qemud.c
  src/logging.[ch]: cleanup the logging code and docs to remove
  all references to log level 0, cleanup hardcoded values and add
  a default VIR_LOG_DEFAULT value, patch by Amy Griffis
daniel
2009-07-01 11:21:15 +00:00
Daniel Veillard
f7bd305904 cleanup and small update for OpenNebula
* src/opennebula/one_conf.c src/opennebula/one_driver.c: cleanup
  and small update for OpenNebula driver by Abel Miguez Rodriguez
Daniel
2009-07-01 10:42:10 +00:00
Daniel P. Berrange
69ba4d0971 Remove unused code. Ensure null termination after strncpy in opennebula 2009-07-01 10:40:12 +00:00
Daniel Veillard
1476b6d487 * src/storage_driver.c: don't destroy a pool when calling create
by mistake, patch by Dave Allan.
daniel
2009-07-01 08:33:22 +00:00
Daniel P. Berrange
eb6d21cc0e Reduce LXC capabilities 2009-06-29 17:09:42 +00:00
Daniel P. Berrange
96619805cb Use libcap-ng to clear capabilities for many child processes 2009-06-29 17:00:52 +00:00
Daniel P. Berrange
39c7e7a6b7 Fix crash in QEMU driver with bad capabilities data 2009-06-29 10:41:56 +00:00
Daniel Veillard
609e31dd3e * src/parthelper.c: fix a superfluous % on printf format problem
raised by Matthias Bolte
Daniel
2009-06-26 20:14:18 +00:00
Daniel Veillard
ecd937164f * src/nodeinfo.c: sometimes libnuma can't handle some topologies,
but those failures should not completely break libvirt, patch
  by Dan Berrange, fixes #506590
daniel
2009-06-26 20:08:07 +00:00
Daniel Veillard
14435163a0 * src/xend_internal.c: avoid a segfault when dumping XML with recent
xen versions, patch by Sascha, fixes #503254
daniel
2009-06-26 18:14:16 +00:00
Daniel Veillard
fd90b67afe allow to create storage volumes on disk backend
* src/libvirt_private.syms src/parthelper.c src/storage_backend_disk.c
  src/storage_conf.c src/storage_conf.h: allow to create storage
  volumes on disk backend, patches by Henrik Persson
* AUTHORS: add Henrik Persson
Daniel
2009-06-26 16:18:59 +00:00
Daniel Veillard
173c230e66 big cleanup of the debug configuration option
* src/Makefile.am src/libvirt.c src/libvirt_private.syms src/logging.c
  src/logging.h src/util.c src/libvirt_debug.syms: big cleanup of
  the debug configuration option and code by Amy Griffis
daniel
2009-06-26 15:08:04 +00:00
Daniel Veillard
b052424c0d * src/node_device.c src/node_device_hal.h src/node_device_hal_linux.c:
fix bogus WWN in NPIV support, patch by David Allan
daniel
2009-06-26 14:09:01 +00:00
Daniel Veillard
4c4ea03d7a fix reading of storage pool definitions at startup
* src/storage_conf.c: fix reading of storage pool definitions at startup
  patch by Cole Robinson
daniel
2009-06-25 15:13:25 +00:00
Daniel Veillard
9e0809911c fix UML driver logging macros
* src/uml_driver.c: fix UML driver logging macros, patch by Amy Griffis
* AUTHORS: adding Amy Griffis
Daniel
2009-06-25 15:02:10 +00:00
Daniel Veillard
cc7499dd03 * src/node_device_conf.c: fix a leak, patch by Dave Allan
daniel
2009-06-25 14:51:21 +00:00
Daniel Veillard
d45242c616 Fix a couple of state problems
* src/qemu_driver.c: fix a domain state problem after
  migration, patch  by Federico Simoncelli, fixes #507537
* src/domain_conf.c:  fix a transcient domain state problem after
  destroy, patch  by Federico Simoncelli, fixes #507304
* AUTHORS: add Federico Simoncelli and Javier Fontan
daniel
2009-06-25 13:55:58 +00:00
Daniel P. Berrange
73f34b31f5 Fix broken dominfo command when no security driver is implemented 2009-06-25 09:37:22 +00:00
Daniel Veillard
b547201561 Finish the integration of OpenNebula driver
* configure.in libvirt.spec.in src/Makefile.am
  src/opennebula/one_client.[ch] src/opennebula/one_conf.h
  src/opennebula/one_driver.[ch] : Finish the integration of OpenNebula,
  avoid dependancy on OpenNebula libraries, require xmlrpc-c-devel
  and build it by default, based on patch by Javier Fontan and DanB
  suggestions
Daniel
2009-06-24 17:32:56 +00:00
Daniel Veillard
31bd8cb6d0 * src/opennebula/one_conf.c src/opennebula/one_driver.c: fix One
driver compilation issues, patch by Javier Fontan and remove
  some tabs in format strings
daniel
2009-06-24 16:17:10 +00:00
Cole Robinson
2fa4a8b991 Fix storage handling for custom test driver.
If using a custom test driver, storage pool file parsing was broken, and
storage volume parsing was never implemented. Fix these issues, and add
some examples in docs/
2009-06-22 17:19:30 +00:00
Cole Robinson
3f305eb1e9 Refactor storage XML parsing to be consistent with domain/network conf.
The storage driver arranges its parsing routines in a way that make them
difficult to use in the test driver for non-default file parsing. This
refactoring moves things to be consistent with the way domain_conf and
network_conf do things.
2009-06-22 16:41:34 +00:00
Cole Robinson
5de555cae2 Activate virtual networks initialized in custom test driver.
If specifying a custom test driver, virtual networks were not 'activated'
on driver init. This differs from the behavior of domains and storage pools,
so fix it. Also improve a couple error messages in that area.
2009-06-22 16:39:23 +00:00
Cole Robinson
f7f52b1592 Fix segfault if storage pool has no type attribute (possibly others)
virEnumFromString doesn't check for a NULL string, and will segfault if
passed one. Lots of calling code protects against this, but at least
/pool/@type parsing does not.
2009-06-22 16:37:52 +00:00
Cole Robinson
387935345c Fix memory reporting for inactive domains in the qemu driver.
Currently, 'info' will always report that mem = max mem. Make sure we
actually return the correct mem value.
2009-06-22 16:35:03 +00:00
Cole Robinson
5ea25b7801 Fix raw storage volume creation for allocation < capacity.
CreateXMLFrom changes accidentally caused all raw volume creation to be
fully allocated (as though allocation == capacity). Fix this.

Also force CreateXMLFrom to maintain the previous behavior: sparseness
should still be maintained since we search for holes when copying, and the
clone behavior hasn't been tested with anything but the broken behavior.
2009-06-22 16:33:24 +00:00
Cole Robinson
c1b2aea80c test driver: Fix domain ID after redefining a running VM
The ID of the existing VM was being unconditionally set to -1, which was
upsetting virt-manager.
2009-06-22 16:29:40 +00:00
Daniel Veillard
a06b407fce * src/conf.[ch]: restrict VMX syntax parsing types
daniel
2009-06-22 11:54:49 +00:00
Daniel Veillard
c57932c663 * src/storage_driver.c: cleanup when creating a storage pool fails,
patch by Henrik Persson
Daniel
2009-06-22 10:15:57 +00:00
Daniel Veillard
144276aa1a extend the configuration parser for VMX syntax
* qemud/qemud.c src/conf.c src/conf.h src/qemu_conf.c src/xen_unified.c
  src/xm_internal.c tests/conftest.c tests/xmconfigtest.c: extend
  the configuration parser for VMX syntax, patch by Matthias Bolte
Daniel
2009-06-19 12:34:30 +00:00
Daniel P. Berrange
2be4d86740 Fix remote socket path for SSH tunnel connections 2009-06-18 13:57:40 +00:00
Daniel Veillard
c0b64e9daa fix a module dependency problem
* src/node_device.[ch] src/storage_backend.[ch]: fixes a
  module dependency problem, patch by Dave Allan
Daniel
2009-06-17 08:38:17 +00:00
Cole Robinson
502278d5b2 Allow USB hostdev product to be 0x0000
Product = 0 is a valid value based on this bug report:

https://www.redhat.com/archives/libvir-list/2009-May/msg00368.html

Also, throw a less ambiguous error if vendor = 0.
2009-06-16 18:46:06 +00:00
Cole Robinson
ac75bd1b1e Fix FS volume creation with backing stores.
This regressed when CreateXMLFrom was added: we should only perform the
backing store comparison if an input volume was passed.
2009-06-16 15:47:53 +00:00
Cole Robinson
53603043c7 Set default emulator in domain_conf.*, rather than the driver.
Rather than numerous instances of:

emulator = vm->def->emulator;
if (!emulator)
    emulator = virDomainDefDefaultEmulator(conn, vm->def, driver->caps);
if (!emulator)
    return -1;

Set this value at XML parse time in the domain config, so we can depend on
it for all future emulator accesses. There were unchecked accesses in the
qemu driver that were tripping up on this if no emulator was specified in
the XML, see:

http://www.redhat.com/archives/libvir-list/2008-October/msg00602.html
2009-06-16 15:42:46 +00:00
Cole Robinson
3f63c44d12 Add virCapabilities*EmulatorRequired.
Certain drivers always need an 'emulator' specified in the XML (qemu and lxc
at least). Store this info in capabilities.

We will eventually use this to move default emulator handling out of
drivers and into domain_conf.*
2009-06-16 15:27:33 +00:00
Cole Robinson
659bd66529 Check that '-drive format=' is supported before adding to qemu cmdline.
Qemu < 0.10.0 did not support it, and virt-* tools now try to add this by
default, so it's extra important we ensure the option exists.
2009-06-16 15:17:10 +00:00
Cole Robinson
bfb59c172b Fix qemu command flags fetching
New function qemudParseHelpStr was being called with arguments in the
wrong order, so command flags == kvm_version :/
2009-06-16 14:01:43 +00:00
Daniel P. Berrange
39f775cc05 Add new 'availheap' sysctl variant for ABI changes in Xen 2009-06-16 09:31:19 +00:00
Daniel P. Berrange
c4a6bc4977 Fix build on non-Linux targets 2009-06-15 17:15:54 +00:00
Daniel P. Berrange
7c4ce7eb03 Fix build from tar.gz 2009-06-15 14:59:22 +00:00
Daniel P. Berrange
ae974a2bbf Fix bogus initialization in virFindFileInPath 2009-06-15 11:08:28 +00:00
Daniel P. Berrange
0420a03240 Remove use of getuid()==0 for privilege checks 2009-06-12 13:20:13 +00:00
Daniel P. Berrange
a8b12e4f27 Include OS driver name (if any) in device XML for nodedev driver 2009-06-12 13:12:55 +00:00
Daniel P. Berrange
d2c9fe850b Improve error reporting for virConnectOpen URIs 2009-06-12 12:06:15 +00:00
Daniel P. Berrange
56a46886ad Fix re-detection of transient VMs after libvirtd restart 2009-06-12 11:38:50 +00:00
Daniel Veillard
bf5d6f431e extract serial number from HAL storage backend
* src/node_device_hal.c src/node_device_conf.[ch]: add support
  for serial number in HAL storage backend, patch by Dave Allan
* docs/schemas/nodedev.rng
tests/nodedevschemadata/storage_serial_3600c0ff000d7a2a5d463ff4902000000.xml:
  update the schemas and add a test case, also by Dave Allan
Daniel
2009-06-11 14:25:19 +00:00
Mark McLoughlin
1fbe229b3c Add qemu help string parsing tests
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-11 14:17:42 +00:00
Mark McLoughlin
04cbe68797 Detect newer qemu-kvm versions
The KVM version string can be one of the following:

  - qemu-kvm-x.y.z in stable releases
  - kvm-XX for kvm versions up to kvm-85
  - qemu-kvm-devel-XX for kvm version kvm-86 and later

There are only a few of places where we need to detect
differences between KVM versions based on 0.9.1:

  1) VNET_HDR introduced in kvm-74

  2) -incoming tcp introduced in kvm-79

  3) -incoming exec introduced in kvm-80

  4) -incoming stdio in all earlier kvm versions

With qemu-kvm-0.10.x, we can now assume that (1) is available
if it's a KVM release, (2) and (3) is always available and
(4) is never available.

So, from now on we should only need to check the qemu version
number and the "is_kvm" flag for detecting feature availability.
We only need the KVM version number for older releases.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-11 14:15:49 +00:00
Mark McLoughlin
56ecebf22d Re-factor qemu version parsing
This patch is purely re-factoring without any functional changes
to make way for the next patch.

The main thing achieved by the refactoring is that we now have
easier access to the parenthesised string that KVM folks seem
to delight in changing.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-11 14:12:30 +00:00
Daniel Veillard
abed6fca87 find and use kvm-img, qemu-img or qcow-create dynamically
* configure.in src/libvirt_private.syms src/storage_backend_fs.c
  src/util.c src/util.h: find and use kvm-img, qemu-img or qcow-create
  dynamically at runtime, patch by Doug Goldstein
* AUTHORS: add Doug Goldstein
Daniel
2009-06-11 13:18:56 +00:00
Daniel Veillard
f969e393a9 Fix a memory error on Xen device removal
* src/xm_internals.c: the memory shrinking on device removal
  didn't copy the right amount of memory, patch by Daniel Berrange
  fixes #497051
daniel
2009-06-04 13:56:49 +00:00
Daniel P. Berrange
3166570f7c Add NUMA memory APIs to vbox driver 2009-06-03 14:32:18 +00:00
Daniel Veillard
e11013d19c * src/network_driver.c: forbid set Autostart on transcient networks
daniel
2009-06-03 13:52:06 +00:00
Daniel P. Berrange
69d4634635 Switch to positional struct initializers in vbox driver table 2009-06-03 13:30:19 +00:00
Daniel P. Berrange
0ca460eada Implement capabilities and nodeinfo APIs 2009-06-03 13:29:23 +00:00
Daniel P. Berrange
b0b968efd5 Generic shared impls of all NUMA apis 2009-06-03 13:28:02 +00:00
Daniel Veillard
3621d42e0f * src/openvz_conf.c src/virsh.c: various typo or english fixups
raised by Runa Bhattacharjee
daniel
2009-06-03 12:13:52 +00:00
Daniel P. Berrange
1b28a99d14 Fix HAL driver restart thread safety 2009-06-03 11:24:21 +00:00
Daniel P. Berrange
c0d74ed43b Support networking in UML driver 2009-06-03 11:13:33 +00:00
Daniel P. Berrange
7cce4768ae Misc User Mode Linux startup/shutdown bugs 2009-06-03 10:55:33 +00:00
Daniel Veillard
81d0ffbc3b NPIV implementation for node device create and destroy
* src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
  src/node_device_hal.[ch] src/node_device_hal_linux.c
  src/qemu_driver.c src/remote_internal.c src/storage_backend.c
  src/virsh.c src/xen_unified.c tests/nodedevxml2xmltest.c
  po/POTFILES.in: implementation for node device create and destroy
  in NPIV support, patch by David Allan
Daniel
2009-06-02 15:12:53 +00:00
Daniel Veillard
66220e3e61 release of libvirt-0.6.4
* configure.in libvirt.spec.in NEWS docs/* po/*: release of
  libvirt-0.6.4
* src/libvirt.c src/virterror.c: some comments cleanups
Daniel
2009-05-29 16:51:15 +00:00
Daniel P. Berrange
8a1a2ac558 Fix Win32 portability problems with 'inteface' symbol clash 2009-05-29 14:29:22 +00:00
Daniel Veillard
43692df590 portability fix
* src/lxc_container.c: fix a portability issue if PR_CAPBSET_DROP is
  not defined.
Daniel
2009-05-29 14:27:04 +00:00
Cole Robinson
b121c7871f network driver: Fix regression defining colliding networks at daemon startup.
If two virtual networks have the same hardcoded bridge device (which
prevents them from being active simultaneously) we still want to define
them at daemon startup, so the user has a fighting chance of correcting
the XML error.

Add an extra flag to SetBridge to avoid reporting an error if there is
a bridge collision, and use this when loading network configs at startup.

This regressed via commit 4c3f3b4d.
2009-05-29 14:18:57 +00:00
Cole Robinson
545c815c4c networkDestroy: Report error if network is inactive
This follows the same convention as domain drivers.
2009-05-29 14:14:32 +00:00
Cole Robinson
34497fdb37 qemu_driver: Fix another domain startup error reporting race.
Parse the command line output a bit earlier so we have a better chance
of reporting the full error output on failure.

I hit this when QEMU would try to boot an invalid kernel (virtinst bug).
2009-05-29 14:12:50 +00:00
Cole Robinson
4ff19ced3a qemuDomainLookupByUUID: print correct UUID string on failed lookup.
Currently we print the raw UUID which isn't very useful in ascii format.
2009-05-29 14:01:55 +00:00
Cole Robinson
58c73c1789 virsh: Use consistent spacing for net-list
There is different spacing when listing active vs. inactive networks. Ex:

Name                 State      Autostart
-----------------------------------------
default              active     yes
xxxxxx               inactive no
2009-05-29 14:00:41 +00:00
Daniel Veillard
525c3d40a9 PPC Qemu Machine Type update
* src/qemu_conf.c docs/schemas/domain.rng
  tests/capabilityschemadata/caps-qemu-kvm.xml: PPC Qemu Machine Type
  changed from g3bw to g3beige some time ago, patch by Thomas Baker
Daniel
2009-05-29 13:32:06 +00:00
Daniel P. Berrange
8c13e4fef0 Fix missing break in network parsing code 2009-05-29 13:26:45 +00:00
Daniel P. Berrange
c31300e69f Fix misc bugs in ARGV -> XML convertor 2009-05-28 13:21:19 +00:00
Daniel P. Berrange
2afc3bfd8b Avoid broken networking with new QEMU/KVM >= 86 2009-05-28 13:15:57 +00:00
Daniel P. Berrange
ee8553e156 Fix misc syntax problems with open nebula driver 2009-05-28 13:11:22 +00:00
Daniel P. Berrange
dcd9865385 Include function/line nr at all logging levels 2009-05-28 12:54:07 +00:00
Daniel P. Berrange
fb828ed21d Fix error location logging 2009-05-27 12:10:47 +00:00
Daniel Veillard
b811851b8d Include the OpenNebula driver
* src/opennebula/one_conf.[ch] src/opennebula/one_driver.[ch]:
  the OpenNebula driver
* configure.in include/libvirt/virterror.h qemud/Makefile.am
  qemud/qemud.c src/Makefile.am src/domain_conf.[ch] src/driver.h
  src/libvirt.c src/virterror.c: integration of the OpenNebula
  driver in the libvirt infrastructure
* AUTHORS: add Abel Miguez Rodriguez
daniel
2009-05-25 11:56:00 +00:00
Daniel P. Berrange
3d4a0ccbc6 QEMU domain XML conversion from QEMU argv 2009-05-21 14:16:55 +00:00
Daniel P. Berrange
7828b5ccb0 Fix typo s/ES97/AC97/ 2009-05-21 14:16:06 +00:00
Daniel P. Berrange
d8dbd61107 Basic domain XML conversions for Xen/QEMU drivers 2009-05-21 14:14:01 +00:00
Daniel P. Berrange
60d4777190 Remote protocol support for domain XML conversion APIs 2009-05-21 13:50:56 +00:00
Daniel P. Berrange
4d5383fd36 public API for domain XML conversions 2009-05-21 13:46:35 +00:00
Daniel Veillard
73bc011483 Add the Interface config APIs
* configure.in include/libvirt/libvirt.h[.in]
  include/libvirt/virterror.h qemud/remote.c
  qemud/remote_dispatch_args.h qemud/remote_dispatch_prototypes.h
  qemud/remote_dispatch_ret.h qemud/remote_dispatch_table.h
  qemud/remote_protocol.[chx] src/Makefile.am src/datatypes.c
  src/datatypes.h src/driver.h src/libvirt.c src/remote_internal.c
  src/virterror.c src/libvirt_private.syms src/libvirt_public.syms:
  Add the Interface config APIs and remote stubs for those, patch
  by Laine Stump
* AUTHORS: add Laine
daniel
2009-05-20 14:26:49 +00:00
Daniel Veillard
e8da987570 cleanup of some direct stderr logging
* qemud/qemud.c src/console.c src/network_driver.c
  src/node_device_conf.c src/node_device_hal.c src/storage_conf.c
  src/util.c: cleanup of some direct stderr logging
daniel
2009-05-20 13:37:30 +00:00
Daniel Veillard
d879d360eb * src/pci.c: small portability patch
daniel
2009-05-20 13:34:15 +00:00
Daniel Veillard
6a140adb78 * src/lxc_driver.c: fix a couple of error code, patch by Amy Griffis
daniel
2009-05-20 07:12:00 +00:00
Cole Robinson
2d1de285b3 VolumeCreateXMLFrom FS storage backend implementation.
Add an extra 'inputvol' parameter to the file volume building routines. This
allows us to easily reuse the duplicate functionality.
2009-05-19 13:43:48 +00:00
Cole Robinson
4aa0959d60 Storage driver implementation for CreateXMLFrom
There is some funkiness here, since we are either dealing with 2 different
pools (which means validation x 2) or the same pool, where we have to be
careful not to deadlock.
2009-05-19 13:37:51 +00:00
Cole Robinson
5f99a7fd23 Fix node device media insert/eject detection.
We were correctly registering a callback , but weren't telling hal to
actually notify us of any property changes.
2009-05-19 13:35:57 +00:00
Cole Robinson
6244c173ba Fix a possible deadlock in HAL nodedev driver.
The cap_lost and prop_modified callbacks could deadlock if an existing
device needed to be refreshed, since dev_create expects the driver to
be unlocked.
2009-05-19 13:26:14 +00:00
Cole Robinson
adf4384501 Use virAsprintf, rather than VIR_ALLOC + strcpy + strcat 2009-05-19 13:15:50 +00:00
Cole Robinson
bb175dfc53 Don't validate disk type in virsh attach-disk
Let the underlying driver tell us what it supports. At the moment
we are at least erroneously denying floppy eject/insert.
2009-05-19 13:04:46 +00:00
Daniel P. Berrange
de658ab4e4 Fix misc locking bugs identified by lock checker 2009-05-19 11:06:25 +00:00
Daniel P. Berrange
6962a2dd7e Added an optional OCaml+CIL test program for mutex lock validation 2009-05-19 10:17:17 +00:00
Daniel P. Berrange
3ce55d22e4 Declare support for QEMU migration in capabilities 2009-05-18 15:10:51 +00:00
Daniel Veillard
67cc35ade9 Finish hostonly networks support in vbox
* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: last patch for
  hostonly networks support in vbox driver, patch by Pritesh Kothari
daniel
2009-05-15 14:00:50 +00:00
Daniel Veillard
37623bf49a * src/vbox/vbox_tmpl.c: implement vbox vrdp/sdl/gui support,
patches by Pritesh Kothari
daniel
2009-05-15 13:45:40 +00:00
Daniel Veillard
cd223d93da generic support for RDP and desktop graphic extensions
* docs/schemas/domain.rng src/domain_conf.[ch] src/qemu_driver.c:
  extend the generic code for the RDP and desktop extensions of
  the graphic tag needed for vbox, patch by Pritesh Kothari
Daniel
2009-05-15 09:43:51 +00:00
Daniel Veillard
fa1ceca232 * src/xend_internal.c: remove [] around cpumaps for recent xend
patch by Tatsuro Enokura
daniel
2009-05-14 10:31:11 +00:00
Cole Robinson
ee0d7552e2 Fix a few 'used uninitialized' warnings. 2009-05-13 17:43:47 +00:00
Daniel Veillard
7afe94e7e2 * src/buf.c: avoid an XML attribute escaping bug #499791
daniel
2009-05-13 16:19:59 +00:00
Daniel P. Berrange
0d11a25e6d Replace sys/capability.h with linux/capability.h 2009-05-13 11:37:16 +00:00
Cole Robinson
be9e5185b4 Break out FS volume build routines to their own functions.
Improves readability, particularly wrt the pending CreateFromXML changes.
This will also help implementing File->Block volume creation in the future,
since some of this code will need to be moved to a backend agnostic file.
2009-05-12 20:27:17 +00:00
Cole Robinson
6852c88fc7 Virsh commands vol-clone and vol-create-from
vol-clone is a convenience function, requiring only a volume to clone and a
new name.

vol-create-from is a direct mapping to the public API, which allows cloning
across pools, converting between formats, etc, but requires an xml file to be
passed
2009-05-12 20:17:21 +00:00
Cole Robinson
3804161eb6 Test driver implementation of virStorageVolCreateXMLFrom 2009-05-12 20:15:56 +00:00
Cole Robinson
885de7f8cf Remote driver plumbing for virStorageVolCreateXMLFrom 2009-05-12 20:13:52 +00:00
Cole Robinson
5b31c7d08a Add public API stubs for virStorageVolCreateXMLFrom
Also checkin regenerated docs due to API change.
2009-05-12 20:10:50 +00:00
Cole Robinson
52c5f7adc8 Fix error squashing when refreshing file volumes 2009-05-12 19:59:46 +00:00
Daniel P. Berrange
1a60d6bcd6 Improve driver open URI handling 2009-05-12 15:35:18 +00:00
Daniel Veillard
e978774ec6 * src/network_driver.c: enable bridges which are not up
without an IP address, patch by Ludwig Nussel
Daniel
2009-05-12 15:31:22 +00:00
Daniel P. Berrange
6582d5872d Make hash destructors call internal unref methods to free objects 2009-05-11 15:27:37 +00:00
Daniel P. Berrange
65ecb4b434 Fix unused variable warning in LXC driver 2009-05-11 15:26:23 +00:00
Daniel P. Berrange
426f9772b8 Fix QEMU ARGV detection with kvm >= 85 2009-05-11 15:14:24 +00:00
Daniel P. Berrange
9927ca6274 Report detailed error if initial connection open attempt fails 2009-05-11 14:55:52 +00:00
Daniel Veillard
9959a1dd9d drop CAP_SYS_BOOT capability from LXC containers
* src/lxc_container.c: drop LXC CAP_SYS_BOOT capability to avoid
  reboot from inside containers, patch by Ryota Ozaki
Daniel
2009-05-11 14:05:27 +00:00
Cole Robinson
0c8a9d2d51 Check that QEMU is still alive while reading startup output.
By checking the pid every retry period, we can quickly determine if
the process crashed at startup, rather than make the user wait for
the entire timeout (3 seconds).
2009-05-11 13:52:31 +00:00
Cole Robinson
a331653dad Add pidfile argument to __virExec
virExec will write out the pid of the daemonized process only. Use this
in the QEMU driver, rather than QEMU's pidfile, so we can catch errors we
might miss if the emulator bails early.
2009-05-11 13:50:38 +00:00
Cole Robinson
27d72bd517 Report qemu log data if we fail to daemonize the process.
This ensures the user will actually see 'hook' function error output.
2009-05-11 13:37:19 +00:00
Cole Robinson
79d9d2432f Add helper function virExecDaemonize
Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate
process to ensure we don't end up with any zombies, and differentiates between
original process errors and intermediate process errors.
2009-05-11 13:34:37 +00:00
Daniel Veillard
2e878906e4 "Host only" and "Internal" network support for vbox
* src/vbox/vbox_tmpl.c: "Host only" and "Internal" network support
  for vbox, patch by Pritesh Kothari
daniel
2009-05-11 09:56:04 +00:00
Daniel Veillard
070c1c82b0 Support for 'internal' network
* src/domain_conf.[ch] docs/schemas/domain.rng: add support
  for internal network in the generic part of the code, and
  update the Relax-NG grammar accordingly, patch by Pritesh Kothari
daniel
2009-05-11 09:50:27 +00:00
Daniel P. Berrange
b81c7c0892 Create cgroups mode 755, not 655 (Ryota Ozaki) 2009-05-08 10:24:11 +00:00
Daniel P. Berrange
328eac61cd Fix /dev/ population to use char devices (Ryota Ozaki) 2009-05-08 10:22:46 +00:00
Guido Günther
6059354da6 return VIR_DRV_OPEN_DECLINED instead of VIR_DRV_OPEN_ERROR when vbox can't be
found so other hypervisors can be probed. Patch by Pritesh Kothari.
2009-05-08 10:18:26 +00:00
Guido Günther
67e2804ecb fix crash when init fails early (i.e. due to vbox not being installed) 2009-05-08 10:14:30 +00:00
Daniel P. Berrange
54ebbde1e1 Improve name & UUID uniqueness checking in QEMU driver 2009-05-08 10:11:14 +00:00
Daniel P. Berrange
88e22e4e8c Enable save/restore/migrate for QEMU >= 0.10.0 2009-05-08 10:07:15 +00:00
Daniel P. Berrange
0fb9066aaf Log dlopen() errors more verbosely 2009-05-08 10:05:56 +00:00
Daniel P. Berrange
7022759b7e Add new VIR_ERR_OPERATION_INVALID error code & use it in Xen & QEMU drivers 2009-05-08 09:58:46 +00:00
Guido Günther
1dfc35677e check for NULL pointers in pidfile functions 2009-05-07 07:29:51 +00:00
Daniel Veillard
7ee54d8356 Changes needed for multiple graphics adapters
* src/domain_conf.c src/domain_conf.h: parse and save multiple
  graphics elements instead of one, patch by Pritesh Kothari
* src/qemu_conf.c src/qemu_driver.c: adapt the qemu/kvm driver for
  the new structures, patch by Pritesh Kothari
* src/xend_internal.c src/xm_internal.c: same thing for Xen drivers
Daniel
2009-05-07 07:27:49 +00:00
Guido Günther
9f9ce6130d don't crash when called without arguments 2009-05-07 07:17:25 +00:00
Mark McLoughlin
1d6c713b18 Fix qemu driver's interpretation of <hostdev managed='yes'/>
This change:

  Tue Mar  3 08:55:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>

       Don't try to detach & reset PCI devices while running test
       suite for XML-> ARGV conversion.
       * src/qemu_driver.c: Add qemuPrepareHostDevices() helper to
       detach and reset PCI devices.
       * src/qemu_conf.c: Don't detach & reset PCI devices while
       building the command line argv

accidentally did this:

-            if (hostdev->managed) {
+        if (!hostdev->managed) {

Which results in managed='yes' not causing the device to be
detached when the guest is starting.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-06 15:56:20 +00:00
Cole Robinson
4f10759024 Refresh QEMU driver capabilities for each getCapabilities call.
Also fix up a couple issues where caps are accessed without locking
the driver structure.
2009-05-06 14:20:34 +00:00
Daniel Veillard
5432ec8ded VirtualBox version improvement and cleanups
* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: changes in
  VirtualBox driver version detection and move informations
  from a global variable into a driver structure, patch by Pritesh
  Kothari.
Daniel
2009-05-06 13:51:19 +00:00
Daniel Veillard
9ccdbb5d61 * src/vbox/vbox_XPCOMCGlue.[ch]: improve VirtualBox path detection
patch by Pritesh Kothari
Daniel
2009-05-06 13:23:44 +00:00
Cole Robinson
840955ff7c Don't throw away StartVM errors when migrating/restoring in qemu driver. 2009-05-05 14:26:02 +00:00
Cole Robinson
03f3736511 Small cleanups in test driver VolCreateXML 2009-05-05 14:19:59 +00:00
Cole Robinson
2a9ca74164 Remove some debug code from storage_driver.c 2009-05-05 14:18:51 +00:00
Cole Robinson
48e9d6862a Use proper error code in virStorageVolCreateXML 2009-05-05 14:17:50 +00:00
Cole Robinson
3f24e6c21c Fix a comment typo in storage_backend_fs.c 2009-05-04 15:44:44 +00:00
Cole Robinson
5314dffc85 virExec: Delay daemonizing as long as possible.
This way the caller can catch more errors (e.g. from a hook callback) from
the intermediate process.
2009-05-04 15:43:25 +00:00
Cole Robinson
a4d0a3fd50 Add some documentation to __virExec and virExec 2009-05-04 15:41:46 +00:00
Daniel P. Berrange
cb4a6614fa Fix check for -Wformat-security which depends on -Wformat 2009-04-28 10:55:45 +00:00
Daniel Veillard
9cae1d5ed6 release of 0.6.3
* NEWS configure.in libvirt.spec.in docs/*: release of 0.6.3
* po/*: regenerated
* src/libvirt.c src/virterror.c: fixed some function comments
Daniel
2009-04-24 14:04:54 +00:00
Daniel P. Berrange
62aa1b56d6 Add virNodeDeviceCreateXML / virNodeDeviceDestroy boilerplate public API and remote protocol impl 2009-04-24 13:11:23 +00:00
Daniel P. Berrange
1aac8114ae Fix Xen dlopen module missing export 2009-04-24 12:19:00 +00:00
Daniel P. Berrange
1fbee8dadf Fix XM driver VIF config creation 2009-04-24 12:17:50 +00:00
Daniel P. Berrange
d83ded2dba Avoid compile warnings about assignment/conditional/truthvalue 2009-04-22 14:28:25 +00:00
Daniel P. Berrange
220bcb0535 Use a private /dev/pts instance in containers if kernel is new enough 2009-04-22 14:26:50 +00:00
Daniel P. Berrange
9c19a898f9 Remove stale QEMU pidfiles 2009-04-21 19:14:50 +00:00
Daniel P. Berrange
7a367cca30 Ensure VirtualBox domain IDs start from 1 instead of 0 2009-04-21 19:13:23 +00:00
Daniel Veillard
4c3f3b4d46 * src/network_conf.c src/network_conf.h: add dynamic bridge names
support, patch by Soren Hansen
* AUTHORS: add Soren
daniel
2009-04-21 19:00:06 +00:00
Daniel Veillard
ec4e379125 * src/xend_internal.c: let xend try vcpu pinning operation even
if the domain is not running, patch by Takahashi Tomohiro
daniel
2009-04-21 15:10:23 +00:00
Daniel Veillard
5237c2b847 * docs/drvvbox.html[.in]: tiny fixes to VirtualBox docs
Daniel
2009-04-21 13:39:40 +00:00
Daniel Veillard
bfc48afa14 cope with kernels where CLONE_NEWUSER is not supported
* src/lxc_container.c src/lxc_container.h: cope with kernels
  where CLONE_NEWUSER is not supported, patch by Serge Hallyn
daniel
2009-04-20 12:27:12 +00:00
Daniel Veillard
943a2f2b60 * src/bridge.c: fix a compilation breakage raised by Anton Protopopov
daniel
2009-04-20 09:18:26 +00:00
Daniel P. Berrange
89626e8d69 Add another vbox file to EXTRA_DIST 2009-04-19 16:36:22 +00:00
Daniel P. Berrange
ac6797b28c Add missing break in error code 2009-04-19 15:49:00 +00:00
Daniel P. Berrange
cfa30de3b8 Improve error reporting for lookup failures on inactive domains 2009-04-19 15:30:50 +00:00
Daniel P. Berrange
c881b32215 Fix 2 domain ID handling bugs in remote driver 2009-04-19 15:21:54 +00:00
Daniel P. Berrange
cb43623acd Switch over todo domain lookup based on UUID in virDomainAssignDef 2009-04-19 15:16:43 +00:00
Daniel P. Berrange
001390a684 Add 2 missing vbox files to EXTRA_DIST 2009-04-19 15:12:01 +00:00
Daniel P. Berrange
9a15c48d2d Switch to using virDomainDefPtr for building command line in QEMU driver 2009-04-19 14:50:01 +00:00
Daniel Veillard
2cd9b2d8ee drop the pool lock when allocating fs volumes
* src/libvirt_private.syms src/storage_backend.h
  src/storage_backend_fs.c src/storage_conf.h src/storage_driver.c:
  drop the pool lock when allocating fs volumes, patch by Cole Robinson
daniel
2009-04-17 19:12:37 +00:00
Daniel Veillard
10d1650843 integration of the VirtualBox support
* configure.in include/libvirt/virterror.h src/Makefile.am
  src/domain_conf.[ch] src/driver.h src/virterror.c src/vbox/README
  src/vbox/vbox_CAPI_v2_2.h src/vbox/vbox_V2_2.c
  src/vbox/vbox_XPCOMCGlue.[ch] src/vbox/vbox_driver.[ch]
  src/vbox/vbox_tmpl.c: integration of the VirtualBox support
  patches by Pritesh Kothari
Daniel
2009-04-17 16:09:07 +00:00
Daniel Veillard
81e6a22192 Small doc fixes
* src/libvirt.c: fix the doc of virNodeGetFreeMemory to say bytes
* docs/drvlxc.html.in docs/drvlxc.html: fix command used in examples
daniel
2009-04-17 15:34:53 +00:00
Guido Günther
5caa1e0eb0 Don't log monitor output to domain log file.
It's logged via the logging system already. Prefix monitor debug output with vm
name.
2009-04-16 15:56:27 +00:00
Mark McLoughlin
9fa79000ec qemu -drive takes format= not fmt=
Seems like a simple typo - it has been "format=" since the flag
was introduced, but we added it as "fmt=".

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-04-16 14:21:35 +00:00
Mark McLoughlin
169afbe9aa Fix lxc syntax-check failure
Fixes:

 CHECK: avoid_if_before_free
 src/lxc_container.c: if (oldroot) VIR_FREE(oldroot)
 src/lxc_container.c: if (newroot) VIR_FREE(newroot)
 Makefile.maint: found useless "if" before "free" above

and:

 src/lxc_container.c:317:
 Makefile.maint: found trailing blank(s)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-04-16 13:08:03 +00:00
Daniel Veillard
f61208bde9 * src/virsh.c: fix for virsh ttyconsole return value bug #495954
daniel
2009-04-15 20:09:09 +00:00
Daniel Veillard
14687aad81 * src/xm_internal.c: fix a crash on vcpupin to inactive Xen domains,
as raised by Takahashi Tomohiro
daniel
2009-04-15 09:53:34 +00:00
Daniel Veillard
cab9eed62e * src/lxc_driver.c: adds the getHostname method to the lxc driver
patch by Dan Smith
daniel
2009-04-15 09:34:56 +00:00
Dan Smith
06e43a8f2c Commit patches by Serge Hallyn from 6-Apr and 7-Apr 2009-04-14 17:51:12 +00:00
Daniel Veillard
b2df3510b7 * src/storage_backend_scsi.[ch]: add SCSI storage rescan support,
patch by David Allan
daniel
2009-04-07 12:50:17 +00:00
Cole Robinson
6d910c9fd4 Don't lose file format info on volume refresh. 2009-04-03 14:17:57 +00:00
Cole Robinson
766b2250e1 Refresh volume alloc/capacity when dumping XML. 2009-04-03 14:15:30 +00:00
Cole Robinson
a843f44c51 Fix test driver domain restore return value. 2009-04-03 14:14:05 +00:00
Cole Robinson
e807e4d9e9 Fix sparse volume allocation reporting. 2009-04-03 14:13:02 +00:00
Daniel P. Berrange
9ec1a56923 Fix crash in svirt verification, and incorrect cleanup in VM failure paths 2009-04-03 14:10:17 +00:00
Daniel P. Berrange
f0817018b1 Allow autoconnect to virsh console in create/start. Refuse to connect to remote consoles 2009-04-03 14:03:38 +00:00
Daniel P. Berrange
92ff72b52c Misc NUMA related fixes 2009-04-03 12:45:05 +00:00
Daniel P. Berrange
e4073623a6 Support PCI passthrough for Xen 2009-04-03 12:38:52 +00:00
Daniel P. Berrange
11b0ed46c5 Improve security label error reporting & verification (Dan Walsh) 2009-04-03 10:55:51 +00:00
Daniel P. Berrange
d9ec9c6937 Fix mingw32 portability 2009-04-02 18:42:33 +00:00
Daniel P. Berrange
55ae53d971 SCSI HBA storage pool implementation (Dave Allan) 2009-04-01 16:03:22 +00:00
Daniel P. Berrange
b02c0455d1 Fix localtime handling for newer XenD 2009-04-01 10:36:52 +00:00
Daniel P. Berrange
e4c65831e3 Misc fixes uncovered by OOM testing 2009-04-01 10:31:01 +00:00
Daniel P. Berrange
dab6391f2d Sanitize symlink resolution 2009-04-01 10:26:22 +00:00
Daniel P. Berrange
9a47149559 Fix misc memory handling bugs 2009-04-01 10:21:34 +00:00
Daniel P. Berrange
83a618f807 Add support for vifname= in XM config files 2009-04-01 10:16:05 +00:00
Daniel P. Berrange
3ad8a273b5 Improve error reporting in Xen driver SEXPR generation 2009-04-01 10:01:23 +00:00
Daniel P. Berrange
b2f5ba21b8 Fix error message in node device lookup 2009-04-01 09:55:32 +00:00
Daniel P. Berrange
461afc2200 Fix URI check in QEMU migration 2009-04-01 09:54:20 +00:00
Daniel P. Berrange
45707d5631 Add treeview to node device listing in virsh 2009-04-01 09:52:59 +00:00
Chris Lalancette
4d3d0039e5 Convert all drivers to use old-style struct initializers; this makes a handy
built-in TODO list for each driver.  Also rip out the internal getURI method;
it is never used by any of the drivers, and was buggy to boot.
2009-03-31 15:47:16 +00:00
Daniel Veillard
b7071653fa * src/util.c: fix virRun() to prevent zombies on pipe errors,
patch by Ryota Ozaki
daniel
2009-03-31 12:26:54 +00:00
Daniel P. Berrange
3b97f7db53 DOn't try to query memory balloon if guest isn't active 2009-03-27 14:57:51 +00:00
Daniel P. Berrange
cb7593bd19 Support memory ballooning in QEMU 2009-03-27 11:44:29 +00:00
Daniel P. Berrange
97230f6a35 Default to native arch, and check domain type when auto-filling guest arch (Soren Hansen) 2009-03-24 11:16:29 +00:00
Daniel P. Berrange
60623a7ce0 Add support for a non-template filesystem root. (Florian Vichot) 2009-03-24 10:59:13 +00:00
Daniel Veillard
aac6018a35 fix missing authentication on virsh shell commands
* src/virsh.c: fix missing authentication when command are issued
  from the shell, patch by Matthias Bolte
Daniel
2009-03-23 16:36:32 +00:00
Daniel Veillard
de4950b200 * src/util.c: flag unused parameters, by Maximilian Wilhelm
daniel
2009-03-20 20:46:07 +00:00
Daniel Veillard
c29d092905 use posix_fallocate() to allocate diskspace faster
* src/libvirt_private.syms src/storage_backend_fs.c src/util.c
  src/util.h: use posix_fallocate() on supported systems to
  allocate diskspace faster, patches by Amit Shah
Daniel
2009-03-20 12:17:56 +00:00
Daniel P. Berrange
b75a469852 More flexible setup of QEMU capabilities/emulators 2009-03-20 11:20:26 +00:00
Daniel P. Berrange
c86afc85ee Fix labelling of shared/readonly devices (Dan Walsh) 2009-03-17 11:35:40 +00:00
Daniel Veillard
df59fdce06 * src/remote_internal.c: remove file descriptors leak
daniel
2009-03-17 11:00:56 +00:00
Cole Robinson
b68a19be0f Don't allow readonly connections to dump secure xml. 2009-03-16 17:21:12 +00:00
Cole Robinson
2068f2f5a3 Initialize security driver after config parsing 2009-03-16 17:16:04 +00:00
Cole Robinson
d2c77e06c7 Fix test driver 'save' deadlock 2009-03-16 17:14:34 +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
35625e5aa8 Fix subsystem lookup for older HAL releases 2009-03-16 10:56:01 +00:00
Daniel Veillard
aa08419ca8 Avoid some potential FILE * leaks
* qemud/qemud.c src/cgroup.c src/uml_driver.c src/util.c: close
  some potential FILE * leaks
Daniel
2009-03-16 10:41:37 +00:00
Daniel P. Berrange
2567fac4a7 Don't free storage volume in cleanup path, since it may still be referenced 2009-03-16 10:31:38 +00:00
Daniel P. Berrange
aad6873175 Don't try to close NULL virConnectPtr object 2009-03-16 10:30:04 +00:00
Daniel Veillard
a3262d812b * src/storage_conf.c: fix storage pool mode parsing, and refactoring
patch by Ryota Ozaki
Daniel
2009-03-12 20:15:32 +00:00
Daniel Veillard
bdd6894713 * src/xs_internal.c: fix xen events handling problem (Dan Berrange)
Daniel
2009-03-11 13:43:24 +00:00
Daniel Veillard
27a63a76af * src/xend_internal.c: fix an allocation problem in xenDaemonDomainLookupByName_ids
Daniel
2009-03-10 11:13:32 +00:00
Daniel P. Berrange
4dfb7e8b2e Fix Xen block detach with newer Xend (Cole RobinSon / Tomohiro Takahashi) 2009-03-10 10:32:24 +00:00
Daniel Veillard
7f39e2e5e5 * src/cgroup.c src/cgroup.h src/lxc_driver.c: allows to get
CPU usage of a lxc using cpuacct subsystem of cgroups, patch
  by Ryota Ozaki
Daniel
2009-03-06 14:44:04 +00:00
Daniel P. Berrange
4ebe4c108d Fix misc failures in test suite & make test cases more robust to future changes 2009-03-04 13:04:06 +00:00
Daniel P. Berrange
b9739b4709 Add missing locking calls in remote driver 2009-03-03 19:33:34 +00:00
Daniel P. Berrange
3aed672836 Use lseek+saferead/write for pci.c & dont link to qemu driver for nodedevxml2xmltest 2009-03-03 17:00:18 +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
Jim Meyering
efa5832b0a config: fix a typo
* src/qemu_conf.c (CHECK_TYPE): Fix typo:
s/security_river/security_driver/
2009-03-03 15:12:30 +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
Jim Meyering
10e3148f0a avoid file descriptor leak when fd == 0
* src/pci.c (pciGetDevice): Initialize dev->fd to -1, not 0.
(pciFreeDevice): Close fd also when it is 0.
2009-03-03 11:25:52 +00:00
Jim Meyering
8343dcb893 don't leak a file descriptor on failed pciGetDevice call
* src/pci.c (pciIterDevices): Always close dir handle.
2009-03-03 11:25:35 +00:00
Daniel P. Berrange
41ed6eb327 SELinux security driver for sVirt support (James Morris, Dan Walsh & Daniel Berrange) 2009-03-03 10:06:49 +00:00
Daniel P. Berrange
aa2c97263d virsh additions for sVirt support (James Morris & Dan Walsh) 2009-03-03 09:59:02 +00:00
Daniel P. Berrange
8bd1604cb7 Core internal driver stub for sVirt support (Jams Morris & Dan Walsh) 2009-03-03 09:44:41 +00:00
Daniel P. Berrange
a8cd24b346 Remote protocol / RPC API for sVirt support (James Morris & Dan Walsh) 2009-03-03 09:27:02 +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
0b7860ecdd Public API for sVirt support (James Morris & Dan Walsh) 2009-03-03 09:09:00 +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
Daniel P. Berrange
72652e9dbb Always reset PCI devices 2009-03-02 20:22:35 +00:00
Daniel P. Berrange
644b41a94d Export virUnrefConnect & virCapabilitiesGenerateMac to driver code 2009-03-02 20:19:13 +00:00
Jim Meyering
9883bec50d virsh: tweak a format string to avoid emitting trailing space
* src/virsh.c (cmdNetworkList): Change format not to right-pad
with spaces, as that would have required a trailing blank in
an expected output file.
2009-03-02 18:39:36 +00:00
Cole Robinson
aedf57db70 Fix bridge generation loop counter (spotted by Jim Meyering) 2009-03-02 17:56:50 +00:00
Cole Robinson
f9cbf065ad Recognize ejectable media in hostdev hal driver. 2009-03-02 17:41:13 +00:00
Cole Robinson
4837725f37 Better error reporting from qemu AttachDevice 2009-03-02 17:39:43 +00:00
Cole Robinson
1f11e3bb61 Generate network bridge names if none passed at define/create time. 2009-03-02 17:37:03 +00:00
Cole Robinson
adecc8fc9e Remove redundant monitor watch variable (s/monitor_watch/monitorWatch/) 2009-03-02 17:33:39 +00:00
Cole Robinson
895247b76b Mark 'defined' networks as persistent. 2009-03-02 17:29:44 +00:00
Daniel Veillard
09fb8845a7 adds a new <hostdev managed='(yes|no)'> property to host devices in domains
* docs/schemas/domain.rng src/domain_conf.c src/domain_conf.h
  src/qemu_conf.c
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml:
  adds a new <hostdev managed='(yes|no)'> property
  to host devices indicating whether or not we should
  automatically dettach/reset, patch by Mark McLoughlin
daniel
2009-03-02 16:40:30 +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
0231102863 Implement node attach/reattach/reset in the remote driver
* qemud/remote.c qemud/remote_dispatch_args.h
  qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_table.h
  qemud/remote_protocol.c qemud/remote_protocol.h
  qemud/remote_protocol.x src/remote_internal.c: Implement
  attach/reattach/reset in the remote driver, patch by Mark
  McLoughlin.
Daniel
2009-03-02 16:30:59 +00:00
Daniel Veillard
6427091ffe * src/virsh.c: add 3 new commands for node device detach, reattach and reset,
patch by Mark McLoughlin.
Daniel
2009-03-02 16:28:17 +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
Daniel Veillard
d217641314 implements dettach, reattach and reset for PCI devices
* configure.in po/POTFILES.in src/Makefile.am src/libvirt_private.syms
  src/pci.c src/pci.h: Add implementations of dettach, reattach and
  reset for PCI devices, patch by Mark McLoughlin
Daniel
2009-03-02 16:18:11 +00:00
Daniel Veillard
a3ce3b1c71 * qemud/qemud.c src/node_device_hal.c: activate DBus multithreading
to avoid random crashes in the daemon, patch by Daniel Berrange
Daniel
2009-03-02 11:13:37 +00:00
Jim Meyering
14dfe93965 correct a typo in a diagnostic
* src/storage_conf.c (virStorageVolDefParsePerms): Correct a typo:
s/owner/group/.  Patch by Ryota Ozaki.
2009-03-02 10:27:20 +00:00
Jim Meyering
0fe3340ed9 plug two config-parsing leaks
* src/storage_conf.c (virStoragePoolDefParsePerms): Free mode string.
(virStorageVolDefParsePerms): Likewise.
* AUTHORS: Update.
Patch by Ryota Ozaki.
2009-03-02 10:26:37 +00:00
Jim Meyering
07696eb347 don't dereference uninitialized pointer
* src/storage_conf.c (virStoragePoolDefParsePerms): Initialize
"ptr" to NULL.
2009-03-02 10:07:55 +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
Daniel P. Berrange
2e187bcbca Add support for a exec callback in virExecWithHook 2009-02-26 16:27:51 +00:00
Daniel Veillard
372d5b3088 * src/remote_internal.c: fix autostart of session daemon, patch
by Dan Berrange
Daniel
2009-02-26 15:06:06 +00:00
Daniel Veillard
299aefebf2 * src/storage_backend_fs.c: fix compile-error when configured without qemu-img
daniel
2009-02-26 14:36:30 +00:00
Mark McLoughlin
c4c5e9dbbb Add virNodeDeviceDefParseString()
Add support for parsing node device XML descriptions.

This will be used by PCI passthrough related functions to
obtain the PCI device address for a given node device.
2009-02-24 14:55:45 +00:00
Mark McLoughlin
ee197521c5 Add virXPathULongLong()
Add a variant of virXPathULong() which can handle long longs.

Needed for parsing storage device capacities.
2009-02-24 14:54:30 +00:00
Mark McLoughlin
c56b4bcbf3 Add virXPathLongHex() and virXPathULongHex()
Add new functions to allow parsing integers with base 16

This will be used to e.g. parse PCI vendor IDs.
2009-02-24 14:53:30 +00:00
Mark McLoughlin
761f5a52dc networkEnableIpForwarding() now returns zero for success 2009-02-22 11:19:54 +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
Jim Meyering
73619269ae Build fix for 'driver.c' when building with loadable modules
The 'asprintf' -> 'virAsprintf' transition made in
[043d702f] "use virAsprintf instead of asprintf" introducted
a build error for 'driver.c' as 'util.h' has to be included.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2009-02-17 10:43:26 +00:00
Jim Meyering
64b72210ad Work around 'virGetVersion' build problem
The 'getVer' fix introducted in d88d459d [Allow remote://hostname/
style URIs for automatic driver probe...] breaks compiling libvirt
with loadable module support.  Work around this to get it building again.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2009-02-17 10:33:41 +00:00
Jim Meyering
cedc15019e avoid compiler warning about unused parameter
* src/bridge.c (brProbeVnetHdr)
[IFF_VNET_HDR && TUNGETFEATURES && TUNGETIFF]: Use a "(void)" case
to mark the parameter as unused.  Reported by Maximilian Wilhelm in
http://thread.gmane.org/gmane.comp.emulators.libvirt/11918/focus=11917
2009-02-17 10:26:43 +00:00
Jim Meyering
bdd5094d8f accommodate configuring --without-lxc --without-qemu
* configure.in: Enable internal WITH_BRIDGE support not just for LXC or
QEMU, but also for --with-network.  Russell Haering reported that
compilation failed when configured with --without-lxc --without-qemu.
Details: http://thread.gmane.org/gmane.comp.emulators.libvirt/11928
* src/bridge.h: Use #if WITH_BRIDGE, rather than currently-equivalent
"#if defined(WITH_QEMU) || defined(WITH_LXC)"
2009-02-17 10:23:19 +00:00
Daniel P. Berrange
4dce547640 Fix I/O errors in libvirtd daemon, and hang/crash in remote client upon I/O error 2009-02-17 09:44:18 +00:00
Cole Robinson
3a53ab7913 Unbreak virsh *-edit commands: Don't pass unexpected flags to DumpXML 2009-02-16 22:51:31 +00:00
Cole Robinson
c482439232 Remove erroneous lvm volume format check for backing store. 2009-02-16 22:47:19 +00:00
Mark McLoughlin
0bb6f816e3 Add virFileWriteStr()
Re-factor the code from networkEnableIpForwarding() into a
utility function in preparation for code which writes to
sysfs files.
2009-02-13 19:13:06 +00:00
Mark McLoughlin
f6a5e8f785 Fix some error strings in xml.c
Just some copy-and-paste mixups.
2009-02-13 19:12:45 +00:00
Mark McLoughlin
c4602255c7 virXPathInt() and virXPathUInt() don't exist
It looks like these functions have never existed.
2009-02-13 19:12:20 +00:00
Mark McLoughlin
9fec27be49 Fix bridge.c warnings with gcc-4.4
bridge.c: In function 'brSetInetAddr':
 bridge.c:665: error: dereferencing pointer '({anonymous})' does break strict-aliasing rules
 bridge.c:665: note: initialized from here
 bridge.c:666: error: dereferencing pointer '({anonymous})' does break strict-aliasing rules
 bridge.c:666: note: initialized from here

Fix qemud.c warnings with gcc-4.4

 qemud.c: In function ‘remoteListenTCP’:
 qemud.c:675: error: dereferencing pointer ‘sa.72’ does break strict-aliasing rules
 qemud.c:675: note: initialized from here
 qemud.c:678: error: dereferencing pointer ‘sa.73’ does break strict-aliasing rules
 qemud.c:678: note: initialized from here
2009-02-13 19:10:55 +00:00
John Levon
7d2b7ad520 Fix migrate for Xen 3.3 2009-02-13 18:23:23 +00:00
Jim Meyering
f98b9e05d8 test:///default driver: don't dereference NULL "def"
* src/test.c (testNetworkCreate, testNetworkDefine): Since "def" is
set to NULL immediately after any vir*AssignDef call (to indicate we
no longer own it and to ensure no clean-up path mistakenly frees it),
dereference via net->def->, not def->.
2009-02-13 18:11:03 +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
John Levon
f84c166013 Improve error reporting in virsh 2009-02-09 14:24:06 +00:00
John Levon
fa7f51b813 introduce virSaveLastError(), virFreeError() 2009-02-09 14:16:23 +00:00
Daniel P. Berrange
1290b28f59 Limit virsh history entries to 500 (Jim Paris) 2009-02-09 10:24:27 +00:00
Guido Günther
0437e75291 Don't ignore errors to save domain status 2009-02-07 21:36:06 +00:00
John Levon
31135bff29 src/domain_conf.c: Check the last error, not the last
connection error, which may not have been set.
2009-02-05 19:29:37 +00:00
John Levon
003f354917 xenstore: Use virMacAddrCompare() for case-insensitive comparison 2009-02-05 18:14:00 +00:00
John Levon
b8b4fd4c7d report error for some xend operations on shutdown domain 2009-02-05 17:24:51 +00:00
John Levon
bc68ae8060 robustify sexpr parser for NICs 2009-02-05 17:17:33 +00:00
Jim Meyering
bafd7389e4 remove remainder of offending strerror uses
* qemud/qemud.c (GET_CONF_STR): Use virStrerror, not strerror.
* qemud/remote.c (remoteDispatchDomainBlockPeek): Likewise.
(remoteDispatchDomainMemoryPeek, remoteDispatchAuthSaslInit): Likewise.
(remoteDispatchAuthPolkit): Likewise.
* src/lxc_container.c (lxcContainerAvailable): Likewise.
* src/network_driver.c (networkStartNetworkDaemon): Likewise.
(networkShutdownNetworkDaemon): Likewise.
* src/qemu_conf.c (qemudExtractVersion, qemudNetworkIfaceConnect):
* src/storage_conf.c (virStoragePoolLoadAllConfigs): Likewise.
* src/storage_driver.c (storagePoolUndefine): Likewise.
* src/uml_driver.c (umlStartup, umlStartVMDaemon): Likewise.
* src/util.c (virFileReadAll): Likewise.
* src/uuid.c (virUUIDGenerate): Likewise.
* src/xen_internal.c (get_cpu_flags): Likewise.
2009-02-05 16:28:30 +00:00
Jim Meyering
d22a844b46 don't include raw errno in diagnostics
* src/uml_driver.c (umlStartVMDaemon): Don't print raw errno value.
* qemud/remote.c (remoteDispatchAuthSaslInit): Likewise.
2009-02-05 16:28:15 +00:00
Jim Meyering
1e31bfb055 iptables.c: Use virStrerror, not strerror.
* src/iptables.c: Include "virterror_internal.h".
Use virStrerror, not strerror.
* src/iptables.c (notifyRulesUpdated): Use %s rather than
string-concatenation that made sc_unmarked_diagnostics report
a false-positive.
2009-02-05 16:27:51 +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
7bc569dda9 publicize virStrerror
* src/virterror.c (virStrerror): Remove "static".
* src/virterror_internal.h (virStrerror): Declare it.
* src/libvirt_private.syms: Add virStrerror;
2009-02-05 16:10:07 +00:00
Jim Meyering
a9aa76bad5 remove useless code
* src/bridge.c (brAddTap): Remove redundant errno=ENOMEM assignment
after failed strdup.
* src/cgroup.c (virCgroupFree): Remove redundant *group=NULL assignment
after VIR_FREE(*group).
* src/lxc_driver.c (lxcShutdown): Likewise.
* src/xen_unified.c (xenUnifiedClose): Likewise.
* src/xm_internal.c (xenXMDomainConfigFormat): Rewrite disk-
and net-config-setting code to be clearer.
2009-02-05 16:03:11 +00:00
Jim Meyering
7faa50d1db lxc_container: Don't dereference NULL upon failure
* src/lxc_container.c (lxcContainerPivotRoot): Free and zero
oldroot *after* printing the diagnostic, both for virFileMakePath
and pivot_root failure.
2009-02-05 15:28:19 +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
Jim Meyering
dff2114795 build: enable redundant-const check
* Makefile.cfg (local-checks-to-skip): Remove sc_redundant_const.
* src/lxc_controller.c: Remove redundant "const"(s).
* src/storage_backend_fs.c: Likewise.
* src/util.h: Likewise.
* src/xen_internal.c: Likewise.
* tests/qparamtest.c: Likewise.
2009-02-03 13:08:59 +00:00
Jim Meyering
c18ccff446 cleanup: remove useless if-before-VIR_FREE
* Makefile.cfg (useless_free_options): Also check for VIR_FREE.
* src/iptables.c (iptRulesFree): Remove useless if-before-VIR_FREE.
* src/remote_internal.c (remoteAuthSASL): Likewise.
* src/test.c (testOpenFromFile): Likewise.
2009-02-03 13:08:07 +00:00
John Levon
66929686c4 fix more printf("%s", NULL) cases 2009-02-02 18:41:56 +00:00
Guido Günther
e69b20d616 Don't hardcode ssh port 22, use VIR_FREE, initialize pointers to NULL not 0. 2009-01-31 13:49:11 +00:00
Daniel P. Berrange
f92e9f599b Fix empty declaration in enum declaration 2009-01-30 21:52:22 +00:00
Jim Meyering
a119a98081 fix qemud version reporting when qemu is not installed
* src/qemu_conf.c (uname_normalize): New function, factored out of...
(qemudBuildCommandLine): ...here.  Use the new function.
(qemudExtractVersion): Use it here, rather than hard-coding "i686".
2009-01-30 19:57:20 +00:00
Daniel P. Berrange
a6ef2e0055 Fix ifname= passing to QEMU for type=ethernet network config 2009-01-30 17:17:58 +00:00
Daniel P. Berrange
67e7416119 Support disk caching mode config 2009-01-30 17:15:39 +00:00
Daniel P. Berrange
3cb55cb51f Fix crash using bogus arch in QEMU 2009-01-30 17:12:28 +00:00
Daniel P. Berrange
896761e5c7 Fix numerous bugs in QEMU domain startup 2009-01-30 17:07:29 +00:00
Daniel P. Berrange
05436ab7ff Fix valgrind crash in LXC & avoid probing unneccessarily 2009-01-30 16:51:33 +00:00
Daniel P. Berrange
d8637214a4 Fix leak of storage vols when freeing pool 2009-01-30 16:48:52 +00:00
John Levon
745c249a61 Fix yet another printf("%s", NULL) case
Fix getpwuid_r() usage
Fix virsh migrateuri handling
2009-01-30 15:43:05 +00:00
Daniel P. Berrange
1c64dc76c1 Misc xen driver bug/crash fixes 2009-01-29 23:01:37 +00:00
John Levon
3a8d93ab36 Fix xend XML generation when CPU pinning is used 2009-01-29 18:40:32 +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
John Levon
e96d88ff3d fix another printf("%s", NULL) case 2009-01-29 17:18:24 +00:00
John Levon
a10aa7a96b correctly enable floppies for HVM guests. 2009-01-29 17:05:49 +00:00
John Levon
3463c34e33 fix VNC port reporting when vncunused is set 2009-01-29 17:02:00 +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
Guido Günther
a99e5ccba4 don't abort if setlocale() fails 2009-01-29 11:49:33 +00:00
Daniel P. Berrange
94d6177982 Fix typo & tweak variable decl 2009-01-28 22:07:36 +00:00
Daniel P. Berrange
46d1324e47 Stopping reading off wire after 1 complete RPC message is received 2009-01-28 22:00:32 +00:00
Jim Meyering
e730de6fd8 remote_internal.c: fix typo that would mistakenly report OOM
* src/remote_internal.c (addrToString): Report VIR_ERR_UNKNOWN_HOST,
not VIR_ERR_NO_MEMORY.
2009-01-28 16:14:24 +00:00
Jim Meyering
8cc2bbe33c qparams.c: Use virReportOOMError(NULL), not qparam_report_oom()
* src/qparams.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
(qparam_report_oom): Remove definition.
Replace all uses.
2009-01-28 16:13:46 +00:00
John Levon
499189694a fix mis-use of PF_UNIX as a protocol 2009-01-28 14:36:23 +00:00
Daniel P. Berrange
489fde7680 Add support for copy-on-write storage volumes 2009-01-27 18:30:03 +00:00
Jim Meyering
f03d3439cd virterror.c: don't read beyond end of buffer upon OOM
* src/virterror.c (virReportSystemErrorFull): Fix typo in
my previous change.  Patch by Daniel P. Berrange.
2009-01-27 12:26:53 +00:00
Mark McLoughlin
b4f62abbf1 kvm/virtio: Set IFF_VNET_HDR when setting up tap fds
IFF_VNET_HDR is a tun/tap flag that allows you to send and receive
large (i.e. GSO) packets and packets with partial checksums. Setting
the flag means that every packet is proceeded by the same header which
virtio uses to communicate GSO/csum metadata.

By enabling this flag on the tap fds we create, we greatly increase
the achievable throughput with virtio_net.

However, we need to be careful to only set the flag when a) QEMU has
support for this ABI and b) the value of the flag is queryable using
the TUNGETIFF ioctl.

It's nearly five months since kvm-74 - the first KVM release with this
feature - was released. Up until now, we've not added libvirt support
because there is no clean way to detect support for this in QEMU at
runtime. A brief attempt to add a "info capabilities" monitor command
to QEMU floundered. Perfect is the enemy of good enough. Probing the
KVM version will suffice for now.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-01-27 11:12:05 +00:00
Jim Meyering
e15147c141 fix errors in virReportSystemErrorFull
* src/virterror.c (virStrerror): New function.
(virReportSystemErrorFull): Don't leak "combined".
In fact, don't even attempt allocation.
Do include the result of formatted print in final diagnostic.
2009-01-27 10:57:18 +00:00
Jim Meyering
339cc9d992 build: avoid format warnings
* src/proxy_internal.c (xenProxyCommand): Mark a diagnostic.
* src/xen_unified.c (xenUnifiedOpen, xenUnifiedAddDomainInfo):
Fix unmarked diagnostics by removing the diagnostic altogether:
replace each xenUnifiedError(...,VIR_ERR_NO_MEMORY call with a
call to virReportOOMError.
2009-01-27 08:50:03 +00:00
Jim Meyering
69d947eb80 * src/virterror.c (virErrorMsg): Correct indentation. 2009-01-27 08:49:15 +00:00
John Levon
39e49ad7c9 fix recursive lock hang in xenstore driver 2009-01-23 19:18:24 +00:00
Daniel P. Berrange
ad70b32414 Support QEMU disk format specification in XML 2009-01-23 16:22:20 +00:00
Jim Meyering
727d4fdc6e fix comment typo: s/contains/continues/
* src/libvirt.c (virStorageVolFree): Correct typo in comment.
2009-01-23 14:18:43 +00:00
Jim Meyering
6278bb191a maint: update list of error function names and adapt
* Makefile.maint (msg_gen_function): Update list.
Remove some now-unused names, add some new ones.
* src/hash.c (virHashError): Remove unused definition.
* src/openvz_conf.h (openvzLog): Likewise.
* src/xen_unified.c: Mark newly-exposed diagnostics for translation.
2009-01-23 12:29:29 +00:00
John Levon
e80f10064e parse IP address for bridge interfaces 2009-01-23 01:48:47 +00:00
Daniel P. Berrange
c4985e9419 use the gnulib random_r function 2009-01-22 20:27:01 +00:00
Daniel P. Berrange
1b745219c7 Remove use of non-reentrant POSIX apis 2009-01-22 19:41:48 +00:00
Jim Meyering
d0eab955c2 xm_internal.c: fix locking bug: s/Lock/Unlock/
* src/xm_internal.c (xenXMDomainDefineXML): Release lock, (don't
try to acquire it) upon failure, just before returning.
2009-01-22 19:18:24 +00:00
John Levon
7420fec81b Remove non-existent symbol from linker script 2009-01-22 18:33:13 +00:00
John Levon
fb4ec82358 Support script for bridge interface type 2009-01-22 18:29:13 +00:00
John Levon
2b29698352 Least privilege support for Solaris 2009-01-22 17:49:41 +00:00
Daniel P. Berrange
e52d74e536 Make xen driver threadsafe 2009-01-21 18:11:14 +00:00
Daniel P. Berrange
e3672d9695 Allow storage driver to handle daemon restarts 2009-01-20 22:43:07 +00:00
Daniel P. Berrange
23a090ab92 Allow virtual networks to survive daemon restart 2009-01-20 22:36:10 +00:00
Daniel P. Berrange
a964a6dad6 Support ac97 soundcard model 2009-01-20 22:15:55 +00:00
Daniel Veillard
5fb1e29c7e * src/logging.c: fix openlog() ident lifetime for Solaris
daniel
2009-01-20 21:34:44 +00:00
Daniel P. Berrange
a888b22cf9 Support domain events in test driver 2009-01-20 20:23:53 +00:00
Jim Meyering
3548e9aae8 don't ignore write failure
* src/network_driver.c (networkEnableIpForwarding): This function
would always return 1 (success).  Now it returns 0 upon write or
close failure, being careful to preserve any errno from a write failure.
Add comments.
2009-01-20 19:29:08 +00:00
Daniel P. Berrange
f61341173b Allow concurrent processing of RPC calls in daemon 2009-01-20 19:25:15 +00:00
Daniel P. Berrange
84ef468ba8 Fix some misleading comments in XM driver 2009-01-20 18:20:09 +00:00
Daniel P. Berrange
2c7be88d15 Remove a use of strerror() in error reporting in remote driver 2009-01-20 17:47:13 +00:00
Daniel P. Berrange
788bedd904 Remove use of static data in Xen XM driver 2009-01-20 17:34:56 +00:00
Daniel P. Berrange
e428a69e6f Remove use of static data in Xen inotify driver 2009-01-20 17:19:23 +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 P. Berrange
61674cc17d Make RPC call dispatch threaded 2009-01-20 16:36:34 +00:00
Daniel Veillard
458a673cb7 remove stdout_fd, stderr_fd from virDomainObj
* src/domain_conf.h src/lxc_driver.c src/uml_driver.c: virDomainObj
  doesn't need stdout and stderr fields anymore, patch from
  Guido Günther
daniel
2009-01-20 16:10:20 +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
Jim Meyering
45062390a6 fix "make syntax-check" failures
* ChangeLog: Start with TAB, not 8 spaces.
* src/virterror.c: Remove trailing spaces.
2009-01-20 13:51:52 +00:00
Daniel P. Berrange
a776fad370 Add public APIs for ref counting on public objects 2009-01-20 12:14:03 +00:00
Daniel P. Berrange
ead04dcbe8 Thread local error reporting 2009-01-20 12:01:45 +00:00
Daniel P. Berrange
c790f6d25e Avoid bogus event loop wakeups in remote driver when doing RPC call 2009-01-20 11:45:09 +00:00
Daniel P. Berrange
ed493909f7 Add locking to the remote driver 2009-01-20 11:41:24 +00:00
Guido Günther
8dfbfe3145 daemonize qemu processes 2009-01-19 21:55:54 +00:00
Guido Günther
5d99a309e6 save domstate as string in status file 2009-01-19 21:06:26 +00:00
Daniel Veillard
9a969b86a9 * src/xen_internal.c src/xend_internal.c: Relax NUMA checking
for RHEL-5 and change the detection stategy for default Xen
  accesses, patch by Markus Armbruster
daniel
2009-01-19 20:16:10 +00:00
Daniel Veillard
b751b46bc5 Fix PVFB version check for RHEL-5
* src/xend_internal.c src/xm_internal.c: fix paravirt framebuffer
  handling since it was backoprted for RHEL-5, patch by Markus
  Armbruster
daniel
2009-01-19 19:49:30 +00:00
Daniel Veillard
e676a699e8 * src/xend_internal.c src/xm_internal.c: fix fully virt network
device configuration for Xen on RHEL-5, patch by Markus Armbruster
daniel
2009-01-19 18:12:00 +00:00
Daniel Veillard
99ed5b4bee Two bug fixes coming from RHEL and Markus being added to AUTHORS
* src/xm_internal.c: two bug fixes coming from RHEL package
  posted by Markus Armbruster
* AUTHORS: adding Markus
daniel
2009-01-19 15:24:41 +00:00
Cole Robinson
46d4a5e047 Fix segfault with console device back compat. 2009-01-16 16:50:11 +00:00
Daniel P. Berrange
dd9b3fb594 Fix bug when fork isn't available (Win32) in remote driver 2009-01-15 20:13:12 +00:00
Daniel P. Berrange
2be79b1d5e Reduce exit paths in remote driver APIs 2009-01-15 20:07:10 +00:00
Daniel P. Berrange
19d1bf2562 Remove use of macros in remote driver private data access 2009-01-15 20:04:44 +00:00
Daniel P. Berrange
0cd119e7b8 Fix incorrect use of private data field in remote driver 2009-01-15 20:03:10 +00:00
Daniel P. Berrange
4dac0a1105 Generic internal threads API 2009-01-15 19:56:05 +00:00
Daniel P. Berrange
52e51d278e Implement virKill for Win32 platform 2009-01-15 19:40:21 +00:00
John Levon
4d713eabf5 Avoid passing NULL to printf %s specifier 2009-01-15 17:54:20 +00:00
John Levon
c7095a4b4c Improve xend_get error message 2009-01-15 15:17:53 +00:00
John Levon
443698d2b2 implement capabilities parsing for Solaris 2009-01-15 01:35:17 +00:00
John Levon
406c05f2e7 Fix xs_unwatch() to correctly pass the token 2009-01-15 01:23:32 +00:00
John Levon
c8070bf632 Fix activeDomainList handling 2009-01-15 01:21:36 +00:00
John Levon
65316d7940 Fix ref-counting for Xen driver event registration 2009-01-15 01:18:37 +00:00
John Levon
5b6c39f51f Mark Xen PV CD-ROM devices as such 2009-01-14 16:21:12 +00:00
Jim Meyering
6954d44e53 diagnose "libvirtd --config=no-such-file"
* qemud/qemud.c (remoteReadConfigFile): Don't return 0 (success)
when the config file is unreadable or nonexistent
Return -1, not 0, upon virConfReadFile failure.
(main): If remote_config_file is not specified via --config(-f),
use the default config file only if it exists.  Otherwise,
use /dev/null.
* src/conf.c (virConfReadFile): Don't diagnose virFileReadAll
failure, since it already does that.
2009-01-12 18:22:32 +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
John Levon
261c3a8fd0 src/logging.h: fix non-debug compile 2009-01-09 19:22:02 +00:00
Guido Günther
d6bd288da2 add missing flags argument 2009-01-08 19:52:15 +00:00
Guido Günther
46971d5ed7 pass flags argument to all virDomain*DefParse* functions 2009-01-08 13:54:20 +00:00
Daniel Veillard
c7cbbfa43b * src/domain_conf.c src/qemu_conf.c: implement PCI passthrough
for recent KVM versions in a similar way to USB, patch by
  Jason Krieg. Some cleanups and reformating too.
daniel
2009-01-07 12:56:13 +00:00
Daniel Veillard
d6eceb568f * src/openvz_driver.c: fix the mac addresses generation for OpenVZ veth
devices, patch by Evgeniy Sokolov
* docs/apps.html: regenerated fixing a typo
Daniel
2009-01-07 10:55:54 +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
Daniel P. Berrange
37e72aa542 Fix misc mingw portability problems 2009-01-06 18:32:03 +00:00
Guido Günther
83467de3ed add virKillProcess 2009-01-06 17:46:46 +00:00
Guido Günther
ffafc252dd trivial cleanups 2009-01-06 17:20:27 +00:00
Jim Meyering
2ad1ca3f6c fix "make dist" (from scratch) failure
* src/Makefile.am (EXTRA_DIST): Don't distribute libvirt_sym.version,
now that it's been removed.  Spotted by Daniel Veillard.
2009-01-06 15:22:57 +00:00
Jim Meyering
950c8b3916 dist: distribute all libvirt_*.syms files, ...
* src/Makefile.am (EXTRA_DIST): Distribute all libvirt_*.syms files,
not just those that happen to be selected at configure time.
2009-01-06 15:16:43 +00:00
Daniel Veillard
0dbcac6598 * src/storage_backend_fs.c: Make mntent.h specific to the FS storage
backend, patch by John Levon
daniel
2009-01-06 08:43:44 +00:00
Jim Meyering
34ac4c1fe7 Remove storage backend symbols from version script
* src/libvirt_private.syms: Remove virStorageBackend* symbol names.
They're linked into qemud, not libvirt.
Author: John Levon
2009-01-05 14:10:40 +00:00
Jim Meyering
b0119de82f migrate linux-specific symbol names into their own sym file
* configure.in (WITH_LINUX): New automake conditional.
* src/Makefile.am (PRIVSYMFILES) [WITH_LINUX]: Append libvirt_linux.syms.
* src/libvirt_private.syms: Move two symbol names into...
* src/libvirt_linux.syms: ...this new file.
Author: John Levon
2009-01-05 14:08:26 +00:00
Jim Meyering
83dfc25c02 Move bridge symbols into a separate syms file
* configure.in: Provide a new --with-bridge option.
* src/Makefile.am (PRIVSYMFILES) [WITH_BRIDGE]: Append libvirt_bridge.syms.
* src/bridge.c: Test WITH_BRIDGE rather than particular drivers.
* src/libvirt_private.syms: Move bridge-related symbols into...
* src/libvirt_bridge.syms: ...this new file.
Author: John Levon
2009-01-05 14:07:31 +00:00
Jim Meyering
ea5775bf8e Move --with-driver-modules symbols into a separate sym file
* src/Makefile.am (PRIVSYMFILES): Append libvirt_driver_modules.syms.
* src/libvirt_private.syms: Move virDriverLoadModule into...
* src/libvirt_driver_modules.syms: ... this new file.
Author: John Levon
2009-01-05 14:06:41 +00:00
Jim Meyering
ad17ffa034 split version script into multiple files
* src/Makefile.am (PRIVSYMFILES): Define.
(EXTRA_DIST): Append $(PRIVSYMFILES).
(libvirt.syms): New rule.
Reflect renaming: s/libvirt_sym.version/libvirt.syms/.
(BUILT_SOURCES): Depend on libvirt.syms.
* configure.in: Define ENABLE_DEBUG as an automake conditional.
(AC_OUTPUT): Remove src/libvirt_sym.version.
* src/.cvsignore: s/libvirt_sym.version/libvirt.syms/.
* src/.gitignore: Regenerate.
* src/libvirt_public.syms: Renamed from src/libvirt_sym.version.in.
* src/libvirt_debug.syms: New file.
* src/libvirt_private.syms: New file.
Author: John Levon
2009-01-05 14:05:29 +00:00
Jim Meyering
8f06d6b103 avoid bogus descriptions due to use of gettext with the empty string
* src/virsh.c: Use `""', not `gettext_noop("")', in numerous
vshCmdInfo definitions.  The latter provokes a warning from gettext.
2009-01-05 13:27:43 +00:00
Daniel P. Berrange
ca34b4d777 Fix numa build on F9, 32-bit 2009-01-05 12:56:36 +00:00
Jim Meyering
cb48d5d71c mark a few diagnostics for translation
* src/xen_inotify.c (xenInotifyXendDomainsDirLookup): Mark a diagnostic.
(xenInotifyXendDomainsDirRemoveEntry, xenInotifyOpen): Likewise.
2009-01-05 08:16:44 +00:00
Guido Günther
043d702f02 use virAsprintf instead of asprintf 2008-12-23 13:03:29 +00:00
Cole Robinson
922f5e6845 Fix storage driver null dereference. 2008-12-22 16:30:57 +00:00
Cole Robinson
bd24695a23 Merge xml building for virsh pool-*-as 2008-12-22 16:23:36 +00:00
Daniel Veillard
0d575be45a * src/uml_conf.c: another logging conversion
daniel
2008-12-22 10:53:07 +00:00
Daniel Veillard
0b05f6c26f convert old logging to the new API
* src/node_device_devkit.c src/uml_driver.c src/virterror.c:
  convert old logging to the new API
daniel
2008-12-22 10:48:59 +00:00
Daniel Veillard
f99b202f5b * src/libvirt.c: convert entry points to new logging
daniel
2008-12-22 10:46:01 +00:00
Daniel Veillard
698d80a824 * src/logging.h src/logging.c: commited the more recent version
with function name and line number
daniel
2008-12-22 10:44:10 +00:00
Daniel Veillard
9fcbbd92bf new internal logging APIs
* src/logging.h src/logging.c: add the infrastructure and internal
  APIs for logging, some of those APIs should be made public later
* src/libvirt_sym.version.in: flag the internal APIs as such
daniel
2008-12-22 10:36:54 +00:00
Daniel Veillard
0ff5cea597 * src/xen_internal.h: remove tabs to fix make syntax-check
and fix the indentation
daniel
2008-12-22 10:32:20 +00:00
Jim Meyering
d010b68962 make NUMA-initialization code more portable and more robust
qemudCapsInitNUMA and umlCapsInitNUMA were identical, so this change
factors them into a new function, virCapsInitNUMA, and puts it in
nodeinfo.c.

In addition to factoring out the duplicates, this change also
adjusts that function definition (along with its macros) so
that it works with Fedora 9's numactl version 1, and makes it
so the code will work even if someone builds the kernel with
CONFIG_NR_CPUS > 4096.

Finally, also perform this NUMA initialization for the lxc
and openvz drivers.

* src/nodeinfo.c: Include <stdint.h>, <numa.h> and "memory.h".
(virCapsInitNUMA): Rename from qemudCapsInitNUMA and umlCapsInitNUMA.
(NUMA_MAX_N_CPUS): Define depending on NUMA API version.
(n_bits, MASK_CPU_ISSET): Define, adjust, use uint64 rather than long.
* src/nodeinfo.h: Include "capabilities.h".
(virCapsInitNUMA): Declare it.
* examples/domain-events/events-c/Makefile.am:
* src/Makefile.am: Add $(NUMACTL_CFLAGS) and $(NUMACTL_LIBS) to various
compile/link-related variables.
* src/qemu_conf.c: Include "nodeinfo.h".
(qemudCapsInitNUMA): Remove duplicate code.  Adjust caller.
* src/uml_conf.c (umlCapsInitNUMA): Likewise.
Include "nodeinfo.h".
* src/lxc_conf.c: Include "nodeinfo.h".
(lxcCapsInit): Perform NUMA initialization here, too.
* src/openvz_conf.c (openvzCapsInit): And here.
Include "nodeinfo.h".
* src/libvirt_sym.version.in: Add virCapsInitNUMA so that libvirtd
can link to this function.
2008-12-21 18:55:09 +00:00
Jim Meyering
337dce1e24 * src/node_device_hal.c: Include <config.h> before everything else. 2008-12-21 18:49:11 +00:00
Guido Günther
5614e868e1 save and remove kvm/qemu domain status 2008-12-20 13:17:49 +00:00
Guido Günther
b679ebe877 add XML parsing for qemu/kvm status files 2008-12-20 13:09:45 +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
829b6420d8 Fix mistaken free of domain event object after queueing (David Lively) 2008-12-18 12:11:53 +00:00
Daniel P. Berrange
6313259ada Fix test driver return value & disable nodeinfotest on non-linux (John Levon) 2008-12-18 12:08:05 +00:00
Daniel P. Berrange
7c4bc3f92f Use pid_t for all PID tracking variables (John Levon) 2008-12-18 11:58:28 +00:00
Daniel P. Berrange
ded70984f3 Fix unreachable statement (John Levon) 2008-12-17 21:50:02 +00:00
Daniel P. Berrange
b5259e7e11 Fix domain events callback type (John Levon) 2008-12-17 21:48:20 +00:00
Daniel P. Berrange
bd31fa766a Remove non-existant symbols from linker script (John Levon) 2008-12-17 21:42:49 +00:00
Daniel P. Berrange
c2fb8bfee3 Convert linker script comments & linker args to be Solaris compat (John Levon) 2008-12-17 21:39:41 +00:00
Daniel P. Berrange
0604e9efe0 Fix __sun macro check (John Levon) 2008-12-17 21:31:51 +00:00
Daniel P. Berrange
e5fc0aad31 Fix return type for Xen open subdriver method impl (John Levon) 2008-12-17 21:26:16 +00:00
Daniel P. Berrange
6add3883a6 Fix openvz crash when setting vcpus & initialize mutex (Anton Protopopov) 2008-12-17 21:13:19 +00:00
Daniel P. Berrange
34cd4f9076 Remove trailing semi-colons causing empty statement warnings (John Levon) 2008-12-17 21:09:44 +00:00
Daniel P. Berrange
7e58aaa7ae Remove use of anonymous unions for non-GCC (John Levon) 2008-12-17 18:12:07 +00:00
Jim Meyering
6ded3ebad5 portability: don't include <endian.h> or <byteswap.h>
* src/storage_backend_fs.c: Don't include <endian.h> or <byteswap.h>.
(LV_BIG_ENDIAN, LV_LITTLE_ENDIAN): Define.
Use those instead of __BIG_ENDIAN and __LITTLE_ENDIAN.
2008-12-17 18:08:42 +00:00
Daniel P. Berrange
f4cbc9370e Remove use of _PATH_DEVNULL in favour of /dev/null for portability (John Levon) 2008-12-17 18:04:55 +00:00
Jim Meyering
e4c7e12300 let gcc's -Wformat do its job; avoid "make syntax-check" failure
* src/util.c (virAsprintf): Remove trailing space.
* src/util.h (virAsprintf): Use ATTRIBUTE_FORMAT.
* HACKING (Printf-style functions): New section.
2008-12-17 17:22:43 +00:00
Daniel P. Berrange
53611889ff Add missing checks for read-only connection flag (CVE-2008-5086) 2008-12-17 16:45:22 +00:00
Jim Meyering
7e6a06aeae fix numa-related (and kernel-dependent) test failures
This change is required on some kernels due to the way a change in
the kernel's CONFIG_NR_CPUS propagates through the numa library.
* src/qemu_conf.c (qemudCapsInitNUMA): Pass numa_all_cpus_ptr->size/8
as the buffer-length-in-bytes in the call to numa_node_to_cpus, since
that's what is required on second and subseqent calls.
* src/uml_conf.c (umlCapsInitNUMA): Likewise.
2008-12-17 07:05:45 +00:00
Cole Robinson
0e459cbdfb Sanitize qemu monitor reads. 2008-12-16 22:34:13 +00:00
Guido Günther
36c612b21c add virAsprintf 2008-12-15 20:09:29 +00:00
Daniel Veillard
e4471a7ac7 * src/storage_driver.c: fix a segfault, patch by Miloslav TrmaC
daniel
2008-12-15 15:34:30 +00:00
Daniel P. Berrange
43b897c17a Fix deadlock when reloading configs 2008-12-15 11:00:11 +00:00
Jim Meyering
289d52c49e remove redundant optname arguments
This is the second part of the change mentioned here:

  http://thread.gmane.org/gmane.comp.emulators.libvirt/10331

It removes the essentially redundant "optname" parameter
from each of the vshCommandOptNetworkBy and vshCommandOptDomainBy
functions as well as the correspond macros (without "By" suffix).
Now, instead of always passing the optname, "domain", to
vshCommandOptDomainBy, that function requires that its command
argument refer to an opts array containing a "domain" option.

This normalization makes one more help-related change:
it renames the net-start "name" argument to the more
sensible and consistent "network".
* src/virsh.c (VSH_BYNAME, vshCommandOptDomain)
(cmd_has_option): New function, used in vshCommandOptDomainBy
and vshCommandOptNetworkBy.
(vshCommandOptDomainBy, vshCommandOptNetworkBy): Remove the optname
parameter, it's always "domain" ("network").  Update all callers.
Call cmd_has_option.
(vshCommandOptNetwork, cmdAutostart, cmdConsole, cmdDomstate)
(cmdDomblkstat, cmdDomIfstat, cmdSuspend, cmdUndefine, cmdStart)
(cmdSave, cmdSchedinfo, cmdDump, cmdResume, cmdShutdown)
(cmdReboot, cmdDestroy, cmdDominfo, cmdVcpuinfo, cmdVcpupin)
(cmdSetvcpus, cmdSetmem, cmdSetmaxmem, cmdDumpXML, cmdDomname)
(cmdDomid, cmdDomuuid, cmdMigrate, cmdNetworkAutostart)
(cmdNetworkDestroy, cmdNetworkDumpXML, cmdNetworkName)
(opts_network_start, cmdNetworkStart, cmdNetworkUndefine)
(cmdNetworkUuid, cmdVNCDisplay, cmdTTYConsole, cmdAttachDevice)
(cmdDetachDevice, cmdAttachInterface, cmdDetachInterface)
(cmdAttachDisk, cmdDetachDisk, cmdEdit)
* src/Makefile.am (virsh-pool-edit.c): This code is generated
from cmdEdit, and cmdEdit uses the vshCommandOptDomain macro which
now, with the changes above, has only 3 (was 4) arguments, yet the
macro use is mapped to vshCommandOptPool, which still requires 4
arguments.  So this change adjusts the sed code to reinsert the
just-removed argument -- we're not changing pool-related code right
now, because it's not as straight-forward.
2008-12-15 10:26:54 +00:00
Jim Meyering
9c5470d292 remove cvs $Id$ strings
* po/id.po: Likewise.
* qemud/remote_generate_stubs.pl: Likewise.
* src/virsh.c: Likewise.
* tests/testutils.c: Likewise.
* tests/testutils.h: Likewise.
* RENAMES: Likewise.
2008-12-12 12:45:34 +00:00
Jim Meyering
506629e619 remove unused xmlrpc-related files
* src/xmlrpc.h: Remove file.
* src/xmlrpc.c: Likewise.
* tests/test_xmlrpc.sh: Likewise.
* tests/xmlrpctest.c: Likewise.
* tests/xmlrpcserver.py: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove xmlserver.py.
(noinst_PROGRAMS): Remove xmlrpctest, along with associated variables.
* po/POTFILES.in: Remove src/xmlrpc.c.
* tests/.cvsignore: Remove xmlrpctest.
2008-12-12 11:31:15 +00:00
Daniel Veillard
2e59a005fd fix bits/bytes memory request mismatches
* src/qemu_conf.c src/uml_conf.c: fix a couple of places where
  we were requesting 8 times the required amount of memory,
  patch by Dave Allan
daniel
2008-12-12 10:39:19 +00:00
Guido Günther
2ddb440cbb fix serial/parallel virtual devices over tcp, unix and telnet 2008-12-12 09:39:31 +00:00
Daniel Veillard
e2d2b7d577 * src/util.c: retry poll() in EINTR failures, patch by Dave Allan
daniel
2008-12-12 07:29:39 +00:00
Cole Robinson
63efdb85c1 Fix locking issue in test driver VolLookupByPath 2008-12-11 15:04:09 +00:00
Cole Robinson
3130848a10 Fix a locking issue in PoolGetAutostart. 2008-12-11 15:00:12 +00:00
Cole Robinson
52037657dc Fix segfault if virtual network does not have a bridge name 2008-12-11 14:57:45 +00:00
Daniel Veillard
a3d570c7b9 Adding support for SDL fullscreen option
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
  tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml:
  slightly modified patch for SDL fullscreen from Itamar Heim
* docs/formatdomain.html docs/formatdomain.html.in docs/libvirt.rng:
  update the schemas and docs about the sdl graphic element attributes
* AUTHORS: add Itamar Heim
Daniel
2008-12-11 11:44:30 +00:00
Jim Meyering
7989276259 avoid format string warnings
* src/openvz_conf.c (openvzGetNodeCPUs): Add "%s" arg before _(...).
* src/uml_driver.c (umlDomainBlockPeek): Likewise.
2008-12-10 16:35:00 +00:00
Jim Meyering
3693a02fff fix just-broken "virsh start" and "virsh pool-start" commands
* src/virsh.c (cmdPoolStart, cmdStart): Change hard-coded
vshCommandOptDomainBy string argument to match just-changed
option name.  Cole Robinson reported that "virsh start" was
broken and provided that part of the fix.
Bug introduced by yesterday's "virsh.c: tweak options to produce
more accurate help".
* tests/start: New file.  Test for the above fix.
* tests/Makefile.am (test_scripts): Add start.
2008-12-09 21:38:04 +00:00
Guido Günther
54f4ed6ba1 logrotate qemu monitor logs 2008-12-09 20:22:39 +00:00
Jim Meyering
1c9968a2b1 virsh.c: tweak options to produce more accurate help
* src/virsh.c: Adjust some vshCmdOptDef command option flags
to improve auto-generated help command syntax.
2008-12-08 13:22:44 +00:00
Jim Meyering
c9319f315c virsh.c: remove all "syntax" vshCmdInfo entries.
* src/virsh.c: ... now that info is generated.
2008-12-08 13:22:13 +00:00
Jim Meyering
34e5d2941c virsh.c: add missing (yet empty) "desc" strings
* src/virsh.c: Now, every command must have a "desc" string,
even if it has zero length.  Mark these, so they'll be filled in.
2008-12-08 13:21:30 +00:00
Jim Meyering
6f61232852 virsh.c: generate each "virsh help COMMAND"s synopsis
* src/virsh.c: Also, diagnose extra arguments after --help (-h).
2008-12-08 13:14:48 +00:00
Daniel P. Berrange
ca1a1b06d0 Workaround broken limits.h on Debian etch 2008-12-08 11:28:37 +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
73bc9c163c Fix NULL crash & integer overflow 2008-12-07 20:45:28 +00:00
Daniel P. Berrange
5abce0805b Fix test driver storage deadlock 2008-12-07 20:21:46 +00:00
Daniel P. Berrange
a2b2ada85c Fix return value in testStoragePoolBuild for test driver 2008-12-07 14:08:37 +00:00
Daniel Veillard
466f86052f Fix a compilation problem with old dbus,
Daniel
2008-12-05 15:05:48 +00:00
Daniel P. Berrange
af61834687 Fix Xen proxy build 2008-12-05 10:10:41 +00:00
Daniel P. Berrange
491b4eab14 Remove unused driver arg from monitor APIs 2008-12-04 22:19:30 +00:00
Daniel P. Berrange
746f4373e7 Impl of threading locking APIs 2008-12-04 22:00:14 +00:00
Daniel P. Berrange
d48717054c Add locking for thread safety to nodedevice drivers 2008-12-04 21:48:31 +00:00
Daniel P. Berrange
e8a4ea75a3 Merge all return paths from node device driver APIs 2008-12-04 21:46:34 +00:00
Daniel P. Berrange
04a31e99fc Add locking for thread safety to openvz driver 2008-12-04 21:44:55 +00:00
Daniel P. Berrange
e8c92c3b17 Merge all return paths from openvz driver APIs 2008-12-04 21:41:51 +00:00
Daniel P. Berrange
b6ee63d8bb Add locking for thread safety to storage driver 2008-12-04 21:40:42 +00:00
Daniel P. Berrange
c38d4d54c6 Merge all return paths from storage driver APIs 2008-12-04 21:39:45 +00:00
Daniel P. Berrange
bff6ac7b63 Add locking for thread safety to network driver 2008-12-04 21:38:38 +00:00
Daniel P. Berrange
b6dbbdc9fe Merge all return paths from network driver APIs 2008-12-04 21:37:52 +00:00
Daniel P. Berrange
055c2b25d2 Add locking for thread safety to UML driver 2008-12-04 21:14:39 +00:00
Daniel P. Berrange
773c8bac35 Merge all return paths from UML driver APIs 2008-12-04 21:13:58 +00:00
Daniel P. Berrange
965c1bfee4 Add locking for thread safety to LXC driver 2008-12-04 21:12:41 +00:00
Daniel P. Berrange
5305c55849 Merge all return paths from LXC driver APIs 2008-12-04 21:11:41 +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
Daniel P. Berrange
8492cd2084 Stub out node device APIs in test driver 2008-12-04 21:00:50 +00:00
Daniel P. Berrange
2a23198886 Add locking for thread safety to test driver 2008-12-04 20:59:06 +00:00
Daniel P. Berrange
3540f6af23 Merge all return paths from test driver APIs 2008-12-04 20:57:47 +00:00
Daniel P. Berrange
069252f0e6 Remove macros for accessing test driver internal state 2008-12-04 20:56:10 +00:00
Daniel P. Berrange
b43401b915 Add thread locking stubs 2008-12-04 20:53:20 +00:00
Daniel Veillard
a2232a5cc2 release of 0.5.1
* src/libvirt_sym.version.in configure.in NEWS docs/*: release
  of 0.5.1
* po/*: updated and regenerated
daniel
2008-12-04 15:54:26 +00:00
Daniel Veillard
1d9a22b785 fix crash and regression when defining a storage volume without a format
* src/storage_conf.c: fix crash and regression when defining
  a storage volume without a format (Cole Robinson)
Daniel
2008-12-04 15:22:04 +00:00
Cole Robinson
76944e8137 Fix documentation cut and paste errors, and a virsh typo. 2008-12-04 14:51:57 +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
Daniel Veillard
4fc29fa9f4 patch setting MTU on tap interface
* src/bridge.c: patch setting MTU on tap interface to be the same
  as the value for the bridge (Eduardo Habkost)
daniel
2008-12-04 14:38:31 +00:00
Guido Günther
1d7d2fae10 Differentiate between active and inactive configs by honoring the
VIR_DOMAIN_XML_INACTIVE flag.
2008-12-04 12:02:59 +00:00
Guido Günther
38b402ce13 also look for /usb/bin/kvm 2008-12-04 10:45:31 +00:00
Jim Meyering
fa4fc0321a fix inadequate initialization in storage and test drivers
* src/storage_driver.c (storageListPools): Set all "names" entries to 0.
(storageListDefinedPools, storagePoolListVolumes): Likewise.
* src/test.c (testStoragePoolListVolumes): Likewise.
2008-12-02 15:59:14 +00:00
Chris Lalancette
a904a56c36 Older distributions (i.e. RHEL-5) don't have udevadm at all, but they do
have udevsettle.  So change our tests to prefer udevadm if it exists, but
to fall back to udevsettle if it does not.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-12-02 12:41:29 +00:00
Daniel P. Berrange
a429e221df Fix recording of UML driver watch to make inotify work 2008-12-02 11:23:27 +00:00
Jim Meyering
0e9349a28d uml: don't free an uninitialized variable
* src/uml_driver.c (umlDomainShutdown): Initialize "info".
Patch and bug report from Ron Yorston <rmy@tigress.co.uk>.
2008-12-01 11:08:16 +00:00
Daniel P. Berrange
937c1e9e92 Close directory handle when done 2008-11-30 18:37:35 +00:00
Guido Günther
5acdb5761d Prefer xenstore driver for listDomains, since xen HV reports ghost ids of
already shutdown domains in some xen versions
2008-11-28 15:25:04 +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
319b83fc28 Fix XM driver handling of disk source paths 2008-11-28 11:23:34 +00:00
Daniel P. Berrange
c23ff311fc Fix libnuma use to build with v1 compatability code 2008-11-28 11:20:27 +00:00
Chris Lalancette
a9567e09ef Instead of relying solely on polling for /dev devices to appear in libvirt, we
really should be synchronizing against udev.  This is generally done by a call
to udevsettle, which is exactly what this patch implements for the storage
backends that are likely to create new /dev nodes.  I believe I've read that
even after udevsettle, you are not guaranteed that devices are all the way
created, so we still need the polling in the rest of the sources, but this
should give us a much better chance of things existing as we expect.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-11-28 07:50:20 +00:00
Chris Lalancette
d20d6b1bb0 Currently libvirt can race with udev
creation of /dev/disk/by-{id,path}, so if we fail to open the directory, retry
up to 5 seconds.  This is only likely to happen on hosts that are:

1) diskless (so /dev/disk/by-{id,path} doesn't exist already), and
2) slow, and/or heavily loaded (meaning that udev can take some time to create
the /dev nodes).

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-11-28 07:42:21 +00:00
Daniel Veillard
431d40fa9c * src/xen_unified.c: use preferably xend method to update
the maximum memory of a xen guest (Jim Fehlig)
Daniel
2008-11-27 16:16:13 +00:00
Daniel Veillard
517ff04bec Release of 0.5.0
* configure.in docs/* NEWS: release of 0.5.0
* po/*: updated from the translators and merged
* docs/apibuild.py src/libvirt.c: avoid some warnings at doc
  generation time
daniel
2008-11-25 15:48:11 +00:00
Daniel P. Berrange
5a01629128 Add missing translations 2008-11-25 11:18:08 +00:00
Daniel P. Berrange
8f7e086f19 Implement autostart for XM driver 2008-11-25 11:04:34 +00:00
Daniel P. Berrange
1eeceaa649 Support domain lifecycle events for Xen (Ben Guthro & Daniel Berrange) 2008-11-25 10:44:52 +00:00
Daniel P. Berrange
b2dbfefcf3 Avoid symbol clash with win32 headers and node device APIs 2008-11-25 10:37:02 +00:00
Jim Meyering
9a7c05d995 * src/virterror.c (virReportErrorHelper): Sync doc to code. 2008-11-25 10:32:27 +00:00
Jim Meyering
335de2ba1f libvirt.c: document the virState* functions
* src/libvirt.c (virStateActive, virStateCleanup, virStateReload):
(virStateActive): Add per-function comments.
2008-11-25 10:31:52 +00:00