Add a patch for qemu 6.1 and replace _ with - in qemu options
parent
660c3f7b0d
commit
879fe9b2b4
|
@ -7,11 +7,11 @@ ARG REL=
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
RUN if [ "$REL" = "buster" ]; then \
|
RUN if [ "$REL" = "buster" -o "$REL" = "bullseye" ]; then \
|
||||||
echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list; \
|
echo "deb http://deb.debian.org/debian $REL-backports main" >> /etc/apt/sources.list; \
|
||||||
echo >> /etc/apt/preferences; \
|
echo >> /etc/apt/preferences; \
|
||||||
echo 'Package: *' >> /etc/apt/preferences; \
|
echo 'Package: *' >> /etc/apt/preferences; \
|
||||||
echo 'Pin: release a=buster-backports' >> /etc/apt/preferences; \
|
echo "Pin: release a=$REL-backports" >> /etc/apt/preferences; \
|
||||||
echo 'Pin-Priority: 500' >> /etc/apt/preferences; \
|
echo 'Pin-Priority: 500' >> /etc/apt/preferences; \
|
||||||
fi; \
|
fi; \
|
||||||
grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \
|
grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \
|
||||||
|
@ -27,15 +27,20 @@ RUN apt-get -y build-dep fio
|
||||||
RUN apt-get --download-only source qemu
|
RUN apt-get --download-only source qemu
|
||||||
RUN apt-get --download-only source fio
|
RUN apt-get --download-only source fio
|
||||||
|
|
||||||
ADD patches/qemu-5.0-vitastor.patch patches/qemu-5.1-vitastor.patch /root/vitastor/patches/
|
ADD patches/qemu-5.0-vitastor.patch patches/qemu-5.1-vitastor.patch patches/qemu-6.1-vitastor.patch /root/vitastor/patches/
|
||||||
RUN set -e; \
|
RUN set -e; \
|
||||||
mkdir -p /root/packages/qemu-$REL; \
|
mkdir -p /root/packages/qemu-$REL; \
|
||||||
rm -rf /root/packages/qemu-$REL/*; \
|
rm -rf /root/packages/qemu-$REL/*; \
|
||||||
cd /root/packages/qemu-$REL; \
|
cd /root/packages/qemu-$REL; \
|
||||||
dpkg-source -x /root/qemu*.dsc; \
|
dpkg-source -x /root/qemu*.dsc; \
|
||||||
if [ -d /root/packages/qemu-$REL/qemu-5.0 ]; then \
|
if ls -d /root/packages/qemu-$REL/qemu-5.0*; then \
|
||||||
cp /root/vitastor/patches/qemu-5.0-vitastor.patch /root/packages/qemu-$REL/qemu-5.0/debian/patches; \
|
D=$(ls -d /root/packages/qemu-$REL/qemu-5.0*); \
|
||||||
echo qemu-5.0-vitastor.patch >> /root/packages/qemu-$REL/qemu-5.0/debian/patches/series; \
|
cp /root/vitastor/patches/qemu-5.0-vitastor.patch $D/debian/patches; \
|
||||||
|
echo qemu-5.0-vitastor.patch >> $D/debian/patches/series; \
|
||||||
|
elif ls /root/packages/qemu-$REL/qemu-6.1*; then \
|
||||||
|
D=$(ls -d /root/packages/qemu-$REL/qemu-6.1*); \
|
||||||
|
cp /root/vitastor/patches/qemu-6.1-vitastor.patch $D/debian/patches; \
|
||||||
|
echo qemu-6.1-vitastor.patch >> $D/debian/patches/series; \
|
||||||
else \
|
else \
|
||||||
cp /root/vitastor/patches/qemu-5.1-vitastor.patch /root/packages/qemu-$REL/qemu-*/debian/patches; \
|
cp /root/vitastor/patches/qemu-5.1-vitastor.patch /root/packages/qemu-$REL/qemu-*/debian/patches; \
|
||||||
P=`ls -d /root/packages/qemu-$REL/qemu-*/debian/patches`; \
|
P=`ls -d /root/packages/qemu-$REL/qemu-*/debian/patches`; \
|
||||||
|
|
|
@ -7,11 +7,11 @@ ARG REL=
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
RUN if [ "$REL" = "buster" ]; then \
|
RUN if [ "$REL" = "buster" -o "$REL" = "bullseye" ]; then \
|
||||||
echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list; \
|
echo "deb http://deb.debian.org/debian $REL-backports main" >> /etc/apt/sources.list; \
|
||||||
echo >> /etc/apt/preferences; \
|
echo >> /etc/apt/preferences; \
|
||||||
echo 'Package: *' >> /etc/apt/preferences; \
|
echo 'Package: *' >> /etc/apt/preferences; \
|
||||||
echo 'Pin: release a=buster-backports' >> /etc/apt/preferences; \
|
echo "Pin: release a=$REL-backports" >> /etc/apt/preferences; \
|
||||||
echo 'Pin-Priority: 500' >> /etc/apt/preferences; \
|
echo 'Pin-Priority: 500' >> /etc/apt/preferences; \
|
||||||
fi; \
|
fi; \
|
||||||
grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \
|
grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \
|
||||||
|
|
|
@ -489,7 +489,7 @@ class VitastorDriver(driver.CloneableImageVD,
|
||||||
# FIXME use etcd_address in qemu driver
|
# FIXME use etcd_address in qemu driver
|
||||||
kk = 'etcd_host'
|
kk = 'etcd_host'
|
||||||
if v:
|
if v:
|
||||||
args += ':'+kk+'='+v.replace(':', '\\:')
|
args += ':'+kk.replace('_', '-')+'='+v.replace(':', '\\:')
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def delete_volume(self, volume):
|
def delete_volume(self, volume):
|
||||||
|
|
|
@ -245,9 +245,9 @@ index cbf0aa4..096700d 100644
|
||||||
+
|
+
|
||||||
+ if (virJSONValueObjectCreate(&ret,
|
+ if (virJSONValueObjectCreate(&ret,
|
||||||
+ "s:driver", "vitastor",
|
+ "s:driver", "vitastor",
|
||||||
+ "S:etcd_host", etcd,
|
+ "S:etcd-host", etcd,
|
||||||
+ "S:etcd_prefix", src->relPath,
|
+ "S:etcd-prefix", src->relPath,
|
||||||
+ "S:config_path", src->configFile,
|
+ "S:config-path", src->configFile,
|
||||||
+ "s:image", src->path,
|
+ "s:image", src->path,
|
||||||
+ NULL) < 0)
|
+ NULL) < 0)
|
||||||
+ goto cleanup;
|
+ goto cleanup;
|
||||||
|
@ -293,7 +293,7 @@ index 822d5f8..e375cef 100644
|
||||||
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
||||||
+
|
+
|
||||||
+ if (src->nhosts > 0) {
|
+ if (src->nhosts > 0) {
|
||||||
+ virBufferAddLit(&buf, ":etcd_host=");
|
+ virBufferAddLit(&buf, ":etcd-host=");
|
||||||
+ for (i = 0; i < src->nhosts; i++) {
|
+ for (i = 0; i < src->nhosts; i++) {
|
||||||
+ if (i)
|
+ if (i)
|
||||||
+ virBufferAddLit(&buf, ",");
|
+ virBufferAddLit(&buf, ",");
|
||||||
|
@ -311,10 +311,10 @@ index 822d5f8..e375cef 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (src->configFile)
|
+ if (src->configFile)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":config_path=%s", src->configFile);
|
+ virBufferEscape(&buf, '\\', ":", ":config-path=%s", src->configFile);
|
||||||
+
|
+
|
||||||
+ if (src->relPath)
|
+ if (src->relPath)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":etcd_prefix=%s", src->relPath);
|
+ virBufferEscape(&buf, '\\', ":", ":etcd-prefix=%s", src->relPath);
|
||||||
+
|
+
|
||||||
+ ret = virBufferContentAndReset(&buf);
|
+ ret = virBufferContentAndReset(&buf);
|
||||||
+ break;
|
+ break;
|
||||||
|
@ -438,16 +438,16 @@ index bd4b027..b323cd6 100644
|
||||||
+ if (STRPREFIX(p, "image=")) {
|
+ if (STRPREFIX(p, "image=")) {
|
||||||
+ if (VIR_STRDUP(src->path, p + strlen("image=")) < 0)
|
+ if (VIR_STRDUP(src->path, p + strlen("image=")) < 0)
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ } else if (STRPREFIX(p, "etcd_prefix=")) {
|
+ } else if (STRPREFIX(p, "etcd-prefix=")) {
|
||||||
+ if (VIR_STRDUP(src->relPath, p + strlen("etcd_prefix=")) < 0)
|
+ if (VIR_STRDUP(src->relPath, p + strlen("etcd-prefix=")) < 0)
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ } else if (STRPREFIX(p, "config_file=")) {
|
+ } else if (STRPREFIX(p, "config-path=")) {
|
||||||
+ if (VIR_STRDUP(src->configFile, p + strlen("config_file=")) < 0)
|
+ if (VIR_STRDUP(src->configFile, p + strlen("config-path=")) < 0)
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ } else if (STRPREFIX(p, "etcd_host=")) {
|
+ } else if (STRPREFIX(p, "etcd-host=")) {
|
||||||
+ char *h, *sep;
|
+ char *h, *sep;
|
||||||
+
|
+
|
||||||
+ h = p + strlen("etcd_host=");
|
+ h = p + strlen("etcd-host=");
|
||||||
+ while (h < e) {
|
+ while (h < e) {
|
||||||
+ for (sep = h; sep < e; ++sep) {
|
+ for (sep = h; sep < e; ++sep) {
|
||||||
+ if (*sep == '\\' && (sep[1] == ',' ||
|
+ if (*sep == '\\' && (sep[1] == ',' ||
|
||||||
|
@ -507,8 +507,8 @@ index bd4b027..b323cd6 100644
|
||||||
+{
|
+{
|
||||||
+ const char *filename;
|
+ const char *filename;
|
||||||
+ const char *image = virJSONValueObjectGetString(json, "image");
|
+ const char *image = virJSONValueObjectGetString(json, "image");
|
||||||
+ const char *conf = virJSONValueObjectGetString(json, "config_path");
|
+ const char *conf = virJSONValueObjectGetString(json, "config-path");
|
||||||
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd_prefix");
|
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd-prefix");
|
||||||
+ virJSONValuePtr servers = virJSONValueObjectGetArray(json, "server");
|
+ virJSONValuePtr servers = virJSONValueObjectGetArray(json, "server");
|
||||||
+ size_t nservers;
|
+ size_t nservers;
|
||||||
+ size_t i;
|
+ size_t i;
|
||||||
|
|
|
@ -244,9 +244,9 @@ index f9c6da2..922dde5 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (virJSONValueObjectCreate(&ret,
|
+ if (virJSONValueObjectCreate(&ret,
|
||||||
+ "S:etcd_host", etcd,
|
+ "S:etcd-host", etcd,
|
||||||
+ "S:etcd_prefix", src->query,
|
+ "S:etcd-prefix", src->query,
|
||||||
+ "S:config_path", src->configFile,
|
+ "S:config-path", src->configFile,
|
||||||
+ "s:image", src->path,
|
+ "s:image", src->path,
|
||||||
+ NULL) < 0)
|
+ NULL) < 0)
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
|
@ -311,7 +311,7 @@ index 6f970a3..10b39ca 100644
|
||||||
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
||||||
+
|
+
|
||||||
+ if (src->nhosts > 0) {
|
+ if (src->nhosts > 0) {
|
||||||
+ virBufferAddLit(&buf, ":etcd_host=");
|
+ virBufferAddLit(&buf, ":etcd-host=");
|
||||||
+ for (i = 0; i < src->nhosts; i++) {
|
+ for (i = 0; i < src->nhosts; i++) {
|
||||||
+ if (i)
|
+ if (i)
|
||||||
+ virBufferAddLit(&buf, ",");
|
+ virBufferAddLit(&buf, ",");
|
||||||
|
@ -329,10 +329,10 @@ index 6f970a3..10b39ca 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (src->configFile)
|
+ if (src->configFile)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":config_path=%s", src->configFile);
|
+ virBufferEscape(&buf, '\\', ":", ":config-path=%s", src->configFile);
|
||||||
+
|
+
|
||||||
+ if (src->query)
|
+ if (src->query)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":etcd_prefix=%s", src->query);
|
+ virBufferEscape(&buf, '\\', ":", ":etcd-prefix=%s", src->query);
|
||||||
+
|
+
|
||||||
+ ret = virBufferContentAndReset(&buf);
|
+ ret = virBufferContentAndReset(&buf);
|
||||||
+ break;
|
+ break;
|
||||||
|
@ -462,14 +462,14 @@ index 0d3c2af..36e3afc 100644
|
||||||
+
|
+
|
||||||
+ if (STRPREFIX(p, "image=")) {
|
+ if (STRPREFIX(p, "image=")) {
|
||||||
+ src->path = g_strdup(p + strlen("image="));
|
+ src->path = g_strdup(p + strlen("image="));
|
||||||
+ } else if (STRPREFIX(p, "etcd_prefix=")) {
|
+ } else if (STRPREFIX(p, "etcd-prefix=")) {
|
||||||
+ src->query = g_strdup(p + strlen("etcd_prefix="));
|
+ src->query = g_strdup(p + strlen("etcd-prefix="));
|
||||||
+ } else if (STRPREFIX(p, "config_file=")) {
|
+ } else if (STRPREFIX(p, "config-path=")) {
|
||||||
+ src->configFile = g_strdup(p + strlen("config_file="));
|
+ src->configFile = g_strdup(p + strlen("config-path="));
|
||||||
+ } else if (STRPREFIX(p, "etcd_host=")) {
|
+ } else if (STRPREFIX(p, "etcd-host=")) {
|
||||||
+ char *h, *sep;
|
+ char *h, *sep;
|
||||||
+
|
+
|
||||||
+ h = p + strlen("etcd_host=");
|
+ h = p + strlen("etcd-host=");
|
||||||
+ while (h < e) {
|
+ while (h < e) {
|
||||||
+ for (sep = h; sep < e; ++sep) {
|
+ for (sep = h; sep < e; ++sep) {
|
||||||
+ if (*sep == '\\' && (sep[1] == ',' ||
|
+ if (*sep == '\\' && (sep[1] == ',' ||
|
||||||
|
@ -526,8 +526,8 @@ index 0d3c2af..36e3afc 100644
|
||||||
+{
|
+{
|
||||||
+ const char *filename;
|
+ const char *filename;
|
||||||
+ const char *image = virJSONValueObjectGetString(json, "image");
|
+ const char *image = virJSONValueObjectGetString(json, "image");
|
||||||
+ const char *conf = virJSONValueObjectGetString(json, "config_path");
|
+ const char *conf = virJSONValueObjectGetString(json, "config-path");
|
||||||
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd_prefix");
|
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd-prefix");
|
||||||
+ virJSONValuePtr servers = virJSONValueObjectGetArray(json, "server");
|
+ virJSONValuePtr servers = virJSONValueObjectGetArray(json, "server");
|
||||||
+ size_t nservers;
|
+ size_t nservers;
|
||||||
+ size_t i;
|
+ size_t i;
|
||||||
|
|
|
@ -276,9 +276,9 @@ index 6627d04..c33f428 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (virJSONValueObjectCreate(&ret,
|
+ if (virJSONValueObjectCreate(&ret,
|
||||||
+ "S:etcd_host", etcd,
|
+ "S:etcd-host", etcd,
|
||||||
+ "S:etcd_prefix", src->query,
|
+ "S:etcd-prefix", src->query,
|
||||||
+ "S:config_path", src->configFile,
|
+ "S:config-path", src->configFile,
|
||||||
+ "s:image", src->path,
|
+ "s:image", src->path,
|
||||||
+ NULL) < 0)
|
+ NULL) < 0)
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
|
@ -343,7 +343,7 @@ index ea51369..8258632 100644
|
||||||
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
+ virBufferStrcat(&buf, "vitastor:image=", src->path, NULL);
|
||||||
+
|
+
|
||||||
+ if (src->nhosts > 0) {
|
+ if (src->nhosts > 0) {
|
||||||
+ virBufferAddLit(&buf, ":etcd_host=");
|
+ virBufferAddLit(&buf, ":etcd-host=");
|
||||||
+ for (i = 0; i < src->nhosts; i++) {
|
+ for (i = 0; i < src->nhosts; i++) {
|
||||||
+ if (i)
|
+ if (i)
|
||||||
+ virBufferAddLit(&buf, ",");
|
+ virBufferAddLit(&buf, ",");
|
||||||
|
@ -361,10 +361,10 @@ index ea51369..8258632 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (src->configFile)
|
+ if (src->configFile)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":config_path=%s", src->configFile);
|
+ virBufferEscape(&buf, '\\', ":", ":config-path=%s", src->configFile);
|
||||||
+
|
+
|
||||||
+ if (src->query)
|
+ if (src->query)
|
||||||
+ virBufferEscape(&buf, '\\', ":", ":etcd_prefix=%s", src->query);
|
+ virBufferEscape(&buf, '\\', ":", ":etcd-prefix=%s", src->query);
|
||||||
+
|
+
|
||||||
+ ret = virBufferContentAndReset(&buf);
|
+ ret = virBufferContentAndReset(&buf);
|
||||||
+ break;
|
+ break;
|
||||||
|
@ -474,14 +474,14 @@ index e48ae72..d7a9b72 100644
|
||||||
+
|
+
|
||||||
+ if (STRPREFIX(p, "image=")) {
|
+ if (STRPREFIX(p, "image=")) {
|
||||||
+ src->path = g_strdup(p + strlen("image="));
|
+ src->path = g_strdup(p + strlen("image="));
|
||||||
+ } else if (STRPREFIX(p, "etcd_prefix=")) {
|
+ } else if (STRPREFIX(p, "etcd-prefix=")) {
|
||||||
+ src->query = g_strdup(p + strlen("etcd_prefix="));
|
+ src->query = g_strdup(p + strlen("etcd-prefix="));
|
||||||
+ } else if (STRPREFIX(p, "config_file=")) {
|
+ } else if (STRPREFIX(p, "config-path=")) {
|
||||||
+ src->configFile = g_strdup(p + strlen("config_file="));
|
+ src->configFile = g_strdup(p + strlen("config-path="));
|
||||||
+ } else if (STRPREFIX(p, "etcd_host=")) {
|
+ } else if (STRPREFIX(p, "etcd-host=")) {
|
||||||
+ char *h, *sep;
|
+ char *h, *sep;
|
||||||
+
|
+
|
||||||
+ h = p + strlen("etcd_host=");
|
+ h = p + strlen("etcd-host=");
|
||||||
+ while (h < e) {
|
+ while (h < e) {
|
||||||
+ for (sep = h; sep < e; ++sep) {
|
+ for (sep = h; sep < e; ++sep) {
|
||||||
+ if (*sep == '\\' && (sep[1] == ',' ||
|
+ if (*sep == '\\' && (sep[1] == ',' ||
|
||||||
|
@ -538,8 +538,8 @@ index e48ae72..d7a9b72 100644
|
||||||
+{
|
+{
|
||||||
+ const char *filename;
|
+ const char *filename;
|
||||||
+ const char *image = virJSONValueObjectGetString(json, "image");
|
+ const char *image = virJSONValueObjectGetString(json, "image");
|
||||||
+ const char *conf = virJSONValueObjectGetString(json, "config_path");
|
+ const char *conf = virJSONValueObjectGetString(json, "config-path");
|
||||||
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd_prefix");
|
+ const char *etcd_prefix = virJSONValueObjectGetString(json, "etcd-prefix");
|
||||||
+ virJSONValue *servers = virJSONValueObjectGetArray(json, "server");
|
+ virJSONValue *servers = virJSONValueObjectGetArray(json, "server");
|
||||||
+ size_t nservers;
|
+ size_t nservers;
|
||||||
+ size_t i;
|
+ size_t i;
|
||||||
|
|
|
@ -124,7 +124,7 @@ index 391231c527..34dc60dcdd 100644
|
||||||
+ if kk == 'etcd_address':
|
+ if kk == 'etcd_address':
|
||||||
+ # FIXME use etcd_address in qemu driver
|
+ # FIXME use etcd_address in qemu driver
|
||||||
+ kk = 'etcd_host'
|
+ kk = 'etcd_host'
|
||||||
+ path += ":"+kk+"="+connection_info['data'][k].replace(':', '\\:')
|
+ path += ":"+kk.replace('_', '-')+"="+connection_info['data'][k].replace(':', '\\:')
|
||||||
else:
|
else:
|
||||||
path = 'unknown'
|
path = 'unknown'
|
||||||
raise exception.DiskNotFound(location='unknown')
|
raise exception.DiskNotFound(location='unknown')
|
||||||
|
|
|
@ -23,18 +23,18 @@ Index: qemu-3.1+dfsg/qapi/block-core.json
|
||||||
+# @inode: Inode number
|
+# @inode: Inode number
|
||||||
+# @pool: Pool ID
|
+# @pool: Pool ID
|
||||||
+# @size: Desired image size in bytes
|
+# @size: Desired image size in bytes
|
||||||
+# @config_path: Path to Vitastor configuration
|
+# @config-path: Path to Vitastor configuration
|
||||||
+# @etcd_host: etcd connection address(es)
|
+# @etcd-host: etcd connection address(es)
|
||||||
+# @etcd_prefix: etcd key/value prefix
|
+# @etcd-prefix: etcd key/value prefix
|
||||||
+##
|
+##
|
||||||
+{ 'struct': 'BlockdevOptionsVitastor',
|
+{ 'struct': 'BlockdevOptionsVitastor',
|
||||||
+ 'data': { '*inode': 'uint64',
|
+ 'data': { '*inode': 'uint64',
|
||||||
+ '*pool': 'uint64',
|
+ '*pool': 'uint64',
|
||||||
+ '*size': 'uint64',
|
+ '*size': 'uint64',
|
||||||
+ '*image': 'str',
|
+ '*image': 'str',
|
||||||
+ '*config_path': 'str',
|
+ '*config-path': 'str',
|
||||||
+ '*etcd_host': 'str',
|
+ '*etcd-host': 'str',
|
||||||
+ '*etcd_prefix': 'str' } }
|
+ '*etcd-prefix': 'str' } }
|
||||||
+
|
+
|
||||||
+##
|
+##
|
||||||
# @ReplicationMode:
|
# @ReplicationMode:
|
||||||
|
|
|
@ -23,18 +23,18 @@ Index: qemu/qapi/block-core.json
|
||||||
+# @inode: Inode number
|
+# @inode: Inode number
|
||||||
+# @pool: Pool ID
|
+# @pool: Pool ID
|
||||||
+# @size: Desired image size in bytes
|
+# @size: Desired image size in bytes
|
||||||
+# @config_path: Path to Vitastor configuration
|
+# @config-path: Path to Vitastor configuration
|
||||||
+# @etcd_host: etcd connection address(es)
|
+# @etcd-host: etcd connection address(es)
|
||||||
+# @etcd_prefix: etcd key/value prefix
|
+# @etcd-prefix: etcd key/value prefix
|
||||||
+##
|
+##
|
||||||
+{ 'struct': 'BlockdevOptionsVitastor',
|
+{ 'struct': 'BlockdevOptionsVitastor',
|
||||||
+ 'data': { '*inode': 'uint64',
|
+ 'data': { '*inode': 'uint64',
|
||||||
+ '*pool': 'uint64',
|
+ '*pool': 'uint64',
|
||||||
+ '*size': 'uint64',
|
+ '*size': 'uint64',
|
||||||
+ '*image': 'str',
|
+ '*image': 'str',
|
||||||
+ '*config_path': 'str',
|
+ '*config-path': 'str',
|
||||||
+ '*etcd_host': 'str',
|
+ '*etcd-host': 'str',
|
||||||
+ '*etcd_prefix': 'str' } }
|
+ '*etcd-prefix': 'str' } }
|
||||||
+
|
+
|
||||||
+##
|
+##
|
||||||
# @ReplicationMode:
|
# @ReplicationMode:
|
||||||
|
|
|
@ -23,18 +23,18 @@ Index: qemu/qapi/block-core.json
|
||||||
+# @inode: Inode number
|
+# @inode: Inode number
|
||||||
+# @pool: Pool ID
|
+# @pool: Pool ID
|
||||||
+# @size: Desired image size in bytes
|
+# @size: Desired image size in bytes
|
||||||
+# @config_path: Path to Vitastor configuration
|
+# @config-path: Path to Vitastor configuration
|
||||||
+# @etcd_host: etcd connection address(es)
|
+# @etcd-host: etcd connection address(es)
|
||||||
+# @etcd_prefix: etcd key/value prefix
|
+# @etcd-prefix: etcd key/value prefix
|
||||||
+##
|
+##
|
||||||
+{ 'struct': 'BlockdevOptionsVitastor',
|
+{ 'struct': 'BlockdevOptionsVitastor',
|
||||||
+ 'data': { '*inode': 'uint64',
|
+ 'data': { '*inode': 'uint64',
|
||||||
+ '*pool': 'uint64',
|
+ '*pool': 'uint64',
|
||||||
+ '*size': 'uint64',
|
+ '*size': 'uint64',
|
||||||
+ '*image': 'str',
|
+ '*image': 'str',
|
||||||
+ '*config_path': 'str',
|
+ '*config-path': 'str',
|
||||||
+ '*etcd_host': 'str',
|
+ '*etcd-host': 'str',
|
||||||
+ '*etcd_prefix': 'str' } }
|
+ '*etcd-prefix': 'str' } }
|
||||||
+
|
+
|
||||||
+##
|
+##
|
||||||
# @ReplicationMode:
|
# @ReplicationMode:
|
||||||
|
|
|
@ -23,18 +23,18 @@ Index: qemu-5.1+dfsg/qapi/block-core.json
|
||||||
+# @inode: Inode number
|
+# @inode: Inode number
|
||||||
+# @pool: Pool ID
|
+# @pool: Pool ID
|
||||||
+# @size: Desired image size in bytes
|
+# @size: Desired image size in bytes
|
||||||
+# @config_path: Path to Vitastor configuration
|
+# @config-path: Path to Vitastor configuration
|
||||||
+# @etcd_host: etcd connection address(es)
|
+# @etcd-host: etcd connection address(es)
|
||||||
+# @etcd_prefix: etcd key/value prefix
|
+# @etcd-prefix: etcd key/value prefix
|
||||||
+##
|
+##
|
||||||
+{ 'struct': 'BlockdevOptionsVitastor',
|
+{ 'struct': 'BlockdevOptionsVitastor',
|
||||||
+ 'data': { '*inode': 'uint64',
|
+ 'data': { '*inode': 'uint64',
|
||||||
+ '*pool': 'uint64',
|
+ '*pool': 'uint64',
|
||||||
+ '*size': 'uint64',
|
+ '*size': 'uint64',
|
||||||
+ '*image': 'str',
|
+ '*image': 'str',
|
||||||
+ '*config_path': 'str',
|
+ '*config-path': 'str',
|
||||||
+ '*etcd_host': 'str',
|
+ '*etcd-host': 'str',
|
||||||
+ '*etcd_prefix': 'str' } }
|
+ '*etcd-prefix': 'str' } }
|
||||||
+
|
+
|
||||||
+##
|
+##
|
||||||
# @ReplicationMode:
|
# @ReplicationMode:
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
Index: qemu-6.1+dfsg/qapi/block-core.json
|
||||||
|
===================================================================
|
||||||
|
--- qemu-6.1+dfsg.orig/qapi/block-core.json
|
||||||
|
+++ qemu-6.1+dfsg/qapi/block-core.json
|
||||||
|
@@ -2838,7 +2838,7 @@
|
||||||
|
'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
|
||||||
|
'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
|
||||||
|
{ 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
|
||||||
|
- 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
|
||||||
|
+ 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', 'vmdk', 'vpc', 'vvfat' ] }
|
||||||
|
|
||||||
|
##
|
||||||
|
# @BlockdevOptionsFile:
|
||||||
|
@@ -3763,6 +3763,28 @@
|
||||||
|
'*server': ['InetSocketAddressBase'] } }
|
||||||
|
|
||||||
|
##
|
||||||
|
+# @BlockdevOptionsVitastor:
|
||||||
|
+#
|
||||||
|
+# Driver specific block device options for vitastor
|
||||||
|
+#
|
||||||
|
+# @image: Image name
|
||||||
|
+# @inode: Inode number
|
||||||
|
+# @pool: Pool ID
|
||||||
|
+# @size: Desired image size in bytes
|
||||||
|
+# @config-path: Path to Vitastor configuration
|
||||||
|
+# @etcd-host: etcd connection address(es)
|
||||||
|
+# @etcd-prefix: etcd key/value prefix
|
||||||
|
+##
|
||||||
|
+{ 'struct': 'BlockdevOptionsVitastor',
|
||||||
|
+ 'data': { '*inode': 'uint64',
|
||||||
|
+ '*pool': 'uint64',
|
||||||
|
+ '*size': 'uint64',
|
||||||
|
+ '*image': 'str',
|
||||||
|
+ '*config-path': 'str',
|
||||||
|
+ '*etcd-host': 'str',
|
||||||
|
+ '*etcd-prefix': 'str' } }
|
||||||
|
+
|
||||||
|
+##
|
||||||
|
# @ReplicationMode:
|
||||||
|
#
|
||||||
|
# An enumeration of replication modes.
|
||||||
|
@@ -4134,6 +4156,7 @@
|
||||||
|
'throttle': 'BlockdevOptionsThrottle',
|
||||||
|
'vdi': 'BlockdevOptionsGenericFormat',
|
||||||
|
'vhdx': 'BlockdevOptionsGenericFormat',
|
||||||
|
+ 'vitastor': 'BlockdevOptionsVitastor',
|
||||||
|
'vmdk': 'BlockdevOptionsGenericCOWFormat',
|
||||||
|
'vpc': 'BlockdevOptionsGenericFormat',
|
||||||
|
'vvfat': 'BlockdevOptionsVVFAT'
|
||||||
|
@@ -4523,6 +4546,17 @@
|
||||||
|
'*encrypt' : 'RbdEncryptionCreateOptions' } }
|
||||||
|
|
||||||
|
##
|
||||||
|
+# @BlockdevCreateOptionsVitastor:
|
||||||
|
+#
|
||||||
|
+# Driver specific image creation options for Vitastor.
|
||||||
|
+#
|
||||||
|
+# @size: Size of the virtual disk in bytes
|
||||||
|
+##
|
||||||
|
+{ 'struct': 'BlockdevCreateOptionsVitastor',
|
||||||
|
+ 'data': { 'location': 'BlockdevOptionsVitastor',
|
||||||
|
+ 'size': 'size' } }
|
||||||
|
+
|
||||||
|
+##
|
||||||
|
# @BlockdevVmdkSubformat:
|
||||||
|
#
|
||||||
|
# Subformat options for VMDK images
|
||||||
|
@@ -4718,6 +4752,7 @@
|
||||||
|
'ssh': 'BlockdevCreateOptionsSsh',
|
||||||
|
'vdi': 'BlockdevCreateOptionsVdi',
|
||||||
|
'vhdx': 'BlockdevCreateOptionsVhdx',
|
||||||
|
+ 'vitastor': 'BlockdevCreateOptionsVitastor',
|
||||||
|
'vmdk': 'BlockdevCreateOptionsVmdk',
|
||||||
|
'vpc': 'BlockdevCreateOptionsVpc'
|
||||||
|
} }
|
||||||
|
Index: qemu-6.1+dfsg/scripts/modules/module_block.py
|
||||||
|
===================================================================
|
||||||
|
--- qemu-6.1+dfsg.orig/scripts/modules/module_block.py
|
||||||
|
+++ qemu-6.1+dfsg/scripts/modules/module_block.py
|
||||||
|
@@ -86,6 +86,7 @@ if __name__ == '__main__':
|
||||||
|
output_file = sys.argv[1]
|
||||||
|
with open(output_file, 'w') as fheader:
|
||||||
|
print_top(fheader)
|
||||||
|
+ add_module(fheader, "vitastor", "vitastor", "vitastor")
|
||||||
|
|
||||||
|
for filename in sys.argv[2:]:
|
||||||
|
if os.path.isfile(filename):
|
|
@ -132,16 +132,19 @@ static void vitastor_parse_filename(const char *filename, QDict *options, Error
|
||||||
error_setg(errp, "conf option %s has no value", name);
|
error_setg(errp, "conf option %s has no value", name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < strlen(name); i++)
|
||||||
|
if (name[i] == '_')
|
||||||
|
name[i] = '-';
|
||||||
qemu_vitastor_unescape(name);
|
qemu_vitastor_unescape(name);
|
||||||
value = qemu_vitastor_next_tok(p, ':', &p);
|
value = qemu_vitastor_next_tok(p, ':', &p);
|
||||||
qemu_vitastor_unescape(value);
|
qemu_vitastor_unescape(value);
|
||||||
if (!strcmp(name, "inode") ||
|
if (!strcmp(name, "inode") ||
|
||||||
!strcmp(name, "pool") ||
|
!strcmp(name, "pool") ||
|
||||||
!strcmp(name, "size") ||
|
!strcmp(name, "size") ||
|
||||||
!strcmp(name, "use_rdma") ||
|
!strcmp(name, "use-rdma") ||
|
||||||
!strcmp(name, "rdma_port_num") ||
|
!strcmp(name, "rdma-port_num") ||
|
||||||
!strcmp(name, "rdma_gid_index") ||
|
!strcmp(name, "rdma-gid-index") ||
|
||||||
!strcmp(name, "rdma_mtu"))
|
!strcmp(name, "rdma-mtu"))
|
||||||
{
|
{
|
||||||
unsigned long long num_val;
|
unsigned long long num_val;
|
||||||
if (parse_uint_full(value, &num_val, 0))
|
if (parse_uint_full(value, &num_val, 0))
|
||||||
|
@ -202,15 +205,15 @@ static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, E
|
||||||
VitastorClient *client = bs->opaque;
|
VitastorClient *client = bs->opaque;
|
||||||
int64_t ret = 0;
|
int64_t ret = 0;
|
||||||
qemu_mutex_init(&client->mutex);
|
qemu_mutex_init(&client->mutex);
|
||||||
client->config_path = g_strdup(qdict_get_try_str(options, "config_path"));
|
client->config_path = g_strdup(qdict_get_try_str(options, "config-path"));
|
||||||
// FIXME: Rename to etcd_address
|
// FIXME: Rename to etcd_address
|
||||||
client->etcd_host = g_strdup(qdict_get_try_str(options, "etcd_host"));
|
client->etcd_host = g_strdup(qdict_get_try_str(options, "etcd-host"));
|
||||||
client->etcd_prefix = g_strdup(qdict_get_try_str(options, "etcd_prefix"));
|
client->etcd_prefix = g_strdup(qdict_get_try_str(options, "etcd-prefix"));
|
||||||
client->use_rdma = qdict_get_try_int(options, "use_rdma", -1);
|
client->use_rdma = qdict_get_try_int(options, "use-rdma", -1);
|
||||||
client->rdma_device = g_strdup(qdict_get_try_str(options, "rdma_device"));
|
client->rdma_device = g_strdup(qdict_get_try_str(options, "rdma-device"));
|
||||||
client->rdma_port_num = qdict_get_try_int(options, "rdma_port_num", 0);
|
client->rdma_port_num = qdict_get_try_int(options, "rdma-port-num", 0);
|
||||||
client->rdma_gid_index = qdict_get_try_int(options, "rdma_gid_index", 0);
|
client->rdma_gid_index = qdict_get_try_int(options, "rdma-gid-index", 0);
|
||||||
client->rdma_mtu = qdict_get_try_int(options, "rdma_mtu", 0);
|
client->rdma_mtu = qdict_get_try_int(options, "rdma-mtu", 0);
|
||||||
client->proxy = vitastor_c_create_qemu(
|
client->proxy = vitastor_c_create_qemu(
|
||||||
(QEMUSetFDHandler*)aio_set_fd_handler, bdrv_get_aio_context(bs), client->config_path, client->etcd_host, client->etcd_prefix,
|
(QEMUSetFDHandler*)aio_set_fd_handler, bdrv_get_aio_context(bs), client->config_path, client->etcd_host, client->etcd_prefix,
|
||||||
client->use_rdma, client->rdma_device, client->rdma_port_num, client->rdma_gid_index, client->rdma_mtu, 0
|
client->use_rdma, client->rdma_device, client->rdma_port_num, client->rdma_gid_index, client->rdma_mtu, 0
|
||||||
|
@ -264,14 +267,14 @@ static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, E
|
||||||
}
|
}
|
||||||
bs->total_sectors = client->size / BDRV_SECTOR_SIZE;
|
bs->total_sectors = client->size / BDRV_SECTOR_SIZE;
|
||||||
//client->aio_context = bdrv_get_aio_context(bs);
|
//client->aio_context = bdrv_get_aio_context(bs);
|
||||||
qdict_del(options, "use_rdma");
|
qdict_del(options, "use-rdma");
|
||||||
qdict_del(options, "rdma_mtu");
|
qdict_del(options, "rdma-mtu");
|
||||||
qdict_del(options, "rdma_gid_index");
|
qdict_del(options, "rdma-gid-index");
|
||||||
qdict_del(options, "rdma_port_num");
|
qdict_del(options, "rdma-port-num");
|
||||||
qdict_del(options, "rdma_device");
|
qdict_del(options, "rdma-device");
|
||||||
qdict_del(options, "config_path");
|
qdict_del(options, "config-path");
|
||||||
qdict_del(options, "etcd_host");
|
qdict_del(options, "etcd-host");
|
||||||
qdict_del(options, "etcd_prefix");
|
qdict_del(options, "etcd-prefix");
|
||||||
qdict_del(options, "image");
|
qdict_del(options, "image");
|
||||||
qdict_del(options, "inode");
|
qdict_del(options, "inode");
|
||||||
qdict_del(options, "pool");
|
qdict_del(options, "pool");
|
||||||
|
@ -515,9 +518,9 @@ static QEMUOptionParameter vitastor_create_opts[] = {
|
||||||
static const char *vitastor_strong_runtime_opts[] = {
|
static const char *vitastor_strong_runtime_opts[] = {
|
||||||
"inode",
|
"inode",
|
||||||
"pool",
|
"pool",
|
||||||
"config_path",
|
"config-path",
|
||||||
"etcd_host",
|
"etcd-host",
|
||||||
"etcd_prefix",
|
"etcd-prefix",
|
||||||
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue