提交 3f63c44d 编写于 作者: C Cole Robinson

Add virCapabilities*EmulatorRequired.

Certain drivers always need an 'emulator' specified in the XML (qemu and lxc
at least). Store this info in capabilities.

We will eventually use this to move default emulator handling out of
drivers and into domain_conf.*
上级 659bd665
Tue Jun 16 11:18:00 EDT 2009 Cole Robinson <crobinso@redhat.com>
* src/capabilities.c src/capabilities.h src/libvirt_private.syms
src/lxc_conf.c src/qemu_conf.c: Add virCapabilities*EmulatorRequired.
Tue Jun 16 11:16:17 EDT 2009 Cole Robinson <crobinso@redhat.com>
* src/qemu_conf.c src/qemu_conf.h tests/qemuhelptest.c
......
......@@ -707,3 +707,13 @@ virCapabilitiesGenerateMac(virCapsPtr caps,
{
virGenerateMacAddr(caps->macPrefix, mac);
}
extern void
virCapabilitiesSetEmulatorRequired(virCapsPtr caps) {
caps->emulatorRequired = 1;
}
extern unsigned int
virCapabilitiesIsEmulatorRequired(virCapsPtr caps) {
return caps->emulatorRequired;
}
......@@ -106,6 +106,7 @@ struct _virCaps {
int nguests;
virCapsGuestPtr *guests;
unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN];
unsigned int emulatorRequired : 1;
};
......@@ -125,6 +126,12 @@ extern void
virCapabilitiesGenerateMac(virCapsPtr caps,
unsigned char *mac);
extern void
virCapabilitiesSetEmulatorRequired(virCapsPtr caps);
extern unsigned int
virCapabilitiesIsEmulatorRequired(virCapsPtr caps);
extern int
virCapabilitiesAddHostFeature(virCapsPtr caps,
const char *name);
......
......@@ -27,6 +27,8 @@ virCapabilitiesFree;
virCapabilitiesNew;
virCapabilitiesSetMacPrefix;
virCapabilitiesGenerateMac;
virCapabilitiesSetEmulatorRequired;
virCapabilitiesIsEmulatorRequired;
# conf.h
......
......@@ -69,6 +69,10 @@ virCapsPtr lxcCapsInit(void)
0,
NULL) == NULL)
goto no_memory;
/* LXC Requires an emulator in the XML */
virCapabilitiesSetEmulatorRequired(caps);
return caps;
no_memory:
......
......@@ -405,6 +405,9 @@ virCapsPtr qemudCapsInit(void) {
}
}
/* QEMU Requires an emulator in the XML */
virCapabilitiesSetEmulatorRequired(caps);
return caps;
no_memory:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册