char *buf);
char * virNWFilterGetXMLDesc (virNWFilterPtr nwfilter,
unsigned int flags);
+/**
+ * virDomainConsoleFlags
+ *
+ * Since 0.9.10
+ */
+typedef enum {
+ VIR_DOMAIN_CONSOLE_FORCE = (1 << 0), /* abort a (possibly) active console
+ connection to force a new
+ connection */
+ VIR_DOMAIN_CONSOLE_SAFE = (1 << 1), /* check if the console driver supports
+ safe console operations */
+} virDomainConsoleFlags;
int virDomainOpenConsole(virDomainPtr dom,
const char *devname,
* @dom: a domain object
* @dev_name: the console, serial or parallel port device alias, or NULL
* @st: a stream to associate with the console
- * @flags: extra flags; not used yet, so callers should always pass 0
+ * @flags: bitwise-OR of virDomainConsoleFlags
*
* This opens the backend associated with a console, serial or
* parallel port device on a guest, if the backend is supported.
* in @st stream, which should have been opened in non-blocking
* mode for bi-directional I/O.
*
- * returns 0 if the console was opened, -1 on error
+ * By default, when @flags is 0, the open will fail if libvirt
+ * detects that the console is already in use by another client;
+ * passing VIR_DOMAIN_CONSOLE_FORCE will cause libvirt to forcefully
+ * remove the other client prior to opening this console.
+ *
+ * If flag VIR_DOMAIN_CONSOLE_SAFE the console is opened only in the
+ * case where the hypervisor driver supports safe (mutually exclusive)
+ * console handling.
+ *
+ * Older servers did not support either flag, and also did not forbid
+ * simultaneous clients on a console, with potentially confusing results.
+ * When passing @flags of 0 in order to support a wider range of server
+ * versions, it is up to the client to ensure mutual exclusion.
+ *
+ * Returns 0 if the console was opened, -1 on error
*/
int virDomainOpenConsole(virDomainPtr dom,
const char *dev_name,