Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150439683
D43754.1792390330.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43754.1792390330.diff
View Options
diff --git a/sys/amd64/vmm/vmm_snapshot.c b/sys/amd64/vmm/vmm_snapshot.c
--- a/sys/amd64/vmm/vmm_snapshot.c
+++ b/sys/amd64/vmm/vmm_snapshot.c
@@ -57,7 +57,7 @@
vm_snapshot_buf(void *data, size_t data_size, struct vm_snapshot_meta *meta)
{
struct vm_snapshot_buffer *buffer;
- int op;
+ int op, error;
buffer = &meta->buffer;
op = meta->op;
@@ -68,11 +68,14 @@
}
if (op == VM_SNAPSHOT_SAVE)
- copyout(data, buffer->buf, data_size);
+ error = copyout(data, buffer->buf, data_size);
else if (op == VM_SNAPSHOT_RESTORE)
- copyin(buffer->buf, data, data_size);
+ error = copyin(buffer->buf, data, data_size);
else
- return (EINVAL);
+ error = EINVAL;
+
+ if (error)
+ return (error);
buffer->buf += data_size;
buffer->buf_rem -= data_size;
@@ -104,30 +107,29 @@
{
struct vm_snapshot_buffer *buffer;
int op;
- int ret;
+ int error;
buffer = &meta->buffer;
op = meta->op;
if (buffer->buf_rem < data_size) {
printf("%s: buffer too small\r\n", __func__);
- ret = E2BIG;
- goto done;
+ return (E2BIG);
}
if (op == VM_SNAPSHOT_SAVE) {
- ret = 0;
- copyout(data, buffer->buf, data_size);
+ error = copyout(data, buffer->buf, data_size);
} else if (op == VM_SNAPSHOT_RESTORE) {
- ret = memcmp(data, buffer->buf, data_size);
+ error = memcmp(data, buffer->buf, data_size);
} else {
- ret = EINVAL;
- goto done;
+ error = EINVAL;
}
+ if (error)
+ return (error);
+
buffer->buf += data_size;
buffer->buf_rem -= data_size;
-done:
- return (ret);
+ return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 19, 6:12 AM (9 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30513342
Default Alt Text
D43754.1792390330.diff (1 KB)
Attached To
Mode
D43754: vmm: Fix compiling error with BHYVE_SNAPSHOT
Attached
Detach File
Event Timeline
Log In to Comment