mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
virDomainShmemDef: Change type of model to virDomainShmemModel
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cacde05ad3
commit
b3a6daa36d
@ -13614,15 +13614,17 @@ virDomainShmemDefParseXML(virDomainXMLOption *xmlopt,
|
||||
|
||||
tmp = virXPathString("string(./model/@type)", ctxt);
|
||||
if (tmp) {
|
||||
int model;
|
||||
/* If there's none, we will automatically have the first one
|
||||
* (as default). Unfortunately this has to be done for
|
||||
* compatibility reasons. */
|
||||
if ((def->model = virDomainShmemModelTypeFromString(tmp)) < 0) {
|
||||
if ((model = virDomainShmemModelTypeFromString(tmp)) < 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Unknown shmem model type '%s'"), tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
def->model = model;
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
|
||||
|
@ -1955,7 +1955,7 @@ typedef enum {
|
||||
struct _virDomainShmemDef {
|
||||
char *name;
|
||||
unsigned long long size;
|
||||
int model; /* enum virDomainShmemModel */
|
||||
virDomainShmemModel model;
|
||||
int role; /* enum virDomainShmemRole */
|
||||
struct {
|
||||
bool enabled;
|
||||
|
@ -9097,7 +9097,7 @@ qemuBuildShmemCommandLine(virLogManager *logManager,
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch ((virDomainShmemModel)shmem->model) {
|
||||
switch (shmem->model) {
|
||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM:
|
||||
devstr = qemuBuildShmemDevLegacyStr(def, shmem, qemuCaps);
|
||||
break;
|
||||
|
@ -2978,7 +2978,7 @@ qemuDomainAttachShmemDevice(virQEMUDriver *driver,
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_SHMEM, { .shmem = shmem } };
|
||||
|
||||
switch ((virDomainShmemModel)shmem->model) {
|
||||
switch (shmem->model) {
|
||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN:
|
||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL:
|
||||
break;
|
||||
@ -5583,7 +5583,7 @@ qemuDomainDetachPrepShmem(virDomainObj *vm,
|
||||
|
||||
*detach = shmem = vm->def->shmems[idx];
|
||||
|
||||
switch ((virDomainShmemModel)shmem->model) {
|
||||
switch (shmem->model) {
|
||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN:
|
||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL:
|
||||
break;
|
||||
|
@ -4893,6 +4893,11 @@ qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem,
|
||||
virDomainShmemModelTypeToString(shmem->model));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_SHMEM_MODEL_LAST:
|
||||
virReportEnumRangeError(virDomainShmemModel, shmem->model);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1209,6 +1209,10 @@ get_files(vahControl * ctl)
|
||||
mem_path = g_strdup_printf("/var/lib/libvirt/shmem-%s-sock",
|
||||
shmem->name);
|
||||
break;
|
||||
case VIR_DOMAIN_SHMEM_MODEL_LAST:
|
||||
virReportEnumRangeError(virDomainShmemModel,
|
||||
shmem->model);
|
||||
break;
|
||||
}
|
||||
if (mem_path != NULL) {
|
||||
if (vah_add_file(&buf, mem_path, "rw") != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user