Attaching to modern qemu will not work with all this code and attempting
to ressurect it would be mostly pointless.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/check-aclrules.pl | 1 +
src/qemu/qemu_driver.c | 92 ++++--------------------------------------
2 files changed, 9 insertions(+), 84 deletions(-)
diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
index 23872cda98..be618f6c9f 100755
--- a/src/check-aclrules.pl
+++ b/src/check-aclrules.pl
@@ -61,6 +61,7 @@ my %whitelist = (
"interfaceClose" => 1,
"connectURIProbe" => 1,
"localOnly" => 1,
+ "domainQemuAttach" => 1,
);
# XXX this vzDomainMigrateConfirm3Params looks
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f623eaa422..16652da9d4 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16799,92 +16799,16 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain,
const char *cmd,
}
-static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn,
- unsigned int pid_value,
- unsigned int flags)
+static virDomainPtr
+qemuDomainQemuAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
+ unsigned int pid_value ATTRIBUTE_UNUSED,
+ unsigned int flags)
{
- virQEMUDriverPtr driver = conn->privateData;
- virDomainObjPtr vm = NULL;
- virDomainDefPtr def = NULL;
- virDomainPtr dom = NULL;
- virDomainChrSourceDefPtr monConfig = NULL;
- bool monJSON = false;
- pid_t pid = pid_value;
- char *pidfile = NULL;
- virQEMUCapsPtr qemuCaps = NULL;
- virCapsPtr caps = NULL;
-
virCheckFlags(0, NULL);
- if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
- goto cleanup;
-
- if (!(def = qemuParseCommandLinePid(driver->qemuCapsCache,
- caps, driver->xmlopt, pid,
- &pidfile, &monConfig, &monJSON)))
- goto cleanup;
-
- if (virDomainQemuAttachEnsureACL(conn, def) < 0)
- goto cleanup;
-
- if (!monConfig) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("No monitor connection for pid %u"), pid_value);
- goto cleanup;
- }
- if (monConfig->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Cannot connect to monitor connection of type '%s'
"
- "for pid %u"),
- virDomainChrTypeToString(monConfig->type),
- pid_value);
- goto cleanup;
- }
-
- if (!(def->name) &&
- virAsprintf(&def->name, "attach-pid-%u", pid_value) < 0)
- goto cleanup;
-
- if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
- def->emulator)))
- goto cleanup;
-
- if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
- goto cleanup;
-
- if (!(vm = virDomainObjListAdd(driver->domains, def,
- driver->xmlopt,
- VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
- VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
- NULL)))
- goto cleanup;
-
- def = NULL;
-
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) {
- qemuDomainRemoveInactive(driver, vm);
- goto cleanup;
- }
-
- if (qemuProcessAttach(conn, driver, vm, pid,
- pidfile, monConfig, monJSON) < 0) {
- qemuDomainRemoveInactive(driver, vm);
- qemuDomainObjEndJob(driver, vm);
- goto cleanup;
- }
-
- dom = virGetDomain(conn, vm->def->name, vm->def->uuid,
vm->def->id);
-
- qemuDomainObjEndJob(driver, vm);
-
- cleanup:
- virDomainDefFree(def);
- virObjectUnref(monConfig);
- virDomainObjEndAPI(&vm);
- VIR_FREE(pidfile);
- virObjectUnref(caps);
- virObjectUnref(qemuCaps);
- return dom;
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("attaching to a QEMU process started outside of libvirt is no
longer supported"));
+ return NULL;
}
@@ -22459,7 +22383,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainRevertToSnapshot = qemuDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
.domainQemuMonitorCommand = qemuDomainQemuMonitorCommand, /* 0.8.3 */
- .domainQemuAttach = qemuDomainQemuAttach, /* 0.9.4 */
+ .domainQemuAttach = qemuDomainQemuAttach, /* 0.9.4 (deprecated: 5.5.0) */
.domainQemuAgentCommand = qemuDomainQemuAgentCommand, /* 0.10.0 */
.connectDomainQemuMonitorEventRegister = qemuConnectDomainQemuMonitorEventRegister,
/* 1.2.3 */
.connectDomainQemuMonitorEventDeregister =
qemuConnectDomainQemuMonitorEventDeregister, /* 1.2.3 */
--
2.21.0