We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blockdevice is like raw image, we just need to change the size calculation
--- tmp/mvisor/images/raw.cc 2024-10-28 12:01:10.003886443 +0100 +++ images/raw.cc 2024-10-28 13:38:35.627238165 +0100 @@ -26,6 +26,9 @@
#include "logger.h" #include "device_manager.h" +#include <sys/ioctl.h> +#include <sys/types.h> +#include <linux/fs.h>
class RawImage : public DiskImage { private: @@ -64,10 +67,14 @@ if (fd_ < 0) MV_PANIC("disk file not found: %s", filepath_.c_str());
long long size_; struct stat st; fstat(fd_, &st); block_size_ = 512; total_blocks_ = st.st_size / block_size_;
if(ioctl(fd_,BLKGETSIZE64,&size_)!=-1)
total_blocks_ = size_ / block_size_;
}
long HandleIoRequest(const ImageIoRequest& request) {
The text was updated successfully, but these errors were encountered:
close by pull request submit #64
Sorry, something went wrong.
No branches or pull requests
blockdevice is like raw image, we just need to change the size calculation
--- tmp/mvisor/images/raw.cc 2024-10-28 12:01:10.003886443 +0100
+++ images/raw.cc 2024-10-28 13:38:35.627238165 +0100
@@ -26,6 +26,9 @@
#include "logger.h"
#include "device_manager.h"
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <linux/fs.h>
class RawImage : public DiskImage {
private:
@@ -64,10 +67,14 @@
if (fd_ < 0)
MV_PANIC("disk file not found: %s", filepath_.c_str());
long long size_;
struct stat st;
fstat(fd_, &st);
block_size_ = 512;
total_blocks_ = st.st_size / block_size_;
}
long HandleIoRequest(const ImageIoRequest& request) {
The text was updated successfully, but these errors were encountered: