[ Version ( since = "1.19.49" ) ]
public bool remove_drive (string label) throws Error
remove a disk image
This function is conceptually the opposite of guestfs_session_add_drive_opts
. It removes the drive that was previously added
with label label
.
Note that in order to remove drives, you have to add them with labels (see the optional label
argument to
guestfs_session_add_drive_opts
). If you didn't use a label, then they cannot be removed.
You can call this function before or after launching the handle. If called after launch, if the backend supports it, we try to hot unplug the drive: see "HOTPLUGGING" in guestfs(3). The disk must not be in use (eg. mounted) when you do this. We try to detect if the disk is in use and stop you from doing this.
this |
A GuestfsSession object |
true on success, false on error |