2010-12-16 16:10:54 +00:00
|
|
|
/*
|
|
|
|
* qemu_hotplug.h: QEMU device hotplug management
|
|
|
|
*
|
2011-10-31 19:06:23 +00:00
|
|
|
* Copyright (C) 2006-2007, 2009-2011 Red Hat, Inc.
|
2010-12-16 16:10:54 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-07-21 10:06:23 +00:00
|
|
|
* License along with this library; If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-12-16 16:10:54 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __QEMU_HOTPLUG_H__
|
|
|
|
# define __QEMU_HOTPLUG_H__
|
|
|
|
|
|
|
|
# include "qemu_conf.h"
|
2012-04-02 13:55:08 +00:00
|
|
|
# include "qemu_domain.h"
|
2010-12-16 16:10:54 +00:00
|
|
|
# include "domain_conf.h"
|
|
|
|
|
|
|
|
int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainDiskDefPtr disk,
|
|
|
|
bool force);
|
2011-09-13 13:49:50 +00:00
|
|
|
int qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
|
2012-04-02 13:55:08 +00:00
|
|
|
virDomainObjPtr vm,
|
|
|
|
enum qemuDomainAsyncJob asyncJob);
|
2011-10-31 19:06:23 +00:00
|
|
|
int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
|
|
|
|
struct qemud_driver *driver,
|
2010-12-16 16:10:54 +00:00
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDiskDefPtr disk);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainControllerDefPtr controller);
|
2011-10-31 19:06:23 +00:00
|
|
|
int qemuDomainAttachSCSIDisk(virConnectPtr conn,
|
|
|
|
struct qemud_driver *driver,
|
2010-12-16 16:10:54 +00:00
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDiskDefPtr disk);
|
2011-10-31 19:06:23 +00:00
|
|
|
int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
|
|
|
|
struct qemud_driver *driver,
|
2010-12-16 16:10:54 +00:00
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDiskDefPtr disk);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|
|
|
struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainNetDefPtr net);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainHostdevDefPtr hostdev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainHostdevDefPtr hostdev);
|
2011-09-02 15:09:14 +00:00
|
|
|
int qemuDomainAttachRedirdevDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainRedirdevDefPtr hostdev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainHostdevDefPtr hostdev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainGraphicsDefPtr dev);
|
Use the new set_password monitor command to set password.
We try to use that command first when setting a VNC/SPICE password. If
that doesn't work we fallback to the legacy VNC only password
Allow an expiry time to be set, if that doesn't work, throw an error
if they try to use SPICE.
Change since v1:
- moved qemuInitGraphicsPasswords to qemu_hotplug, renamed
to qemuDomainChangeGraphicsPasswords.
- updated what looks like a typo (that appears to work anyway) in
initial patch from Daniel:
- ret = qemuInitGraphicsPasswords(driver, vm,
- VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
- &vm->def->graphics[0]->data.vnc.auth,
- driver->vncPassword);
+ ret = qemuInitGraphicsPasswords(driver, vm,
+ VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
+ &vm->def->graphics[0]->data.spice.auth,
+ driver->spicePassword);
Based on patch by Daniel P. Berrange <berrange@redhat.com>.
2011-01-10 11:12:33 +00:00
|
|
|
int qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
int type,
|
|
|
|
virDomainGraphicsAuthDefPtr auth,
|
|
|
|
const char *defaultPasswd);
|
2011-09-06 08:23:47 +00:00
|
|
|
int qemuDomainChangeNet(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainPtr dom,
|
|
|
|
virDomainNetDefPtr dev);
|
|
|
|
int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainNetDefPtr dev,
|
|
|
|
int linkstate);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDeviceDefPtr dev);
|
2011-03-07 03:31:48 +00:00
|
|
|
int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDeviceDefPtr dev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDeviceDefPtr dev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainDetachNetDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDeviceDefPtr dev);
|
2010-12-16 16:10:54 +00:00
|
|
|
int qemuDomainDetachHostDevice(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-04 12:09:09 +00:00
|
|
|
virDomainDeviceDefPtr dev);
|
2011-05-18 16:20:53 +00:00
|
|
|
int qemuDomainAttachLease(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainLeaseDefPtr lease);
|
|
|
|
int qemuDomainDetachLease(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
virDomainLeaseDefPtr lease);
|
2010-12-16 16:10:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __QEMU_HOTPLUG_H__ */
|