mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
Drop needless typecast to virStorageType enum
There are three places (two in domain_conf.c and one in qemu_migration.c) where a virStorageSource->type is typecasted to virStorageType (for the purpose of catching missing enum member in a switch() statement at compile time). This is needless, because as of v8.2.0-rc1~120 the struct member is of proper type. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
This commit is contained in:
parent
0c4bdd835c
commit
2307f06cb2
@ -8658,7 +8658,7 @@ virDomainStorageSourceParse(xmlNodePtr node,
|
|||||||
|
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
|
|
||||||
switch ((virStorageType)src->type) {
|
switch (src->type) {
|
||||||
case VIR_STORAGE_TYPE_FILE:
|
case VIR_STORAGE_TYPE_FILE:
|
||||||
src->path = virXMLPropString(node, "file");
|
src->path = virXMLPropString(node, "file");
|
||||||
break;
|
break;
|
||||||
@ -23349,7 +23349,7 @@ virDomainDiskSourceFormat(virBuffer *buf,
|
|||||||
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||||
|
|
||||||
switch ((virStorageType)src->type) {
|
switch (src->type) {
|
||||||
case VIR_STORAGE_TYPE_FILE:
|
case VIR_STORAGE_TYPE_FILE:
|
||||||
virBufferEscapeString(&attrBuf, " file='%s'", src->path);
|
virBufferEscapeString(&attrBuf, " file='%s'", src->path);
|
||||||
break;
|
break;
|
||||||
|
@ -182,7 +182,7 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
|
|||||||
|
|
||||||
VIR_DEBUG("Precreate disk type=%s", virStorageTypeToString(disk->src->type));
|
VIR_DEBUG("Precreate disk type=%s", virStorageTypeToString(disk->src->type));
|
||||||
|
|
||||||
switch ((virStorageType)disk->src->type) {
|
switch (disk->src->type) {
|
||||||
case VIR_STORAGE_TYPE_FILE:
|
case VIR_STORAGE_TYPE_FILE:
|
||||||
if (!virDomainDiskGetSource(disk)) {
|
if (!virDomainDiskGetSource(disk)) {
|
||||||
VIR_DEBUG("Dropping sourceless disk '%s'",
|
VIR_DEBUG("Dropping sourceless disk '%s'",
|
||||||
|
Loading…
Reference in New Issue
Block a user