mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
qemu: driver: Remove support for native->XML conversion
This code is really neglected and does not at all work reliably. It can't even be used for converting our own commandline back. Since this was mostly useful for aiding migration from manually run qemu to libvirt and will not work for this puspose in many cases it's not worth having. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
953b88fc88
commit
5cc402a9b4
@ -43,7 +43,6 @@
|
|||||||
#include "qemu_conf.h"
|
#include "qemu_conf.h"
|
||||||
#include "qemu_capabilities.h"
|
#include "qemu_capabilities.h"
|
||||||
#include "qemu_command.h"
|
#include "qemu_command.h"
|
||||||
#include "qemu_parse_command.h"
|
|
||||||
#include "qemu_cgroup.h"
|
#include "qemu_cgroup.h"
|
||||||
#include "qemu_hostdev.h"
|
#include "qemu_hostdev.h"
|
||||||
#include "qemu_hotplug.h"
|
#include "qemu_hotplug.h"
|
||||||
@ -7318,45 +7317,20 @@ static char
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *qemuConnectDomainXMLFromNative(virConnectPtr conn,
|
static char *
|
||||||
const char *format,
|
qemuConnectDomainXMLFromNative(virConnectPtr conn,
|
||||||
const char *config,
|
const char *format ATTRIBUTE_UNUSED,
|
||||||
unsigned int flags)
|
const char *config ATTRIBUTE_UNUSED,
|
||||||
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
virQEMUDriverPtr driver = conn->privateData;
|
|
||||||
virDomainDefPtr def = NULL;
|
|
||||||
char *xml = NULL;
|
|
||||||
virCapsPtr caps = NULL;
|
|
||||||
|
|
||||||
virCheckFlags(0, NULL);
|
virCheckFlags(0, NULL);
|
||||||
|
|
||||||
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
|
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
if (STRNEQ(format, QEMU_CONFIG_FORMAT_ARGV)) {
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
_("converting arbitrary QEMU command lines to libvirt domain XML is no longer supported"));
|
||||||
_("unsupported config type %s"), format);
|
return NULL;
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
def = qemuParseCommandLineString(driver->qemuCapsCache,
|
|
||||||
caps, driver->xmlopt, config,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
if (!def)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!def->name && VIR_STRDUP(def->name, "unnamed") < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
xml = qemuDomainDefFormatXML(driver, def, VIR_DOMAIN_XML_INACTIVE);
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virDomainDefFree(def);
|
|
||||||
virObjectUnref(caps);
|
|
||||||
return xml;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
|
static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
|
||||||
@ -22298,7 +22272,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
|
|||||||
.domainGetSecurityLabelList = qemuDomainGetSecurityLabelList, /* 0.10.0 */
|
.domainGetSecurityLabelList = qemuDomainGetSecurityLabelList, /* 0.10.0 */
|
||||||
.nodeGetSecurityModel = qemuNodeGetSecurityModel, /* 0.6.1 */
|
.nodeGetSecurityModel = qemuNodeGetSecurityModel, /* 0.6.1 */
|
||||||
.domainGetXMLDesc = qemuDomainGetXMLDesc, /* 0.2.0 */
|
.domainGetXMLDesc = qemuDomainGetXMLDesc, /* 0.2.0 */
|
||||||
.connectDomainXMLFromNative = qemuConnectDomainXMLFromNative, /* 0.6.4 */
|
.connectDomainXMLFromNative = qemuConnectDomainXMLFromNative, /* 0.6.4 (deprecated: 5.5.0) */
|
||||||
.connectDomainXMLToNative = qemuConnectDomainXMLToNative, /* 0.6.4 */
|
.connectDomainXMLToNative = qemuConnectDomainXMLToNative, /* 0.6.4 */
|
||||||
.connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */
|
.connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */
|
||||||
.connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */
|
.connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user