diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-10-05 14:56:35 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-10-08 20:04:53 +0100 |
commit | 18b7f09f366d518050f467d0944c81c82fd5e39e (patch) | |
tree | 6f89801dec73c60eb05cc01160544d76782e454a /src/guestfs-internal.h | |
parent | 7786d56db8c22413949f98ef6b15fe0ea367d195 (diff) | |
download | libguestfs-18b7f09f366d518050f467d0944c81c82fd5e39e.tar.gz libguestfs-18b7f09f366d518050f467d0944c81c82fd5e39e.tar.xz libguestfs-18b7f09f366d518050f467d0944c81c82fd5e39e.zip |
Add support for hotplugging (adding disks) to the libvirt attach-method.
When libvirt is used, we can allow disks to be hotplugged.
guestfs_add_drive can be called after launch to hot-add a disk.
When a disk is hot-added, we first ask libvirt to add the disk to the
appliance, then we make an internal call into the appliance to get it
to wait for the disk to appear (ie. udev_settle ()).
Hot-added disks are tracked in the g->drives array.
This also adds a test.
Diffstat (limited to 'src/guestfs-internal.h')
-rw-r--r-- | src/guestfs-internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index ed9ada48..db9818c3 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -166,6 +166,9 @@ struct attach_ops { int (*get_pid) (guestfs_h *g); /* get-pid API. */ int (*max_disks) (guestfs_h *g); /* max-disks API. */ + + /* Hotplugging drives. */ + int (*hot_add_drive) (guestfs_h *g, struct drive *drv, size_t drv_index); }; extern struct attach_ops attach_ops_appliance; extern struct attach_ops attach_ops_libvirt; |