Commit Graph

15335 Commits

Author SHA1 Message Date
Gao feng
b9ce5d388f rename virBlkioDeviceWeightPtr to virBlkioDevicePtr
The throttle blkio cgroup will reuse this struct.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
2013-12-12 12:29:59 +00:00
Gao feng
b4710669c3 rename virBlkioDeviceWeightArrayClear to virBlkioDeviceArrayClear
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
2013-12-12 12:29:54 +00:00
Gao feng
529739cc80 rename virDomainBlkioDeviceWeightParseXML to virDomainBlkioDeviceParseXML
virDomainBlkioDeviceWeightParseXML will be used to parse
the xml element read_bps, write_bps, read_iops, write_iops.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
2013-12-12 12:29:50 +00:00
Eric Blake
602751b4ab storage: show gluster option in virsh --version=long
Adding output to 'virsh --version=long' makes it easier to
tell if a distro built with particular libraries (it doesn't
tell you what a remote libvirtd is built with, but is still
better than nothing).  But we forgot to mention gluster.

* tools/virsh.c (vshShowVersion): Add gluster witness.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-11 21:02:24 -07:00
Cédric Bosdonnat
a5a484ddfc Added default case with error for object event dispatching
Hitting this should be pretty rare, but at least developers will know
that they are providing a weird event ID. Otherwise for namespace that
are added in the normal way, gcc will raise a warning about unhandled
case in the switch.
2013-12-11 13:35:08 +00:00
Cédric Bosdonnat
1b07406e9e Fixed indentation in src/conf/*_event* 2013-12-11 13:35:06 +00:00
Cédric Bosdonnat
cd88e9293a Added network events to the bridged network driver 2013-12-11 13:32:21 +00:00
Cédric Bosdonnat
61ac8ce0a9 Add network events to the remote driver 2013-12-11 13:26:25 +00:00
Cédric Bosdonnat
b1d2951660 Add network events unit tests 2013-12-11 13:15:03 +00:00
Cédric Bosdonnat
2ef412bdba test driver: implemented network events 2013-12-11 13:15:01 +00:00
Cédric Bosdonnat
9ff38c5428 Added Network events API and virNetworkEventLifecycle.
Define the public API for (de-)registering network events
and the callbacks for receiving lifecycle events. The lifecycle
event includes a 'detail' parameter to match the domain lifecycle
event data, but this is currently unused.

The network events related code goes into its own set of internal
files src/conf/network_event.[ch]
2013-12-11 13:10:41 +00:00
Chen Hanxiao
fb2125902f docs: fix a typo in libvirt.h
s/pausde/paused

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-12-11 13:36:35 +01:00
Michael Chapman
6100cd985c storage_backend_rbd: rename "stat" variable
This variable shadows the stat(2) function, which only became visible in
this scope as of commit 9cac8639. Rename the variable so it doesn't
conflict.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-12-11 10:18:15 +01:00
Eric Blake
6cd60b687a storage: fix omitted slash in gluster volume URI
When doing 'virsh vol-dumpxml' on a gluster pool's volume, the
resulting URI incorrectly omitted a slash between hostname and
path:  gluster://192.168.122.206rhsvol1/fedora-19.img

This is fallout from me rebasing earlier versions of my patch
that ended up as commit efee1af; I had originally played with
always requiring the gluster volume to have a leading slash,
but it was easier to use the gluster API if the gluster volume
name was guaranteed to have no slash.  While I got the URI of
the pool correct, I forgot to fix the URI of a libvirt volume.

* src/storage/storage_backend_gluster.c
(virStorageBackendGlusterRefreshVol): Use correct starting point
since uri construction requires leading slash.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-10 09:40:41 -07:00
Chen Hanxiao
6006c091e2 If we do not specify a readonly mount, we don't need to
re-mount it again.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-12-10 16:29:09 +00:00
Michal Privoznik
d10a6506b0 Revert "virtlockd: treat SIGHUP like SIGUSR1"
This reverts commit 8355d42dd3.

After some discussion upstream [1] this patch turns out to be spurious.
It better gets reverted prior to a release.

1: https://www.redhat.com/archives/libvir-list/2013-December/msg00563.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2013-12-10 15:49:06 +01:00
Michal Privoznik
11e44d66fd qemu_process: Read errors from child
https://bugzilla.redhat.com/show_bug.cgi?id=1035955

There's a window when starting a qemu process between fork() and exec()
during which we are doing things that may fail but not tunnelling the
error to the daemon. This is basically all within qemuProcessHook().
So whenever we fail in something, e.g. placing a process onto numa node,
users are left with:

    error: Child quit during startup handshake: Input/output error

while the original error is thrown into the domain log:

    libvirt:  error : internal error: NUMA memory tuning in 'preferred'
    mode only supports single node

Hence, we should read the log file and search for the error message and
report it to users.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2013-12-10 15:36:17 +01:00
Eric Blake
a5a8bd54b7 docs: fix recent typo
Introduced in commit 24fbbb82.

* docs/formatdomain.html.in: s/tunning/tuning/

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-10 07:04:58 -07:00
Cédric Bosdonnat
008e877779 daemon/remote.c: renamed remoteDispatchDomainEventSend
into remoteDispatchObjectEventSend as it will later be used for both
the domain and network events.
2013-12-10 13:12:58 +00:00
Cédric Bosdonnat
9973032fd8 test driver: renamed testDomainEventQueue into testObjectEventQueue 2013-12-10 13:12:37 +00:00
Cédric Bosdonnat
620103feaf Extracted common parts of domain_event.[ch] to object_event.[ch] 2013-12-10 13:12:35 +00:00
Cédric Bosdonnat
f88241608a Split the virObjectEvent and virDomainEvent* to separate them after 2013-12-10 13:07:07 +00:00
Cédric Bosdonnat
d397bf2f6d Renamed virDomainEventTimer to virObjectEventTimer 2013-12-10 13:07:02 +00:00
Cédric Bosdonnat
abb65994b7 Add object event namespaces for the event IDs
Each unique event ID will thus be composed by 1 byte for the namespace
and 1 byte for a namespace-specific ID. The namespace for domain event
needs to be 0 for compatibility reasons.
2013-12-10 13:04:25 +00:00
Cédric Bosdonnat
67d91cb2bd Use virObjectEventPtr instead of virDomainEventPtr
The virDomainEvent class is kept as it indicates what meta informations
are valid for the children classes. This may be useful in the future.
2013-12-10 12:45:21 +00:00
Cédric Bosdonnat
d4d02b206a Create virDomainEventDeviceRemoved and remove the huge union
RIP virDomainEvent union. All data are now stored in each
virObjectEvent subclass.
2013-12-10 12:38:36 +00:00
Cédric Bosdonnat
d9c6ba31a5 Create virDomainEventBalloonChange to get rid of the huge union 2013-12-10 12:38:03 +00:00
Cédric Bosdonnat
8d53d6ab74 Create virDomainEventTrayChange to get rid of the huge union 2013-12-10 12:37:26 +00:00
Cédric Bosdonnat
bc7b304336 Create virDomainEventDiskChange to get rid of the huge union 2013-12-10 12:36:54 +00:00
Cédric Bosdonnat
0ac4c9edad Create virDomainEventBlockJob to get rid of the huge union 2013-12-10 12:35:12 +00:00
Cédric Bosdonnat
e6b83046b1 Create virDomainEventGraphics to get rid of the huge union 2013-12-10 12:34:52 +00:00
Cédric Bosdonnat
b223263850 Create virDomainEventIOError to get rid of the huge union 2013-12-10 12:33:24 +00:00
Cédric Bosdonnat
b044091540 Create virDomainEventWatchdog to get rid of the huge union 2013-12-10 12:31:55 +00:00
Cédric Bosdonnat
8a29ffcf9a Create virDomainEventRTCChange to get rid of the huge union 2013-12-10 12:30:55 +00:00
Cédric Bosdonnat
2c0008cc3e Renamed virDomainEventNewInternal to virDomainEventNew
This change may be confusing at first, but provides a much more
consistent naming scheme for the virObjectEvent children construction
functions.
2013-12-10 12:29:38 +00:00
Cédric Bosdonnat
6ffce0f698 Renamed virDomainEventNew* to virDomainEventLifecycleNew*
This aims at providing some consistency with other domain events
2013-12-10 12:27:37 +00:00
Cédric Bosdonnat
0d1d632d79 Create virDomainEventLifecycle to start removing the huge union 2013-12-10 12:25:26 +00:00
Cédric Bosdonnat
de463feb97 virObject-ified virDomainEvent
Added a parent class virObjectEvent for future event types
2013-12-10 12:05:06 +00:00
Cédric Bosdonnat
6893f37682 Created virObjectEventStateRegisterID
Keep virDomainEventStateRegisterID as a convenience wrapper around
this new function.
2013-12-10 11:38:30 +00:00
Cédric Bosdonnat
1ee803e590 Renamed virDomainEventCallbackList* to virObjectEventCallbackList*
Keep the legacy Domain lifecycle event functions as is.
2013-12-10 11:37:07 +00:00
Cédric Bosdonnat
146434efad Renamed virDomainEventState to virObjectEventState
Leave virDomainEventRegister and its Deregister brother as these are
legacy functions only for domain lifecycle events.
2013-12-10 11:35:34 +00:00
Cédric Bosdonnat
df328f9345 Renamed virDomainEventQueue to virObjectEventQueue
The event queue will be generalized to hold events related
to any object type.
2013-12-10 11:33:12 +00:00
Cédric Bosdonnat
9db86c87d7 Renamed virDomainMeta to virObjectMeta
The metadata struct will hold the unique identifiers for
any type of object, though not all fields will be used
for all types.
2013-12-10 11:31:02 +00:00
Cédric Bosdonnat
f95b1921a1 Rename virDomainEventCallback to virObjectEventCallback
The event callbacks will be generalized to handle events
for any object type.
2013-12-10 11:30:24 +00:00
Cédric Bosdonnat
b775b48e94 Added domain start/stop/define/undefine event unit tests
These unit tests are aiming at providing some help during the domain
events refactoring.
2013-12-10 11:23:20 +00:00
Michael Chapman
81764660ae spec: clean up libvirtd and virtlockd service mgmt
- systemctl and the %systemd_* RPM macros can take multiple unit names
  in the one invocation. Make use of this to avoid repeated systemd
  daemon reloads.

- virtlockd was only properly enabled and disabled when using systemd,
  but when systemd RPM macros were not available (e.g. on Fedora < 18).
  Make sure it's enabled when systemd RPM macros are present, or when
  using initscripts.

- Always use "reload" on virtlockd, not "condrestart". This allows it to
  cleanly re-execute itself without losing running state. Ignore any
  error should the reload fail.

- Move the reloading of virtlockd and libvirtd via their initscripts
  into the daemon package's %postun scriptlet. These services must be
  restarted after all of the libvirt-daemon-driver-* packages have
  been upgraded during the same RPM transaction.

- Add a %triggerpostun executed only when upgrading an older
  libvirt-daemon. As an older package would only reload libvirtd during
  %post, and the newer package would only reload libvirtd during
  %postun, such an upgrade would not reload libvirtd at all without the
  trigger.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-12-10 12:02:37 +01:00
Michael Chapman
f1b1752537 virtlockd: use common exit path when out-of-memory
Also use a distinct, valid exit status for daemon re-execution failure.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-12-10 12:02:37 +01:00
Michael Chapman
8355d42dd3 virtlockd: treat SIGHUP like SIGUSR1
SIGHUP is commonly used to instruct a daemon to reload its config. For
now we should handle it in virtlockd just like SIGUSR1, rather than
having it kill the process.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2013-12-10 12:02:37 +01:00
Michael Chapman
59d6e65d6c virtlockd: improve initscripts
- Use SIGUSR1, not SIGHUP, on reload. At present, virtlockd only
  responds to the former.

- Fix PID file for virtlockd.

- Do not start virtlockd in any runlevels by default. It needs to be
  explicitly selected in libvirt's qemu.conf anyway, so there is no
  need to have it running on all systems regardless.

- Fix chkconfig priorities to ensure virtlockd is started before
  libvirtd is started, and stopped after libvirtd is stopped.

- Add "Should-Start: virtlockd" to the libvirtd initscript's LSB header,
  for the same reason.

- Add "Default-Stop" to both libvirtd and virtlockd initscripts. LSB
  does not guarantee that this defaults to the inverse of
  "Default-Start".

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2013-12-10 12:02:37 +01:00
Michael Chapman
1163fa36b7 virtlockd: improve systemd units
- Pass VIRTLOCKD_ARGS through to virtlockd.

- Use SIGUSR1, not SIGHUP, in ExecReload. At present, virtlockd only
  responds to the former.

- Have "systemctl enable virtlockd.service" enable virtlockd.socket,
  rather than throw an error.

- Make virtlockd.socket wanted by sockets.target, rather than
  multi-user.target. This is consistent with other socket units in
  Fedora, and it ensures that the socket is available before libvirtd is
  started.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-12-10 12:02:37 +01:00